feat(effect): 实现多个新技能效果逻辑

- 新增 NewSel12 效果:实现特定条件下增加属性的功能
- 新增 NewSel36 效果:实现按回合轮换属性顺序出招的去血逻辑
- 修改 NewSel37 效果:限制仅对红伤生效
- 修改 NewSel39 和 NewSel40 效果:方法名从 Damage_Floor 改为 Damage_DIV_ex
- 新增 NewSel44 效果:实现重生逻辑,恢复
This commit is contained in:
2025-11-26 23:09:20 +08:00
parent f15f08189f
commit 5a9c37e852
12 changed files with 1239 additions and 513 deletions

View File

@@ -1,6 +1,7 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
@@ -10,6 +11,29 @@ type NewSel12 struct {
NewSel0
}
func (e *NewSel12) Damage_DIV_ex(t *info.DamageZone) bool {
// fmt.Println(e.ID().GetCatchTime(), e.Ctx().Our.CurrentPet.Info.CatchTime)
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
// 2. 技能为空或非物理攻击,不触发
skill := e.Ctx().SkillEntity
if skill == nil {
return true
}
if skill.Category() == info.Category.SPECIAL {
return true
}
// 3. 概率判定Args()[1]为触发概率)
success, _, _ := e.Input.Player.Roll(e.Args()[1], 100)
if !success {
return true
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0]), 1, info.AbilityOpType.ADD)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 12, &NewSel12{})
}

View File

@@ -1,15 +1,55 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/shopspring/decimal"
)
// 36. 按5回合轮换属性顺序出招的技能才能对去血a1-a8: btl_stat/elem_type
// TODO: 实现按5回合轮换属性顺序出招的技能才能对去血a1-a8: btl_stat/elem_type的核心逻辑
type NewSel36 struct {
NewSel0
index int
round int
}
func (e *NewSel36) Damage_DIV_ex(t *info.DamageZone) bool {
e.round++
e.Ctx().Our.AttackValue.State = uint32(e.Args()[e.index])
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
if t.Type != info.DamageType.Red {
return true
}
if e.Args()[e.index] == e.Ctx().SkillEntity.Type {
if e.round >= 5 {
e.round = 0
e.index++
if e.index >= len(e.Args()) {
e.index = 0
}
}
return true
}
t.Damage = decimal.NewFromInt(0)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 36, &NewSel36{})
}

View File

@@ -16,6 +16,10 @@ func (e *NewSel37) Damage_Lock_ex(t *info.DamageZone) bool {
return true
}
if t.Type != info.DamageType.Red {
return true
}
if t.Damage.IntPart() > int64(e.Args()[0]) {
e.Ctx().Opp.CurrentPet.Info.Hp = 0

View File

@@ -13,7 +13,7 @@ type NewSel39 struct {
NewSel0
}
func (e *NewSel39) Damage_Floor(t *info.DamageZone) bool {
func (e *NewSel39) Damage_DIV_ex(t *info.DamageZone) bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true

View File

@@ -13,7 +13,7 @@ type NewSel40 struct {
NewSel0
}
func (e *NewSel40) Damage_Floor(t *info.DamageZone) bool {
func (e *NewSel40) Damage_DIV_ex(t *info.DamageZone) bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true

View File

@@ -8,8 +8,27 @@ import (
// TODO: 实现重生 (hp和btl_maxhp 恢复到 maxhp + maxhp_adj, 技能PP值回满)a1: 可重生次数)的核心逻辑
type NewSel44 struct {
NewSel0
count int
}
func (e *NewSel44) Action_end_ex() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp == 0 {
if e.count >= e.Args()[0] {
return true
}
e.count++
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
e.Ctx().Our.HealPP(-1)
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 44, &NewSel44{})
}

View File

@@ -2,6 +2,8 @@ package effect
import (
"blazing/logic/service/fight/input"
"github.com/samber/lo"
)
// 50. 免疫某类特效a1-an: 被免疫的特效ID
@@ -10,6 +12,26 @@ type NewSel50 struct {
NewSel0
}
func (e *NewSel50) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if in != e.Ctx().Opp {
return true
}
_, ok := lo.Find(e.Args(), func(item int) bool {
return effEffect.ID().Suffix() == uint16(item)
})
if ok {
return false
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 50, &NewSel50{})
}

View File

@@ -19,8 +19,14 @@ func (e *NewSel7) Skill_Hit_ex() bool {
if skill == nil {
return true
}
if skill.AttackTime == 2 {
return true
}
success, _, _ := e.Input.Player.Roll(e.Args()[0], 100)
if success {
skill.AttackTime = 0
}
skill.AttackTime -= uint32(e.Args()[0])
return true
}
func init() {

View File

@@ -0,0 +1,26 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
// T84. 属性技能无效
type NewSel84 struct {
NewSel0
}
func (e *NewSel84) Skill_Hit_ex() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().Opp.EffectCache = make([]input.Effect, 0)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 84, &NewSel84{})
}

View File

@@ -5,7 +5,6 @@ import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"fmt"
"github.com/shopspring/decimal"
)
@@ -32,11 +31,11 @@ func (e *Effect7) Action_start(a, b *action.SelectSkillAction) bool {
return true
}
func (e *Effect7) Damage_Floor(t *info.DamageZone) bool {
func (e *Effect7) Damage_Lock(t *info.DamageZone) bool {
if !e.Hit() {
return true
}
fmt.Println("Effect7_old", t.Damage.IntPart())
//fmt.Println("Effect7_old", t.Damage.IntPart())
if t.Type == info.DamageType.Red {
if e.Ctx().Our.CurrentPet.Info.Hp <= e.Ctx().Opp.CurrentPet.Info.Hp {
@@ -45,6 +44,6 @@ func (e *Effect7) Damage_Floor(t *info.DamageZone) bool {
}
}
fmt.Println("Effect7_new", t.Damage.IntPart())
// fmt.Println("Effect7_new", t.Damage.IntPart())
return true
}

View File

@@ -23,7 +23,7 @@ type Effect8 struct {
}
// 伤害落实前触发,限制最大伤害
func (e *Effect8) Damage_Floor(t *info.DamageZone) bool {
func (e *Effect8) Damage_Lock(t *info.DamageZone) bool {
if t.Type == info.DamageType.Red {
t.Damage = decimal.NewFromInt(utils.Min(t.Damage.IntPart(),
int64(e.Ctx().Opp.CurrentPet.Info.Hp)-1))

File diff suppressed because it is too large Load Diff