Files
bl/logic/service/fight/effect/effect_9.go
昔念 004ce51c5e feat(fight): 调整效果叠加逻辑与精灵属性处理
- 将 `MaxStack` 方法重命名为 `CanStack`,并修改其逻辑为布尔值控制是否可叠加
- 更新多个效果文件中的注释和调用方式以适配新的叠加控制方法
- 修复精灵属性类型获取逻辑,增加缓存字段 `PType`
- 修改战斗回合处理流程,优化技能解析顺序和状态比较时机
- 调整状态效果初始化逻辑,确保状态类效果默认允许无限叠加
- 更正伤害类型缺失问题,在固定伤害
2025-11-14 06:14:49 +08:00

42 lines
908 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/common/utils"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 连续使用每次威力增加n最高威力m
*/
func init() {
t := &Effect9{}
t.Duration(-1) //次数类无限回合
t.CanStack(true) //后续的不会顶掉这个效果
input.InitEffect(input.EffectType.Skill, 9, t)
}
type Effect9 struct {
node.EffectNode
Skillid int //记录使用的技能 如果技能变了就删除effect
UseSkillCount int //技能使用了多少次切换后置0
}
func (e *Effect9) Skill_Hit() bool {
if e.Skillid != 0 && e.Ctx().SkillEntity.ID != e.Skillid {
e.Alive(false)
e.UseSkillCount = 0
return true
}
e.Skillid = e.Ctx().SkillEntity.ID
add := e.EffectNode.SideEffectArgs[0] * e.UseSkillCount
e.Ctx().SkillEntity.Power += utils.Min(add, e.EffectNode.SideEffectArgs[1])
e.UseSkillCount++
return true
}