refactor: 重构 CurrentPet 为 CurPet
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -82,7 +82,7 @@ func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAct
|
||||
Type: info.DamageType.True,
|
||||
Damage: damage,
|
||||
})
|
||||
if e.Ctx().Opp.CurrentPet[0].GetHP().IntPart() == 0 {
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().IntPart() == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ func (e *ContinuousDamage) ActionStart(attacker, defender *action.SelectSkillAct
|
||||
|
||||
// 计算伤害:最大生命值的1/8
|
||||
func (e *ContinuousDamage) calculateDamage() alpacadecimal.Decimal {
|
||||
return alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet[0].Info.MaxHp)).
|
||||
return alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurPet[0].Info.MaxHp)).
|
||||
Div(alpacadecimal.NewFromInt(8))
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ func (e *ParasiticSeed) SwitchOut(in *input.Input) bool {
|
||||
func (e *ParasiticSeed) ActionStartEx(attacker, defender *action.SelectSkillAction) bool {
|
||||
// 过滤特定类型单位(假设1是植物类型,使用枚举替代魔法数字)
|
||||
|
||||
damage := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet[0].Info.MaxHp)).
|
||||
damage := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurPet[0].Info.MaxHp)).
|
||||
Div(alpacadecimal.NewFromInt(8))
|
||||
|
||||
// 对我方造成真实伤害
|
||||
@@ -133,7 +133,7 @@ func (e *ParasiticSeed) ActionStartEx(attacker, defender *action.SelectSkillActi
|
||||
Type: info.DamageType.True,
|
||||
Damage: damage,
|
||||
})
|
||||
if e.Ctx().Opp.CurrentPet[0].GetHP().IntPart() == 0 {
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().IntPart() == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user