Files
bl/logic/service/fight/effect/2295_2304.go
昔念 e037539123 ```
docs(effects): 移除已完成的技能效果任务文档

移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档,
这些任务已经完成实现,相关文档不再需要维护。
```
2026-03-31 00:38:50 +08:00

199 lines
6.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/common/data/xmlres"
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
"github.com/gogf/gf/v2/util/grand"
)
func addRandomControlStatus2295(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Petrified),
int(info.PetStatus.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt2295(count, len(statuses))] {
addStatusEffect(owner, target, statuses[idx])
}
}
func minInt2295(a, b int) int {
if a < b {
return a
}
return b
}
// Effect 2295: 废除技能恢复对方全体力并清空自身PP按怨气等级秒杀对手
type Effect2295 struct{ node.EffectNode }
func (e *Effect2295) Skill_Use() bool {
if e.Ctx().Opp == nil || e.Ctx().Our == nil {
return true
}
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = 0
}
e.Ctx().Opp.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP())
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetHP()})
}
return true
}
// Effect 2296: 令对方体力上限与自身等同并恢复等量体力,然后降低非体力上限类提升值
type Effect2296 struct{ node.EffectNode }
func (e *Effect2296) Skill_Use() bool {
if e.Ctx().Opp == nil || e.Ctx().Our == nil {
return true
}
targetMax := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Opp.CurrentPet.Info.MaxHp = uint32(targetMax.IntPart())
e.Ctx().Opp.Heal(e.Ctx().Our, &action.SelectSkillAction{}, targetMax)
for i, v := range e.Ctx().Opp.Prop[:] {
if i == 0 || v <= 0 {
continue
}
if v > 1 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -1)
}
}
return true
}
// Effect 2297: 反转自身能力下降状态,反转成功则自身全属性+{0}
type Effect2297 struct{ node.EffectNode }
func (e *Effect2297) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 2298: 自身不处于能力提升状态时先制+2
type Effect2298 struct{ node.EffectNode }
func (e *Effect2298) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.XML.Priority += 2
}
return true
}
// Effect 2299: 消除对手回合类效果消除成功则令对手攻击技能PP归0
type Effect2299 struct{ node.EffectNode }
func (e *Effect2299) Skill_Use() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
for i := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(e.Ctx().Opp.CurrentPet.Info.SkillList[i].ID)]; ok {
if skill.Category == int(info.Category.PHYSICAL) || skill.Category == int(info.Category.SPECIAL) {
e.Ctx().Opp.CurrentPet.Info.SkillList[i].PP = 0
}
}
}
return true
}
// Effect 2300: 攻击伤害受限时{0}%令对手{1}
type Effect2300 struct{ node.EffectNode }
func (e *Effect2300) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if zone.Damage.Cmp(alpacadecimal.NewFromInt(1)) > 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2301: {0}回合内自身免疫受到的攻击
type Effect2301 struct{ node.EffectNode }
func (e *Effect2301) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 2302: 对手每有1个技能PP值小于1先制+1
type Effect2302 struct{ node.EffectNode }
func (e *Effect2302) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().Opp == nil {
return true
}
count := 0
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if s.PP <= 0 {
count++
}
}
e.Ctx().SkillEntity.XML.Priority += count
return true
}
// Effect 2303: 自身满体力时吸取并压制对手
type Effect2303 struct{ node.EffectNode }
func (e *Effect2303) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
addRandomControlStatus2295(e.Ctx().Our, e.Ctx().Opp, 1)
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
for i := range e.Ctx().Opp.CurrentPet.Info.SkillList {
e.Ctx().Opp.CurrentPet.Info.SkillList[i].PP = uint32(e.Args()[3].IntPart())
}
return true
}
// Effect 2304: 技能无效时消除对手回合类效果并叠加危机感与登场压制
type Effect2304 struct{ node.EffectNode }
func (e *Effect2304) Skill_Use_ex() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
addRandomControlStatus2295(e.Ctx().Our, e.Ctx().Opp, 1)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2295, &Effect2295{})
input.InitEffect(input.EffectType.Skill, 2296, &Effect2296{})
input.InitEffect(input.EffectType.Skill, 2297, &Effect2297{})
input.InitEffect(input.EffectType.Skill, 2298, &Effect2298{})
input.InitEffect(input.EffectType.Skill, 2299, &Effect2299{})
input.InitEffect(input.EffectType.Skill, 2300, &Effect2300{})
input.InitEffect(input.EffectType.Skill, 2301, &Effect2301{})
input.InitEffect(input.EffectType.Skill, 2302, &Effect2302{})
input.InitEffect(input.EffectType.Skill, 2303, &Effect2303{})
input.InitEffect(input.EffectType.Skill, 2304, &Effect2304{})
}