buff机制修改
This commit is contained in:
parent
e85f2ba4f2
commit
026166478e
@ -395,7 +395,7 @@ local buff = {
|
|||||||
["id"]=48,
|
["id"]=48,
|
||||||
["name"]="burn",
|
["name"]="burn",
|
||||||
["buff_type"]=4,
|
["buff_type"]=4,
|
||||||
["stack"]=1,
|
["stack"]=0,
|
||||||
["decr"]=2,
|
["decr"]=2,
|
||||||
["formula"]=4,
|
["formula"]=4,
|
||||||
["icon"]="burn",
|
["icon"]="burn",
|
||||||
@ -694,6 +694,7 @@ local buff = {
|
|||||||
["name"]="invincible_shield",
|
["name"]="invincible_shield",
|
||||||
["buff_type"]=7,
|
["buff_type"]=7,
|
||||||
["decr"]=3,
|
["decr"]=3,
|
||||||
|
["stack"]=3,
|
||||||
["icon"]="invincible_shield",
|
["icon"]="invincible_shield",
|
||||||
["fx_continued"]={
|
["fx_continued"]={
|
||||||
26
|
26
|
||||||
|
|||||||
@ -415,6 +415,7 @@ function GFunc.getPerStr(key, str)
|
|||||||
key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE_REBOUND_400 or
|
key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE_REBOUND_400 or
|
||||||
key == GConst.BattleConst.BUFF_NAME.BURN or
|
key == GConst.BattleConst.BUFF_NAME.BURN or
|
||||||
key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE or
|
key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE or
|
||||||
|
key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE_02 or
|
||||||
key == GConst.BattleConst.BUFF_NAME.BLOCK or
|
key == GConst.BattleConst.BUFF_NAME.BLOCK or
|
||||||
key == GConst.BattleConst.BUFF_NAME.CRIT_ADD
|
key == GConst.BattleConst.BUFF_NAME.CRIT_ADD
|
||||||
then
|
then
|
||||||
|
|||||||
@ -124,7 +124,8 @@ BattleConst.BUFF_TYPE = {
|
|||||||
BattleConst.BUFF_STACK_TYPE = {
|
BattleConst.BUFF_STACK_TYPE = {
|
||||||
CANT_ADD = 0,
|
CANT_ADD = 0,
|
||||||
ADD_ROUND = 1,
|
ADD_ROUND = 1,
|
||||||
ADD = 2
|
ADD = 2,
|
||||||
|
REMOVE_LAST = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleConst.BUFF_DECR_TYPE = {
|
BattleConst.BUFF_DECR_TYPE = {
|
||||||
@ -338,6 +339,7 @@ local BUFF_NAME = {
|
|||||||
END_DMG_ADDITION_ALL_ADD = "end_dmg_addition_all_add",
|
END_DMG_ADDITION_ALL_ADD = "end_dmg_addition_all_add",
|
||||||
END_DMG_DEC_ALL_ADD = "end_dmg_dec_all_add",
|
END_DMG_DEC_ALL_ADD = "end_dmg_dec_all_add",
|
||||||
INVINCIBLE_SHIELD = "invincible_shield",
|
INVINCIBLE_SHIELD = "invincible_shield",
|
||||||
|
SHIELD_ICE_02 = "shield_ice_02",
|
||||||
}
|
}
|
||||||
BattleConst.BUFF_NAME = BUFF_NAME
|
BattleConst.BUFF_NAME = BUFF_NAME
|
||||||
|
|
||||||
|
|||||||
@ -1631,10 +1631,12 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
|||||||
if num < 0 then -- 伤害
|
if num < 0 then -- 伤害
|
||||||
local delayTime = 0
|
local delayTime = 0
|
||||||
if shieldHpDiff < 0 or shieldWorkOn then
|
if shieldHpDiff < 0 or shieldWorkOn then
|
||||||
if shieldHpDiff == 0 then
|
if shieldHpDiff == 0 then -- 护盾血量没有减少, 但是被抵消了
|
||||||
shieldHpDiff = damage
|
shieldHpDiff = -1
|
||||||
|
damage = 0
|
||||||
|
else
|
||||||
|
damage = damage - shieldHpDiff
|
||||||
end
|
end
|
||||||
damage = damage - shieldHpDiff
|
|
||||||
delayTime = BattleConst.EFFECT_NUMBER_DELAY
|
delayTime = BattleConst.EFFECT_NUMBER_DELAY
|
||||||
if self.lastBlueNumberTime == time then
|
if self.lastBlueNumberTime == time then
|
||||||
self.lastSameTimeBlueCount = self.lastSameTimeBlueCount + 1
|
self.lastSameTimeBlueCount = self.lastSameTimeBlueCount + 1
|
||||||
|
|||||||
@ -229,6 +229,7 @@ function BattleTeam:handleShield(reduceShield, unit)
|
|||||||
while currShieldBuff do
|
while currShieldBuff do
|
||||||
if reduceShield <= 0 and currShieldBuff.buff and currShieldBuff.buff:getName() == BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then
|
if reduceShield <= 0 and currShieldBuff.buff and currShieldBuff.buff:getName() == BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then
|
||||||
reduceShield = currShieldBuff.result - 1
|
reduceShield = currShieldBuff.result - 1
|
||||||
|
needReedRefreshBuff = true
|
||||||
else
|
else
|
||||||
reduceShield = reduceShield + currShieldBuff.result
|
reduceShield = reduceShield + currShieldBuff.result
|
||||||
end
|
end
|
||||||
@ -278,6 +279,13 @@ function BattleTeam:addBuff(buffEffect)
|
|||||||
bEffect[fieldName] = buffEffect[fieldName]
|
bEffect[fieldName] = buffEffect[fieldName]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if bEffect.buff:getEffectNum() < buffEffect.buff:getEffectNum() then
|
||||||
|
bEffect.buff:setEffectNum(buffEffect.buff:getEffectNum())
|
||||||
|
end
|
||||||
|
needRecycle = bEffect
|
||||||
|
break
|
||||||
|
elseif bEffect.buff:getEffectNum() < buffEffect.buff:getEffectNum() then
|
||||||
|
bEffect.buff:setEffectNum(buffEffect.buff:getEffectNum())
|
||||||
needRecycle = bEffect
|
needRecycle = bEffect
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
@ -304,6 +312,10 @@ function BattleTeam:addBuff(buffEffect)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif stack == BattleConst.BUFF_STACK_TYPE.ADD then
|
elseif stack == BattleConst.BUFF_STACK_TYPE.ADD then
|
||||||
|
|
||||||
|
elseif stack == BattleConst.BUFF_STACK_TYPE.REMOVE_LAST then
|
||||||
|
local buffName = buffEffect.buff:getName()
|
||||||
|
self:removeBuffByName(buffName)
|
||||||
end
|
end
|
||||||
|
|
||||||
if needRecycle then
|
if needRecycle then
|
||||||
|
|||||||
@ -427,7 +427,7 @@ function BattleBaseUI:refreshBuff(side, buffList)
|
|||||||
local cell = self.tinyBuffCells[side][index]
|
local cell = self.tinyBuffCells[side][index]
|
||||||
if cell then
|
if cell then
|
||||||
cell:getBaseObject():setVisible(true)
|
cell:getBaseObject():setVisible(true)
|
||||||
cell:refresh(buffObj.buff:getIcon(), buffObj.round)
|
cell:refresh(buffObj.buff:getIcon(), buffObj.round, buffObj.buff:getEffectNum(), buffObj.result)
|
||||||
end
|
end
|
||||||
index = index + 1
|
index = index + 1
|
||||||
if index > buffCellCount then
|
if index > buffCellCount then
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
local TinyBuffCell = class("TinyBuffCell", BaseCell)
|
local TinyBuffCell = class("TinyBuffCell", BaseCell)
|
||||||
|
|
||||||
function TinyBuffCell:refresh(buffName, round)
|
function TinyBuffCell:refresh(buffName, round, num, result)
|
||||||
if round <= 1 or round > 9 then
|
if round <= 1 or round > 9 then
|
||||||
round = GConst.EMPTY_STRING
|
round = GConst.EMPTY_STRING
|
||||||
else
|
else
|
||||||
@ -10,6 +10,15 @@ function TinyBuffCell:refresh(buffName, round)
|
|||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
uiMap["tiny_buff_cell.buff_icon"]:setSprite(GConst.ATLAS_PATH.ICON_BUFF, buffName)
|
uiMap["tiny_buff_cell.buff_icon"]:setSprite(GConst.ATLAS_PATH.ICON_BUFF, buffName)
|
||||||
uiMap["tiny_buff_cell.round_text"]:setText(round)
|
uiMap["tiny_buff_cell.round_text"]:setText(round)
|
||||||
|
|
||||||
|
local buffNum = uiMap["tiny_buff_cell.buff_num"]
|
||||||
|
if buffName == GConst.BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then
|
||||||
|
uiMap["tiny_buff_cell.round_text"]:setText(GConst.EMPTY_STRING)
|
||||||
|
result = result or num
|
||||||
|
buffNum:setText(result or GConst.EMPTY_STRING)
|
||||||
|
else
|
||||||
|
buffNum:setText(GConst.EMPTY_STRING)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return TinyBuffCell
|
return TinyBuffCell
|
||||||
Loading…
x
Reference in New Issue
Block a user