refactor(fight/effect): 统一效果初始化接口,重构效果类型管理并优化参数传递逻辑

This commit is contained in:
1
2025-09-24 16:36:32 +00:00
parent e909200799
commit 266a328159
14 changed files with 146 additions and 204 deletions

View File

@@ -14,7 +14,7 @@ type Effect62 struct {
}
func init() {
input.InitSkillEffect(62, &Effect62{
input.InitEffect(input.EffectType.Skill, 62, &Effect62{
EffectNode: node.EffectNode{
Owner: true,
},
@@ -44,7 +44,8 @@ func (this *Effect62) TurnEnd(e *input.Input) {
func (e *Effect62) SkillUseEnd(opp *input.Input) {
if !e.Hide { //如果还在隐藏,就直接返回
defer e.EffectNode.NotALive() //失效
e.Input.Death() //本只死亡
//应该是对方固定伤害等于自身血量
//e.Input.Death() //本只死亡
}
@@ -53,10 +54,11 @@ func (e *Effect62) SkillUseEnd(opp *input.Input) {
}
func (e *Effect62) SetArgs(args ...int) {
// 默认添加回合
func (e *Effect62) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(args...)
e.EffectNode.Duration(args[0])
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}