refactor: 重构持续伤害触发时机为回合开始
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-04-14 15:21:47 +08:00
parent c9b5f8569f
commit 4a77066d08
3 changed files with 5 additions and 13996 deletions

View File

@@ -95,13 +95,13 @@ type ContinuousDamage struct {
isheal bool //是否回血
}
// 技能命中前触发伤害1/8最大生命值真实伤害
func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAction) bool {
// 回合开始触发持续伤害,保证吃药/空过回合时也会正常结算。
func (e *ContinuousDamage) TurnStart(attacker, defender *action.SelectSkillAction) {
carrier := e.CarrierInput()
source := e.SourceInput()
opp := e.TargetInput()
if carrier == nil {
return true
return
}
damage := e.calculateDamage()
@@ -110,7 +110,7 @@ func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAct
Damage: damage,
})
if len(e.SideEffectArgs) == 0 {
return true
return
}
// 额外效果
carrier.Damage(source, &info.DamageZone{
@@ -118,12 +118,11 @@ func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAct
Damage: damage,
})
if opp == nil || opp.CurPet[0].GetHP().IntPart() == 0 {
return true
return
}
// 给对方回血(不受回血限制影响)
opp.Heal(carrier, nil, damage)
return true
}
// 计算伤害最大生命值的1/8

File diff suppressed because it is too large Load Diff