feat(fight): 添加新效果类型574并优化现有战斗逻辑 - 重命名NewSel409结构体的Action_end_ex方法为Skill_Use_ex - 将effect/523中HP检查改为Alive()方法调用 - 修复selfkill效果中的代码格式问题 - 新增效果类型574:消耗自身全部体力使下次技能必定先手、命中且暴击 - 实现Effect574的ComparePre和ActionStart方法处理先手、命中和暴击逻辑 ```
48 lines
925 B
Go
48 lines
925 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// {
|
|
// "id": 548,
|
|
// "argsNum": 1,
|
|
// "info": "消除对手能力提升状态,消除成功后恢复{0}点体力"
|
|
// },
|
|
type Effect548 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect548) OnSkill() bool {
|
|
|
|
healAmount := e.Args()[0] // 恢复体力值
|
|
|
|
// 检查对手是否有能力提升状态
|
|
hasPositiveStatus := false
|
|
for i, prop := range e.Ctx().Opp.Prop {
|
|
if prop > 0 {
|
|
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
|
hasPositiveStatus = true
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
// 如果成功消除了能力提升状态,则恢复体力
|
|
if hasPositiveStatus {
|
|
e.Ctx().Our.Heal(
|
|
e.Ctx().Our,
|
|
&action.SelectSkillAction{},
|
|
healAmount,
|
|
)
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 548, &Effect548{})
|
|
}
|