Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
refactor(fight): 统一技能执行方法命名并修复战斗逻辑错误 - 将多个boss技能结构体中的OnSkill()方法重命名为Skill_Use()以保持一致性 - 修改fightc.go中的战斗回合逻辑,修复attacker和defender的执行顺序错误 - 将Effect126的TurnStart方法改为Skill_Use方法并返回bool值 - 为Effect499添加缺失的方法实现 - 移除effect_124_126.go中未
34 lines
620 B
Go
34 lines
620 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// 506 - 下回合受到致命伤害时残留m点体力
|
|
type Effect506 struct {
|
|
node.EffectNode
|
|
triggered bool
|
|
}
|
|
|
|
func (e *Effect506) Skill_Use() bool {
|
|
e.triggered = true
|
|
|
|
return true
|
|
}
|
|
func (e *Effect506) Action_end() bool {
|
|
if !e.triggered {
|
|
return true
|
|
}
|
|
minHealth := uint32(e.Args()[0].IntPart()) // m点体力
|
|
if e.Ctx().Our.CurrentPet.GetHP().IntPart() == 0 {
|
|
e.Ctx().Our.CurrentPet.Info.Hp = minHealth
|
|
}
|
|
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 506, &Effect506{})
|
|
|
|
}
|