docs(effects): 移除已完成的技能效果任务文档 移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档, 这些任务已经完成实现,相关文档不再需要维护。 ```
353 lines
10 KiB
Go
353 lines
10 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"
|
|
)
|
|
|
|
func addStatus2245(owner, target *input.Input, statusID int) bool {
|
|
if owner == nil || target == nil || statusID <= 0 {
|
|
return false
|
|
}
|
|
eff := owner.InitEffect(input.EffectType.Status, statusID)
|
|
if eff == nil {
|
|
return false
|
|
}
|
|
target.AddEffect(owner, eff)
|
|
return true
|
|
}
|
|
|
|
func clearTurnEffects2245(target, owner *input.Input) {
|
|
if target == nil || owner == nil {
|
|
return
|
|
}
|
|
target.CancelTurn(owner)
|
|
}
|
|
|
|
// Effect 2245: 场下阵亡精灵联动护盾。
|
|
type Effect2245 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2245) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
koCount := 0
|
|
if e.Ctx().Our.AllPet != nil {
|
|
for _, pet := range e.Ctx().Our.AllPet {
|
|
if pet != nil && pet.Info.Hp <= 0 {
|
|
koCount++
|
|
}
|
|
}
|
|
}
|
|
if koCount > 0 {
|
|
e.Ctx().Our.AddShield(e.Args()[0].Mul(alpacadecimal.NewFromInt(int64(koCount))))
|
|
e.Ctx().Our.AddShield(e.Args()[1])
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2246: 概率附加异常。
|
|
type Effect2246 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2246) Skill_Use() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
|
addStatus2245(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2247: 最后一只存活精灵时先制。
|
|
type Effect2247 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2247) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
|
if current == nil || current.SkillEntity == nil {
|
|
return true
|
|
}
|
|
aliveCount := 0
|
|
for _, pet := range e.Ctx().Our.AllPet {
|
|
if pet != nil && pet.Info.Hp > 0 {
|
|
aliveCount++
|
|
}
|
|
}
|
|
if aliveCount <= 1 {
|
|
current.SkillEntity.XML.Priority += 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2248: 回复技能剩余PP。
|
|
type Effect2248 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2248) Skill_Use() bool {
|
|
if len(e.Args()) == 0 || e.Ctx().Our.CurrentPet == nil {
|
|
return true
|
|
}
|
|
restore := uint32(e.Args()[0].IntPart())
|
|
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
|
|
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP += restore
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2249: 反驳能力下降并回满PP。
|
|
type Effect2249 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2249) Skill_Use() bool {
|
|
if e.Ctx().Our.HasPropADD() {
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, 0, 0)
|
|
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
|
|
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = e.Ctx().Our.CurrentPet.Info.SkillList[i].PP
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2250: 平均能力级别转伤。
|
|
type Effect2250 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2250) Skill_Use() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
ourAvg := e.Ctx().Our.Prop[0] + e.Ctx().Our.Prop[1] + e.Ctx().Our.Prop[2] + e.Ctx().Our.Prop[3] + e.Ctx().Our.Prop[4] + e.Ctx().Our.Prop[5]
|
|
oppAvg := e.Ctx().Opp.Prop[0] + e.Ctx().Opp.Prop[1] + e.Ctx().Opp.Prop[2] + e.Ctx().Opp.Prop[3] + e.Ctx().Opp.Prop[4] + e.Ctx().Opp.Prop[5]
|
|
if ourAvg > oppAvg {
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2251: 全能力同级时激活体上限提升并附加伤害。
|
|
type Effect2251 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2251) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.Prop[0] == e.Ctx().Our.Prop[1] && e.Ctx().Our.Prop[1] == e.Ctx().Our.Prop[2] && e.Ctx().Our.Prop[2] == e.Ctx().Our.Prop[3] && e.Ctx().Our.Prop[3] == e.Ctx().Our.Prop[4] && e.Ctx().Our.Prop[4] == e.Ctx().Our.Prop[5] {
|
|
e.Ctx().Our.AddShield(e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2252: 击败后获得异常免疫层数。
|
|
type Effect2252 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2252) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
|
e.Ctx().Our.AddShield(e.Args()[0])
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2253: 两侧体力差转换伤害。
|
|
type Effect2253 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2253) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
diff := e.Ctx().Our.CurrentPet.GetHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())
|
|
if diff.Cmp(alpacadecimal.Zero) < 0 {
|
|
diff = diff.Mul(alpacadecimal.NewFromInt(-1))
|
|
}
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: diff.Mul(e.Args()[0]).Div(hundred)})
|
|
return true
|
|
}
|
|
|
|
// Effect 2254: 消耗上限换增伤。
|
|
type Effect2254 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2254) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
|
|
return true
|
|
}
|
|
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[2])).Div(hundred)
|
|
return true
|
|
}
|
|
|
|
// Effect 2255: 龙系转换。
|
|
type Effect2255 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2255) Skill_Use() bool {
|
|
if e.Ctx().Opp.CurrentPet != nil {
|
|
e.Ctx().Opp.CurrentPet.PetInfo.Type = 8
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2256: 超频状态持续延长。
|
|
type Effect2256 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2256) Skill_Use() bool { return true }
|
|
|
|
// Effect 2257: 击败后解除异常并提供恢复限制。
|
|
type Effect2257 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2257) Skill_Use() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
|
e.Ctx().Our.CancelTurn(e.Ctx().Our)
|
|
e.Ctx().Our.AddShield(e.Args()[0])
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2258: 超频时先制倍率。
|
|
type Effect2258 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2258) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 2259: 护盾时先制+2。
|
|
type Effect2259 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2259) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
|
if current != nil && current.SkillEntity != nil && e.Ctx().Our.HasShield() {
|
|
current.SkillEntity.XML.Priority += 2
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2260: 免疫除指定状态外的异常。
|
|
type Effect2260 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2260) Skill_Use_ex() bool {
|
|
if len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
clearTurnEffects2245(e.Ctx().Opp, e.Ctx().Our)
|
|
return true
|
|
}
|
|
|
|
// Effect 2261: 追加对手已损失体力的固定伤害。
|
|
type Effect2261 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2261) OnSkill() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
lost := e.Ctx().Opp.CurrentPet.GetMaxHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost.Mul(e.Args()[0]).Div(hundred)})
|
|
return true
|
|
}
|
|
|
|
// Effect 2262: 溟澜之泪计数联动。
|
|
type Effect2262 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2262) Skill_Use() bool {
|
|
return true
|
|
}
|
|
|
|
// Effect 2263: 消耗护盾附加冻结和溟澜之泪。
|
|
type Effect2263 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2263) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
e.Ctx().Our.ConsumeAllShield()
|
|
addStatus2245(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Frozen))
|
|
return true
|
|
}
|
|
|
|
// Effect 2264: 永恒之水相关转化。
|
|
type Effect2264 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2264) Damage_Mul(zone *info.DamageZone) bool {
|
|
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
if e.Ctx().Our.HasPropADD() {
|
|
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2265: 寂杀之魇层数联动。
|
|
type Effect2265 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2265) DamageDivEx(zone *info.DamageZone) bool { return true }
|
|
|
|
// Effect 2266: 附加蔷薇之绒。
|
|
type Effect2266 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2266) Skill_Use() bool {
|
|
if len(e.Args()) == 0 {
|
|
return true
|
|
}
|
|
addStatus2245(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Fear))
|
|
return true
|
|
}
|
|
|
|
// Effect 2267: 寂杀之魇不减少。
|
|
type Effect2267 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2267) Skill_Use() bool { return true }
|
|
|
|
// Effect 2268: 连击与异常联动。
|
|
type Effect2268 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2268) SkillHit() bool {
|
|
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if e.Ctx().Opp.StatEffect_Exist_all() {
|
|
e.Ctx().SkillEntity.AttackTime += uint32(e.Args()[2].IntPart())
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 2269: 技能无效时解除回合类效果并免疫一次攻击。
|
|
type Effect2269 struct{ node.EffectNode }
|
|
|
|
func (e *Effect2269) Skill_Use_ex() bool {
|
|
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
|
|
clearTurnEffects2245(e.Ctx().Opp, e.Ctx().Our)
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 2245, &Effect2245{})
|
|
input.InitEffect(input.EffectType.Skill, 2246, &Effect2246{})
|
|
input.InitEffect(input.EffectType.Skill, 2247, &Effect2247{})
|
|
input.InitEffect(input.EffectType.Skill, 2248, &Effect2248{})
|
|
input.InitEffect(input.EffectType.Skill, 2249, &Effect2249{})
|
|
input.InitEffect(input.EffectType.Skill, 2250, &Effect2250{})
|
|
input.InitEffect(input.EffectType.Skill, 2251, &Effect2251{})
|
|
input.InitEffect(input.EffectType.Skill, 2252, &Effect2252{})
|
|
input.InitEffect(input.EffectType.Skill, 2253, &Effect2253{})
|
|
input.InitEffect(input.EffectType.Skill, 2254, &Effect2254{})
|
|
input.InitEffect(input.EffectType.Skill, 2255, &Effect2255{})
|
|
input.InitEffect(input.EffectType.Skill, 2256, &Effect2256{})
|
|
input.InitEffect(input.EffectType.Skill, 2257, &Effect2257{})
|
|
input.InitEffect(input.EffectType.Skill, 2258, &Effect2258{})
|
|
input.InitEffect(input.EffectType.Skill, 2259, &Effect2259{})
|
|
input.InitEffect(input.EffectType.Skill, 2260, &Effect2260{})
|
|
input.InitEffect(input.EffectType.Skill, 2261, &Effect2261{})
|
|
input.InitEffect(input.EffectType.Skill, 2262, &Effect2262{})
|
|
input.InitEffect(input.EffectType.Skill, 2263, &Effect2263{})
|
|
input.InitEffect(input.EffectType.Skill, 2264, &Effect2264{})
|
|
input.InitEffect(input.EffectType.Skill, 2265, &Effect2265{})
|
|
input.InitEffect(input.EffectType.Skill, 2266, &Effect2266{})
|
|
input.InitEffect(input.EffectType.Skill, 2267, &Effect2267{})
|
|
input.InitEffect(input.EffectType.Skill, 2268, &Effect2268{})
|
|
input.InitEffect(input.EffectType.Skill, 2269, &Effect2269{})
|
|
}
|