火蛇海蛇效果
This commit is contained in:
parent
0e143e3a81
commit
7dae3a6ab5
@ -479,6 +479,8 @@ local grid_type = {
|
|||||||
[36]={
|
[36]={
|
||||||
["icon"]="battle_obstacle_lava",
|
["icon"]="battle_obstacle_lava",
|
||||||
["next_type"]=0,
|
["next_type"]=0,
|
||||||
|
["spine_name"]="ui_battle_obstacle_firesnake",
|
||||||
|
["spine_idle"]="idle",
|
||||||
["can_fall"]=1,
|
["can_fall"]=1,
|
||||||
["cant_link"]=1,
|
["cant_link"]=1,
|
||||||
["element_invalid"]=1,
|
["element_invalid"]=1,
|
||||||
@ -490,6 +492,8 @@ local grid_type = {
|
|||||||
[37]={
|
[37]={
|
||||||
["icon"]="battle_obstacle_poisonous_mist",
|
["icon"]="battle_obstacle_poisonous_mist",
|
||||||
["next_type"]=0,
|
["next_type"]=0,
|
||||||
|
["spine_name"]="ui_battle_obstacle_watersnake",
|
||||||
|
["spine_idle"]="idle",
|
||||||
["can_fall"]=1,
|
["can_fall"]=1,
|
||||||
["cant_link"]=1,
|
["cant_link"]=1,
|
||||||
["element_invalid"]=1,
|
["element_invalid"]=1,
|
||||||
|
|||||||
@ -330,6 +330,20 @@ function BattleManager:getPosIdsByDirection(posId, direction)
|
|||||||
return list
|
return list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleManager:getPosDirection(originPosId, posId)
|
||||||
|
local originR, originC = self:getPosRC(originPosId).r, self:getPosRC(originPosId).c
|
||||||
|
local r, c = self:getPosRC(posId).r, self:getPosRC(posId).c
|
||||||
|
if originR < r and originC == c then
|
||||||
|
return BattleConst.BOARD_RANGE_TYPE.DOWN
|
||||||
|
elseif originR > r and originC == c then
|
||||||
|
return BattleConst.BOARD_RANGE_TYPE.UP
|
||||||
|
elseif originR == r and originC < c then
|
||||||
|
return BattleConst.BOARD_RANGE_TYPE.RIGHT
|
||||||
|
elseif originR == r and originC > c then
|
||||||
|
return BattleConst.BOARD_RANGE_TYPE.LEFT
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
----------------------- end 一些公共相关的方法 -----------------------------
|
----------------------- end 一些公共相关的方法 -----------------------------
|
||||||
|
|
||||||
function BattleManager:bindBattleUnitAttribute(hashCode, side)
|
function BattleManager:bindBattleUnitAttribute(hashCode, side)
|
||||||
|
|||||||
@ -125,6 +125,19 @@ local function _crossMoveNotBreak(entity, gridEntities, battleController, onlyCh
|
|||||||
for _, posId in ipairs(tempList) do
|
for _, posId in ipairs(tempList) do
|
||||||
local gridEntity = gridEntities[posId]
|
local gridEntity = gridEntities[posId]
|
||||||
if gridEntity:isEmptyIdle() and not map[posId] then
|
if gridEntity:isEmptyIdle() and not map[posId] then
|
||||||
|
local direction = ModuleManager.BattleManager:getPosDirection(entity:getPosId(), posId)
|
||||||
|
local cell = entity:getCell()
|
||||||
|
if cell then
|
||||||
|
if direction == BattleConst.BOARD_RANGE_TYPE.UP then
|
||||||
|
cell:playAnim("up", true, false, false)
|
||||||
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.DOWN then
|
||||||
|
cell:playAnim("down", true, false, false)
|
||||||
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.LEFT then
|
||||||
|
cell:playAnim("left", true, false, false)
|
||||||
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.RIGHT then
|
||||||
|
cell:playAnim("right", true, false, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
map[entity:getPosId()] = entity
|
map[entity:getPosId()] = entity
|
||||||
map[posId] = gridEntity
|
map[posId] = gridEntity
|
||||||
battleController.battleData:exchangeGridEntities(entity:getPosId(), posId)
|
battleController.battleData:exchangeGridEntities(entity:getPosId(), posId)
|
||||||
@ -135,7 +148,13 @@ local function _crossMoveNotBreak(entity, gridEntities, battleController, onlyCh
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if succ then
|
if succ then
|
||||||
battleController.battleUI:moveGridCells(map)
|
battleController.battleUI:moveGridCells(map, function()
|
||||||
|
for _, entity in ipairs(allSnake) do
|
||||||
|
if entity:getCell() then
|
||||||
|
entity:getCell():playAnim(entity:getSpineIdleName(), true, false, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
return succ
|
return succ
|
||||||
end
|
end
|
||||||
|
|||||||
@ -32,17 +32,24 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
|
|||||||
self.lastGridType = gridEntity:getGridType()
|
self.lastGridType = gridEntity:getGridType()
|
||||||
local spineObj = uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]
|
local spineObj = uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]
|
||||||
local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"]
|
local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"]
|
||||||
|
self.spineAssetLoadOver = false
|
||||||
if gridEntity:getSpineAsset() then
|
if gridEntity:getSpineAsset() then
|
||||||
local scale = gridEntity:getSpineScale()
|
local scale = gridEntity:getSpineScale()
|
||||||
spineObj:setLocalScale(scale, scale, scale)
|
spineObj:setLocalScale(scale, scale, scale)
|
||||||
spineObj:setActive(true)
|
spineObj:setActive(true)
|
||||||
spineObj:loadAssetAsync(gridEntity:getSpineAsset(), function()
|
spineObj:loadAssetAsync(gridEntity:getSpineAsset(), function()
|
||||||
|
self.spineAssetLoadOver = true
|
||||||
|
local finalAniname = gridEntity:getSpineIdleName()
|
||||||
|
if self.nextSpineAniName then
|
||||||
|
finalAniname = self.nextSpineAniName
|
||||||
|
self.nextSpineAniName = nil
|
||||||
|
end
|
||||||
if gridEntity:getSpineChangeName() then
|
if gridEntity:getSpineChangeName() then
|
||||||
spineObj:playAnimComplete(gridEntity:getSpineChangeName(), false, true, function()
|
spineObj:playAnimComplete(gridEntity:getSpineChangeName(), false, true, function()
|
||||||
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
|
spineObj:playAnim(finalAniname, true, false, true)
|
||||||
end, true)
|
end, true)
|
||||||
else
|
else
|
||||||
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
|
spineObj:playAnim(finalAniname, true, false, true)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
upBg:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")
|
upBg:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")
|
||||||
@ -265,4 +272,16 @@ function GridCell:setGridTypeIcon(icon)
|
|||||||
uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]:setActive(false)
|
uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]:setActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GridCell:playAnim(aniName, loop, forceRefresh, forceGetSG)
|
||||||
|
if not self.spineAssetLoadOver then
|
||||||
|
self.nextSpineAniName = aniName
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.nextSpineAniName = nil
|
||||||
|
|
||||||
|
local uiMap = self:getUIMap()
|
||||||
|
local spineObj = uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]
|
||||||
|
spineObj:playAnim(aniName, loop, forceRefresh, forceGetSG)
|
||||||
|
end
|
||||||
|
|
||||||
return GridCell
|
return GridCell
|
||||||
@ -168,7 +168,7 @@ function BattleTeamEntity:getWeakness(matchType)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleTeamEntity:getCrittime()
|
function BattleTeamEntity:getCrittime()
|
||||||
return self.attr.crittime or 0
|
return self.attr.crit_time or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleTeamEntity:getCrit()
|
function BattleTeamEntity:getCrit()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user