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

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

412 lines
13 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 hasCurseStack(in *input.Input) int {
if in == nil {
return 0
}
eff := in.GetEffect(input.EffectType.Status, int(petStatusCurse))
if eff == nil || !eff.Alive() {
return 0
}
return eff.Stack()
}
func addStatusByID1795(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil || statusID <= 0 {
return false
}
statusEffect := owner.InitEffect(input.EffectType.Status, statusID)
if statusEffect == nil {
return false
}
target.AddEffect(owner, statusEffect)
return true
}
// Effect 1795: 1回合做{0}次攻击自身每存在1层诅咒则攻击次数+{1}
type Effect1795 struct{ node.EffectNode }
func (e *Effect1795) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || len(e.Args()) < 2 {
return true
}
times := int(e.Args()[0].IntPart())
if times < 1 {
times = 1
}
if stacks := hasCurseStack(e.Ctx().Our); stacks > 0 {
times += stacks * int(e.Args()[1].IntPart())
}
e.Ctx().SkillEntity.AttackTime += uint32(times - 1)
return true
}
// Effect 1796: 附加对手最大体力百分比伤害,诅咒层数达到{1}层则转变为等量真实伤害
type Effect1796 struct{ node.EffectNode }
func (e *Effect1796) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) < 2 {
return true
}
percent := e.Args()[0]
if stacks := hasCurseStack(e.Ctx().Our); stacks >= int(e.Args()[1].IntPart()) {
zone.Type = info.DamageType.True
zone.Damage = e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(hundred)
return true
}
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(hundred))
return true
}
// Effect 1797: 当回合命中失败对手则令自身诅咒的重置层数+{0}
type Effect1797 struct{ node.EffectNode }
func (e *Effect1797) Skill_Use_ex() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
if eff := e.Ctx().Our.GetEffect(input.EffectType.Status, int(petStatusCurse)); eff != nil && eff.Alive() {
eff.Stack(eff.Stack() + int(e.Args()[0].IntPart()))
}
}
return true
}
// Effect 1798: 下回合对手未使用攻击技能则造成伤害
type Effect1798 struct{ node.EffectNode }
func (e *Effect1798) TurnEnd() {
if len(e.Args()) < 3 {
e.EffectNode.TurnEnd()
return
}
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
e.EffectNode.TurnEnd()
}
// Effect 1799: 后出手时附带效果
type Effect1799 struct{ node.EffectNode }
func (e *Effect1799) Skill_Use_ex() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.AttackTime != 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
} else {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1800: 场地与残存精灵相关的护盾与吸血效果
type Effect1800 struct{ node.EffectNode }
func (e *Effect1800) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp > 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[0])).Div(hundred)
return true
}
func (e *Effect1800) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
if e.Ctx().Our.AllPet != nil {
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && pet.Info.Hp <= 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
}
}
e.Ctx().Our.AddShield(e.Args()[1])
return true
}
// Effect 1801: 若上回合未受伤害则附加固定比例伤害
type Effect1801 struct{ node.EffectNode }
func (e *Effect1801) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.Zero) == 0 {
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
}
return true
}
// Effect 1802: 上回合受伤上限封顶
type Effect1802 struct{ node.EffectNode }
func (e *Effect1802) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) > 0 {
zone.Damage = e.Args()[0]
}
return true
}
// Effect 1803: 技能无效时恢复体力并清除自身有害状态
type Effect1803 struct{ node.EffectNode }
func (e *Effect1803) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3)))
e.Ctx().Our.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1804: 本回合选择攻击技能时视为能力下降
type Effect1804 struct{ node.EffectNode }
func (e *Effect1804) SkillHit() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().SkillEntity.XML.Priority -= int(e.Args()[0].IntPart())
}
return true
}
// Effect 1805: 命中对手异常状态时伤害翻倍
type Effect1805 struct{ node.EffectNode }
func (e *Effect1805) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Opp.StatEffect_Exist_all() {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1806: 针对雄性精灵的控制与回满
type Effect1806 struct{ node.EffectNode }
func (e *Effect1806) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet == nil || e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().Opp.CurrentPet.Info.Gender == 1 {
addStatusByID1795(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Fear))
} else {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
}
return true
}
// Effect 1807: 自身能力下降时先制
type Effect1807 struct{ node.EffectNode }
func (e *Effect1807) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && current.SkillEntity.Category() != info.Category.STATUS && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1808: 对手回合类效果时增伤并清除
type Effect1808 struct{ node.EffectNode }
func (e *Effect1808) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.AttackTime == 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
func (e *Effect1808) Skill_Use_ex() bool {
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1809: 获得护盾,护盾消失时附加效果
type Effect1809 struct{ node.EffectNode }
func (e *Effect1809) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 1810: 若自身遇到天敌则先制+3
type Effect1810 struct{ node.EffectNode }
func (e *Effect1810) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.ISNaturalEnemy() {
current.SkillEntity.XML.Priority += 3
}
return true
}
// Effect 1811: 回合击败对手则回合内回合类效果无法被消除
type Effect1811 struct{ node.EffectNode }
func (e *Effect1811) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(0))
return true
}
// Effect 1812: 消耗自身全部体力,首发必定先手命中
type Effect1812 struct{ node.EffectNode }
func (e *Effect1812) SkillHit() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime != 0 {
e.Ctx().SkillEntity.XML.Priority = 9999
}
return true
}
// Effect 1813: 护盾/场地联动
type Effect1813 struct{ node.EffectNode }
func (e *Effect1813) Skill_Use() bool {
if len(e.Args()) < 6 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
e.Ctx().Our.AddShield(e.Args()[1])
if e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.Info.Hp > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
return true
}
// Effect 1814: 每回合首个技能吸取对手体力
type Effect1814 struct{ node.EffectNode }
func (e *Effect1814) Skill_Use() bool {
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[3])})
return true
}
// Effect 1815: 激发防御能力
type Effect1815 struct{ node.EffectNode }
func (e *Effect1815) Skill_Use_ex() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]))
}
return true
}
// Effect 1816: 高体力时暴击倍率提升
type Effect1816 struct{ node.EffectNode }
func (e *Effect1816) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
percent := e.Args()[0]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) > 0 {
percent = e.Args()[1]
}
zone.Damage = zone.Damage.Mul(hundred.Add(percent)).Div(hundred)
return true
}
// Effect 1817: 消除对手回合类效果
type Effect1817 struct{ node.EffectNode }
func (e *Effect1817) Skill_Use() bool {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
return true
}
// Effect 1818: 免疫并反弹固定/百分比伤害
type Effect1818 struct{ node.EffectNode }
func (e *Effect1818) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil {
return true
}
if zone.Type == info.DamageType.Fixed || zone.Type == info.DamageType.Percent {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 1819: 异常状态命中率提升
type Effect1819 struct{ node.EffectNode }
func (e *Effect1819) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID1795(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
} else {
addStatusByID1795(e.Ctx().Our, e.Ctx().Our, int(e.Args()[2].IntPart()))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1795, &Effect1795{})
input.InitEffect(input.EffectType.Skill, 1796, &Effect1796{})
input.InitEffect(input.EffectType.Skill, 1797, &Effect1797{})
input.InitEffect(input.EffectType.Skill, 1798, &Effect1798{})
input.InitEffect(input.EffectType.Skill, 1799, &Effect1799{})
input.InitEffect(input.EffectType.Skill, 1800, &Effect1800{})
input.InitEffect(input.EffectType.Skill, 1801, &Effect1801{})
input.InitEffect(input.EffectType.Skill, 1802, &Effect1802{})
input.InitEffect(input.EffectType.Skill, 1803, &Effect1803{})
input.InitEffect(input.EffectType.Skill, 1804, &Effect1804{})
input.InitEffect(input.EffectType.Skill, 1805, &Effect1805{})
input.InitEffect(input.EffectType.Skill, 1806, &Effect1806{})
input.InitEffect(input.EffectType.Skill, 1807, &Effect1807{})
input.InitEffect(input.EffectType.Skill, 1808, &Effect1808{})
input.InitEffect(input.EffectType.Skill, 1809, &Effect1809{})
input.InitEffect(input.EffectType.Skill, 1810, &Effect1810{})
input.InitEffect(input.EffectType.Skill, 1811, &Effect1811{})
input.InitEffect(input.EffectType.Skill, 1812, &Effect1812{})
input.InitEffect(input.EffectType.Skill, 1813, &Effect1813{})
input.InitEffect(input.EffectType.Skill, 1814, &Effect1814{})
input.InitEffect(input.EffectType.Skill, 1815, &Effect1815{})
input.InitEffect(input.EffectType.Skill, 1816, &Effect1816{})
input.InitEffect(input.EffectType.Skill, 1817, &Effect1817{})
input.InitEffect(input.EffectType.Skill, 1818, &Effect1818{})
input.InitEffect(input.EffectType.Skill, 1819, &Effect1819{})
}