docs(effects): 移除已完成的技能效果任务文档 移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档, 这些任务已经完成实现,相关文档不再需要维护。 ```
198 lines
6.3 KiB
Go
198 lines
6.3 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 2305: 本场战斗若己方存在希望之花则消耗全部体力并进入危机,若被摧毁则获得魔王咒怨
|
|
type Effect2305 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2305) OnSkill() bool {
|
|
if e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.Damage(e.Ctx().Opp, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Our.CurrentPet.GetHP()})
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, 0, 1)
|
|
return true
|
|
}
|
|
|
|
// Effect 2306: 技能无效时对手对应技能伤害达到阈值则附加效果
|
|
type Effect2306 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2306) Skill_Use_ex() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.XML.Power >= int(e.Args()[2].IntPart()) {
|
|
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2307: 低伤害时附加固定伤害,弱招时固定伤害按克制倍率缩放
|
|
type Effect2307 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2307) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
if zone.Damage.Cmp(e.Args()[0]) < 0 {
|
|
zone.Damage = zone.Damage.Add(e.Args()[1])
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2308: 致命一击时令对手随机若干个技能PP归0
|
|
type Effect2308 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2308) SkillHit() bool {
|
|
if len(e.Args()) < 1 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Crit == 0 {
|
|
return true
|
|
}
|
|
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
|
return true
|
|
}
|
|
|
|
// Effect 2309: 恢复最大体力并造成等量百分比伤害,若对手免疫则追加效果
|
|
type Effect2309 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2309) OnSkill() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
|
return true
|
|
}
|
|
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
|
|
if e.Ctx().Opp.StatEffect_Exist_all() {
|
|
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2310: 对手处于异常时自身造成技能伤害提升
|
|
type Effect2310 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2310) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.StatEffect_Exist_all() {
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[1].IntPart()))).Div(alpacadecimal.NewFromInt(100))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2311: 消除对手护盾并降低全体PP
|
|
type Effect2311 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2311) OnSkill() bool {
|
|
if len(e.Args()) < 1 {
|
|
return true
|
|
}
|
|
e.Ctx().Opp.ConsumeAllShield()
|
|
cost := uint32(e.Args()[0].IntPart())
|
|
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
|
|
if e.Ctx().Our.CurrentPet.Info.SkillList[i].PP > 0 {
|
|
if cost >= e.Ctx().Our.CurrentPet.Info.SkillList[i].PP {
|
|
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = 0
|
|
} else {
|
|
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP -= cost
|
|
}
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2312: 回复生命并按条件附加后续效果
|
|
type Effect2312 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2312) OnSkill() bool {
|
|
if len(e.Args()) < 4 || e.Ctx().Our.CurrentPet == nil {
|
|
return true
|
|
}
|
|
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
|
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2312, e.SideEffectArgs...)
|
|
if eff != nil {
|
|
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Effect2312Sub struct {
|
|
node.EffectNode
|
|
triggered bool
|
|
}
|
|
|
|
func (e *Effect2312Sub) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 {
|
|
return true
|
|
}
|
|
e.triggered = true
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[2].IntPart()))).Div(alpacadecimal.NewFromInt(100))
|
|
return true
|
|
}
|
|
|
|
func (e *Effect2312Sub) TurnEnd() {
|
|
if e.triggered {
|
|
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
|
|
}
|
|
}
|
|
|
|
// Effect 2313: 无视攻击免疫效果,对手无免疫时吸取最大体力
|
|
type Effect2313 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2313) SkillHit_ex() bool {
|
|
if len(e.Args()) < 1 || e.Ctx().Opp.StatEffect_Exist_all() || e.Ctx().Opp.CurrentPet == nil {
|
|
return true
|
|
}
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
|
|
return true
|
|
}
|
|
|
|
// Effect 2314: 触发登场效果先制+1且忽略对手25%防御值
|
|
type Effect2314 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2314) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
|
if current != nil && current.SkillEntity != nil {
|
|
current.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (e *Effect2314) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.HasPropSub() {
|
|
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(75)).Div(alpacadecimal.NewFromInt(100))
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 2305, &Effect2305{})
|
|
input.InitEffect(input.EffectType.Skill, 2306, &Effect2306{})
|
|
input.InitEffect(input.EffectType.Skill, 2307, &Effect2307{})
|
|
input.InitEffect(input.EffectType.Skill, 2308, &Effect2308{})
|
|
input.InitEffect(input.EffectType.Skill, 2309, &Effect2309{})
|
|
input.InitEffect(input.EffectType.Skill, 2310, &Effect2310{})
|
|
input.InitEffect(input.EffectType.Skill, 2311, &Effect2311{})
|
|
input.InitEffect(input.EffectType.Skill, 2312, &Effect2312{})
|
|
input.InitEffect(input.EffectType.Sub, 2312, &Effect2312Sub{})
|
|
input.InitEffect(input.EffectType.Skill, 2313, &Effect2313{})
|
|
input.InitEffect(input.EffectType.Skill, 2314, &Effect2314{})
|
|
}
|