feat(fight): 添加新效果类型574并优化现有战斗逻辑 - 重命名NewSel409结构体的Action_end_ex方法为Skill_Use_ex - 将effect/523中HP检查改为Alive()方法调用 - 修复selfkill效果中的代码格式问题 - 新增效果类型574:消耗自身全部体力使下次技能必定先手、命中且暴击 - 实现Effect574的ComparePre和ActionStart方法处理先手、命中和暴击逻辑 ```
50 lines
819 B
Go
50 lines
819 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// {
|
|
// "id": 528,
|
|
// "argsNum": 1,
|
|
// "info": "先出手时{0}回合内不受能力下降技能影响"
|
|
// },
|
|
type Effect528 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect528) OnSkill() bool {
|
|
|
|
// 检查是否先出手
|
|
if !e.IsFirst() {
|
|
e.Alive(false)
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func (e *Effect528) PropBefer(in *input.Input, prop int8, level int8) bool {
|
|
|
|
if in == e.Ctx().Our {
|
|
return true
|
|
}
|
|
|
|
//能力下降类
|
|
if level < 0 {
|
|
|
|
return false
|
|
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (e *Effect528) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
|
|
e.EffectNode.Duration(a[0]) // 持续m回合
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 528, &Effect528{})
|
|
}
|