feat(boss): 实现 boss 特殊技能逻辑增强

- 新增 NewSeIdx_12 技能:受到特殊攻击时提升指定 battle_lv 等级,可配置最大触发次数
- 新增 NewSeIdx_16 技能:根据 HP 减少量动态提升指定 battle_lv 等级,每损失 1/8 最大 HP 提升一级
- 新增 NewSeIdx_26 技能:预留 Turn_Start 接口以支持回合开始时的逻辑处理
- 在 EffectNode 中增加命中日志输出,便于调试效果触发情况
This commit is contained in:
2025-12-18 00:32:47 +08:00
parent 0322f28f53
commit ae616ac848
4 changed files with 40 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
// TODO: 实现受到特殊攻击时使自身的一种 battle_lv 提升1个等级可提升n次;a1: which blv, a2: max_blv_up_times的核心逻辑
type NewSel12 struct {
NewSel0
count int
}
func (e *NewSel12) Damage_DIV_ex(t *info.DamageZone) bool {
@@ -25,6 +26,9 @@ func (e *NewSel12) Damage_DIV_ex(t *info.DamageZone) bool {
if skill.Category() != info.Category.SPECIAL {
return true
}
if e.count >= int(e.Args()[2].IntPart()) {
return true
}
// 3. 概率判定Args()[1]为触发概率)
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !success {
@@ -32,6 +36,7 @@ func (e *NewSel12) Damage_DIV_ex(t *info.DamageZone) bool {
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD)
e.count++
return true
}
func init() {

View File

@@ -1,15 +1,44 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 16. hp 与 battle_lv 的某一种绑定, 自身体力每减少1/8, 则该battle_lv上升1个等级, 最高到12;a1: which blv
// TODO: 实现hp 与 battle_lv 的某一种绑定, 自身体力每减少1/8, 则该battle_lv上升1个等级, 最高到12;a1: which blv的核心逻辑
type NewSel16 struct {
NewSel0
curhp alpacadecimal.Decimal
}
func (e *NewSel16) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
// fmt.Println(e.ID().GetCatchTime(), e.Ctx().Our.CurrentPet.Info.CatchTime)
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return
}
maxHP := e.Ctx().Our.CurrentPet.GetMaxHP()
if e.curhp.IntPart() == 0 {
e.curhp = maxHP
}
//如果当前被扣除的血量少于当前血,说明我方回血
if e.curhp.Cmp(e.Ctx().Our.CurrentPet.GetHP()) == -1 {
e.curhp = e.Ctx().Our.CurrentPet.GetHP()
return
}
if e.curhp.Sub(e.Ctx().Our.CurrentPet.GetHP()).Cmp(maxHP.Div(alpacadecimal.NewFromInt(8))) == 1 {
e.curhp = e.Ctx().Our.CurrentPet.GetHP()
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD)
}
return
}
func init() {
input.InitEffect(input.EffectType.NewSel, 16, &NewSel16{})
}

View File

@@ -1,6 +1,7 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
)
@@ -10,6 +11,9 @@ type NewSel26 struct {
NewSel0
}
func (e *NewSel26) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
}
func init() {
input.InitEffect(input.EffectType.NewSel, 26, &NewSel26{})
}

View File

@@ -68,7 +68,9 @@ func (e *EffectNode) ID(t ...input.EffectIDCombiner) input.EffectIDCombiner {
}
func (e *EffectNode) Hit(t ...bool) bool {
if len(t) > 0 {
println("效果命中", e.id.GetEffectType(), e.id.Suffix(), t[0])
e.hit = t[0]
}