```feat(fight): 新增战斗效果60/699/700并优化宠物物品使用逻辑

This commit is contained in:
1
2025-12-30 15:04:21 +00:00
parent f91b88e90f
commit f770ccc06f
5 changed files with 96 additions and 10 deletions

View File

@@ -1,7 +1,10 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 60. 受到攻击时n%几率使受到的伤害降低m点a1: n, a2: m
@@ -10,6 +13,25 @@ type NewSel60 struct {
NewSel0
}
func (e *NewSel60) Damage_SUB_ex(t *info.DamageZone) bool {
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
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
t.Damage = t.Damage.Sub(alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart())))
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 60, &NewSel60{})
}

View File

@@ -0,0 +1,39 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 60. "20%弹60点固定伤害" StarLevel="0
type NewSel699 struct {
NewSel0
}
func (e *NewSel699) Skill_Use_ex() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.Min(e.Ctx().Opp.SumDamage, e.Args()[1]),
})
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 699, &NewSel699{})
}

View File

@@ -0,0 +1,29 @@
package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
)
// 60.回复造成伤害的6%
type NewSel700 struct {
NewSel0
}
func (e *NewSel700) Skill_Useed() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
e.Input.Heal(
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(e.Args()[1]),
)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 700, &NewSel700{})
}