2025-11-14 04:55:29 +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 04:55:29 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 牺牲全部体力造成对手250~300点伤害,造成致命伤害时,对手剩下1点体力
|
|
|
|
|
|
*/
|
|
|
|
|
|
type Effect112 struct {
|
|
|
|
|
|
node.EffectNode
|
|
|
|
|
|
can bool
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
|
2025-11-15 13:20:42 +08:00
|
|
|
|
input.InitEffect(input.EffectType.Skill, 112, &Effect112{})
|
2025-11-14 04:55:29 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 命中之后
|
|
|
|
|
|
func (e *Effect112) OnSkill() bool {
|
2026-01-04 21:41:10 +08:00
|
|
|
|
|
2025-11-14 04:55:29 +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:55:29 +08:00
|
|
|
|
})
|
|
|
|
|
|
n := int64(e.Input.FightC.GetRand().Int31n(int32(50+1))) + 250
|
|
|
|
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
|
|
|
|
Type: info.DamageType.Fixed,
|
2025-12-05 00:24:02 +08:00
|
|
|
|
Damage: alpacadecimal.Min(alpacadecimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))),
|
2025-11-14 04:55:29 +08:00
|
|
|
|
})
|
2025-12-01 23:31:48 +08:00
|
|
|
|
e.Ctx().Our.CurrentPet.NotAlive = true
|
2025-11-14 04:55:29 +08:00
|
|
|
|
return true
|
|
|
|
|
|
}
|