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

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

339 lines
10 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/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 addRandomStatus(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
statuses := []int{
int(info.PetStatus.Burned),
int(info.PetStatus.Frozen),
int(info.PetStatus.Poisoned),
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt(count, len(statuses))] {
addStatusEffect(owner, target, statuses[idx])
}
}
// Effect 2145: 对手每损失一定体力则额外附加固定伤害
type Effect2145 struct{ node.EffectNode }
func (e *Effect2145) OnSkill() bool { return true }
// Effect 2146: 若本次攻击未打出致命一击则自身获得先制
type Effect2146 struct{ node.EffectNode }
func (e *Effect2146) SkillHit() bool {
if e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2147: 消耗自身全部体力并恢复自身体力与护盾
type Effect2147 struct{ node.EffectNode }
func (e *Effect2147) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 2148: 先出手时提升自身伤害并附加异常状态免疫
type Effect2148 struct{ node.EffectNode }
func (e *Effect2148) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.AttackTime == 1 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2149: 附加随机异常状态
type Effect2149 struct{ node.EffectNode }
func (e *Effect2149) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2150: 消除双方回合类效果
type Effect2150 struct{ node.EffectNode }
func (e *Effect2150) OnSkill() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
clearTargetEffects(e.Ctx().Opp, e.Ctx().Our)
return true
}
// Effect 2151: 自身不在异常状态且不在能力提升状态时附加控制类异常
type Effect2151 struct{ node.EffectNode }
func (e *Effect2151) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Our.StatEffect_Exist_all() || e.Ctx().Our.HasPropADD() {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2152: 若自身处于能力提升状态则复制给对手,否则清除自身能力提升状态
type Effect2152 struct{ node.EffectNode }
func (e *Effect2152) OnSkill() bool {
if e.Ctx().Our.HasPropADD() {
for i, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v)
}
}
return true
}
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
return true
}
// Effect 2153: 自身技能PP消耗降低
type Effect2153 struct{ node.EffectNode }
func (e *Effect2153) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count -= int(e.Args()[0].IntPart())
if *count < 0 {
*count = 0
}
}
return true
}
// Effect 2154: 对手技能PP消耗增加
type Effect2154 struct{ node.EffectNode }
func (e *Effect2154) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count += int(e.Args()[0].IntPart())
}
return true
}
// Effect 2155: {0}回合内每回合恢复自身体力,若自身不处于能力提升状态则额外附加百分比伤害
type Effect2155 struct{ node.EffectNode }
func (e *Effect2155) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if !e.Ctx().Our.HasPropADD() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2])})
}
return true
}
// Effect 2156: 全属性+{0}
type Effect2156 struct{ node.EffectNode }
func (e *Effect2156) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 2157: 技能威力提升若对手任意技能PP低于阈值则效果翻倍
type Effect2157 struct{ node.EffectNode }
func (e *Effect2157) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil {
return true
}
boost := e.Args()[0]
if e.Ctx().Opp.CurrentPet != nil {
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if int(s.PP) < int(e.Args()[1].IntPart()) {
boost = boost.Mul(alpacadecimal.NewFromInt(2))
break
}
}
}
addSkillPowerPercent(e.Ctx().SkillEntity, boost)
return true
}
// Effect 2158: 若本次攻击造成伤害则额外附加异常状态
type Effect2158 struct{ node.EffectNode }
func (e *Effect2158) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2159: 自身满体力时技能威力提升
type Effect2159 struct{ node.EffectNode }
func (e *Effect2159) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2160: 自身不处于能力提升状态时先制+1且必定命中
type Effect2160 struct{ node.EffectNode }
func (e *Effect2160) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2161: 技能无效时消除对手回合类效果并使对手沉睡
type Effect2161 struct{ node.EffectNode }
func (e *Effect2161) Skill_Use_ex() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Sleep))
return true
}
// Effect 2162: {0}%令对手进入异常状态未触发则降低自身所有技能PP值
type Effect2162 struct{ node.EffectNode }
func (e *Effect2162) OnSkill() bool {
if len(e.Args()) < 3 {
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
}
e.Ctx().Our.DelPP(int(e.Args()[2].IntPart()))
return true
}
// Effect 2163: 对手处于异常状态时造成伤害提升
type Effect2163 struct{ node.EffectNode }
func (e *Effect2163) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 2164: 若自身处于异常状态则技能威力提升
type Effect2164 struct{ node.EffectNode }
func (e *Effect2164) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Our.StatEffect_Exist_all() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 2165: 为自身附加{0}种异常状态
type Effect2165 struct{ node.EffectNode }
func (e *Effect2165) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Our, int(e.Args()[0].IntPart()))
return true
}
// Effect 2166: 为自身随机附加{0}/{1}/{2}/{3}中的{4}种异常状态
type Effect2166 struct{ node.EffectNode }
func (e *Effect2166) OnSkill() bool {
if len(e.Args()) < 5 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Our, int(e.Args()[4].IntPart()))
return true
}
// Effect 2167: 先出手时吸取对手最大体力的1/{0}且当回合对手无法造成攻击伤害
type Effect2167 struct{ node.EffectNode }
func (e *Effect2167) DamageLockEx(zone *info.DamageZone) bool { return true }
// Effect 2168: 若对手当回合切换精灵则{0}%令对手{1},未触发则{2}%令对手{3}
type Effect2168 struct{ node.EffectNode }
func (e *Effect2168) OnSkill() bool { return true }
// Effect 2169: 消除对手能力提升状态,消除成功则为自身附加{0}点护盾
type Effect2169 struct{ node.EffectNode }
func (e *Effect2169) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2145, &Effect2145{})
input.InitEffect(input.EffectType.Skill, 2146, &Effect2146{})
input.InitEffect(input.EffectType.Skill, 2147, &Effect2147{})
input.InitEffect(input.EffectType.Skill, 2148, &Effect2148{})
input.InitEffect(input.EffectType.Skill, 2149, &Effect2149{})
input.InitEffect(input.EffectType.Skill, 2150, &Effect2150{})
input.InitEffect(input.EffectType.Skill, 2151, &Effect2151{})
input.InitEffect(input.EffectType.Skill, 2152, &Effect2152{})
input.InitEffect(input.EffectType.Skill, 2153, &Effect2153{})
input.InitEffect(input.EffectType.Skill, 2154, &Effect2154{})
input.InitEffect(input.EffectType.Skill, 2155, &Effect2155{})
input.InitEffect(input.EffectType.Skill, 2156, &Effect2156{})
input.InitEffect(input.EffectType.Skill, 2157, &Effect2157{})
input.InitEffect(input.EffectType.Skill, 2158, &Effect2158{})
input.InitEffect(input.EffectType.Skill, 2159, &Effect2159{})
input.InitEffect(input.EffectType.Skill, 2160, &Effect2160{})
input.InitEffect(input.EffectType.Skill, 2161, &Effect2161{})
input.InitEffect(input.EffectType.Skill, 2162, &Effect2162{})
input.InitEffect(input.EffectType.Skill, 2163, &Effect2163{})
input.InitEffect(input.EffectType.Skill, 2164, &Effect2164{})
input.InitEffect(input.EffectType.Skill, 2165, &Effect2165{})
input.InitEffect(input.EffectType.Skill, 2166, &Effect2166{})
input.InitEffect(input.EffectType.Skill, 2167, &Effect2167{})
input.InitEffect(input.EffectType.Skill, 2168, &Effect2168{})
input.InitEffect(input.EffectType.Skill, 2169, &Effect2169{})
}