经验加成
This commit is contained in:
parent
5bdf637e03
commit
5c4d0bf6b7
@ -1147,7 +1147,12 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus)
|
|||||||
if hpRealReduce < 0 and self.side == BattleConst.SIDE_DEF then -- 实际掉血了
|
if hpRealReduce < 0 and self.side == BattleConst.SIDE_DEF then -- 实际掉血了
|
||||||
local exp = self.unitEntity:getExp()
|
local exp = self.unitEntity:getExp()
|
||||||
if exp > 0 then
|
if exp > 0 then
|
||||||
self.battleController:addBattleExp(math.floor(exp/self.unitEntity:getMaxHp()*-hpRealReduce))
|
local expTime = atker.unitEntity:getExpTime()
|
||||||
|
local addExp = math.floor(exp/self.unitEntity:getMaxHp()*-hpRealReduce)
|
||||||
|
if expTime > 0 then
|
||||||
|
addExp = addExp * (DEFAULT_FACTOR + expTime) // DEFAULT_FACTOR
|
||||||
|
end
|
||||||
|
self.battleController:addBattleExp(addExp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local shieldHpDiff = self.unitEntity:getShieldHp() - shieldHpBefore
|
local shieldHpDiff = self.unitEntity:getShieldHp() - shieldHpBefore
|
||||||
|
|||||||
@ -169,6 +169,10 @@ function BattleTeamEntity:getNormalAttackAddCount()
|
|||||||
return self.attr[ATTR_NAME.NORMAL_ATTACK_COUNT] or 0
|
return self.attr[ATTR_NAME.NORMAL_ATTACK_COUNT] or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleTeamEntity:getExpTime()
|
||||||
|
return self.attr.exp_time or 0
|
||||||
|
end
|
||||||
|
|
||||||
function BattleTeamEntity:addMaxHp(num)
|
function BattleTeamEntity:addMaxHp(num)
|
||||||
local hpBefore = self.attr.hp
|
local hpBefore = self.attr.hp
|
||||||
local currPercent = hpBefore * DEFAULT_FACTOR // self.attr.max_hp
|
local currPercent = hpBefore * DEFAULT_FACTOR // self.attr.max_hp
|
||||||
|
|||||||
@ -318,6 +318,10 @@ function BattleUnitEntity:getExp()
|
|||||||
return self.unitData.exp
|
return self.unitData.exp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitEntity:getExpTime()
|
||||||
|
return self.team:getExpTime()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:getIsDead()
|
function BattleUnitEntity:getIsDead()
|
||||||
return self.team:getIsDead()
|
return self.team:getIsDead()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user