834 lines
22 KiB
Go
834 lines
22 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"
|
||
"github.com/gogf/gf/v2/util/grand"
|
||
)
|
||
|
||
var effect1267Statuses = []int{
|
||
int(info.PetStatus.Burned),
|
||
int(info.PetStatus.Frozen),
|
||
int(info.PetStatus.Poisoned),
|
||
}
|
||
|
||
func applyOneOfStatuses(owner, target *input.Input, count int) {
|
||
if owner == nil || target == nil || count <= 0 {
|
||
return
|
||
}
|
||
if count > len(effect1267Statuses) {
|
||
count = len(effect1267Statuses)
|
||
}
|
||
for _, idx := range grand.Perm(len(effect1267Statuses))[:count] {
|
||
if eff := owner.InitEffect(input.EffectType.Status, effect1267Statuses[idx]); eff != nil {
|
||
target.AddEffect(owner, eff)
|
||
}
|
||
}
|
||
}
|
||
|
||
func applyStatusByID(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)
|
||
}
|
||
}
|
||
|
||
func clearPositivePropsTo(target, owner *input.Input) bool {
|
||
if target == nil || owner == nil {
|
||
return false
|
||
}
|
||
cleared := false
|
||
for i, v := range target.Prop[:] {
|
||
if v > 0 && target.SetProp(owner, int8(i), 0) {
|
||
cleared = true
|
||
}
|
||
}
|
||
return cleared
|
||
}
|
||
|
||
// Effect 1263: 吸取对手最大体力的1/{0},自身体力低于对手时变为1/{1}
|
||
type Effect1263 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1263) Skill_Use() bool {
|
||
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
divisor := e.Args()[0]
|
||
if e.CarrierPet().GetHP().Cmp(e.OpponentPet().GetHP()) < 0 {
|
||
divisor = e.Args()[1]
|
||
}
|
||
|
||
damage := e.OpponentPet().GetMaxHP().Div(divisor)
|
||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, damage)
|
||
return true
|
||
}
|
||
|
||
// Effect 1264: 待补
|
||
type Effect1264 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1264) Skill_Use() bool {
|
||
return true
|
||
}
|
||
|
||
// Effect 1265: 下{0}次受到的攻击伤害减少{1}%
|
||
type Effect1265 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1265) Skill_Use() bool {
|
||
if len(e.Args()) < 2 {
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1265, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1265Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
percent int
|
||
}
|
||
|
||
func (e *Effect1265Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
if len(a) > 1 {
|
||
e.percent = a[1]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1265Sub) DamageDivEx(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||
return true
|
||
}
|
||
|
||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(100 - e.percent))).Div(alpacadecimal.NewFromInt(100))
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1266: {0}回合内若对手使用属性技能,则使用属性技能后己方在场精灵令对手下{1}次使用的攻击技能无效
|
||
type Effect1266 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect1266) Skill_Use_ex() bool {
|
||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1266, int(e.Args()[1].IntPart()))
|
||
if effect != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1266Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1266Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1266Sub) 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 1267: {0}回合内对手使用攻击技能则对手随机进入烧伤、中毒、冻伤中的{1}种异常状态,未触发则消除对手回合类效果
|
||
type Effect1267 struct {
|
||
RoundEffectArg0Base
|
||
triggered bool
|
||
}
|
||
|
||
func (e *Effect1267) Skill_Use_ex() bool {
|
||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
e.triggered = true
|
||
applyOneOfStatuses(e.CarrierInput(), e.TargetInput(), int(e.Args()[1].IntPart()))
|
||
return true
|
||
}
|
||
|
||
func (e *Effect1267) TurnEnd() {
|
||
if !e.triggered && e.Duration() == 1 {
|
||
e.OpponentInput().CancelTurn(e.CarrierInput())
|
||
}
|
||
e.EffectNode.TurnEnd()
|
||
}
|
||
|
||
// Effect 1268: 击败对手则下回合开始后随机附加烧伤、冻伤、中毒中的{0}种异常状态
|
||
type Effect1268 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1268) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.OpponentPet().Info.Hp > 0 {
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1268, int(e.Args()[0].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1268Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1268Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(1)
|
||
}
|
||
|
||
func (e *Effect1268Sub) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||
if len(e.Args()) == 0 {
|
||
e.Alive(false)
|
||
return
|
||
}
|
||
applyOneOfStatuses(e.CarrierInput(), e.OpponentInput(), int(e.Args()[0].IntPart()))
|
||
e.Alive(false)
|
||
}
|
||
|
||
// Effect 1269: {0}回合内若对手使用攻击技能则命中前令自身吸取对手最大体力的1/{1}
|
||
type Effect1269 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect1269) SkillHit_ex() bool {
|
||
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
damage := e.OpponentPet().GetMaxHP().Div(e.Args()[1])
|
||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, damage)
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||
return true
|
||
}
|
||
|
||
// Effect 1270: 命中则{0}%使对手{1},未触发则对手下{2}次技能无效
|
||
type Effect1270 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1270) OnSkill() bool {
|
||
if len(e.Args()) < 3 {
|
||
return true
|
||
}
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||
if success {
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(e.Args()[1].IntPart()))
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1270, int(e.Args()[2].IntPart()))
|
||
if effect != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1270Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1270Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1270Sub) 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 1271: {0}回合内每回合攻击有{1}%令对手{2},未触发则下{3}回合攻击有{4}%概率使对手{5}
|
||
type Effect1271 struct {
|
||
RoundEffectArg0Base
|
||
triggered bool
|
||
}
|
||
|
||
func (e *Effect1271) OnSkill() bool {
|
||
if len(e.Args()) < 6 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||
if success {
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(e.Args()[2].IntPart()))
|
||
e.triggered = true
|
||
return true
|
||
}
|
||
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1271, int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()), int(e.Args()[5].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1271Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1271Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1271Sub) OnSkill() bool {
|
||
if e.remaining <= 0 || len(e.Args()) < 3 {
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||
if success {
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(e.Args()[2].IntPart()))
|
||
}
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1272: 附加自身当前护盾值等量的固定伤害
|
||
type Effect1272 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1272) OnSkill() bool {
|
||
shield := e.CarrierInput().CurrentShield()
|
||
if shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||
return true
|
||
}
|
||
|
||
// Effect 1273: 若自身满体力则附加自身最大体力1/{0}的百分比伤害
|
||
type Effect1273 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1273) OnSkill() bool {
|
||
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
if e.CarrierPet().GetHP().Cmp(e.CarrierPet().GetMaxHP()) != 0 {
|
||
return true
|
||
}
|
||
damage := e.CarrierPet().GetMaxHP().Div(e.Args()[0])
|
||
if damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||
return true
|
||
}
|
||
|
||
// Effect 1274: {0}%令对手{1},对手处于能力下降状态时触发概率翻倍
|
||
type Effect1274 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1274) OnSkill() bool {
|
||
if len(e.Args()) < 2 {
|
||
return true
|
||
}
|
||
chance := int(e.Args()[0].IntPart())
|
||
if e.TargetInput().HasPropSub() {
|
||
chance *= 2
|
||
}
|
||
success, _, _ := e.Input.Player.Roll(chance, 100)
|
||
if success {
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(e.Args()[1].IntPart()))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1275: 消耗自身全部体力,使下只出场精灵前{0}次出手必定先手必定暴击
|
||
type Effect1275 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1275) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierPet().GetHP()})
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1275, int(e.Args()[0].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1275Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1275Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1275Sub) ActionStart(a, b *action.SelectSkillAction) bool {
|
||
if e.remaining <= 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
e.Ctx().SkillEntity.XML.Priority += 7
|
||
e.Ctx().SkillEntity.XML.CritRate = 16
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1276: 消耗自身全部体力,给对手附加消耗体力1/{0}等量的百分比伤害
|
||
type Effect1276 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1276) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
damage := e.CarrierPet().GetHP().Div(e.Args()[0])
|
||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierPet().GetHP()})
|
||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1277: 若体力大于对手,则消耗自身体力至残留1点HP给对手造成350-550点伤害;若体力小于对手,则消耗自身全部体力给对手等同于消耗量的固定伤害并使对手瘫痪2回合,若对手受到致命伤害时残留1点体力
|
||
type Effect1277 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1277) Skill_Use() bool {
|
||
if e.CarrierPet().GetHP().Cmp(e.OpponentPet().GetHP()) > 0 {
|
||
leave := alpacadecimal.NewFromInt(1)
|
||
if e.CarrierPet().GetHP().Cmp(leave) > 0 {
|
||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.CarrierPet().GetHP().Sub(leave)})
|
||
}
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(grand.N(350, 550)))})
|
||
return true
|
||
}
|
||
|
||
lost := e.CarrierPet().GetHP()
|
||
e.CarrierInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(info.PetStatus.Paralysis))
|
||
return true
|
||
}
|
||
|
||
// Effect 1278: {0}%令对手{1},未触发则免疫下{2}次受到的攻击伤害并反弹等量的固定伤害
|
||
type Effect1278 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1278) OnSkill() bool {
|
||
if len(e.Args()) < 3 {
|
||
return true
|
||
}
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||
if success {
|
||
applyStatusByID(e.CarrierInput(), e.TargetInput(), int(e.Args()[1].IntPart()))
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1278, int(e.Args()[2].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1278Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1278Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1278Sub) DamageLockEx(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||
return true
|
||
}
|
||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: zone.Damage})
|
||
zone.Damage = alpacadecimal.Zero
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1279: 反转自身能力下降状态,反转成功则使对手下{0}次技能无效
|
||
type Effect1279 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1279) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
reversed := false
|
||
for i, v := range e.CarrierInput().Prop[:] {
|
||
if v < 0 && e.CarrierInput().SetProp(e.CarrierInput(), int8(i), -2*v) {
|
||
reversed = true
|
||
}
|
||
}
|
||
if !reversed {
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1279, int(e.Args()[0].IntPart()))
|
||
if effect != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1279Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1279Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1279Sub) 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 1280: 附加自身当前体力值{0}%的百分比伤害,每次使用增加{1}%,最高{2}%
|
||
type Effect1280 struct {
|
||
node.EffectNode
|
||
bonus int
|
||
}
|
||
|
||
func (e *Effect1280) OnSkill() bool {
|
||
if len(e.Args()) < 3 {
|
||
return true
|
||
}
|
||
percent := int(e.Args()[0].IntPart()) + e.bonus
|
||
max := int(e.Args()[2].IntPart())
|
||
if percent > max {
|
||
percent = max
|
||
}
|
||
damage := e.CarrierPet().GetHP().Mul(alpacadecimal.NewFromInt(int64(percent))).Div(alpacadecimal.NewFromInt(100))
|
||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||
}
|
||
e.bonus += int(e.Args()[1].IntPart())
|
||
return true
|
||
}
|
||
|
||
// Effect 1281: 消耗自身所有护盾值并造成等量固定伤害,若消耗的护盾值大于300则额外附加自身最大体力1/3的百分比伤害,小于300且大于0则恢复自身最大体力的1/3并造成等量百分比伤害
|
||
type Effect1281 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1281) Skill_Use() bool {
|
||
shield := e.CarrierInput().CurrentShield()
|
||
if shield.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
|
||
if shield.Cmp(alpacadecimal.NewFromInt(300)) > 0 {
|
||
dmg := e.CarrierPet().GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
|
||
return true
|
||
}
|
||
if shield.Cmp(alpacadecimal.NewFromInt(300)) < 0 {
|
||
val := e.CarrierPet().GetMaxHP().Div(alpacadecimal.NewFromInt(3))
|
||
e.CarrierInput().Heal(e.CarrierInput(), &action.SelectSkillAction{}, val)
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Percent, Damage: val})
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1282: 命中后使对手受到{0}点固定伤害,未命中则自身死亡
|
||
type Effect1282 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1282) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
e.TargetInput().Damage(e.CarrierInput(), &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
|
||
return true
|
||
}
|
||
|
||
// Effect 1283: 全属性+{0},先出手时自身强化效果翻倍
|
||
type Effect1283 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1283) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
boost := int8(e.Args()[0].IntPart())
|
||
if e.IsFirst() {
|
||
boost *= 2
|
||
}
|
||
for i := 0; i < 6; i++ {
|
||
e.CarrierInput().SetProp(e.CarrierInput(), int8(i), boost)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1284: 先出手时使对手{0}回合属性技能无效
|
||
type Effect1284 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1284) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || !e.IsFirst() {
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1284, int(e.Args()[0].IntPart()))
|
||
if effect != nil {
|
||
e.TargetInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1284Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect1284Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1284Sub) 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 1285: 当回合未击败对手则减少对方所有技能PP{0}点
|
||
type Effect1285 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1285) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.OpponentPet().Info.Hp == 0 {
|
||
return true
|
||
}
|
||
zeroRandomSkillPP(e.TargetInput(), int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 1286: 当回合击败对手则恢复自身所有技能PP值
|
||
type Effect1286 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1286) Skill_Use() bool {
|
||
return true
|
||
}
|
||
|
||
// Effect 1287: 吸取对手能力提升,吸取成功则下{0}次受到的攻击伤害减少{1}%
|
||
type Effect1287 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect1287) OnSkill() bool {
|
||
if len(e.Args()) < 2 {
|
||
return true
|
||
}
|
||
absorbed := clearPositivePropsTo(e.TargetInput(), e.CarrierInput())
|
||
if !absorbed {
|
||
return true
|
||
}
|
||
effect := e.CarrierInput().InitEffect(input.EffectType.Sub, 1287, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||
if effect != nil {
|
||
e.CarrierInput().AddEffect(e.CarrierInput(), effect)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect1287Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
percent int
|
||
}
|
||
|
||
func (e *Effect1287Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
if len(a) > 1 {
|
||
e.percent = a[1]
|
||
}
|
||
}
|
||
|
||
func (e *Effect1287Sub) DamageDivEx(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
|
||
return true
|
||
}
|
||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(100 - e.percent))).Div(alpacadecimal.NewFromInt(100))
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 1263, &Effect1263{})
|
||
input.InitEffect(input.EffectType.Skill, 1264, &Effect1264{})
|
||
input.InitEffect(input.EffectType.Skill, 1265, &Effect1265{})
|
||
input.InitEffect(input.EffectType.Sub, 1265, &Effect1265Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1266, &Effect1266{})
|
||
input.InitEffect(input.EffectType.Sub, 1266, &Effect1266Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1267, &Effect1267{})
|
||
input.InitEffect(input.EffectType.Skill, 1268, &Effect1268{})
|
||
input.InitEffect(input.EffectType.Sub, 1268, &Effect1268Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1269, &Effect1269{})
|
||
input.InitEffect(input.EffectType.Skill, 1270, &Effect1270{})
|
||
input.InitEffect(input.EffectType.Sub, 1270, &Effect1270Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1271, &Effect1271{})
|
||
input.InitEffect(input.EffectType.Sub, 1271, &Effect1271Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1272, &Effect1272{})
|
||
input.InitEffect(input.EffectType.Skill, 1273, &Effect1273{})
|
||
input.InitEffect(input.EffectType.Skill, 1274, &Effect1274{})
|
||
input.InitEffect(input.EffectType.Skill, 1275, &Effect1275{})
|
||
input.InitEffect(input.EffectType.Sub, 1275, &Effect1275Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1276, &Effect1276{})
|
||
input.InitEffect(input.EffectType.Skill, 1277, &Effect1277{})
|
||
input.InitEffect(input.EffectType.Skill, 1278, &Effect1278{})
|
||
input.InitEffect(input.EffectType.Sub, 1278, &Effect1278Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1279, &Effect1279{})
|
||
input.InitEffect(input.EffectType.Sub, 1279, &Effect1279Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1280, &Effect1280{})
|
||
input.InitEffect(input.EffectType.Skill, 1281, &Effect1281{})
|
||
input.InitEffect(input.EffectType.Skill, 1282, &Effect1282{})
|
||
input.InitEffect(input.EffectType.Skill, 1283, &Effect1283{})
|
||
input.InitEffect(input.EffectType.Skill, 1284, &Effect1284{})
|
||
input.InitEffect(input.EffectType.Sub, 1284, &Effect1284Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 1285, &Effect1285{})
|
||
input.InitEffect(input.EffectType.Skill, 1286, &Effect1286{})
|
||
input.InitEffect(input.EffectType.Skill, 1287, &Effect1287{})
|
||
input.InitEffect(input.EffectType.Sub, 1287, &Effect1287Sub{})
|
||
}
|