refactor(fight): 统一DamageLock方法命名规范并修改方法签名 - 将DamageLock_ex方法重命名为DamageLockEx,统一命名规范 - 修改NewSeIdx_53、NewSeIdx_54、NewSeIdx_71的TurnEnd方法为TurnStart - 为TurnStart方法添加fattack和sattack参数 - 修复NewSeIdx_5中的条件判断逻辑,将!ok改为ok - 修正NewSeIdx_5中的Ctx().SkillEntity.Type为Ctx().Type - 移除EffectNode.Alive方法中的调试打印语句 - 添加必要的action包导入 ```
41 lines
925 B
Go
41 lines
925 B
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
|
||
"github.com/alpacahq/alpacadecimal"
|
||
)
|
||
|
||
// 1回合内,受到致死攻击时则余下1点体力
|
||
// ---- Effect68 ----
|
||
type Effect68 struct {
|
||
node.EffectNode
|
||
StatusID int
|
||
}
|
||
|
||
func (e *Effect68) DamageLockEx(t *info.DamageZone) bool {
|
||
|
||
if e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
//fmt.Println("Effect68_o", t.Damage)
|
||
//伤害溢出
|
||
if t.Type == info.DamageType.Red && t.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) == 1 {
|
||
//e.Ctx().Our.CurrentPet.Info.Hp = 1
|
||
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
||
}
|
||
//fmt.Println("Effect68_n", t.Damage)
|
||
return true
|
||
}
|
||
|
||
// ---- 注册所有效果 ----
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
|
||
}
|