feat: 新增战斗Boss特性效果实现
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-05 18:04:20 +08:00
committed by cnb
parent 03d93a2fba
commit eb5ea901f4
3 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
// 144. 重生 (hp和btl_maxhp 恢复到 maxhp + maxhp_adj, 技能PP值回满)a1: 可重生次数)
// TODO: 实现重生 (hp和btl_maxhp 恢复到 maxhp + maxhp_adj, 技能PP值回满)a1: 可重生次数)的核心逻辑
type NewSel144 struct {
NewSel0
count int
}
func (e *NewSel144) ActionEndEx() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp == 0 {
if e.count >= int(e.Args()[0].IntPart()) {
return true
}
e.count++
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
e.Ctx().Our.HealPP(-1)
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 6, info.AbilityOpType.ADD)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 144, &NewSel144{})
}

View File

@@ -0,0 +1,44 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
"github.com/samber/lo"
)
// 224. 对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);a1-a8: 有效技能ID
// TODO: 实现对方用这些技能时, 对自身的命中率为0 (最多8个 / 不要与必中技能一起配置);a1-a8: 有效技能ID的核心逻辑
type NewSel224 struct {
NewSel0
}
func (e *NewSel224) SkillUseed() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
// 技能为空时不处理
skill := e.Ctx().SkillEntity
if skill == nil {
return true
}
_, ok := lo.Find(e.Args(), func(item alpacadecimal.Decimal) bool {
return skill.ID == int(item.IntPart())
})
if !ok {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(alpacadecimal.NewFromInt(3)),
})
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 224, &NewSel224{})
}

View File

@@ -0,0 +1,32 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
// 283. 受到超过n 全属性-1
type NewSel283 struct {
NewSel0
}
func (e *NewSel283) SkillUseed() bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
// 检查受到的伤害是否超过阈值
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) > 0 {
for i := 0; i < 6; i++ {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[1].IntPart()), info.AbilityOpType.SUB)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 283, &NewSel283{})
}