refactor(fight/effect): 重构SkillUseEnd方法签名,统一添加input参数并优化属性提升逻辑

This commit is contained in:
1
2025-09-23 19:28:19 +00:00
parent 908d36b126
commit fb55f18a39
6 changed files with 22 additions and 13 deletions

View File

@@ -41,15 +41,15 @@ func (this *Effect62) TurnEnd(e *input.Input) {
}
func (this *Effect62) SkillUseEnd() bool {
func (this *Effect62)SkillUseEnd(*input.Input) {
if this.Hide { //如果还在隐藏,就直接返回
return true
//return true
}
defer func() { //延迟处理
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this) //如果生效就移除
}()
//否则触发秒杀 在对面使用技能后
return true
//return true
}

View File

@@ -38,10 +38,20 @@ type EffectStat struct {
// addrA := unsafe.Pointer(baseAddr + 4) //根据攻击算其他字段
// *(*uint32)(addrA) = 100
// }
func (this *EffectStat) SkillUseEnd() {
if !this.etype { //自身
func (e *EffectStat) SkillUseEnd(opp *input.Input) {
// for i := 0; i < 6; i++ { //堆叠属性提升
// ret.FAttack.Prop[i] = int8(attacker.GetProp(i, true))
// ret.FAttack.Prop[i] = int8(defender.GetProp(i, true))
// }
t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
if t {
if !e.etype { //自身
} else { //对方
e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2])
} else { //对方
opp.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2])
}
}
}

View File

@@ -541,10 +541,7 @@ func (f *FightC) enterturn(fattack, sattack BattleActionI) {
SAttack: *f.Second.AttackValue,
}
for i := 0; i < 6; i++ { //堆叠属性提升
ret.FAttack.Prop[i] = int8(attacker.GetProp(i, true))
ret.FAttack.Prop[i] = int8(defender.GetProp(i, true))
}
for i := 0; i < 20; i++ { //堆叠状态剩余回合
ate, ok := attacker.GetStatusEffect(i)
if ok {

View File

@@ -15,6 +15,7 @@ type Effect interface {
OnTurnStart(opp *Input) bool //回合开始
UseSkill(opp *Input) bool //使用技能 可以取消用技能节点
SkillUseEnd(opp *Input)
// OnSkillPP() bool //技能PP减少节点
// BeforeMultiHit() bool //多段攻击前
// BeforeHit() bool //命中前

View File

@@ -16,9 +16,7 @@ func (this *EffectNode) TakeHit(opp *input.Input, skill *info.SkillEntity) {
}
func (this *EffectNode) SkillUseEnd() bool {
panic("not implemented") // TODO: Implement
}
func (this *EffectNode) BeforeMultiHit() bool {
panic("not implemented") // TODO: Implement

View File

@@ -18,3 +18,6 @@ func (e *EffectNode) OnSkill(opp *input.Input, skill *info.SkillEntity) {
func (e *EffectNode) OnSkillPP() bool {
panic("not implemented") // TODO: Implement
}
func (this *EffectNode) SkillUseEnd(*input.Input) {
}