feat(fight): 添加新效果类型574并优化现有战斗逻辑 - 重命名NewSel409结构体的Action_end_ex方法为Skill_Use_ex - 将effect/523中HP检查改为Alive()方法调用 - 修复selfkill效果中的代码格式问题 - 新增效果类型574:消耗自身全部体力使下次技能必定先手、命中且暴击 - 实现Effect574的ComparePre和ActionStart方法处理先手、命中和暴击逻辑 ```
48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// {
|
|
// "id": 557,
|
|
// "argsNum": 3,
|
|
// "info": "{0}回合内对手使用正先制的技能时{1}%令对手{2}"
|
|
// },
|
|
type Effect557 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect557) Skill_Use_ex() bool {
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.XML.Priority <= 0 {
|
|
return true
|
|
}
|
|
|
|
chance := int(e.Args()[1].IntPart()) // 触发概率
|
|
statusType := int(e.Args()[2].IntPart()) // 异常状态类型
|
|
|
|
if success, _, _ := e.Input.Player.Roll(chance, 100); success {
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, statusType)
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func (e *Effect557) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
|
|
e.EffectNode.Duration(a[0]) // 持续m回合
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 557, &Effect557{})
|
|
}
|