2025-11-14 03:21:00 +08:00
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/logic/service/fight/info"
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
"blazing/logic/service/fight/node"
|
|
|
|
|
|
2025-12-05 00:24:02 +08:00
|
|
|
"github.com/alpacahq/alpacadecimal"
|
2025-11-14 03:21:00 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 消耗自身全部体力(体力降到0), 使下一只出战精灵的 battle_lv1 和 battle_lv2 能力提升1个等级
|
|
|
|
|
*/
|
|
|
|
|
type Effect59 struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
can bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 59, &Effect59{})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
func (e *Effect59) SetArgs(t *input.Input, a ...int) {
|
|
|
|
|
|
2025-11-14 06:14:49 +08:00
|
|
|
//e.CanStack(-1)//后续的不会顶掉这个效果
|
2025-11-14 03:21:00 +08:00
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
|
|
|
e.Duration(-1) //次数类,无限回合
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 命中之后
|
|
|
|
|
func (e *Effect59) OnSkill() bool {
|
|
|
|
|
if !e.Hit() {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
e.can = true
|
|
|
|
|
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
|
|
|
|
Type: info.DamageType.Fixed,
|
2025-12-05 00:24:02 +08:00
|
|
|
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
2025-11-14 03:21:00 +08:00
|
|
|
})
|
2025-12-01 23:31:48 +08:00
|
|
|
e.Ctx().Our.CurrentPet.NotAlive = true
|
2025-11-14 03:21:00 +08:00
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
func (e *Effect59) Switch(in *input.Input, at info.AttackValue, oldpet *info.BattlePetEntity) bool {
|
|
|
|
|
// 1. 检查效果是否生效(当次攻击有效)
|
|
|
|
|
if !e.can {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2025-11-14 04:23:50 +08:00
|
|
|
//
|
2025-11-14 03:21:00 +08:00
|
|
|
if in != e.Ctx().Our {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-06 15:11:42 +08:00
|
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD)
|
|
|
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1].IntPart()), 1, info.AbilityOpType.ADD)
|
2025-11-14 03:21:00 +08:00
|
|
|
e.Alive(false)
|
|
|
|
|
return true
|
|
|
|
|
}
|