- 将 `MaxStack` 方法重命名为 `CanStack`,并修改其逻辑为布尔值控制是否可叠加 - 更新多个效果文件中的注释和调用方式以适配新的叠加控制方法 - 修复精灵属性类型获取逻辑,增加缓存字段 `PType` - 修改战斗回合处理流程,优化技能解析顺序和状态比较时机 - 调整状态效果初始化逻辑,确保状态类效果默认允许无限叠加 - 更正伤害类型缺失问题,在固定伤害
56 lines
1.1 KiB
Go
56 lines
1.1 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
// "可完全抵挡n次攻击伤害 百分百减伤 ,后面还有锁伤
|
|
// ---- Effect46 ----
|
|
type Effect46 struct {
|
|
node.EffectNode
|
|
//StatusID int
|
|
conut int
|
|
}
|
|
|
|
func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if e.Args()[0] == e.conut {
|
|
e.Alive(false)
|
|
return true
|
|
}
|
|
|
|
//fmt.Println("Effect46_o", t.Damage)
|
|
if t.Type == info.DamageType.Red {
|
|
|
|
t.Damage = decimal.NewFromInt(0)
|
|
|
|
}
|
|
e.conut++
|
|
//fmt.Println("Effect46_n", t.Damage)
|
|
return true
|
|
}
|
|
func (e *Effect46) SetArgs(t *input.Input, a ...int) {
|
|
|
|
//e.CanStack(-1)//后续的不会顶掉这个效果
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.Duration(-1) //次数类,无限回合
|
|
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 46, &Effect46{})
|
|
}
|