2025-11-14 04:23:50 +08:00
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
import (
|
2025-11-14 23:09:16 +08:00
|
|
|
"blazing/logic/service/fight/action"
|
2025-11-14 04:23:50 +08:00
|
|
|
"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 04:23:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自己牺牲(体力降到0), 使下一只出战精灵在前两回合内必定致命一击
|
|
|
|
|
*/
|
|
|
|
|
type Effect71 struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
can bool
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-02 04:11:37 +08:00
|
|
|
func (e *Effect71) SwitchOut(in *input.Input) bool {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2025-11-14 04:23:50 +08:00
|
|
|
func init() {
|
|
|
|
|
|
2025-11-14 23:09:16 +08:00
|
|
|
input.InitEffect(input.EffectType.Skill, 71, &Effect71{})
|
2025-11-14 04:23:50 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
func (e *Effect71) SetArgs(t *input.Input, a ...int) {
|
|
|
|
|
|
2025-11-14 06:14:49 +08:00
|
|
|
//e.CanStack(-1)//后续的不会顶掉这个效果
|
2025-11-14 04:23:50 +08:00
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
|
|
|
e.Duration(-1) //次数类,无限回合
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 命中之后
|
|
|
|
|
func (e *Effect71) OnSkill() bool {
|
2026-01-04 21:41:10 +08:00
|
|
|
|
2025-11-14 04:23:50 +08:00
|
|
|
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 04:23:50 +08:00
|
|
|
})
|
2025-12-01 23:31:48 +08:00
|
|
|
e.Ctx().Our.CurrentPet.NotAlive = true
|
2025-11-14 04:23:50 +08:00
|
|
|
return true
|
|
|
|
|
}
|
2025-12-25 20:49:54 +08:00
|
|
|
func (e *Effect71) SwitchIn(in *input.Input) bool {
|
2025-11-14 04:23:50 +08:00
|
|
|
// 1. 检查效果是否生效(当次攻击有效)
|
|
|
|
|
if !e.can {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if in != e.Ctx().Our {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2025-11-14 23:09:16 +08:00
|
|
|
t := &Effect71_sub{}
|
2025-11-15 13:20:42 +08:00
|
|
|
t.Duration(1)
|
2025-11-26 15:25:10 +08:00
|
|
|
tt := e.ID()
|
|
|
|
|
tt.SetEffectType(input.EffectType.Sub)
|
2025-11-22 00:44:42 +08:00
|
|
|
|
2025-11-22 22:57:32 +08:00
|
|
|
t.ID(tt)
|
2025-11-14 23:09:16 +08:00
|
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, t)
|
2025-11-14 04:23:50 +08:00
|
|
|
|
2025-11-14 23:09:16 +08:00
|
|
|
e.Alive(false)
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Effect71_sub struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
}
|
2025-11-14 04:23:50 +08:00
|
|
|
|
2026-01-05 23:00:42 +08:00
|
|
|
func (e *Effect71_sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
2025-11-14 23:09:16 +08:00
|
|
|
|
|
|
|
|
//fmt.Println(e.Ctx().SkillEntity)
|
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
|
|
|
return true
|
2025-11-14 04:23:50 +08:00
|
|
|
}
|
2025-11-14 23:09:16 +08:00
|
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
e.Ctx().SkillEntity.CritRate = 16
|
|
|
|
|
|
2025-11-14 04:23:50 +08:00
|
|
|
return true
|
|
|
|
|
}
|