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

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

343 lines
11 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"
)
func applyStatusToOpp(owner, target *input.Input, statusID int) {
if owner == nil || target == nil {
return
}
if eff := owner.InitEffect(input.EffectType.Status, statusID); eff != nil {
target.AddEffect(owner, eff)
}
}
// Effect 1820: 造成的攻击伤害若低于{0}则附加给对手{1}点真实伤害
type Effect1820 struct{ node.EffectNode }
func (e *Effect1820) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
return true
}
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[1]})
}
return true
}
// Effect 1821: 未击败对手则恢复自身所有技能{0}点PP值
type Effect1821 struct{ node.EffectNode }
func (e *Effect1821) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
amount := int(e.Args()[0].IntPart())
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP += uint32(amount)
}
return true
}
// Effect 1822: 消耗自身所有技能的PP值并附加自身最大体力{0}%的百分比伤害若消耗的PP值少于{1}点则附加的百分比伤害翻倍且额外令对手下{2}次攻击技能无效
type Effect1822 struct{ node.EffectNode }
func (e *Effect1822) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
consumed := uint32(0)
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
consumed += e.Ctx().Our.CurrentPet.Info.SkillList[i].PP
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = 0
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if consumed < uint32(e.Args()[1].IntPart()) {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1822, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
}
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
type Effect1822Sub struct{ node.EffectNode; remaining int }
func (e *Effect1822Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1822Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1823: 1823 组合控制效果
type Effect1823 struct{ node.EffectNode }
func (e *Effect1823) Skill_Use() bool {
if len(e.Args()) < 6 {
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
return true
}
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[4].IntPart()))
return true
}
// Effect 1824: 未触发则对手每层存在1层决印记自身免疫1次异常状态
type Effect1824 struct{ node.EffectNode }
func (e *Effect1824) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1824, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1824Sub struct{ node.EffectNode; remaining int }
func (e *Effect1824Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1824Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our || !input.IS_Stat(effEffect) || e.remaining <= 0 {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 1825: 使对手直接受到{0}点圣灵系伤害...
type Effect1825 struct{ node.EffectNode }
func (e *Effect1825) Skill_Use() bool { return true }
// Effect 1826: 使对手直接受到{0}点神秘系伤害...
type Effect1826 struct{ node.EffectNode }
func (e *Effect1826) Skill_Use() bool { return true }
// Effect 1827: 击败对手则令对手下次使用的属性技能无效
type Effect1827 struct{ node.EffectNode }
func (e *Effect1827) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1827, 1)
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1827Sub struct{ node.EffectNode; remaining int }
func (e *Effect1827Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1827Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1828: 消除对手所有护盾、护罩效果...
type Effect1828 struct{ node.EffectNode }
func (e *Effect1828) Skill_Use() bool { return true }
// Effect 1829: 对手每存在{0}层决印记则先出手时技能威力提升{0}%
type Effect1829 struct{ node.EffectNode }
func (e *Effect1829) SkillHit() bool { return true }
// Effect 1830: 圣剑重铸期间若击败对手...
type Effect1830 struct{ node.EffectNode }
func (e *Effect1830) Skill_Use() bool { return true }
// Effect 1831: {0}回合内每回合结束后附加{1}点固定伤害
type Effect1831 struct{ node.EffectNode }
func (e *Effect1831) Skill_Use() bool { return true }
// Effect 1832: {0}回合内{1}%闪避对手攻击...
type Effect1832 struct{ node.EffectNode }
func (e *Effect1832) Skill_Use() bool { return true }
// Effect 1833: {0}回合内若对手使用攻击技能...
type Effect1833 struct{ node.EffectNode }
func (e *Effect1833) Skill_Use() bool { return true }
// Effect 1834: 自身已受到的攻击伤害不超过{1}
type Effect1834 struct{ node.EffectNode }
func (e *Effect1834) DamageDivEx(zone *info.DamageZone) bool { return true }
// Effect 1835: 100%令对手全属性{0}
type Effect1835 struct{ node.EffectNode }
func (e *Effect1835) Skill_Use() bool { return true }
// Effect 1836: 每回合使用技能吸取对手最大体力...
type Effect1836 struct{ node.EffectNode }
func (e *Effect1836) Skill_Use() bool { return true }
// Effect 1837: {0}%令对手{1}
type Effect1837 struct{ node.EffectNode }
func (e *Effect1837) Skill_Use() bool { return true }
// Effect 1838: 对手处于异常状态时...
type Effect1838 struct{ node.EffectNode }
func (e *Effect1838) Skill_Use() bool { return true }
// Effect 1839: 每回合使用技能恢复自身最大体力...
type Effect1839 struct{ node.EffectNode }
func (e *Effect1839) Skill_Use() bool { return true }
// Effect 1840: 若打出致命一击则...
type Effect1840 struct{ node.EffectNode }
func (e *Effect1840) Skill_Use() bool { return true }
// Effect 1841: 消耗自身全部体力,令对手随机{0}项技能PP值归零
type Effect1841 struct{ node.EffectNode }
func (e *Effect1841) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1842: 每回合使用技能吸取对手{1}点体力...
type Effect1842 struct{ node.EffectNode }
func (e *Effect1842) Skill_Use() bool { return true }
// Effect 1843: 造成的攻击伤害若高于{0}则{1}%令对手{2}
type Effect1843 struct{ node.EffectNode }
func (e *Effect1843) Skill_Use() bool { return true }
// Effect 1844: 附加对手已损失体力值{0}%的百分比伤害
type Effect1844 struct{ node.EffectNode }
func (e *Effect1844) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
lost := e.Ctx().Opp.CurrentPet.GetMaxHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())
if lost.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := lost.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1820, &Effect1820{})
input.InitEffect(input.EffectType.Skill, 1821, &Effect1821{})
input.InitEffect(input.EffectType.Skill, 1822, &Effect1822{})
input.InitEffect(input.EffectType.Sub, 1822, &Effect1822Sub{})
input.InitEffect(input.EffectType.Skill, 1823, &Effect1823{})
input.InitEffect(input.EffectType.Skill, 1824, &Effect1824{})
input.InitEffect(input.EffectType.Sub, 1824, &Effect1824Sub{})
input.InitEffect(input.EffectType.Skill, 1825, &Effect1825{})
input.InitEffect(input.EffectType.Skill, 1826, &Effect1826{})
input.InitEffect(input.EffectType.Skill, 1827, &Effect1827{})
input.InitEffect(input.EffectType.Sub, 1827, &Effect1827Sub{})
input.InitEffect(input.EffectType.Skill, 1828, &Effect1828{})
input.InitEffect(input.EffectType.Skill, 1829, &Effect1829{})
input.InitEffect(input.EffectType.Skill, 1830, &Effect1830{})
input.InitEffect(input.EffectType.Skill, 1831, &Effect1831{})
input.InitEffect(input.EffectType.Skill, 1832, &Effect1832{})
input.InitEffect(input.EffectType.Skill, 1833, &Effect1833{})
input.InitEffect(input.EffectType.Skill, 1834, &Effect1834{})
input.InitEffect(input.EffectType.Skill, 1835, &Effect1835{})
input.InitEffect(input.EffectType.Skill, 1836, &Effect1836{})
input.InitEffect(input.EffectType.Skill, 1837, &Effect1837{})
input.InitEffect(input.EffectType.Skill, 1838, &Effect1838{})
input.InitEffect(input.EffectType.Skill, 1839, &Effect1839{})
input.InitEffect(input.EffectType.Skill, 1840, &Effect1840{})
input.InitEffect(input.EffectType.Skill, 1841, &Effect1841{})
input.InitEffect(input.EffectType.Skill, 1842, &Effect1842{})
input.InitEffect(input.EffectType.Skill, 1843, &Effect1843{})
input.InitEffect(input.EffectType.Skill, 1844, &Effect1844{})
}