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

@@ -7,10 +7,10 @@ import (
func init() {
//技能使用成功时m%自身XX等级+/-n
input.InitSkillEffect(4, NewEffectStat(false))
input.InitEffect(input.EffectType.Skill, 4, NewEffectStat(false))
//技能使用成功时m%对方XX等级+/-n
input.InitSkillEffect(5, NewEffectStat(true))
input.InitEffect(input.EffectType.Skill, 5, NewEffectStat(true))
}
func NewEffectStat(b bool) input.Effect {
@@ -24,7 +24,7 @@ func NewEffectStat(b bool) input.Effect {
type EffectStat struct {
node.EffectNode
etype bool
Etype bool
}
// func (this *EffectStat) GetPet() {
@@ -42,7 +42,7 @@ func (e *EffectStat) SkillUseEnd(opp *input.Input) {
t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
if t {
if !e.etype { //自身
if !e.Etype { //自身
e.Input.SetProp(e.EffectNode.SideEffectArgs[0], e.EffectNode.SideEffectArgs[2])
} else { //对方