feat(effect): 实现effects 1770-1794战斗效果 - 实现Effect 1770: 开启战魂附体效果,免疫对手下1次攻击技能伤害, 若对手攻击技能PP值为满则额外免疫下1次固定伤害和百分比伤害 - 实现Effect 1771-1779相关战斗效果,包括能力状态反转、固定伤害计算等功能 - 实现Effect 1780-1794系列效果,包含伤害计算、护盾机制、切换限制等功能
1039 lines
27 KiB
Go
1039 lines
27 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/common/data/xmlres"
|
||
"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"
|
||
)
|
||
|
||
const (
|
||
petStatus2077Holy info.EnumPetStatus = 32
|
||
petStatus2077Evil info.EnumPetStatus = 33
|
||
)
|
||
|
||
func effect2077StatusID(formType int, opposite bool) int {
|
||
statusID := int(petStatus2077Holy)
|
||
if formType != 0 {
|
||
statusID = int(petStatus2077Evil)
|
||
}
|
||
if opposite {
|
||
if statusID == int(petStatus2077Holy) {
|
||
return int(petStatus2077Evil)
|
||
}
|
||
return int(petStatus2077Holy)
|
||
}
|
||
return statusID
|
||
}
|
||
|
||
func isControlStatus2087(statusID int) bool {
|
||
switch info.EnumPetStatus(statusID) {
|
||
case info.PetStatus.Paralysis,
|
||
info.PetStatus.Tired,
|
||
info.PetStatus.Fear,
|
||
info.PetStatus.Petrified,
|
||
info.PetStatus.Sleep:
|
||
return true
|
||
default:
|
||
return false
|
||
}
|
||
}
|
||
|
||
func countNotFullSkillPP2088(target *input.Input) int {
|
||
if target == nil || target.CurrentPet == nil {
|
||
return 0
|
||
}
|
||
|
||
count := 0
|
||
for _, skillInfo := range target.CurrentPet.Info.SkillList {
|
||
skill, ok := xmlres.SkillMap[int(skillInfo.ID)]
|
||
if !ok || skill.MaxPP <= 0 {
|
||
continue
|
||
}
|
||
if skillInfo.PP < uint32(skill.MaxPP) {
|
||
count++
|
||
}
|
||
}
|
||
return count
|
||
}
|
||
|
||
func restoreAllSkillPP2089(target *input.Input) {
|
||
if target == nil || target.CurrentPet == nil {
|
||
return
|
||
}
|
||
target.HealPP(-1)
|
||
}
|
||
|
||
// Effect 2072: 自身处于异常状态时先制+1且必定命中
|
||
type Effect2072 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
// Effect 2070: 下{0}次自身能力提升状态被反转时令该效果无效
|
||
type Effect2070 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2070) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2070, int(e.Args()[0].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2070Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2070Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.RoundEffectArg0Base.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.Stack(a[0])
|
||
}
|
||
}
|
||
|
||
func (e *Effect2070Sub) PropBefer(source *input.Input, prop int8, level int8) bool {
|
||
if source != e.Ctx().Opp {
|
||
return true
|
||
}
|
||
if prop < 0 || int(prop) >= len(e.Ctx().Our.Prop) {
|
||
return true
|
||
}
|
||
if level >= 0 || e.Ctx().Our.Prop[prop] <= 0 {
|
||
return true
|
||
}
|
||
if e.Stack() <= 0 {
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
e.Stack(e.Stack() - 1)
|
||
if e.Stack() <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return false
|
||
}
|
||
|
||
// Effect 2071: 自身被击败后,对手下{0}次体力恢复效果减少{1}%
|
||
type Effect2071 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2071) SwitchOut(in *input.Input) bool {
|
||
if in != e.Ctx().Our || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Our.CurrentPet.Alive() {
|
||
return true
|
||
}
|
||
if len(e.Args()) < 2 {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2071, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2071Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2071Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.RoundEffectArg0Base.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.Stack(a[0])
|
||
}
|
||
}
|
||
|
||
func (e *Effect2071Sub) Heal_Pre(_ action.BattleActionI, value *int) bool {
|
||
if len(e.Args()) < 2 || value == nil || *value <= 0 {
|
||
return true
|
||
}
|
||
if e.Stack() <= 0 {
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
|
||
reduce := *value * int(e.Args()[1].IntPart()) / 100
|
||
if reduce > *value {
|
||
reduce = *value
|
||
}
|
||
*value -= reduce
|
||
e.Stack(e.Stack() - 1)
|
||
if e.Stack() <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2072) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
if !e.Ctx().Our.StatEffect_Exist_all() {
|
||
return true
|
||
}
|
||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||
if current == nil || current.SkillEntity == nil {
|
||
return true
|
||
}
|
||
current.SkillEntity.XML.Priority += 1
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2072) SkillHit() bool {
|
||
if !e.Ctx().Our.StatEffect_Exist_all() || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
e.Ctx().SkillEntity.XML.MustHit = 1
|
||
return true
|
||
}
|
||
|
||
// Effect 2073: 对手每处于一种异常状态造成的伤害提高{0}%
|
||
type Effect2073 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2073) 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
|
||
}
|
||
|
||
statuses := []info.EnumPetStatus{
|
||
info.PetStatus.Burned,
|
||
info.PetStatus.Frozen,
|
||
info.PetStatus.Poisoned,
|
||
info.PetStatus.Paralysis,
|
||
info.PetStatus.Fear,
|
||
info.PetStatus.Tired,
|
||
}
|
||
count := 0
|
||
for _, st := range statuses {
|
||
if e.Ctx().Opp.StatEffect_Exist(st) {
|
||
count++
|
||
}
|
||
}
|
||
if count <= 0 {
|
||
return true
|
||
}
|
||
|
||
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0].Mul(alpacadecimal.NewFromInt(int64(count))))).Div(hundred)
|
||
return true
|
||
}
|
||
|
||
// Effect 2074: 随机附加{0}种非限制类异常状态
|
||
type Effect2074 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2074) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
|
||
statuses := []int{
|
||
int(info.PetStatus.Burned),
|
||
int(info.PetStatus.Frozen),
|
||
int(info.PetStatus.Poisoned),
|
||
int(info.PetStatus.Paralysis),
|
||
int(info.PetStatus.Fear),
|
||
int(info.PetStatus.Tired),
|
||
}
|
||
count := int(e.Args()[0].IntPart())
|
||
if count > len(statuses) {
|
||
count = len(statuses)
|
||
}
|
||
indexes := grand.Perm(len(statuses))
|
||
for _, idx := range indexes[:count] {
|
||
st := e.Ctx().Our.InitEffect(input.EffectType.Status, statuses[idx])
|
||
if st != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, st)
|
||
}
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2080: 自身处于护盾状态时威力提升{0}%
|
||
// Effect 2075: 未击败对手则对手{0}回合无法解除、反转自身能力下降状态
|
||
type Effect2075 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2075) Action_end() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2075, int(e.Args()[0].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2075Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2075Sub) SwitchOut(in *input.Input) bool {
|
||
if in == e.Ctx().Our {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2075Sub) PropBefer(source *input.Input, prop int8, level int8) bool {
|
||
if source != e.Ctx().Our {
|
||
return true
|
||
}
|
||
if prop < 0 || int(prop) >= len(e.Ctx().Our.Prop) {
|
||
return true
|
||
}
|
||
if e.Ctx().Our.Prop[prop] >= 0 {
|
||
return true
|
||
}
|
||
if level >= 0 {
|
||
return false
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2076: {0}回合内使用技能吸取对手最大体力的1/{1},自身低于1/{2}时效果翻倍,吸取后若对手体力未减少则为己方所有不在场精灵恢复{3}点体力
|
||
type Effect2076 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2076) Skill_Use() bool {
|
||
if len(e.Args()) < 4 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
||
return true
|
||
}
|
||
if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
drain := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])
|
||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) < 0 {
|
||
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
||
}
|
||
}
|
||
|
||
beforeHP := e.Ctx().Opp.CurrentPet.Info.Hp
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Percent,
|
||
Damage: drain,
|
||
})
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||
|
||
if beforeHP == e.Ctx().Opp.CurrentPet.Info.Hp && e.Args()[3].Cmp(alpacadecimal.Zero) > 0 {
|
||
healBench(e.Ctx().Our, e.Args()[3])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2077: {0}回合内使用技能吸取对手{1}点体力,自身体力低于1/{2}时效果翻倍,吸取后若对手体力减少值低于180则附加{3}点真实伤害与1层自身所处形态相应的圣告/邪诲
|
||
type Effect2077 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2077) Skill_Use() bool {
|
||
if len(e.Args()) < 4 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
||
return true
|
||
}
|
||
if e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
drain := e.Args()[1]
|
||
if e.Args()[2].Cmp(alpacadecimal.Zero) > 0 {
|
||
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])
|
||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) < 0 {
|
||
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
||
}
|
||
}
|
||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
beforeHP := e.Ctx().Opp.CurrentPet.Info.Hp
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: drain,
|
||
})
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||
|
||
if int64(beforeHP)-int64(e.Ctx().Opp.CurrentPet.Info.Hp) < 180 {
|
||
if e.Args()[3].Cmp(alpacadecimal.Zero) > 0 {
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.True,
|
||
Damage: e.Args()[3],
|
||
})
|
||
}
|
||
if e.Ctx().Our.CurrentPet != nil {
|
||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, effect2077StatusID(e.Ctx().Our.CurrentPet.PetInfo.Type, false))
|
||
}
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2078: 吸取对手{0}点体力,吸取后若对手体力减少值低于180则为对手附加1层自身所处形态相反的圣告/邪诲
|
||
type Effect2078 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2078) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
||
return true
|
||
}
|
||
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
drain := e.Args()[0]
|
||
beforeHP := e.Ctx().Opp.CurrentPet.Info.Hp
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: drain,
|
||
})
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||
|
||
if int64(beforeHP)-int64(e.Ctx().Opp.CurrentPet.Info.Hp) < 180 && e.Ctx().Our.CurrentPet != nil {
|
||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, effect2077StatusID(e.Ctx().Our.CurrentPet.PetInfo.Type, true))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2079: 对手处于护盾状态时先制+1并无视对手护盾
|
||
type Effect2079 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2079) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
if !e.Ctx().Opp.HasShield() {
|
||
return true
|
||
}
|
||
|
||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||
if current != nil && current.SkillEntity != nil {
|
||
current.SkillEntity.XML.Priority += 1
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2079)
|
||
if sub != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2079Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2079Sub) Damage_Shield(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
if e.Ctx().Our == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
|
||
e.Ctx().Our.ConsumeAllShield()
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2079Sub) SwitchOut(in *input.Input) bool {
|
||
if in == e.Ctx().Our {
|
||
e.Alive(false)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2080 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2080) 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().Our.HasShield() {
|
||
return true
|
||
}
|
||
|
||
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
|
||
return true
|
||
}
|
||
|
||
// Effect 2081: 对手不处于异常状态时令对手随机{0}个技能PP值归零
|
||
type Effect2081 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2081) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().Opp.StatEffect_Exist_all() {
|
||
return true
|
||
}
|
||
|
||
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2082: 为对手附加1道天霆之律
|
||
type Effect2082 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2082) Skill_Use() bool {
|
||
if e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
if eff := e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2082); eff != nil {
|
||
if sub, ok := eff.(*Effect2082Sub); ok && sub != nil && sub.Stack() >= 3 {
|
||
return true
|
||
}
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2082)
|
||
if sub != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2082Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2082Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.CanStack(true)
|
||
e.Duration(-1)
|
||
e.Stack(1)
|
||
}
|
||
|
||
func (e *Effect2082Sub) HookPP(count *int) bool {
|
||
if count == nil || e.Stack() <= 0 {
|
||
return true
|
||
}
|
||
|
||
*count += e.Stack()
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2082Sub) SwitchOut(in *input.Input) bool {
|
||
if in != e.Ctx().Our {
|
||
return true
|
||
}
|
||
|
||
zeroRandomSkillPP(e.Ctx().Our, e.Stack())
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
|
||
// Effect 2083: 对手选择必中技能时先制+3
|
||
type Effect2083 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2083) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||
if current == nil || current.SkillEntity == nil {
|
||
return true
|
||
}
|
||
other := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
|
||
if other == nil || other.SkillEntity == nil {
|
||
return true
|
||
}
|
||
if other.SkillEntity.AttackTime != 2 {
|
||
return true
|
||
}
|
||
|
||
current.SkillEntity.XML.Priority += 3
|
||
return true
|
||
}
|
||
|
||
// Effect 2084: 对手选择非必中技能时吸取对手所选技能{0}点PP
|
||
type Effect2084 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2084) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2084, int(e.Args()[0].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2084Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2084Sub) Skill_Use_ex() bool {
|
||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
|
||
pp := uint32(e.Args()[0].IntPart())
|
||
if e.Ctx().SkillEntity.Info.PP > pp {
|
||
e.Ctx().SkillEntity.Info.PP -= pp
|
||
} else {
|
||
e.Ctx().SkillEntity.Info.PP = 0
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2085: 命中后自身{0},若造成的伤害高于{6}则效果翻倍
|
||
type Effect2085 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2085) 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 || e.Ctx().SkillEntity.AttackTime == 0 || len(e.Args()) < 7 {
|
||
return true
|
||
}
|
||
|
||
multiplier := int8(1)
|
||
if zone.Damage.Cmp(e.Args()[6]) > 0 {
|
||
multiplier = 2
|
||
}
|
||
for i := 0; i < 6; i++ {
|
||
boost := int8(e.Args()[i].IntPart()) * multiplier
|
||
if boost != 0 {
|
||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
|
||
}
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2086: 空元之诗·渍:若技能无效,则消除对手回合类效果、能力提升效果,消除成功任意一项则令对手诅咒
|
||
type Effect2086 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2086) Skill_Use_ex() bool {
|
||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime != 0 {
|
||
return true
|
||
}
|
||
|
||
cleared := false
|
||
if activeTurnEffectCount(e.Ctx().Opp) > 0 {
|
||
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
||
cleared = true
|
||
}
|
||
if clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
|
||
cleared = true
|
||
}
|
||
if cleared {
|
||
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(petStatusCurse))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2087: 空元之诗·镀:若对手处于控制类异常状态,则己方免疫下2次受到的异常状态
|
||
type Effect2087 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2087) Skill_Use() bool {
|
||
if e.Ctx().Opp == nil {
|
||
return true
|
||
}
|
||
|
||
hasControl := false
|
||
for _, statusID := range []info.EnumPetStatus{
|
||
info.PetStatus.Paralysis,
|
||
info.PetStatus.Tired,
|
||
info.PetStatus.Fear,
|
||
info.PetStatus.Petrified,
|
||
info.PetStatus.Sleep,
|
||
} {
|
||
if e.Ctx().Opp.StatEffect_Exist(statusID) {
|
||
hasControl = true
|
||
break
|
||
}
|
||
}
|
||
if !hasControl {
|
||
return true
|
||
}
|
||
|
||
if eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2087, 2); eff != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2087Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect2087Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect2087Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
if in != e.Ctx().Our || !input.IS_Stat(effEffect) {
|
||
return true
|
||
}
|
||
|
||
if !isControlStatus2087(int(effEffect.ID().Suffix())) {
|
||
return true
|
||
}
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Alive(false)
|
||
}
|
||
return false
|
||
}
|
||
|
||
// Effect 2088: 空元之诗·柱:若对手处于回合类效果,则对手每有1个技能PP值不为满附加50点次元·龙系伤害且对手下回合无法主动切换精灵
|
||
type Effect2088 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2088) Skill_Use() bool {
|
||
if e.Ctx().Opp == nil || activeTurnEffectCount(e.Ctx().Opp) <= 0 {
|
||
return true
|
||
}
|
||
|
||
count := countNotFullSkillPP2088(e.Ctx().Opp)
|
||
if count > 0 {
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: alpacadecimal.NewFromInt(int64(50 * count)),
|
||
})
|
||
}
|
||
|
||
if eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2088, 2); eff != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||
e.Ctx().Opp.CanChange = 1
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2088Sub struct {
|
||
node.EffectNode
|
||
remaining int
|
||
}
|
||
|
||
func (e *Effect2088Sub) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
if len(a) > 0 {
|
||
e.remaining = a[0]
|
||
}
|
||
}
|
||
|
||
func (e *Effect2088Sub) TurnEnd() {
|
||
if e.remaining <= 0 {
|
||
e.Ctx().Our.CanChange = 0
|
||
e.Alive(false)
|
||
return
|
||
}
|
||
|
||
e.remaining--
|
||
if e.remaining <= 0 {
|
||
e.Ctx().Our.CanChange = 0
|
||
e.Alive(false)
|
||
return
|
||
}
|
||
e.Ctx().Our.CanChange = 1
|
||
}
|
||
|
||
// Effect 2089: 空元之诗·烙:若自身为先出手,则此技能每剩余1点PP值附加50点次元·龙系伤害,下次击败对手后恢复自身全部体力与PP值
|
||
type Effect2089 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2089) SkillHit() bool {
|
||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || !e.IsFirst() || e.Ctx().SkillEntity.AttackTime == 0 {
|
||
return true
|
||
}
|
||
|
||
if eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2089); eff != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2089) 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 || e.Ctx().SkillEntity.AttackTime == 0 || !e.IsFirst() {
|
||
return true
|
||
}
|
||
|
||
bonus := alpacadecimal.NewFromInt(int64(e.Ctx().SkillEntity.Info.PP * 50))
|
||
if bonus.Cmp(alpacadecimal.Zero) > 0 {
|
||
zone.Damage = zone.Damage.Add(bonus)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2089Sub struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect2089Sub) Action_end() bool {
|
||
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||
return true
|
||
}
|
||
if e.Ctx().Opp == nil || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
|
||
return true
|
||
}
|
||
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
|
||
restoreAllSkillPP2089(e.Ctx().Our)
|
||
e.Alive(false)
|
||
return true
|
||
}
|
||
|
||
func getPoemState2091(owner *input.Input, create bool) *Effect2091 {
|
||
if owner == nil {
|
||
return nil
|
||
}
|
||
if eff := owner.GetEffect(input.EffectType.Sub, 2091); eff != nil {
|
||
if state, ok := eff.(*Effect2091); ok && state.Alive() {
|
||
return state
|
||
}
|
||
}
|
||
if !create {
|
||
return nil
|
||
}
|
||
eff := owner.InitEffect(input.EffectType.Sub, 2091)
|
||
if eff == nil {
|
||
return nil
|
||
}
|
||
owner.AddEffect(owner, eff)
|
||
state, ok := eff.(*Effect2091)
|
||
if !ok {
|
||
return nil
|
||
}
|
||
return state
|
||
}
|
||
|
||
// Effect 2090: 空元之诗·均:附加双方体力上限差值50%的次元·龙系伤害,自身体力上限高于对手时额外吸取对手第五技能剩余的PP值,自身体力上限低于对手时附加伤害翻倍
|
||
type Effect2090 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2090) Skill_Use() bool {
|
||
if e.Ctx().Our == nil || e.Ctx().Opp == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().Our.CurrentPet.GetMaxHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) <= 0 {
|
||
return true
|
||
}
|
||
if len(e.Ctx().Opp.CurrentPet.Info.SkillList) < 5 {
|
||
return true
|
||
}
|
||
pp := e.Ctx().Opp.CurrentPet.Info.SkillList[4].PP
|
||
if pp <= 0 {
|
||
return true
|
||
}
|
||
e.Ctx().Opp.CurrentPet.Info.SkillList[4].PP = 0
|
||
return true
|
||
}
|
||
|
||
func (e *Effect2090) Damage_Mul(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().Our == nil || e.Ctx().Opp == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
ourMax := e.Ctx().Our.CurrentPet.GetMaxHP()
|
||
oppMax := e.Ctx().Opp.CurrentPet.GetMaxHP()
|
||
diff := ourMax.Sub(oppMax).Abs()
|
||
if diff.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
bonus := diff.Mul(alpacadecimal.NewFromInt(50)).Div(hundred)
|
||
if ourMax.Cmp(oppMax) < 0 {
|
||
bonus = bonus.Mul(alpacadecimal.NewFromInt(2))
|
||
}
|
||
if bonus.Cmp(alpacadecimal.Zero) > 0 {
|
||
zone.Damage = zone.Damage.Add(bonus)
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2091: 空妄诗章计数状态
|
||
type Effect2091 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2091) SetArgs(t *input.Input, a ...int) {
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.Duration(-1)
|
||
e.CanStack(true)
|
||
}
|
||
|
||
// Effect 2092: 全属性+{0}并将空妄诗章补充至与自身先制等级相等,自身没有空妄诗章时额外书写{1}篇,拥有时强化效果翻倍
|
||
type Effect2092 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2092) Skill_Use() bool {
|
||
if len(e.Args()) < 2 || e.Ctx().Our == nil {
|
||
return true
|
||
}
|
||
poem := getPoemState2091(e.Ctx().Our, true)
|
||
if poem == nil {
|
||
return true
|
||
}
|
||
boost := int(e.Args()[0].IntPart())
|
||
if poem.Stack() > 0 {
|
||
boost *= 2
|
||
}
|
||
boostAllProps2294(e.Ctx().Our, boost)
|
||
|
||
priority := 0
|
||
if e.Ctx().SkillEntity != nil {
|
||
priority = e.Ctx().SkillEntity.XML.Priority
|
||
if priority < 0 {
|
||
priority = 0
|
||
}
|
||
}
|
||
poems := poem.Stack()
|
||
if poems < priority {
|
||
poems = priority
|
||
}
|
||
if poem.Stack() <= 0 {
|
||
poems += int(e.Args()[1].IntPart())
|
||
}
|
||
poem.Stack(poems)
|
||
return true
|
||
}
|
||
|
||
// Effect 2093: {0}回合内使用技能吸取对手最大体力的1/{1},自身体力低于1/{2}时效果翻倍,吸取后若对手体力未减少则{3}回合内对手{4}
|
||
type Effect2093 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2093) Skill_Use() bool {
|
||
if len(e.Args()) < 5 {
|
||
return true
|
||
}
|
||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2093, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()))
|
||
if sub != nil {
|
||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||
}
|
||
return true
|
||
}
|
||
|
||
type Effect2093Sub struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect2093Sub) Skill_Use() bool {
|
||
if len(e.Args()) < 5 || e.Ctx().Our == nil || e.Ctx().Opp == nil || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||
return true
|
||
}
|
||
drain := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
|
||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) < 0 {
|
||
drain = drain.Mul(alpacadecimal.NewFromInt(2))
|
||
}
|
||
if drain.Cmp(alpacadecimal.Zero) <= 0 {
|
||
return true
|
||
}
|
||
before := e.Ctx().Opp.CurrentPet.Info.Hp
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: drain})
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, drain)
|
||
if e.Ctx().Opp.CurrentPet.Info.Hp >= before {
|
||
return true
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2094: 自身每有1篇空妄诗章造成的攻击伤害提升{0}%,若空妄诗章的篇数高于{1}则每有1篇额外附加{2}点真实伤害
|
||
type Effect2094 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2094) Damage_Mul(zone *info.DamageZone) bool {
|
||
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 || e.Ctx().Our == nil {
|
||
return true
|
||
}
|
||
poem := getPoemState2091(e.Ctx().Our, false)
|
||
if poem == nil || poem.Stack() <= 0 {
|
||
return true
|
||
}
|
||
count := poem.Stack()
|
||
bonus := alpacadecimal.NewFromInt(int64(count) * e.Args()[0].IntPart())
|
||
if bonus.Cmp(alpacadecimal.Zero) > 0 {
|
||
zone.Damage = zone.Damage.Mul(hundred.Add(bonus)).Div(hundred)
|
||
}
|
||
if count > int(e.Args()[1].IntPart()) {
|
||
extra := alpacadecimal.NewFromInt(int64(count) * e.Args()[2].IntPart())
|
||
if extra.Cmp(alpacadecimal.Zero) > 0 {
|
||
zone.Damage = zone.Damage.Add(extra)
|
||
}
|
||
}
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
holy := &BaseStatus{}
|
||
holy.Status = petStatus2077Holy
|
||
input.InitEffect(input.EffectType.Status, int(petStatus2077Holy), holy)
|
||
evil := &BaseStatus{}
|
||
evil.Status = petStatus2077Evil
|
||
input.InitEffect(input.EffectType.Status, int(petStatus2077Evil), evil)
|
||
|
||
input.InitEffect(input.EffectType.Skill, 2070, &Effect2070{})
|
||
input.InitEffect(input.EffectType.Sub, 2070, &Effect2070Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2071, &Effect2071{})
|
||
input.InitEffect(input.EffectType.Sub, 2071, &Effect2071Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2074, &Effect2074{})
|
||
input.InitEffect(input.EffectType.Skill, 2075, &Effect2075{})
|
||
input.InitEffect(input.EffectType.Sub, 2075, &Effect2075Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2076, &Effect2076{})
|
||
input.InitEffect(input.EffectType.Skill, 2077, &Effect2077{})
|
||
input.InitEffect(input.EffectType.Skill, 2078, &Effect2078{})
|
||
input.InitEffect(input.EffectType.Skill, 2079, &Effect2079{})
|
||
input.InitEffect(input.EffectType.Sub, 2079, &Effect2079Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2080, &Effect2080{})
|
||
input.InitEffect(input.EffectType.Skill, 2081, &Effect2081{})
|
||
input.InitEffect(input.EffectType.Skill, 2082, &Effect2082{})
|
||
input.InitEffect(input.EffectType.Sub, 2082, &Effect2082Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2083, &Effect2083{})
|
||
input.InitEffect(input.EffectType.Skill, 2084, &Effect2084{})
|
||
input.InitEffect(input.EffectType.Sub, 2084, &Effect2084Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2085, &Effect2085{})
|
||
input.InitEffect(input.EffectType.Skill, 2086, &Effect2086{})
|
||
input.InitEffect(input.EffectType.Skill, 2087, &Effect2087{})
|
||
input.InitEffect(input.EffectType.Sub, 2087, &Effect2087Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2088, &Effect2088{})
|
||
input.InitEffect(input.EffectType.Sub, 2088, &Effect2088Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2089, &Effect2089{})
|
||
input.InitEffect(input.EffectType.Sub, 2089, &Effect2089Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2090, &Effect2090{})
|
||
input.InitEffect(input.EffectType.Sub, 2091, &Effect2091{})
|
||
input.InitEffect(input.EffectType.Skill, 2092, &Effect2092{})
|
||
input.InitEffect(input.EffectType.Skill, 2093, &Effect2093{})
|
||
input.InitEffect(input.EffectType.Sub, 2093, &Effect2093Sub{})
|
||
input.InitEffect(input.EffectType.Skill, 2094, &Effect2094{})
|
||
}
|