docs(effects): 移除已完成的技能效果任务文档 移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档, 这些任务已经完成实现,相关文档不再需要维护。 ```
401 lines
9.8 KiB
Go
401 lines
9.8 KiB
Go
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"
|
|
)
|
|
|
|
// Effect 1895: 吸取对手体力,若未受到固定伤害则附加后续效果
|
|
type Effect1895 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1895) OnSkill() bool {
|
|
if len(e.Args()) < 3 {
|
|
return true
|
|
}
|
|
damage := e.Args()[0]
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: damage,
|
|
})
|
|
return true
|
|
}
|
|
|
|
// Effect 1896: 清空对手技能PP
|
|
type Effect1896 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1896) Skill_Use() bool {
|
|
for i := range e.Ctx().Opp.CurrentPet.Info.SkillList {
|
|
e.Ctx().Opp.CurrentPet.Info.SkillList[i].PP = 0
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1897: 消除对手能力提升状态
|
|
type Effect1897 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1897) Skill_Use() bool {
|
|
for i, v := range e.Ctx().Opp.Prop[:] {
|
|
if v > 0 {
|
|
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1898: 对手无强化时提升自身伤害
|
|
type Effect1898 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1898) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.HasPropADD() {
|
|
return true
|
|
}
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(100 + e.Args()[0].IntPart()))).Div(hundred)
|
|
return true
|
|
}
|
|
|
|
func (e *Effect1898) PropBefer(in *input.Input, prop, level int8) bool {
|
|
if in == e.Ctx().Opp && level > 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1899: 优先行动
|
|
type Effect1899 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1899) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1900: 消除对手回合类效果
|
|
type Effect1900 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1900) Skill_Use() bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 1901: 自身永昌币数提升强化效果
|
|
type Effect1901 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1901) Skill_Use() bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 1902: 获得永昌币
|
|
type Effect1902 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1902) Skill_Use() bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 1903: 每有永昌币吸取对手体力
|
|
type Effect1903 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1903) OnSkill() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: e.Args()[1],
|
|
})
|
|
return true
|
|
}
|
|
|
|
// Effect 1904: 对手处于能力提升时先制
|
|
type Effect1904 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1904) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if !e.Ctx().Opp.HasPropADD() {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 3
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1905: 自身永昌币数量达到阈值时忽略双防
|
|
type Effect1905 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1905) 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
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1906: 每场仅一次的大型恢复与清场
|
|
type Effect1906 struct {
|
|
node.EffectNode
|
|
used bool
|
|
}
|
|
|
|
func (e *Effect1906) Skill_Use() bool {
|
|
if e.used {
|
|
return true
|
|
}
|
|
e.used = true
|
|
return true
|
|
}
|
|
|
|
// Effect 1907: 令对手进入指定状态
|
|
type Effect1907 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1907) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1908: 概率按最大体力造成百分比伤害
|
|
type Effect1908 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1908) OnSkill() bool {
|
|
if len(e.Args()) < 4 {
|
|
return true
|
|
}
|
|
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Percent,
|
|
Damage: damage,
|
|
})
|
|
return true
|
|
}
|
|
|
|
// Effect 1909: 体力越低越容易重复触发
|
|
type Effect1909 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1909) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.CurrentPet.GetHP().Mul(alpacadecimal.NewFromInt(100)).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0])) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1910: 自身有护盾时强化
|
|
type Effect1910 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1910) 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().Our.HasShield() {
|
|
return true
|
|
}
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
|
return true
|
|
}
|
|
|
|
// Effect 1911: 自身换人后下只出战精灵获得护盾
|
|
type Effect1911 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1911) SwitchOut(in *input.Input) bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 1912: 自身体力低于150时先制
|
|
type Effect1912 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1912) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(150)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1913: 自身体力低于120时先制
|
|
type Effect1913 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1913) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(120)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1914: 自身体力低于90时先制
|
|
type Effect1914 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1914) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(90)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1915: 自身体力低于60时先制
|
|
type Effect1915 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1915) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(60)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1916: 自身体力低于30时先制
|
|
type Effect1916 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1916) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(30)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1917: 对手体力低于150时先制
|
|
type Effect1917 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1917) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(150)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1918: 对手体力低于120时先制
|
|
type Effect1918 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1918) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(120)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 1919: 对手体力低于90时先制
|
|
type Effect1919 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect1919) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(90)) >= 0 {
|
|
return true
|
|
}
|
|
if fattack != nil && fattack.SkillEntity != nil {
|
|
fattack.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 1895, &Effect1895{})
|
|
input.InitEffect(input.EffectType.Skill, 1896, &Effect1896{})
|
|
input.InitEffect(input.EffectType.Skill, 1897, &Effect1897{})
|
|
input.InitEffect(input.EffectType.Skill, 1898, &Effect1898{})
|
|
input.InitEffect(input.EffectType.Skill, 1899, &Effect1899{})
|
|
input.InitEffect(input.EffectType.Skill, 1900, &Effect1900{})
|
|
input.InitEffect(input.EffectType.Skill, 1901, &Effect1901{})
|
|
input.InitEffect(input.EffectType.Skill, 1902, &Effect1902{})
|
|
input.InitEffect(input.EffectType.Skill, 1903, &Effect1903{})
|
|
input.InitEffect(input.EffectType.Skill, 1904, &Effect1904{})
|
|
input.InitEffect(input.EffectType.Skill, 1905, &Effect1905{})
|
|
input.InitEffect(input.EffectType.Skill, 1906, &Effect1906{})
|
|
input.InitEffect(input.EffectType.Skill, 1907, &Effect1907{})
|
|
input.InitEffect(input.EffectType.Skill, 1908, &Effect1908{})
|
|
input.InitEffect(input.EffectType.Skill, 1909, &Effect1909{})
|
|
input.InitEffect(input.EffectType.Skill, 1910, &Effect1910{})
|
|
input.InitEffect(input.EffectType.Skill, 1911, &Effect1911{})
|
|
input.InitEffect(input.EffectType.Skill, 1912, &Effect1912{})
|
|
input.InitEffect(input.EffectType.Skill, 1913, &Effect1913{})
|
|
input.InitEffect(input.EffectType.Skill, 1914, &Effect1914{})
|
|
input.InitEffect(input.EffectType.Skill, 1915, &Effect1915{})
|
|
input.InitEffect(input.EffectType.Skill, 1916, &Effect1916{})
|
|
input.InitEffect(input.EffectType.Skill, 1917, &Effect1917{})
|
|
input.InitEffect(input.EffectType.Skill, 1918, &Effect1918{})
|
|
input.InitEffect(input.EffectType.Skill, 1919, &Effect1919{})
|
|
}
|
|
|