2025-11-25 18:25:52 +08:00
|
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2026-03-28 21:57:22 +08:00
|
|
|
|
"blazing/logic/service/fight/action"
|
2025-11-25 18:25:52 +08:00
|
|
|
|
"blazing/logic/service/fight/input"
|
2026-03-28 21:57:22 +08:00
|
|
|
|
|
|
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
2025-11-25 18:25:52 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 58. 按一定条件触发魔王的愤怒,触发时,战斗等级提升至一定状态,可以被消强化(SideEffect="33")恢复至正常状态(+6)(a1-a6: atk/def/sp_atk/sp_def/spd/accuracy,-1为不设置)
|
|
|
|
|
|
type NewSel58 struct {
|
|
|
|
|
|
NewSel0
|
2026-03-28 21:57:22 +08:00
|
|
|
|
active bool
|
|
|
|
|
|
used bool
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (e *NewSel58) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
|
|
|
|
|
|
if !e.IsOwner() || e.used {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
currentHP := e.Ctx().Our.CurrentPet.GetHP()
|
|
|
|
|
|
maxHP := e.Ctx().Our.CurrentPet.GetMaxHP()
|
|
|
|
|
|
if maxHP.IntPart() == 0 {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 当前仓库里没有更具体的触发参数,采用半血触发作为兜底实现。
|
|
|
|
|
|
if currentHP.Mul(alpacadecimal.NewFromInt(2)).Cmp(maxHP) == 1 {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
e.used = true
|
|
|
|
|
|
e.active = true
|
|
|
|
|
|
for i, arg := range e.Args() {
|
|
|
|
|
|
if arg.IntPart() < 0 {
|
|
|
|
|
|
continue
|
|
|
|
|
|
}
|
|
|
|
|
|
target := int8(arg.IntPart())
|
|
|
|
|
|
if target > e.Ctx().Our.AttackValue.Prop[i] {
|
|
|
|
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), target-e.Ctx().Our.AttackValue.Prop[i])
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (e *NewSel58) TurnEnd() {
|
|
|
|
|
|
if !e.IsOwner() || !e.active {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
hasPositive := false
|
|
|
|
|
|
for i, arg := range e.Args() {
|
|
|
|
|
|
if arg.IntPart() < 0 {
|
|
|
|
|
|
continue
|
|
|
|
|
|
}
|
|
|
|
|
|
if e.Ctx().Our.AttackValue.Prop[i] > 0 {
|
|
|
|
|
|
hasPositive = true
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if !hasPositive {
|
|
|
|
|
|
e.active = false
|
|
|
|
|
|
}
|
2025-11-25 18:25:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
input.InitEffect(input.EffectType.NewSel, 58, &NewSel58{})
|
|
|
|
|
|
}
|