fix(fight): 实现无限PP值效果并修复Effect46伤害逻辑
- 在NewSeIdx_10中添加Turn_Start方法以实现每回合恢复PP值 - 修复Effect46中伤害计算与存活判断的顺序问题 - 调整部分代码结构,移除无用math包引用及注释内容
This commit is contained in:
@@ -1,26 +1,36 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/input"
|
||||
"math"
|
||||
)
|
||||
|
||||
// 10. 无限PP值;
|
||||
// TODO: 实现无限PP值;的核心逻辑
|
||||
type NewSel10 struct {
|
||||
NewSel0
|
||||
can bool
|
||||
}
|
||||
|
||||
func (e *NewSel10) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
|
||||
if e.can {
|
||||
e.Ctx().Our.HealPP(-1)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
func (e *NewSel10) OnSkill() bool {
|
||||
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.Info.PP = math.MaxInt32
|
||||
e.can = true
|
||||
|
||||
// if e.Ctx().SkillEntity == nil {
|
||||
// return true
|
||||
// }
|
||||
// e.Ctx().SkillEntity.Info.PP = math.MaxInt32
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@ type Effect46 struct {
|
||||
conut int64
|
||||
}
|
||||
|
||||
func (e *Effect46) Turn_End() {
|
||||
e.conut++
|
||||
}
|
||||
func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
@@ -29,18 +26,17 @@ func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
//fmt.Println("Effect46_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
e.conut++
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
}
|
||||
if e.Args()[0].IntPart() == e.conut {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
|
||||
//fmt.Println("Effect46_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
}
|
||||
|
||||
//fmt.Println("Effect46_n", t.Damage)
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user