checkBlock.cache
This commit is contained in:
parent
bb6241dedf
commit
c983ba09c7
@ -1493,8 +1493,8 @@ events.prototype.battle = function (id, x, y, force, callback) {
|
|||||||
|
|
||||||
// ------ 支援技能 ------//
|
// ------ 支援技能 ------//
|
||||||
if (core.isset(x) && core.isset(y)) {
|
if (core.isset(x) && core.isset(y)) {
|
||||||
var index = x + "," + y, buff = (core.status.checkBlock.buff || {})[index] || {},
|
var index = x + "," + y, cache = (core.status.checkBlock.cache || {})[index] || {},
|
||||||
guards = buff.guards || [];
|
guards = cache.guards || [];
|
||||||
if (guards.length>0) {
|
if (guards.length>0) {
|
||||||
core.setFlag("__guards__"+x+"_"+y, guards);
|
core.setFlag("__guards__"+x+"_"+y, guards);
|
||||||
var actions = [];
|
var actions = [];
|
||||||
|
|||||||
@ -1683,7 +1683,7 @@ ui.prototype.drawMaps = function (index, x, y) {
|
|||||||
|
|
||||||
clearTimeout(core.interval.tipAnimate);
|
clearTimeout(core.interval.tipAnimate);
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
core.status.checkBlock.buff = {};
|
core.status.checkBlock.cache = {};
|
||||||
this.drawThumbnail(floorId, 'ui', core.status.maps[floorId].blocks, 0, 0, 416, x, y);
|
this.drawThumbnail(floorId, 'ui', core.status.maps[floorId].blocks, 0, 0, 416, x, y);
|
||||||
|
|
||||||
// 绘图
|
// 绘图
|
||||||
|
|||||||
@ -499,9 +499,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
// ------ 支援 ------
|
// ------ 支援 ------
|
||||||
var guards = [];
|
var guards = [];
|
||||||
// 检查光环缓存
|
// 检查光环缓存
|
||||||
if (!core.isset(core.status.checkBlock.buff)) core.status.checkBlock.buff = {};
|
if (!core.isset(core.status.checkBlock.cache)) core.status.checkBlock.cache = {};
|
||||||
var index = core.isset(x) && core.isset(y) ? (x + "," + y) : "floor";
|
var index = core.isset(x) && core.isset(y) ? (x + "," + y) : "floor";
|
||||||
var cache = core.status.checkBlock.buff[index];
|
var cache = core.status.checkBlock.cache[index];
|
||||||
if (!core.isset(cache)) {
|
if (!core.isset(cache)) {
|
||||||
// 没有该点的缓存,则遍历每个图块
|
// 没有该点的缓存,则遍历每个图块
|
||||||
core.status.maps[floorId].blocks.forEach(function (block) {
|
core.status.maps[floorId].blocks.forEach(function (block) {
|
||||||
@ -533,7 +533,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 放入缓存中
|
// 放入缓存中
|
||||||
core.status.checkBlock.buff[index] = { "hp_buff": hp_buff, "atk_buff": atk_buff, "def_buff": def_buff, "guards": guards };
|
core.status.checkBlock.cache[index] = { "hp_buff": hp_buff, "atk_buff": atk_buff, "def_buff": def_buff, "guards": guards };
|
||||||
} else {
|
} else {
|
||||||
// 直接使用缓存数据
|
// 直接使用缓存数据
|
||||||
hp_buff = cache.hp_buff;
|
hp_buff = cache.hp_buff;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user