伤害数字重叠问题
This commit is contained in:
parent
47d8b479f9
commit
5214dd8136
@ -53,6 +53,7 @@ BattleConst.SKILL_ELIMINATION_TIME = 0.5
|
||||
BattleConst.ELIMINATION_INTERVAL = 0.01
|
||||
BattleConst.GRID_BREAK_EFFECT_INTERVAL = 0.1
|
||||
BattleConst.COMBO_DEFAULT_POSITION = 0
|
||||
BattleConst.EFFECT_NUMBER_INTERVAL = 0.2
|
||||
|
||||
BattleConst.BATTLE_ROUND_STEP = {
|
||||
WAIT_BEGIN = 0, -- 等待开始
|
||||
|
||||
@ -1315,7 +1315,16 @@ function BattleUnitComp:addBuff(buffEffect, conditionResult)
|
||||
x = x - 80
|
||||
end
|
||||
y = y - 120
|
||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_SPECIAL, direction, buffEffect.buff:getShowName(true), x - 20, y - 20, 0, conditionResult == BattleConst.SKILL_CONDITION_RESULT.CONDITION_PASS)
|
||||
local time = Time:getServerTime()
|
||||
if self.lastAddBuffTime == time then
|
||||
self.lastSameTimeAddBuffCount = self.lastSameTimeAddBuffCount + 1
|
||||
else
|
||||
self.lastAddBuffTime = time
|
||||
self.lastSameTimeAddBuffCount = 0
|
||||
end
|
||||
time = self.lastSameTimeAddBuffCount * BattleConst.EFFECT_NUMBER_INTERVAL
|
||||
local showCombo = conditionResult == BattleConst.SKILL_CONDITION_RESULT.CONDITION_PASS
|
||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_SPECIAL, direction, buffEffect.buff:getShowName(true), x - 20, y - 20, time, showCombo)
|
||||
end
|
||||
|
||||
return self.team:addBuff(buffEffect)
|
||||
@ -1604,11 +1613,19 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
||||
local hp = self.unitEntity:getHp()
|
||||
local x, y = self.team:getMainUnitLocalPosition(self)
|
||||
local damage = num
|
||||
local time = Time:getServerTime()
|
||||
if num < 0 then -- 伤害
|
||||
local delayTime = 0
|
||||
if shieldHpDiff < 0 then
|
||||
damage = damage - shieldHpDiff
|
||||
delayTime = BattleConst.EFFECT_NUMBER_DELAY
|
||||
if self.lastBlueNumberTime == time then
|
||||
self.lastSameTimeBlueCount = self.lastSameTimeBlueCount + 1
|
||||
else
|
||||
self.lastBlueNumberTime = time
|
||||
self.lastSameTimeBlueCount = 0
|
||||
end
|
||||
delayTime = delayTime + self.lastSameTimeBlueCount * BattleConst.EFFECT_NUMBER_INTERVAL
|
||||
if self.side == BattleConst.SIDE_ATK then
|
||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_BLUE, BattleConst.EFFECT_TYPE_MOVE_L, shieldHpDiff, x, y, 0, showHurtCombo)
|
||||
else
|
||||
@ -1616,6 +1633,13 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
||||
end
|
||||
end
|
||||
if damage < 0 then
|
||||
if self.lastBlueNumberTime == time then
|
||||
self.lastSameTimeBlueCount = self.lastSameTimeBlueCount + 1
|
||||
else
|
||||
self.lastBlueNumberTime = time
|
||||
self.lastSameTimeBlueCount = 0
|
||||
end
|
||||
delayTime = delayTime + self.lastSameTimeBlueCount * BattleConst.EFFECT_NUMBER_INTERVAL
|
||||
if effectStatus == HURT_STATE_CRIT then
|
||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_RED, BattleConst.EFFECT_TYPE_CRIT, "c" .. damage, x, y, delayTime, showHurtCombo)
|
||||
else
|
||||
@ -1665,14 +1689,13 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
|
||||
end
|
||||
end
|
||||
elseif num > 0 then -- 治疗
|
||||
local time = Time:getServerTime()
|
||||
if self.lastHealTime == time then
|
||||
self.lastSameTimeHealCount = self.lastSameTimeHealCount + 1
|
||||
else
|
||||
self.lastHealTime = time
|
||||
self.lastSameTimeHealCount = 0
|
||||
end
|
||||
local delayTime = self.lastSameTimeHealCount * 0.1
|
||||
local delayTime = self.lastSameTimeHealCount * BattleConst.EFFECT_NUMBER_INTERVAL
|
||||
self:showEffectNumber(BattleConst.EFFECT_COLOR_GREEN, BattleConst.EFFECT_TYPE_BUFF, "+" .. num, x, y, delayTime)
|
||||
end
|
||||
local hpPercent = self.unitEntity:getHpPercent()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user