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:
@@ -153,11 +153,11 @@ type BossJsonEid224 struct {
|
||||
}
|
||||
|
||||
func (e *BossJsonEid224) revive() bool {
|
||||
if !e.ownerActive() || e.used || e.Ctx().Our.CurrentPet[0].Info.Hp != 0 {
|
||||
if !e.ownerActive() || e.used || e.Ctx().Our.CurPet[0].Info.Hp != 0 {
|
||||
return true
|
||||
}
|
||||
e.used = true
|
||||
e.Ctx().Our.CurrentPet[0].Info.Hp = e.Ctx().Our.CurrentPet[0].Info.MaxHp
|
||||
e.Ctx().Our.CurPet[0].Info.Hp = e.Ctx().Our.CurPet[0].Info.MaxHp
|
||||
e.Ctx().Our.HealPP(-1)
|
||||
stageSeed := bossJsonIntArg(e.Args(), len(e.Args())-1, 6)
|
||||
stage := int8(stageSeed - 6)
|
||||
@@ -200,12 +200,12 @@ func (e *BossJsonEid2104) TurnStart(fattack, sattack *action.SelectSkillAction)
|
||||
if growPercent <= 0 {
|
||||
return
|
||||
}
|
||||
add := int(e.Ctx().Our.CurrentPet[0].Info.MaxHp) * growPercent / 100
|
||||
add := int(e.Ctx().Our.CurPet[0].Info.MaxHp) * growPercent / 100
|
||||
if add <= 0 {
|
||||
return
|
||||
}
|
||||
e.Ctx().Our.CurrentPet[0].Info.MaxHp += uint32(add)
|
||||
e.Ctx().Our.CurrentPet[0].Info.Hp += uint32(add)
|
||||
e.Ctx().Our.CurPet[0].Info.MaxHp += uint32(add)
|
||||
e.Ctx().Our.CurPet[0].Info.Hp += uint32(add)
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2104) TurnEnd() {
|
||||
@@ -213,10 +213,10 @@ func (e *BossJsonEid2104) TurnEnd() {
|
||||
return
|
||||
}
|
||||
recoverPercent := bossJsonIntArg(e.Args(), 0, 0)
|
||||
if recoverPercent <= 0 || e.Ctx().Our.CurrentPet[0].Info.MaxHp <= e.Ctx().Our.CurrentPet[0].Info.Hp {
|
||||
if recoverPercent <= 0 || e.Ctx().Our.CurPet[0].Info.MaxHp <= e.Ctx().Our.CurPet[0].Info.Hp {
|
||||
return
|
||||
}
|
||||
missing := int(e.Ctx().Our.CurrentPet[0].Info.MaxHp - e.Ctx().Our.CurrentPet[0].Info.Hp)
|
||||
missing := int(e.Ctx().Our.CurPet[0].Info.MaxHp - e.Ctx().Our.CurPet[0].Info.Hp)
|
||||
heal := missing * recoverPercent / 100
|
||||
if heal > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(heal)))
|
||||
@@ -284,10 +284,10 @@ func (e *BossJsonEid2105) TurnEnd() {
|
||||
}
|
||||
threshold := bossJsonIntArg(e.Args(), 0, 0)
|
||||
grant := bossJsonIntArg(e.Args(), 1, 0)
|
||||
if threshold <= 0 || grant <= 0 || e.Ctx().Our.CurrentPet[0].Info.MaxHp == 0 {
|
||||
if threshold <= 0 || grant <= 0 || e.Ctx().Our.CurPet[0].Info.MaxHp == 0 {
|
||||
return
|
||||
}
|
||||
if int(e.Ctx().Our.CurrentPet[0].Info.Hp)*100 < int(e.Ctx().Our.CurrentPet[0].Info.MaxHp)*threshold && e.rounds < grant {
|
||||
if int(e.Ctx().Our.CurPet[0].Info.Hp)*100 < int(e.Ctx().Our.CurPet[0].Info.MaxHp)*threshold && e.rounds < grant {
|
||||
e.rounds = grant
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user