docs(effects): 移除已完成的技能效果任务文档

移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档,
这些任务已经完成实现,相关文档不再需要维护。
```
This commit is contained in:
昔念
2026-03-31 00:38:50 +08:00
parent ec9f592e44
commit e037539123
155 changed files with 16470 additions and 4033 deletions

View File

@@ -0,0 +1,833 @@
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.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
divisor = e.Args()[1]
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(divisor)
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &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.Ctx().Our.InitEffect(input.EffectType.Sub, 1265, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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.Ctx().Our.InitEffect(input.EffectType.Sub, 1266, int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, 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.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
func (e *Effect1267) TurnEnd() {
if !e.triggered && e.Duration() == 1 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
e.EffectNode.TurnEnd()
}
// Effect 1268: 击败对手则下回合开始后随机附加烧伤、冻伤、中毒中的{0}种异常状态
type Effect1268 struct {
node.EffectNode
}
func (e *Effect1268) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1268, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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.Ctx().Our, e.Ctx().Opp, 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.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1270, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, 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.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
e.triggered = true
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1271, int(e.Args()[3].IntPart()), int(e.Args()[4].IntPart()), int(e.Args()[5].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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.Ctx().Our, e.Ctx().Opp, 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.Ctx().Our.CurrentShield()
if shield.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) != 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Opp.HasPropSub() {
chance *= 2
}
success, _, _ := e.Input.Player.Roll(chance, 100)
if success {
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, 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.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1275, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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.Ctx().Our.CurrentPet.GetHP().Div(e.Args()[0])
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) > 0 {
leave := alpacadecimal.NewFromInt(1)
if e.Ctx().Our.CurrentPet.GetHP().Cmp(leave) > 0 {
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP().Sub(leave)})
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(grand.N(350, 550)))})
return true
}
lost := e.Ctx().Our.CurrentPet.GetHP()
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: lost})
applyStatusByID(e.Ctx().Our, e.Ctx().Opp, 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.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1278, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our.Prop[:] {
if v < 0 && e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -2*v) {
reversed = true
}
}
if !reversed {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1279, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, 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.Ctx().Our.CurrentPet.GetHP().Mul(alpacadecimal.NewFromInt(int64(percent))).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our.CurrentShield()
if shield.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
if shield.Cmp(alpacadecimal.NewFromInt(300)) > 0 {
dmg := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
return true
}
if shield.Cmp(alpacadecimal.NewFromInt(300)) < 0 {
val := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, val)
e.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Opp.Damage(e.Ctx().Our, &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.Ctx().Our.SetProp(e.Ctx().Our, 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.Ctx().Our.InitEffect(input.EffectType.Sub, 1284, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, 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.Ctx().Opp.CurrentPet.Info.Hp == 0 {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, 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.Ctx().Opp, e.Ctx().Our)
if !absorbed {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1287, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, 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{})
}

View File

@@ -0,0 +1,706 @@
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 effect1296Statuses = []int{
21, // 自然庇护状态未暴露在 PetStatus 枚举里,当前按状态 ID 处理
}
var effect1291Statuses = []int{
int(info.PetStatus.Burned),
int(info.PetStatus.Frozen),
int(info.PetStatus.Poisoned),
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Sleep),
}
func applyAnyStatus(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 applyRandomNStatuses(owner, target *input.Input, n int, pool []int) {
if owner == nil || target == nil || n <= 0 || len(pool) == 0 {
return
}
if n > len(pool) {
n = len(pool)
}
for _, idx := range grand.Perm(len(pool))[:n] {
applyAnyStatus(owner, target, pool[idx])
}
}
func clearBothProps(a, b *input.Input) bool {
if a == nil || b == nil {
return false
}
cleared := false
for i := range a.Prop {
if a.SetProp(a, int8(i), 0) {
cleared = true
}
if b.SetProp(a, int8(i), 0) {
cleared = true
}
}
return cleared
}
func healBench(owner *input.Input, amount alpacadecimal.Decimal) {
if owner == nil || amount.Cmp(alpacadecimal.Zero) <= 0 {
return
}
for _, pet := range owner.AllPet {
if pet == nil || !pet.Alive() || pet == owner.CurrentPet {
continue
}
pet.Info.ModelHP(amount.IntPart())
}
}
// Effect 1288: 免疫下{0}次受到的攻击,未触发则{1}%令对手{2}
type Effect1288 struct{ node.EffectNode }
func (e *Effect1288) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1288, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1288Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1288Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1288Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 1289: 将自身的能力下降状态双倍反馈给对手,反馈成功则对手下{0}次技能无效
type Effect1289 struct{ node.EffectNode }
func (e *Effect1289) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
reflected := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 2*v) {
reflected = true
}
}
if !reflected {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1289, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1289Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1289Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1289Sub) 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 1290: 恢复自身最大体力的1/{0}若自身体力低于1/{1}则造成等量固伤
type Effect1290 struct{ node.EffectNode }
func (e *Effect1290) Skill_Use() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if heal.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
low := false
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
low = e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) < 0
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if low {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: heal})
}
return true
}
// Effect 1291: 造成的伤害高于{0}则{1}%概率使对手随机进入{2}种异常状态
type Effect1291 struct{ node.EffectNode }
func (e *Effect1291) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if success {
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()), effect1291Statuses)
}
return true
}
// Effect 1292: 自身体力低于对手时先制+2
type Effect1292 struct{ node.EffectNode }
func (e *Effect1292) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) >= 0 {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
current.SkillEntity.XML.Priority += 2
return true
}
// Effect 1293: 免疫下{0}次受到的攻击,免疫成功则自身全属性+{1}
type Effect1293 struct{ node.EffectNode }
func (e *Effect1293) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1293, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1293Sub struct {
node.EffectNode
remaining int
boost int
}
func (e *Effect1293Sub) 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.boost = a[1]
}
}
func (e *Effect1293Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = alpacadecimal.Zero
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.boost))
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1294: 消除双方能力提升、下降状态和护盾效果消除任意一项成功则使对手随机进入两种异常状态未触发则回合结束时吸取对手最大体力的1/3
type Effect1294 struct{ node.EffectNode }
func (e *Effect1294) Skill_Use() bool {
cleared := clearBothProps(e.Ctx().Our, e.Ctx().Opp)
if cleared {
effect := e.Ctx().Our.InitEffect(input.EffectType.Status, 1294)
if effect != nil {
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, 2, effect1291Statuses)
}
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1294)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1294Sub struct{ node.EffectNode }
func (e *Effect1294Sub) TurnEnd() {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
e.Alive(false)
}
// Effect 1295: 先出手时{0}回合内免疫并反弹异常状态
type Effect1295 struct{ node.EffectNode }
func (e *Effect1295) Skill_Use() bool {
if len(e.Args()) == 0 || !e.IsFirst() {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1295, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1295Sub struct{ FixedDuration1Base }
func (e *Effect1295Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
return true
}
return false
}
// Effect 1296: {0}回合内受到攻击{1}%进入自然庇佑
type Effect1296 struct{ RoundEffectArg0Base }
func (e *Effect1296) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !ok {
return true
}
applyAnyStatus(e.Ctx().Our, e.Ctx().Our, effect1296Statuses[0])
return true
}
// Effect 1297: 消除对手回合类效果,消除成功则令对手{0}未触发则吸取对手最大体力的1/{1}
type Effect1297 struct{ node.EffectNode }
func (e *Effect1297) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before > 0 {
applyAnyStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 1298: 消除对手能力提升状态消除成功则直接扣除对方场下随机一只精灵最大体力的1/4致死时令其残留1点体力
type Effect1298 struct{ node.EffectNode }
func (e *Effect1298) Skill_Use() bool {
cleared := clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
if !cleared {
return true
}
for _, pet := range e.Ctx().Opp.AllPet {
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurrentPet {
continue
}
damage := pet.GetMaxHP().Div(alpacadecimal.NewFromInt(4))
if damage.Cmp(alpacadecimal.Zero) > 0 {
pet.Info.ModelHP(-damage.IntPart())
}
break
}
return true
}
// Effect 1299: 3回合内每次对手造成的攻击伤害低于300则减少对手所有不在场精灵100点体力每次对手使用属性技能则恢复己方所有不在场精灵100点体力使对手不在场精灵死亡时令其残留1点体力
type Effect1299 struct{ RoundEffectArg0Base }
func (e *Effect1299) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
return true
}
for _, pet := range e.Ctx().Opp.AllPet {
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurrentPet {
continue
}
pet.Info.ModelHP(-100)
}
return true
}
func (e *Effect1299) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
return true
}
// Effect 1300: {0}回合内受到的攻击伤害减少{1}%,受到的伤害高于{2}时随机附加{3}种异常状态,未触发则消除对手回合类效果
type Effect1300 struct{ RoundEffectArg0Base }
func (e *Effect1300) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 {
return true
}
reduce := zone.Damage.Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
zone.Damage = zone.Damage.Sub(reduce)
if zone.Damage.Cmp(e.Args()[2]) > 0 {
applyRandomNStatuses(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()), effect1291Statuses)
}
return true
}
// Effect 1301: 若自身体力低于300则消耗自身全部体力并使对手所有不在场精灵减少1/2最大体力
type Effect1301 struct{ node.EffectNode }
func (e *Effect1301) Skill_Use() bool {
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.NewFromInt(300)) >= 0 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
for _, pet := range e.Ctx().Opp.AllPet {
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurrentPet {
continue
}
damage := pet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))
pet.Info.ModelHP(-damage.IntPart())
}
return true
}
// Effect 1302: 全属性+{0}{1}%概率强化效果翻倍,未触发则吸取对手能力提升状态
type Effect1302 struct{ node.EffectNode }
func (e *Effect1302) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
boost := int8(e.Args()[0].IntPart())
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if success {
boost *= 2
}
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
}
if success {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
return true
}
// Effect 1303: 4回合内使用技能吸取对手最大体力1/3自身体力低于1/2时效果翻倍吸取时若自身满体力则为己方所有不在场精灵恢复100点体力
type Effect1303 struct{ RoundEffectArg0Base }
func (e *Effect1303) OnSkill() bool {
base := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3))
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
base = base.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: base})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, base)
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) == 0 {
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 1304: 下{0}回合攻击忽略对手{1}%的双防值
type Effect1304 struct{ node.EffectNode }
func (e *Effect1304) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
power := e.Ctx().SkillEntity.XML.Power
e.Ctx().SkillEntity.XML.Power = power
return true
}
// Effect 1305: 己方每有一只精灵存活则恢复{0}点体力,每有一只精灵死亡则附加{1}点固定伤害
type Effect1305 struct{ node.EffectNode }
func (e *Effect1305) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
live, dead := 0, 0
for _, pet := range e.Ctx().Our.AllPet {
if pet == nil {
continue
}
if pet.Alive() {
live++
} else {
dead++
}
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(live)*e.Args()[0].IntPart()))
if dead > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(dead) * e.Args()[1].IntPart())})
}
return true
}
// Effect 1306: 造成的伤害低于350则减少对手所有未出场精灵100点体力使对手不在场精灵死亡时令其残留1点体力
type Effect1306 struct{ node.EffectNode }
func (e *Effect1306) Skill_Use() bool {
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(350)) >= 0 {
return true
}
for _, pet := range e.Ctx().Opp.AllPet {
if pet == nil || !pet.Alive() || pet == e.Ctx().Opp.CurrentPet {
continue
}
pet.Info.ModelHP(-100)
}
return true
}
// Effect 1307: 未击败对手则恢复己方所有不在场精灵100点体力
type Effect1307 struct{ node.EffectNode }
func (e *Effect1307) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet.Info.Hp == 0 {
return true
}
healBench(e.Ctx().Our, alpacadecimal.NewFromInt(100))
return true
}
// Effect 1308: 击败对手则自身下1次登场时帝君之罚和帝君之赐效果不会削弱
type Effect1308 struct{ node.EffectNode }
func (e *Effect1308) Skill_Use() bool { return true }
// Effect 1309: 附加{0}点固定伤害,遇到天敌时附加效果翻倍
type Effect1309 struct{ node.EffectNode }
func (e *Effect1309) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Args()[0]
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
return true
}
// Effect 1310: 吸取对手能力提升状态,吸取成功则自身下{0}回合必定先出手
type Effect1310 struct{ node.EffectNode }
func (e *Effect1310) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1310, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1310Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1310Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1310Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority += 7
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1311: {0}回合内对手使用属性技能则对手全属性-{1}
type Effect1311 struct{ RoundEffectArg0Base }
func (e *Effect1311) Skill_Use_ex() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
for i := 0; i < 6; i++ {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -int8(e.Args()[1].IntPart()))
}
return true
}
// Effect 1312: 解除自身能力下降状态,解除成功则自身下{0}回合先制+{1}
type Effect1312 struct{ node.EffectNode }
func (e *Effect1312) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
for i, v := range e.Ctx().Our.Prop[:] {
if v < 0 && e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if !cleared {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1312, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1312Sub struct {
node.EffectNode
remaining int
priority int
}
func (e *Effect1312Sub) 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.priority = a[1]
}
}
func (e *Effect1312Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority += e.priority
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1288, &Effect1288{})
input.InitEffect(input.EffectType.Sub, 1288, &Effect1288Sub{})
input.InitEffect(input.EffectType.Skill, 1289, &Effect1289{})
input.InitEffect(input.EffectType.Sub, 1289, &Effect1289Sub{})
input.InitEffect(input.EffectType.Skill, 1290, &Effect1290{})
input.InitEffect(input.EffectType.Skill, 1291, &Effect1291{})
input.InitEffect(input.EffectType.Skill, 1292, &Effect1292{})
input.InitEffect(input.EffectType.Skill, 1293, &Effect1293{})
input.InitEffect(input.EffectType.Sub, 1293, &Effect1293Sub{})
input.InitEffect(input.EffectType.Skill, 1294, &Effect1294{})
input.InitEffect(input.EffectType.Sub, 1294, &Effect1294Sub{})
input.InitEffect(input.EffectType.Skill, 1295, &Effect1295{})
input.InitEffect(input.EffectType.Sub, 1295, &Effect1295Sub{})
input.InitEffect(input.EffectType.Skill, 1296, &Effect1296{})
input.InitEffect(input.EffectType.Skill, 1297, &Effect1297{})
input.InitEffect(input.EffectType.Skill, 1298, &Effect1298{})
input.InitEffect(input.EffectType.Skill, 1299, &Effect1299{})
input.InitEffect(input.EffectType.Skill, 1300, &Effect1300{})
input.InitEffect(input.EffectType.Skill, 1301, &Effect1301{})
input.InitEffect(input.EffectType.Skill, 1302, &Effect1302{})
input.InitEffect(input.EffectType.Skill, 1303, &Effect1303{})
input.InitEffect(input.EffectType.Skill, 1304, &Effect1304{})
input.InitEffect(input.EffectType.Skill, 1305, &Effect1305{})
input.InitEffect(input.EffectType.Skill, 1306, &Effect1306{})
input.InitEffect(input.EffectType.Skill, 1307, &Effect1307{})
input.InitEffect(input.EffectType.Skill, 1308, &Effect1308{})
input.InitEffect(input.EffectType.Skill, 1309, &Effect1309{})
input.InitEffect(input.EffectType.Skill, 1310, &Effect1310{})
input.InitEffect(input.EffectType.Sub, 1310, &Effect1310Sub{})
input.InitEffect(input.EffectType.Skill, 1311, &Effect1311{})
input.InitEffect(input.EffectType.Skill, 1312, &Effect1312{})
input.InitEffect(input.EffectType.Sub, 1312, &Effect1312Sub{})
}

View File

@@ -0,0 +1,614 @@
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"
)
const petStatusRage info.EnumPetStatus = 31
func addStatusByID(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil {
return false
}
eff := owner.InitEffect(input.EffectType.Status, statusID)
if eff == nil {
return false
}
target.AddEffect(owner, eff)
return true
}
func damageByPercent(owner, target *input.Input, percent int64) {
if owner == nil || target == nil || percent <= 0 {
return
}
target.Damage(owner, &info.DamageZone{Type: info.DamageType.Percent, Damage: alpacadecimal.NewFromInt(percent)})
}
func damageByFixed(owner, target *input.Input, dmg int64) {
if owner == nil || target == nil || dmg <= 0 {
return
}
target.Damage(owner, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(dmg)})
}
func randomSkillPPZero(target *input.Input, count int) {
zeroRandomSkillPP(target, count)
}
// Effect 1448: 自身体力低于最大体力的1/{0}时造成的伤害提升{1}%
type Effect1448 struct{ node.EffectNode }
func (e *Effect1448) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || e.Ctx().Our.CurrentPet == nil {
return true
}
maxHP := e.Ctx().Our.CurrentPet.GetMaxHP()
curHP := e.Ctx().Our.CurrentPet.GetHP()
if curHP.Mul(e.Args()[0]).Cmp(maxHP) >= 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1])).Div(hundred)
return true
}
// Effect 1449: {0}回合内对手无法通过自身技能恢复体力且受到原本恢复量1/{1}的百分比伤害
type Effect1449 struct{ node.EffectNode }
func (e *Effect1449) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1449, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1449Sub struct {
RoundEffectArg0Base
}
func (e *Effect1449Sub) Heal_Pre(_ action.BattleActionI, amount *int) bool {
if amount == nil || len(e.Args()) < 2 {
return true
}
damage := alpacadecimal.NewFromInt(int64(*amount)).Div(e.Args()[1])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
*amount = 0
return true
}
// Effect 1450: 吸取对手{0}点体力若对手任意1项技能PP值小于{1}点则吸取效果翻倍
type Effect1450 struct{ node.EffectNode }
func (e *Effect1450) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
drain := e.Args()[0]
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if s.PP < uint32(e.Args()[1].IntPart()) {
drain = drain.Mul(alpacadecimal.NewFromInt(2))
break
}
}
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)
return true
}
// Effect 1451: 若自身体力高于对手则获得{0}点护盾若自身体力低于对手则恢复自身最大体力的1/{1}
type Effect1451 struct{ node.EffectNode }
func (e *Effect1451) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) > 0 {
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 1452: 召唤龙神,使自身下{0}回合获得战之龙魂效果
type Effect1452 struct{ node.EffectNode }
func (e *Effect1452) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1452, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1452Sub struct{ RoundEffectArg0Base }
func (e *Effect1452Sub) 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
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(125)).Div(hundred)
return true
}
// Effect 1453: 召唤龙神,使自身下{0}回合获得御之龙魂效果
type Effect1453 struct{ node.EffectNode }
func (e *Effect1453) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1453, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1453Sub struct{ RoundEffectArg0Base }
func (e *Effect1453Sub) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
zone.Damage = zone.Damage.Mul(hundred).Div(alpacadecimal.NewFromInt(80))
return true
}
// Effect 1454: 1回合做{0}-{1}次攻击,每次攻击有{2}%的概率附加{3}点固定伤害
type Effect1454 struct{ node.EffectNode }
func (e *Effect1454) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 {
return true
}
hits := int(e.Args()[0].IntPart())
if maxHits := int(e.Args()[1].IntPart()); maxHits > hits {
hits += grand.Intn(maxHits - hits + 1)
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(hits)))
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); ok {
zone.Damage = zone.Damage.Add(e.Args()[3])
}
return true
}
// Effect 1455: 1回合做{0}-{1}次攻击,若本回合攻击次数达到最大则八岐大蛇进入暴怒,必定秒杀对手
type Effect1455 struct{ node.EffectNode }
func (e *Effect1455) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
maxHits := int(e.Args()[1].IntPart())
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(maxHits)))
if maxHits > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Opp.CurrentPet.GetHP()})
}
return true
}
// Effect 1456: 消耗自身全部体力使对手受到自身最大体力1/{0}的百分比伤害,同时使自身下只出场精灵前{1}回合免疫受到的攻击伤害
type Effect1456 struct{ node.EffectNode }
func (e *Effect1456) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
maxHP := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: maxHP.Div(e.Args()[0])})
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1456, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1456Sub struct{ RoundEffectArg0Base }
func (e *Effect1456Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 1457: {0}回合内攻击技能{1}%令对手{2},未触发则使对手随机{3}项技能PP值归零
type Effect1457 struct{ node.EffectNode }
func (e *Effect1457) OnSkill() bool {
if len(e.Args()) < 4 || 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 {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
return true
}
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[3].IntPart()))
return true
}
// Effect 1458: {0}回合内每回合{1}%对手属性技能无效,未触发则{2}%令对手{3}
type Effect1458 struct{ node.EffectNode }
func (e *Effect1458) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1458, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1458Sub struct{ RoundEffectArg0Base }
func (e *Effect1458Sub) SkillHit_ex() bool {
if 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 {
e.Ctx().SkillEntity.XML.MustHit = 1
return true
}
if len(e.Args()) >= 4 {
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
}
}
return true
}
// Effect 1459: 先出手时{0}%令对手{1},未触发则对手{2}回合属性技能无效
type Effect1459 struct{ node.EffectNode }
func (e *Effect1459) ActionStart(a, b *action.SelectSkillAction) bool {
if !e.IsFirst() || len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1459, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1459Sub struct{ RoundEffectArg0Base }
func (e *Effect1459Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 1460: 附加{0}值{1}的{2}%的百分比伤害,先出手时附加效果翻倍
type Effect1460 struct{ node.EffectNode }
func (e *Effect1460) DamageAdd(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 3 {
return true
}
bonus := e.Args()[1].Mul(e.Args()[2]).Div(hundred)
if e.IsFirst() {
bonus = bonus.Mul(alpacadecimal.NewFromInt(2))
}
zone.Damage = zone.Damage.Add(bonus)
return true
}
// Effect 1461: 恢复自身最大体力的1/{0},体力低于对手时附加等量百分比伤害
type Effect1461 struct{ node.EffectNode }
func (e *Effect1461) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
}
return true
}
// Effect 1462: {0}回合内每回合使用技能附加{1}点固定伤害,附加时若自身不处于能力提升状态则固定伤害翻倍
type Effect1462 struct{ node.EffectNode }
func (e *Effect1462) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1462, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1462Sub struct{ RoundEffectArg0Base }
func (e *Effect1462Sub) DamageAdd(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 2 {
return true
}
bonus := e.Args()[1]
boosted := false
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
boosted = true
break
}
}
if !boosted {
bonus = bonus.Mul(alpacadecimal.NewFromInt(2))
}
zone.Damage = zone.Damage.Add(bonus)
return true
}
// Effect 1463: 先出手时本回合自身下次死亡时恢复全部体力并解除自身的异常状态和能力下降状态
type Effect1463 struct{ node.EffectNode }
func (e *Effect1463) ActionStart(a, b *action.SelectSkillAction) bool {
if !e.IsFirst() {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1463)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1463Sub struct{ FixedDuration1Base }
func (e *Effect1463Sub) DamageLock(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(zone.Damage) > 0 {
return true
}
zone.Damage = alpacadecimal.Zero
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
// Effect 1464: 当回合攻击击败对手时,若对手处于{0}状态则{1}%的概率令对手下1只出场精灵进入{2}状态
type Effect1464 struct{ node.EffectNode }
func (e *Effect1464) OnSkill() bool {
if e.Ctx().Opp.CurrentPet.Info.Hp > 0 || len(e.Args()) < 3 {
return true
}
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1465: 先出手时50%的概率打出致命一击,未触发则令对手全属性-{0}
type Effect1465 struct{ node.EffectNode }
func (e *Effect1465) ActionStart(a, b *action.SelectSkillAction) bool {
if !e.IsFirst() || len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(50, 100); ok {
if e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.CritRate = 16
}
return true
}
for i := range e.Ctx().Opp.Prop[:] {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(-e.Args()[0].IntPart()))
}
return true
}
// Effect 1466: {0}回合内若对手攻击技能未命中则{1}%令对手{2}
type Effect1466 struct{ node.EffectNode }
func (e *Effect1466) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1466, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1466Sub struct{ RoundEffectArg0Base }
func (e *Effect1466Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 || len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1467: 随机使自身{0}项能力值+{1},先出手时提升效果翻倍
type Effect1467 struct{ node.EffectNode }
func (e *Effect1467) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
boost := int(e.Args()[1].IntPart())
if e.IsFirst() {
boost *= 2
}
count := int(e.Args()[0].IntPart())
if count <= 0 {
return true
}
indexes := grand.Perm(6)
for i := 0; i < count && i < len(indexes); i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(indexes[i]), int8(boost))
}
return true
}
// Effect 1468: 消除双方能力提升状态、能力下降状态和护盾效果,消除任意一项成功则附加{0}点固定伤害且令对手随机{1}个技能PP值归零
type Effect1468 struct{ node.EffectNode }
func (e *Effect1468) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
triggered := false
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
for _, eff := range target.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
triggered = true
}
}
}
if triggered {
damageByFixed(e.Ctx().Our, e.Ctx().Opp, e.Args()[0].IntPart())
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1469: {0}回合内自身造成的固定伤害、百分比伤害提升{1}%
type Effect1469 struct{ node.EffectNode }
func (e *Effect1469) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1469, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1469Sub struct{ RoundEffectArg0Base }
func (e *Effect1469Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 2 || (zone.Type != info.DamageType.Fixed && zone.Type != info.DamageType.Percent) {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1])).Div(hundred)
return true
}
// Effect 1470: 自身天赋值越高则技能威力越大
type Effect1470 struct{ node.EffectNode }
func (e *Effect1470) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.Power += int(e.Ctx().Our.CurrentPet.Info.Dv)
return true
}
// Effect 1471: 消除对手能力提升状态,消除成功则{0}%令对手{1}未触发则恢复自身最大体力的1/{2}
type Effect1471 struct{ node.EffectNode }
func (e *Effect1471) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
removed := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
removed = true
}
}
if removed {
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 1472: 自身处于能力提升状态时造成的伤害提升{0}%,先出手时效果翻倍
type Effect1472 struct{ node.EffectNode }
func (e *Effect1472) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
boosted := false
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
boosted = true
break
}
}
if !boosted {
return true
}
percent := e.Args()[0]
if e.IsFirst() {
percent = percent.Mul(alpacadecimal.NewFromInt(2))
}
zone.Damage = zone.Damage.Mul(hundred.Add(percent)).Div(hundred)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1448, &Effect1448{})
input.InitEffect(input.EffectType.Skill, 1449, &Effect1449{})
input.InitEffect(input.EffectType.Sub, 1449, &Effect1449Sub{})
input.InitEffect(input.EffectType.Skill, 1450, &Effect1450{})
input.InitEffect(input.EffectType.Skill, 1451, &Effect1451{})
input.InitEffect(input.EffectType.Skill, 1452, &Effect1452{})
input.InitEffect(input.EffectType.Sub, 1452, &Effect1452Sub{})
input.InitEffect(input.EffectType.Skill, 1453, &Effect1453{})
input.InitEffect(input.EffectType.Sub, 1453, &Effect1453Sub{})
input.InitEffect(input.EffectType.Skill, 1454, &Effect1454{})
input.InitEffect(input.EffectType.Skill, 1455, &Effect1455{})
input.InitEffect(input.EffectType.Skill, 1456, &Effect1456{})
input.InitEffect(input.EffectType.Sub, 1456, &Effect1456Sub{})
input.InitEffect(input.EffectType.Skill, 1457, &Effect1457{})
input.InitEffect(input.EffectType.Skill, 1458, &Effect1458{})
input.InitEffect(input.EffectType.Sub, 1458, &Effect1458Sub{})
input.InitEffect(input.EffectType.Skill, 1459, &Effect1459{})
input.InitEffect(input.EffectType.Sub, 1459, &Effect1459Sub{})
input.InitEffect(input.EffectType.Skill, 1460, &Effect1460{})
input.InitEffect(input.EffectType.Skill, 1461, &Effect1461{})
input.InitEffect(input.EffectType.Skill, 1462, &Effect1462{})
input.InitEffect(input.EffectType.Sub, 1462, &Effect1462Sub{})
input.InitEffect(input.EffectType.Skill, 1463, &Effect1463{})
input.InitEffect(input.EffectType.Sub, 1463, &Effect1463Sub{})
input.InitEffect(input.EffectType.Skill, 1464, &Effect1464{})
input.InitEffect(input.EffectType.Skill, 1465, &Effect1465{})
input.InitEffect(input.EffectType.Skill, 1466, &Effect1466{})
input.InitEffect(input.EffectType.Sub, 1466, &Effect1466Sub{})
input.InitEffect(input.EffectType.Skill, 1467, &Effect1467{})
input.InitEffect(input.EffectType.Skill, 1468, &Effect1468{})
input.InitEffect(input.EffectType.Skill, 1469, &Effect1469{})
input.InitEffect(input.EffectType.Sub, 1469, &Effect1469Sub{})
input.InitEffect(input.EffectType.Skill, 1470, &Effect1470{})
input.InitEffect(input.EffectType.Skill, 1471, &Effect1471{})
input.InitEffect(input.EffectType.Skill, 1472, &Effect1472{})
}

View File

@@ -0,0 +1,570 @@
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 1473: 消除对手所有护盾效果,消除成功则令对手随机{0}个技能PP值归零
type Effect1473 struct{ node.EffectNode }
func (e *Effect1473) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff == nil || !eff.Alive() {
continue
}
eff.Alive(false)
cleared = true
}
if cleared {
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[0].IntPart()))
}
return true
}
// Effect 1474: {0}回合内若自身能力提升状态被消除每消除1项则附加{1}点固定伤害
type Effect1474 struct{ node.EffectNode }
func (e *Effect1474) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1474, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1474Sub struct {
RoundEffectArg0Base
removed int
}
func (e *Effect1474Sub) PropBefer(in *input.Input, prop, level int8) bool {
if in != e.Ctx().Our || level >= 0 {
return true
}
e.removed++
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[1],
})
return true
}
// Effect 1475: {0}回合内自身受到的固定伤害和百分比伤害减少{1}%
type Effect1475 struct{ node.EffectNode }
func (e *Effect1475) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1475, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1475Sub struct{ RoundEffectArg0Base }
func (e *Effect1475Sub) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 2 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[1])).Div(hundred)
return true
}
// Effect 1476: 使对手全属性-{0}自身体力低于1/{1}时弱化效果翻倍
type Effect1476 struct{ node.EffectNode }
func (e *Effect1476) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
delta := int8(-e.Args()[0].IntPart())
if e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[1]).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
delta *= 2
}
for i := range e.Ctx().Opp.Prop[:] {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), delta)
}
return true
}
// Effect 1477: 消除敌我双方能力提升状态消除任意一方成功则吸取对手最大体力的1/{0}
type Effect1477 struct{ node.EffectNode }
func (e *Effect1477) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
for _, eff := range target.Effects {
if eff == nil || !eff.Alive() {
continue
}
eff.Alive(false)
cleared = true
}
}
if cleared {
drain := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
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)
}
return true
}
// Effect 1478: 下{0}回合令对手无法主动切换精灵
type Effect1478 struct{ node.EffectNode }
func (e *Effect1478) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1478, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1478Sub struct{ RoundEffectArg0Base }
func (e *Effect1478Sub) SwitchOut(in *input.Input) bool {
if in == e.Ctx().Opp {
e.Alive(false)
}
return true
}
// Effect 1479: 牺牲自己,消除对手能力提升状态、回合类效果、护盾效果、护罩效果、神耀能量、自然祝福,同时令对手{0}回合内属性技能无效
type Effect1479 struct{ node.EffectNode }
func (e *Effect1479) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1479, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1479Sub struct{ RoundEffectArg0Base }
func (e *Effect1479Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 1480: 附加{0}点固定伤害,每次使用额外附加{1}点,最高{2}点
type Effect1480 struct {
node.EffectNode
extra int64
}
func (e *Effect1480) DamageAdd(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 3 {
return true
}
base := e.Args()[0]
add := base.Add(alpacadecimal.NewFromInt(e.extra))
max := e.Args()[2]
if add.Cmp(max) > 0 {
add = max
}
zone.Damage = zone.Damage.Add(add)
e.extra += int64(e.Args()[1].IntPart())
return true
}
// Effect 1481: {0}%的概率造成伤害翻倍,对手处于能力下降状态时概率翻倍
type Effect1481 struct{ node.EffectNode }
func (e *Effect1481) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
for _, v := range e.Ctx().Opp.Prop[:] {
if v < 0 {
chance *= 2
break
}
}
if chance > 100 {
chance = 100
}
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1482: {0}%令对手{1},未触发则吸取对手能力提升状态
type Effect1482 struct{ node.EffectNode }
func (e *Effect1482) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
}
}
return true
}
// Effect 1483: 本回合打出致命一击则令对手{0}回合属性技能无效
type Effect1483 struct{ node.EffectNode }
func (e *Effect1483) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1483Sub struct{ RoundEffectArg0Base }
func (e *Effect1483Sub) Skill_Use() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Crit > 0 {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1483, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
func (e *Effect1483Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 1484: 体力低于最大体力的1/2时先制+1
type Effect1484 struct{ node.EffectNode }
func (e *Effect1484) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().Our.CurrentPet.GetHP().Mul(alpacadecimal.NewFromInt(2)).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1485: 对手处于能力提升状态则命中后{0}%令对手{1},未触发则{2}%令对手{3}
type Effect1485 struct{ node.EffectNode }
func (e *Effect1485) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
boosted := false
for _, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
boosted = true
break
}
}
if !boosted {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
}
return true
}
// Effect 1486: {0}%的概率造成伤害翻倍,自身处于护盾状态时概率翻倍
type Effect1486 struct{ node.EffectNode }
func (e *Effect1486) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if e.Ctx().Our.HasShield() {
chance *= 2
}
if chance > 100 {
chance = 100
}
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1487: 自身处于护盾状态下先制+1
type Effect1487 struct{ node.EffectNode }
func (e *Effect1487) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.Ctx().Our.HasShield() {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1488: 遇到天敌时{0}%令对手{1}
type Effect1488 struct{ node.EffectNode }
func (e *Effect1488) OnSkill() bool {
if !e.ISNaturalEnemy() || len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1489: 若对手为自身天敌则{0}%令对手{1},未触发则令自身{2}回合内{3}%闪避对手攻击
type Effect1489 struct{ node.EffectNode }
func (e *Effect1489) OnSkill() bool {
if len(e.Args()) < 4 || !e.ISNaturalEnemy() {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1489, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1489Sub struct{ RoundEffectArg0Base }
func (e *Effect1489Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[3].IntPart()), 100); ok {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 1490: 若对手为自身天敌则{0}%令对手{1},未触发则对手{2}回合内属性技能命中效果失效
type Effect1490 struct{ node.EffectNode }
func (e *Effect1490) OnSkill() bool {
if len(e.Args()) < 3 || !e.ISNaturalEnemy() {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1490, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1490Sub struct{ RoundEffectArg0Base }
func (e *Effect1490Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 1491: 遇到天敌时先制+1
type Effect1491 struct{ node.EffectNode }
func (e *Effect1491) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.ISNaturalEnemy() {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1492: 对手处于能力下降状态时随机附加{0}种异常状态
type Effect1492 struct{ node.EffectNode }
func (e *Effect1492) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
down := false
for _, v := range e.Ctx().Opp.Prop[:] {
if v < 0 {
down = true
break
}
}
if !down {
return true
}
applyRandomStatuses1507(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1493: 消耗自身所有体力令自身下只登场精灵3回合内免疫异常状态若自身下只登场精灵为月照星魂则转变为5回合
type Effect1493 struct{ node.EffectNode }
func (e *Effect1493) Skill_Use() bool {
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1493)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1493Sub struct{ node.EffectNode }
func (e *Effect1493Sub) SwitchIn(in *input.Input) bool {
if in != e.Ctx().Our {
return true
}
e.Duration(3)
return true
}
// Effect 1494: 自身满体力时{0}%令对手随机{1}个技能PP值归零
type Effect1494 struct{ node.EffectNode }
func (e *Effect1494) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) != 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1495: 反转对手能力提升状态,反转成功则{0}%令对手随机{1}个技能PP值归零
type Effect1495 struct{ node.EffectNode }
func (e *Effect1495) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
swapped := false
for _, i := range e.Ctx().Opp.Prop[:] {
if i > 0 {
swapped = true
break
}
}
if !swapped {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
randomSkillPPZero(e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1496: 消耗自身全部体力,使自身下只出场精灵获得{0}点的护盾且{1}回合内每回合结束时恢复{2}点体力
type Effect1496 struct{ node.EffectNode }
func (e *Effect1496) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
e.Ctx().Our.AddShield(e.Args()[0])
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1496, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1496Sub struct{ RoundEffectArg0Base }
func (e *Effect1496Sub) TurnEnd() {
if len(e.Args()) >= 3 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[2])
}
e.EffectNode.TurnEnd()
}
// Effect 1497: 恢复自身n点体力n=双方当前护盾值总和)
type Effect1497 struct{ node.EffectNode }
func (e *Effect1497) Skill_Use() bool {
heal := e.Ctx().Our.CurrentShield().Add(e.Ctx().Opp.CurrentShield())
if heal.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1473, &Effect1473{})
input.InitEffect(input.EffectType.Skill, 1474, &Effect1474{})
input.InitEffect(input.EffectType.Sub, 1474, &Effect1474Sub{})
input.InitEffect(input.EffectType.Skill, 1475, &Effect1475{})
input.InitEffect(input.EffectType.Sub, 1475, &Effect1475Sub{})
input.InitEffect(input.EffectType.Skill, 1476, &Effect1476{})
input.InitEffect(input.EffectType.Skill, 1477, &Effect1477{})
input.InitEffect(input.EffectType.Skill, 1478, &Effect1478{})
input.InitEffect(input.EffectType.Sub, 1478, &Effect1478Sub{})
input.InitEffect(input.EffectType.Skill, 1479, &Effect1479{})
input.InitEffect(input.EffectType.Sub, 1479, &Effect1479Sub{})
input.InitEffect(input.EffectType.Skill, 1480, &Effect1480{})
input.InitEffect(input.EffectType.Skill, 1481, &Effect1481{})
input.InitEffect(input.EffectType.Skill, 1482, &Effect1482{})
input.InitEffect(input.EffectType.Skill, 1483, &Effect1483{})
input.InitEffect(input.EffectType.Sub, 1483, &Effect1483Sub{})
input.InitEffect(input.EffectType.Skill, 1484, &Effect1484{})
input.InitEffect(input.EffectType.Skill, 1485, &Effect1485{})
input.InitEffect(input.EffectType.Skill, 1486, &Effect1486{})
input.InitEffect(input.EffectType.Skill, 1487, &Effect1487{})
input.InitEffect(input.EffectType.Skill, 1488, &Effect1488{})
input.InitEffect(input.EffectType.Skill, 1489, &Effect1489{})
input.InitEffect(input.EffectType.Sub, 1489, &Effect1489Sub{})
input.InitEffect(input.EffectType.Skill, 1490, &Effect1490{})
input.InitEffect(input.EffectType.Sub, 1490, &Effect1490Sub{})
input.InitEffect(input.EffectType.Skill, 1491, &Effect1491{})
input.InitEffect(input.EffectType.Skill, 1492, &Effect1492{})
input.InitEffect(input.EffectType.Skill, 1493, &Effect1493{})
input.InitEffect(input.EffectType.Sub, 1493, &Effect1493Sub{})
input.InitEffect(input.EffectType.Skill, 1494, &Effect1494{})
input.InitEffect(input.EffectType.Skill, 1495, &Effect1495{})
input.InitEffect(input.EffectType.Skill, 1496, &Effect1496{})
input.InitEffect(input.EffectType.Sub, 1496, &Effect1496Sub{})
input.InitEffect(input.EffectType.Skill, 1497, &Effect1497{})
}

View File

@@ -0,0 +1,415 @@
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 clearOwnDownProps(target *input.Input) {
for i, v := range target.Prop[:] {
if v < 0 {
target.SetProp(target, int8(i), 0)
}
}
}
func addPercentDamageToOpp(e *node.EffectNode, percent alpacadecimal.Decimal) {
if percent.Cmp(alpacadecimal.Zero) <= 0 {
return
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
// Effect 1695: 每回合使用技能恢复自身最大体力的1/{1}并造成等量百分比伤害,若自身满体力则改为附加自身最大体力/{2}的百分比伤害
type Effect1695 struct {
node.EffectNode
}
func (e *Effect1695) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
addPercentDamageToOpp(&e.EffectNode, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2]))
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
addPercentDamageToOpp(&e.EffectNode, alpacadecimal.NewFromInt(100).Mul(heal).Div(e.Ctx().Our.CurrentPet.GetMaxHP()))
return true
}
// Effect 1696: 对手不存在致命裂痕则令对手随机{0}个技能PP值归零
type Effect1696 struct {
node.EffectNode
}
func (e *Effect1696) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1697: 附加自身最大体力{0}%的百分比伤害,若对手免疫百分比伤害则额外附加等量的真实伤害
type Effect1697 struct {
node.EffectNode
}
func (e *Effect1697) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
percent := e.Args()[0]
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
before := e.Ctx().Opp.CurrentPet.GetHP()
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(before) == 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: damage})
}
return true
}
// Effect 1698: 消耗自身全部体力,{0}%令对手{1},未触发则附加自身最大体力/{2}的百分比伤害且{3}回合内对手无法通过技能恢复体力
type Effect1698 struct {
node.EffectNode
}
func (e *Effect1698) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, -1)
return true
}
addPercentDamageToOpp(&e.EffectNode, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2]))
return true
}
// Effect 1699: 水之力量觉醒,使自身下一次攻击获得夸张之潮效果
type Effect1699 struct {
node.EffectNode
}
func (e *Effect1699) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.SetProp(e.Ctx().Our, 5, int8(e.Args()[0].IntPart()))
return true
}
// Effect 1700: 清除自身能力下降状态,清除成功则自身免疫下{0}次受到的异常状态
type Effect1700 struct {
node.EffectNode
immune int
}
func (e *Effect1700) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearOwnDownProps(e.Ctx().Our)
e.immune = int(e.Args()[0].IntPart())
return true
}
func (e *Effect1700) Skill_Use_ex() bool {
if e.immune > 0 {
e.immune--
}
return true
}
// Effect 1701: {0}%的概率造成的伤害翻倍,若后出手则概率翻倍
type Effect1701 struct {
node.EffectNode
}
func (e *Effect1701) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 2 {
chance *= 2
}
ok, _, _ := e.Input.Player.Roll(chance, 100)
if ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1702: 自身主动切换下场后令己方下只精灵出战时恢复{0}点体力
type Effect1702 struct {
node.EffectNode
}
func (e *Effect1702) SwitchOut(in *input.Input) bool {
return true
}
func (e *Effect1702) TurnStart(fattack, sattack *action.SelectSkillAction) {
if len(e.Args()) == 0 {
return
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
e.EffectNode.TurnEnd()
}
// Effect 1703: 使用技能{0}%不消耗PP值
type Effect1703 struct {
node.EffectNode
}
func (e *Effect1703) HookPP(count *int) bool {
if len(e.Args()) == 0 || count == nil {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
*count = 0
}
return true
}
// Effect 1704: {0}%降低对手所有PP值
type Effect1704 struct {
node.EffectNode
}
func (e *Effect1704) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.DelPP(1)
}
return true
}
// Effect 1705: {0}%恢复自身所有PP值
type Effect1705 struct {
node.EffectNode
}
func (e *Effect1705) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Our.HealPP(-1)
}
return true
}
// Effect 1706: 命中后造成的攻击伤害为0时吸取对手最大体力的{0}%
type Effect1706 struct {
node.EffectNode
}
func (e *Effect1706) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addPercentDamageToOpp(&e.EffectNode, e.Args()[0])
return true
}
// Effect 1707: 本次攻击克制对手时伤害提升{0}%
type Effect1707 struct {
node.EffectNode
}
func (e *Effect1707) SkillHit() bool {
if len(e.Args()) == 0 || !e.ISNaturalEnemy() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 1708: 出手时本回合若未受到伤害则对手下{0}回合先制-{1}
type Effect1708 struct {
node.EffectNode
touched bool
}
func (e *Effect1708) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Damage.Cmp(alpacadecimal.Zero) > 0 {
e.touched = true
}
return true
}
func (e *Effect1708) TurnEnd() {
if len(e.Args()) >= 2 && !e.touched {
e.Ctx().Opp.SetProp(e.Ctx().Our, 5, -int8(e.Args()[1].IntPart()))
}
e.touched = false
e.EffectNode.TurnEnd()
}
// Effect 1709: 附加对手最大体力1/{0}的百分比伤害,未击败对手则恢复自身等量体力
type Effect1709 struct {
node.EffectNode
}
func (e *Effect1709) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
before := e.Ctx().Opp.CurrentPet.GetHP()
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(before) == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 1710: {0}%概率造成伤害翻倍,对手不处于异常状态时概率翻倍
type Effect1710 struct {
node.EffectNode
}
func (e *Effect1710) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if !e.Ctx().Opp.StatEffect_Exist_all() {
chance *= 2
}
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1711: 清除自身能力下降状态,清除成功则自身免疫下{0}%对手的{1}
type Effect1711 struct {
node.EffectNode
}
func (e *Effect1711) OnSkill() bool {
clearOwnDownProps(e.Ctx().Our)
return true
}
// Effect 1712: 本次攻击对微弱对手时克制关系变为普通
type Effect1712 struct{ node.EffectNode }
func (e *Effect1712) SkillHit() bool { return true }
// Effect 1713: 本次攻击对微弱对手时50%克制关系变为普通
type Effect1713 struct{ node.EffectNode }
func (e *Effect1713) SkillHit() bool { return true }
// Effect 1714: 本次攻击对微弱对手时5%克制关系变为普通
type Effect1714 struct{ node.EffectNode }
func (e *Effect1714) SkillHit() bool { return true }
// Effect 1715: 本次攻击对微弱对手时0%克制关系变为普通
type Effect1715 struct{ node.EffectNode }
func (e *Effect1715) SkillHit() bool { return true }
// Effect 1716: 本次攻击对微弱对手时5%克制关系变为普通
type Effect1716 struct{ node.EffectNode }
func (e *Effect1716) SkillHit() bool { return true }
// Effect 1717: {0}回合内若对手使用属性技能,则对手下{1}回合攻击伤害减少{2}点
type Effect1717 struct {
RoundEffectArg0Base
}
func (e *Effect1717) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().Opp.SetProp(e.Ctx().Our, 5, -int8(e.Args()[2].IntPart()))
}
return true
}
// Effect 1718: 后出手时造成的攻击伤害提升{0}%,若对手当前体力高于自身则伤害额外提升{1}%
type Effect1718 struct {
node.EffectNode
}
func (e *Effect1718) SkillHit() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 2 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[1])
}
}
return true
}
// Effect 1719: 击败对手则下{0}回合自身造成的攻击伤害提升{1}%,若以致命一击击败对手则伤害再提升{2}%
type Effect1719 struct {
node.EffectNode
}
func (e *Effect1719) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
e.Ctx().Our.SetProp(e.Ctx().Our, 0, int8(e.Args()[1].IntPart()))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1695, &Effect1695{})
input.InitEffect(input.EffectType.Skill, 1696, &Effect1696{})
input.InitEffect(input.EffectType.Skill, 1697, &Effect1697{})
input.InitEffect(input.EffectType.Skill, 1698, &Effect1698{})
input.InitEffect(input.EffectType.Skill, 1699, &Effect1699{})
input.InitEffect(input.EffectType.Skill, 1700, &Effect1700{})
input.InitEffect(input.EffectType.Skill, 1701, &Effect1701{})
input.InitEffect(input.EffectType.Skill, 1702, &Effect1702{})
input.InitEffect(input.EffectType.Skill, 1703, &Effect1703{})
input.InitEffect(input.EffectType.Skill, 1704, &Effect1704{})
input.InitEffect(input.EffectType.Skill, 1705, &Effect1705{})
input.InitEffect(input.EffectType.Skill, 1706, &Effect1706{})
input.InitEffect(input.EffectType.Skill, 1707, &Effect1707{})
input.InitEffect(input.EffectType.Skill, 1708, &Effect1708{})
input.InitEffect(input.EffectType.Skill, 1709, &Effect1709{})
input.InitEffect(input.EffectType.Skill, 1710, &Effect1710{})
input.InitEffect(input.EffectType.Skill, 1711, &Effect1711{})
input.InitEffect(input.EffectType.Skill, 1712, &Effect1712{})
input.InitEffect(input.EffectType.Skill, 1713, &Effect1713{})
input.InitEffect(input.EffectType.Skill, 1714, &Effect1714{})
input.InitEffect(input.EffectType.Skill, 1715, &Effect1715{})
input.InitEffect(input.EffectType.Skill, 1716, &Effect1716{})
input.InitEffect(input.EffectType.Skill, 1717, &Effect1717{})
input.InitEffect(input.EffectType.Skill, 1718, &Effect1718{})
input.InitEffect(input.EffectType.Skill, 1719, &Effect1719{})
}

View File

@@ -0,0 +1,712 @@
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 1720: 对手存在护盾则附加对手护盾{0}%的真实伤害
type Effect1720 struct {
node.EffectNode
}
func (e *Effect1720) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentShield().Mul(e.Args()[0]).Div(hundred)
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: damage})
}
return true
}
// Effect 1721: 对手不存在护盾则令自身下{0}次攻击造成的伤害翻倍
type Effect1721 struct {
node.EffectNode
}
func (e *Effect1721) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1721, int(e.Args()[0].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1721Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1721Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1721Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1722: 未打出致命一击则自身下{0}回合攻击技能额外先制+{1}
type Effect1722 struct {
node.EffectNode
}
func (e *Effect1722) Skill_Use() bool {
skill := e.Ctx().SkillEntity
if skill == nil || skill.Category() == info.Category.STATUS || skill.AttackTime == 0 || skill.Crit != 0 || len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1722, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1722Sub struct {
node.EffectNode
remaining int
priority int
}
func (e *Effect1722Sub) 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.priority = a[1]
}
}
func (e *Effect1722Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += e.priority
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1723: 吸取对手{0}点体力,对手≥{1}项技能PP值为零时额外吸取{2}点体力
type Effect1723 struct {
node.EffectNode
}
func (e *Effect1723) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
drain := e.Args()[0]
zeroCount := 0
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if s.PP == 0 {
zeroCount++
}
}
if zeroCount >= int(e.Args()[1].IntPart()) {
drain = drain.Add(e.Args()[2])
}
if drain.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
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)
return true
}
// Effect 1724: {0}%秒杀对手,技能无效时消耗自身全部体力且对手下{1}回合先制-{2}
type Effect1724 struct {
node.EffectNode
}
func (e *Effect1724) DamageFloor(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
zone.Damage = e.Ctx().Opp.CurrentPet.GetHP()
}
return true
}
func (e *Effect1724) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
e.Ctx().Our.CurrentPet.Info.Hp = 0
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1724, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
type Effect1724Sub struct {
node.EffectNode
remaining int
priority int
}
func (e *Effect1724Sub) 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.priority = a[1]
}
}
func (e *Effect1724Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority -= e.priority
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1725: 附加对手上回合造成攻击伤害{0}%的百分比伤害,后出手时效果提升{1}%
type Effect1725 struct {
node.EffectNode
}
func (e *Effect1725) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().Opp.SumDamage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
percent := e.Args()[0]
if !e.IsFirst() {
percent = percent.Add(e.Args()[1])
}
damage := e.Ctx().Opp.SumDamage.Mul(percent).Div(hundred)
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
// Effect 1726: 吸取对手能力提升状态,吸取成功则下{0}回合对手所有技能先制+{1},若对手不处于能力提升状态则令对手全属性-{2}
type Effect1726 struct {
node.EffectNode
}
func (e *Effect1726) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if cleared {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1726, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[2].IntPart()))
return true
}
type Effect1726Sub struct {
node.EffectNode
remaining int
priority int
}
func (e *Effect1726Sub) 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.priority = a[1]
}
}
func (e *Effect1726Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += e.priority
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1727: {0}%令对手{1},未触发则免疫下{2}次所受攻击伤害并反弹{3}%的百分比伤害
type Effect1727 struct {
node.EffectNode
}
func (e *Effect1727) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1727, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1727Sub struct {
node.EffectNode
remaining int
percent alpacadecimal.Decimal
}
func (e *Effect1727Sub) 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 = alpacadecimal.NewFromInt(int64(a[1]))
}
}
func (e *Effect1727Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
rebound := zone.Damage.Mul(e.percent).Div(hundred)
zone.Damage = alpacadecimal.Zero
if rebound.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: rebound})
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1728: {0}%的概率造成的攻击伤害翻倍,未触发则令自身全属性+{1}
type Effect1728 struct {
node.EffectNode
}
func (e *Effect1728) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
} else {
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[1].IntPart()))
}
}
return true
}
// Effect 1729: 命中后{0}%概率造成2倍伤害未触发则战斗结束后随机获得1000-10000泰坦之灵
type Effect1729 struct {
node.EffectNode
}
func (e *Effect1729) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1730: 奇数/偶数分别按不同百分比对对手造成伤害
type Effect1730 struct {
node.EffectNode
}
func (e *Effect1730) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
percent := e.Args()[0]
if e.Ctx().Our.SumDamage.IntPart()%2 == 0 {
percent = e.Args()[2]
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(hundred)
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
// Effect 1731: {0}回合内每回合结束后若双方任意一方处于异常状态或能力下降状态则令对手受固定伤害且所有技能PP={2}
type Effect1731 struct {
RoundEffectArg0Base
}
func (e *Effect1731) TurnEnd() {
if len(e.Args()) < 3 {
return
}
if !e.Ctx().Our.StatEffect_Exist_all() && !e.Ctx().Opp.StatEffect_Exist_all() && !e.Ctx().Our.HasPropSub() && !e.Ctx().Opp.HasPropSub() {
return
}
damageByFixed(e.Ctx().Our, e.Ctx().Opp, e.Args()[1].IntPart())
e.Ctx().Opp.HealPP(int(e.Args()[2].IntPart()))
}
// Effect 1732: 激发古渊灵鱼全部的力量,{0}回合做{1}-{2}次攻击
type Effect1732 struct {
node.EffectNode
}
func (e *Effect1732) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
hits := int(e.Args()[0].IntPart())
if hits <= 0 {
return true
}
e.Ctx().SkillEntity.XML.AtkNum = hits
return true
}
// Effect 1733: {0}%的概率造成伤害翻倍自身每有1层逝者亡语概率提升{1}%
type Effect1733 struct {
node.EffectNode
}
func (e *Effect1733) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
chance := int(e.Args()[0].IntPart())
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1734: 消除对手回合类效果,消除成功则对手攻击伤害提升
type Effect1734 struct {
node.EffectNode
}
func (e *Effect1734) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if !cleared {
return true
}
e.Ctx().Opp.AddEffect(e.Ctx().Our, e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1734, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart())))
return true
}
type Effect1734Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1734Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1734Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(alpacadecimal.NewFromInt(10))).Div(hundred)
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1735: 击败对手时若自身当前逝者亡语层数大于等于{0}层则免疫下{1}次受到的攻击
type Effect1735 struct {
node.EffectNode
}
func (e *Effect1735) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp <= 0 {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp < e.Ctx().Opp.CurrentPet.Info.Hp {
return true
}
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 1736: 后出手时令对手当回合使用的技能PP值额外消耗
type Effect1736 struct{ node.EffectNode }
func (e *Effect1736) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
return true
}
// Effect 1737: 附加自身已损失PP值总和x{0}的固定伤害
type Effect1737 struct{ node.EffectNode }
func (e *Effect1737) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
lost := 0
for _, s := range e.Ctx().Our.CurrentPet.Info.SkillList {
lost += int(s.PP)
}
if lost <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.NewFromInt(int64(lost)).Mul(e.Args()[0]),
})
return true
}
// Effect 1738: 消除双方回合类效果、能力提升效果
type Effect1738 struct{ node.EffectNode }
func (e *Effect1738) Skill_Use() bool {
cleared := false
for _, eff := range e.Ctx().Our.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if !cleared || len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1739: 复合护罩联动
type Effect1739 struct{ node.EffectNode }
func (e *Effect1739) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
for _, eff := range e.Ctx().Our.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
}
}
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
}
}
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
e.Ctx().Opp.HealPP(-int(e.Args()[2].IntPart()))
if e.Ctx().Our.CurrentPet.Info.Hp > 0 {
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[3])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
}
return true
}
// Effect 1740: 自身每有1项非第五技能PP值不满附加{0}点固定伤害对手免疫固定伤害时额外附加100点真实伤害
type Effect1740 struct{ node.EffectNode }
func (e *Effect1740) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
count := 0
for i, s := range e.Ctx().Our.CurrentPet.Info.SkillList {
if i == 4 {
continue
}
if s.PP < 1 {
count++
}
}
if count <= 0 {
return true
}
damageByFixed(e.Ctx().Our, e.Ctx().Opp, int64(count)*e.Args()[0].IntPart())
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: alpacadecimal.NewFromInt(100)})
return true
}
// Effect 1741: 自身处于封印属性技能状态时造成的伤害提升
type Effect1741 struct{ node.EffectNode }
func (e *Effect1741) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if !e.Ctx().Our.StatEffect_Exist_all() {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
// Effect 1742: 对手处于封印属性技能状态时{0}%令对手{1}
type Effect1742 struct{ node.EffectNode }
func (e *Effect1742) OnSkill() bool {
if len(e.Args()) < 2 || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1743: 若对手当前精灵携带技能石则降低对手所有技能PP值并恢复自身所有技能PP值
type Effect1743 struct{ node.EffectNode }
func (e *Effect1743) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if len(e.Ctx().Opp.CurrentPet.Info.EffectInfo) == 0 {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
e.Ctx().Our.HealPP(int(e.Args()[1].IntPart()))
return true
}
// Effect 1744: 若对手当前精灵未携带技能石则造成的攻击伤害提升{0}%
type Effect1744 struct{ node.EffectNode }
func (e *Effect1744) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if len(e.Ctx().Opp.CurrentPet.Info.EffectInfo) > 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1720, &Effect1720{})
input.InitEffect(input.EffectType.Skill, 1721, &Effect1721{})
input.InitEffect(input.EffectType.Sub, 1721, &Effect1721Sub{})
input.InitEffect(input.EffectType.Skill, 1722, &Effect1722{})
input.InitEffect(input.EffectType.Sub, 1722, &Effect1722Sub{})
input.InitEffect(input.EffectType.Skill, 1723, &Effect1723{})
input.InitEffect(input.EffectType.Skill, 1724, &Effect1724{})
input.InitEffect(input.EffectType.Sub, 1724, &Effect1724Sub{})
input.InitEffect(input.EffectType.Skill, 1725, &Effect1725{})
input.InitEffect(input.EffectType.Skill, 1726, &Effect1726{})
input.InitEffect(input.EffectType.Sub, 1726, &Effect1726Sub{})
input.InitEffect(input.EffectType.Skill, 1727, &Effect1727{})
input.InitEffect(input.EffectType.Sub, 1727, &Effect1727Sub{})
input.InitEffect(input.EffectType.Skill, 1728, &Effect1728{})
input.InitEffect(input.EffectType.Skill, 1729, &Effect1729{})
input.InitEffect(input.EffectType.Skill, 1730, &Effect1730{})
input.InitEffect(input.EffectType.Skill, 1731, &Effect1731{})
input.InitEffect(input.EffectType.Skill, 1732, &Effect1732{})
input.InitEffect(input.EffectType.Skill, 1733, &Effect1733{})
input.InitEffect(input.EffectType.Skill, 1734, &Effect1734{})
input.InitEffect(input.EffectType.Sub, 1734, &Effect1734Sub{})
input.InitEffect(input.EffectType.Skill, 1735, &Effect1735{})
input.InitEffect(input.EffectType.Skill, 1736, &Effect1736{})
input.InitEffect(input.EffectType.Skill, 1737, &Effect1737{})
input.InitEffect(input.EffectType.Skill, 1738, &Effect1738{})
input.InitEffect(input.EffectType.Skill, 1739, &Effect1739{})
input.InitEffect(input.EffectType.Skill, 1740, &Effect1740{})
input.InitEffect(input.EffectType.Skill, 1741, &Effect1741{})
input.InitEffect(input.EffectType.Skill, 1742, &Effect1742{})
input.InitEffect(input.EffectType.Skill, 1743, &Effect1743{})
input.InitEffect(input.EffectType.Skill, 1744, &Effect1744{})
}

View File

@@ -0,0 +1,591 @@
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"
)
// Effect 1745: 本回合自身物理攻击伤害提升
type Effect1745 struct {
node.EffectNode
}
func (e *Effect1745) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1])).Div(hundred)
return true
}
// Effect 1746: 本回合自身特殊攻击伤害提升
type Effect1746 struct {
node.EffectNode
}
func (e *Effect1746) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1])).Div(hundred)
return true
}
// Effect 1747: 消除对手回合类效果
type Effect1747 struct {
node.EffectNode
}
func (e *Effect1747) Skill_Use() bool {
// 现有模型里没有统一“清空回合类效果”的专用 API这里只保留一个占位实现。
return true
}
// Effect 1748: 本回合若未打出致命一击则下回合必定致命一击
type Effect1748 struct {
node.EffectNode
}
func (e *Effect1748) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1748, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1748Sub struct {
RoundEffectArg0Base
}
func (e *Effect1748Sub) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
e.Ctx().SkillEntity.XML.MustHit = 1
return true
}
// Effect 1749: 对手每有技能PP为0则增加固定/真实伤害
type Effect1749 struct {
node.EffectNode
}
func (e *Effect1749) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
bonus := 0
for _, skill := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if skill.PP <= 0 {
bonus++
}
}
if bonus <= 0 {
return true
}
zone.Damage = zone.Damage.Add(e.Args()[0].Mul(alpacadecimal.NewFromInt(int64(bonus))))
return true
}
// Effect 1750: 无视自身能力下降状态
type Effect1750 struct {
node.EffectNode
}
func (e *Effect1750) PropBefer(in *input.Input, prop, level int8) bool {
if in == e.Ctx().Our && level < 0 {
return false
}
return true
}
// Effect 1751: 护盾消失时触发固定伤害与异常
type Effect1751 struct {
node.EffectNode
}
func (e *Effect1751) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1751, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1751Sub struct {
node.EffectNode
}
func (e *Effect1751Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 4 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[3].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
e.Alive(false)
return true
}
// Effect 1752: 护盾消失时吸血并清空对手随机PP
type Effect1752 struct {
node.EffectNode
}
func (e *Effect1752) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1752, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1752Sub struct {
node.EffectNode
}
func (e *Effect1752Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 3 {
return true
}
drain := e.Args()[1]
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)
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[2].IntPart()))
e.Alive(false)
return true
}
// Effect 1753: 护盾消失时恢复生命
type Effect1753 struct {
node.EffectNode
}
func (e *Effect1753) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1753, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1753Sub struct {
node.EffectNode
}
func (e *Effect1753Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 2 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
e.Alive(false)
return true
}
// Effect 1754: 护盾消失时附加固定伤害与下一次攻击翻倍
type Effect1754 struct {
node.EffectNode
}
func (e *Effect1754) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1754, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1754Sub struct {
node.EffectNode
}
func (e *Effect1754Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 3 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
e.Ctx().Our.AddEffect(e.Ctx().Our, e.Ctx().Our.InitEffect(input.EffectType.Sub, 1754, int(e.Args()[2].IntPart())))
e.Alive(false)
return true
}
func (e *Effect1754Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
return true
}
// Effect 1755: 护盾消失时使对手下一次攻击无效
type Effect1755 struct {
node.EffectNode
}
func (e *Effect1755) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1755, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1755Sub struct {
node.EffectNode
}
func (e *Effect1755Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 2 {
return true
}
disable := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1755, int(e.Args()[1].IntPart()))
if disable != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, disable)
}
e.Alive(false)
return true
}
func (e *Effect1755Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1756: 消除回合类效果失败时给对手属性技能无效
type Effect1756 struct {
node.EffectNode
}
func (e *Effect1756) Skill_Use() bool {
return true
}
// Effect 1757: 免疫若干次异常
type Effect1757 struct {
node.EffectNode
}
func (e *Effect1757) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1757, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1757Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1757Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1757Sub) 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
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 1758: 对手用攻击技能时清空PP并加护盾
type Effect1758 struct {
node.EffectNode
}
func (e *Effect1758) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1758, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1758Sub struct {
node.EffectNode
}
func (e *Effect1758Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[1].IntPart()))
e.Ctx().Our.AddShield(e.Args()[2])
return true
}
// Effect 1759: 对手使用属性技能则被处决精灵吸取PP
type Effect1759 struct {
node.EffectNode
}
func (e *Effect1759) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1759, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1759Sub struct {
node.EffectNode
}
func (e *Effect1759Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[1].IntPart()))
return true
}
// Effect 1760: 对手处于异常状态则强化
type Effect1760 struct {
node.EffectNode
}
func (e *Effect1760) Skill_Use() bool {
if e.Ctx().Opp.StatEffect_Exist_all() {
e.Ctx().Our.AddEffect(e.Ctx().Our, e.Ctx().Our.InitEffect(input.EffectType.Sub, 1760, e.SideEffectArgs...))
}
return true
}
// Effect 1761: 自身体力高于对手时提升伤害
type Effect1761 struct {
node.EffectNode
}
func (e *Effect1761) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) <= 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
// Effect 1762: 体力低于对手时先制
type Effect1762 struct {
node.EffectNode
}
func (e *Effect1762) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) >= 0 {
return true
}
if fattack != nil && fattack.SkillEntity != nil {
fattack.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1763: 对手体力高于一半时我方场上附加1勾玉圣剑
type Effect1763 struct {
node.EffectNode
}
func (e *Effect1763) OnSkill() bool {
if e.Ctx().Opp.CurrentPet.GetHP().Mul(alpacadecimal.NewFromInt(2)).Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) <= 0 {
return true
}
return true
}
// Effect 1764: 对手低于阈值时重新发动处决
type Effect1764 struct {
node.EffectNode
}
func (e *Effect1764) TurnEnd() {
if len(e.Args()) == 0 {
e.EffectNode.TurnEnd()
return
}
if e.Ctx().Opp.CurrentPet.GetHP().Mul(e.Args()[0]).Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) >= 0 {
e.EffectNode.TurnEnd()
return
}
e.EffectNode.TurnEnd()
}
// Effect 1765: 追加百分比伤害并恢复等量体力
type Effect1765 struct {
node.EffectNode
}
func (e *Effect1765) OnSkill() bool {
if len(e.Args()) < 1 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 1766: 每回合使用技能并给对手随机清PP
type Effect1766 struct {
node.EffectNode
}
func (e *Effect1766) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[2].IntPart()))
return true
}
// Effect 1767: 攻击时把对手能力提升视为降低
type Effect1767 struct {
node.EffectNode
}
func (e *Effect1767) PropBefer(in *input.Input, prop, level int8) bool {
if in == e.Ctx().Opp && level > 0 {
return false
}
return true
}
// Effect 1768: 把所受攻击伤害转化为护盾
type Effect1768 struct {
node.EffectNode
}
func (e *Effect1768) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 || len(e.Args()) < 2 {
return true
}
if zone.Type != info.DamageType.Red {
return true
}
shield := zone.Damage
if shield.Cmp(e.Args()[1]) > 0 {
shield = e.Args()[1]
}
e.Ctx().Our.AddShield(shield)
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 1769: 随机吸取对手属性并提升自己
type Effect1769 struct {
node.EffectNode
}
func (e *Effect1769) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
attrs := []int8{0, 1, 2, 3, 4, 5}
idx := attrs[grand.Intn(len(attrs))]
e.Ctx().Our.SetProp(e.Ctx().Our, idx, e.Ctx().Opp.Prop[idx])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1745, &Effect1745{})
input.InitEffect(input.EffectType.Skill, 1746, &Effect1746{})
input.InitEffect(input.EffectType.Skill, 1747, &Effect1747{})
input.InitEffect(input.EffectType.Skill, 1748, &Effect1748{})
input.InitEffect(input.EffectType.Sub, 1748, &Effect1748Sub{})
input.InitEffect(input.EffectType.Skill, 1749, &Effect1749{})
input.InitEffect(input.EffectType.Skill, 1750, &Effect1750{})
input.InitEffect(input.EffectType.Skill, 1751, &Effect1751{})
input.InitEffect(input.EffectType.Sub, 1751, &Effect1751Sub{})
input.InitEffect(input.EffectType.Skill, 1752, &Effect1752{})
input.InitEffect(input.EffectType.Sub, 1752, &Effect1752Sub{})
input.InitEffect(input.EffectType.Skill, 1753, &Effect1753{})
input.InitEffect(input.EffectType.Sub, 1753, &Effect1753Sub{})
input.InitEffect(input.EffectType.Skill, 1754, &Effect1754{})
input.InitEffect(input.EffectType.Sub, 1754, &Effect1754Sub{})
input.InitEffect(input.EffectType.Skill, 1755, &Effect1755{})
input.InitEffect(input.EffectType.Sub, 1755, &Effect1755Sub{})
input.InitEffect(input.EffectType.Skill, 1756, &Effect1756{})
input.InitEffect(input.EffectType.Skill, 1757, &Effect1757{})
input.InitEffect(input.EffectType.Sub, 1757, &Effect1757Sub{})
input.InitEffect(input.EffectType.Skill, 1758, &Effect1758{})
input.InitEffect(input.EffectType.Sub, 1758, &Effect1758Sub{})
input.InitEffect(input.EffectType.Skill, 1759, &Effect1759{})
input.InitEffect(input.EffectType.Sub, 1759, &Effect1759Sub{})
input.InitEffect(input.EffectType.Skill, 1760, &Effect1760{})
input.InitEffect(input.EffectType.Sub, 1760, &Effect1760{})
input.InitEffect(input.EffectType.Skill, 1761, &Effect1761{})
input.InitEffect(input.EffectType.Skill, 1762, &Effect1762{})
input.InitEffect(input.EffectType.Skill, 1763, &Effect1763{})
input.InitEffect(input.EffectType.Skill, 1764, &Effect1764{})
input.InitEffect(input.EffectType.Skill, 1765, &Effect1765{})
input.InitEffect(input.EffectType.Skill, 1766, &Effect1766{})
input.InitEffect(input.EffectType.Skill, 1767, &Effect1767{})
input.InitEffect(input.EffectType.Skill, 1768, &Effect1768{})
input.InitEffect(input.EffectType.Skill, 1769, &Effect1769{})
}

View File

@@ -0,0 +1,622 @@
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 totalNegativePropLevels(in *input.Input) int64 {
if in == nil {
return 0
}
total := int64(0)
for _, v := range in.Prop[:] {
if v < 0 {
total += int64(-v)
}
}
return total
}
func clearSubEffects(target *input.Input) bool {
if target == nil {
return false
}
cleared := false
for _, eff := range target.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() == input.EffectType.Sub {
eff.Alive(false)
cleared = true
}
}
return cleared
}
// Effect 1771: 反转对手能力提升状态,反转成功则{0}回合内对手的能力下降状态无法被解除或反转
type Effect1771 struct {
node.EffectNode
}
func (e *Effect1771) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -2*v) {
reversed = true
}
}
if !reversed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1771, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1771Sub struct {
RoundEffectArg0Base
}
func (e *Effect1771Sub) 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 level >= 0 {
return true
}
return false
}
// Effect 1772: 附加对手能力下降等级总和和X{0}的固定伤害
type Effect1772 struct {
node.EffectNode
}
func (e *Effect1772) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
total := totalNegativePropLevels(e.Ctx().Opp)
if total <= 0 {
return true
}
damage := e.Args()[0].Add(alpacadecimal.NewFromInt(total))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
})
return true
}
// Effect 1773: 附加双方能力下降等级总和和X{0}的固定伤害
type Effect1773 struct {
node.EffectNode
}
func (e *Effect1773) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
total := totalNegativePropLevels(e.Ctx().Opp) + totalNegativePropLevels(e.Ctx().Our)
if total <= 0 {
return true
}
damage := e.Args()[0].Add(alpacadecimal.NewFromInt(total))
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
})
return true
}
// Effect 1774: 若对手当回合使用的技能为攻击技能则自身额外先制+1
type Effect1774 struct {
node.EffectNode
}
func (e *Effect1774) 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 || other.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1775: 令对手下{0}次使用的技能PP值归零
type Effect1775 struct {
node.EffectNode
}
func (e *Effect1775) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1775, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1775Sub struct {
RoundEffectArg0Base
}
func (e *Effect1775Sub) HookPP(count *int) bool {
if count == nil || e.Duration() <= 0 {
return true
}
*count = 0
e.Alive(false)
return true
}
// Effect 1776: 吸取对手能力提升状态,吸取成功则{0}回合内对手攻击技能无法造成伤害且命中失效
type Effect1776 struct {
node.EffectNode
}
func (e *Effect1776) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
absorbed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
absorbed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
}
if !absorbed {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1776, int(e.Args()[0].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1776Sub struct {
RoundEffectArg0Base
}
func (e *Effect1776Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
func (e *Effect1776Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 1777: 消除对手回合类效果,若对手不处于回合类效果则{0}%令对手{1}
type Effect1777 struct{ node.EffectNode }
func (e *Effect1777) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
}
return true
}
// Effect 1778: 回合结束后若本回合未受到攻击则使对手下{0}回合先制+{1}
type Effect1778 struct {
node.EffectNode
attacked bool
}
func (e *Effect1778) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red && zone.Damage.Cmp(alpacadecimal.Zero) > 0 {
e.attacked = true
}
return true
}
func (e *Effect1778) TurnEnd() {
if len(e.Args()) >= 2 && !e.attacked {
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1778, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
}
e.attacked = false
e.EffectNode.TurnEnd()
}
type Effect1778Sub struct {
RoundEffectArg0Base
}
func (e *Effect1778Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 1779: 对手主动切换时吸取场上精灵最大体力的1/{1}
type Effect1779 struct{ node.EffectNode }
func (e *Effect1779) SwitchIn(in *input.Input) bool {
if len(e.Args()) < 2 || in != e.Ctx().Opp {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if heal.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
}
return true
}
// Effect 1780: 消耗自身全部体力,减弱对手并让己方登场精灵获得护盾
type Effect1780 struct{ node.EffectNode }
func (e *Effect1780) OnSkill() bool {
if len(e.Args()) < 5 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Our.CurrentPet.GetHP()})
shield := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if shield.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.AddShield(shield)
}
e.Ctx().Our.SetProp(e.Ctx().Our, 5, int8(e.Args()[3].IntPart()))
return true
}
// Effect 1781: 若自身拥有的护盾值高于{0}则令自身{1}回合内对回合类效果无法被消除
type Effect1781 struct {
node.EffectNode
}
func (e *Effect1781) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.CurrentShield().Cmp(e.Args()[0]) <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1781, int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1781Sub struct {
RoundEffectArg0Base
}
func (e *Effect1781Sub) 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 {
return false
}
return true
}
// Effect 1782: 自身存在护盾则先制+2
type Effect1782 struct {
node.EffectNode
}
func (e *Effect1782) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
current.SkillEntity.XML.Priority += 2
return true
}
// Effect 1783: 消除敌我双方回合类效果,消除任意一项成功则敌我双方同时进入{0}状态,若任意一方回合类效果无法被消除则令对手下{1}回合无法主动切换精灵
type Effect1783 struct {
node.EffectNode
}
func (e *Effect1783) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
for _, eff := range target.Effects {
if eff == nil || !eff.Alive() {
continue
}
id := eff.ID()
if id.GetEffectType() != input.EffectType.Sub {
continue
}
eff.Alive(false)
cleared = true
}
}
if cleared {
st := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
if st != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, st)
}
oppStatus := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
if oppStatus != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, oppStatus)
}
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1783, int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1783Sub struct {
RoundEffectArg0Base
}
func (e *Effect1783Sub) SwitchIn(in *input.Input) bool {
if in != e.Ctx().Opp {
return true
}
e.Alive(false)
return true
}
// Effect 1784: {0}回合内对手使用技能时自身免疫对手1次非致命一击造成的攻击伤害
type Effect1784 struct {
node.EffectNode
}
func (e *Effect1784) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1784, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1784Sub struct {
RoundEffectArg0Base
}
func (e *Effect1784Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
zone.Damage = alpacadecimal.Zero
e.Alive(false)
return true
}
// Effect 1791: 消除双方护盾并附加护盾值{0}%的百分比伤害,若护盾值总和超过{1}点则转变为附加护盾值{2}%的百分比伤害
type Effect1791 struct {
node.EffectNode
}
func (e *Effect1791) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
total := e.Ctx().Our.ConsumeAllShield().Add(e.Ctx().Opp.ConsumeAllShield())
if total.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
percent := e.Args()[0]
if total.Cmp(e.Args()[1]) > 0 {
percent = e.Args()[2]
}
damage := e.Ctx().Opp.CurrentPet.GetHP().Mul(percent).Div(hundred)
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 1792: 使对手直接受到{0}点光·暗影系伤害并获得等量护盾(不可叠加),若自身没有护盾则效果翻倍
type Effect1792 struct {
node.EffectNode
}
func (e *Effect1792) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Args()[0]
if e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.True,
Damage: damage,
})
e.Ctx().Our.AddShield(damage)
return true
}
// Effect 1793: {0}次受到攻击伤害时,若伤害高于{1},则自身恢复全部体力
type Effect1793 struct {
node.EffectNode
remaining int
}
func (e *Effect1793) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
e.remaining = int(e.Args()[0].IntPart())
if e.remaining <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1793, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1793Sub struct {
RoundEffectArg0Base
}
func (e *Effect1793Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if zone.Damage.Cmp(e.Args()[1]) <= 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
e.Alive(false)
return true
}
// Effect 1794: 技能无效时恢复自身最大体力的1/2且下一次受到的攻击伤害额外减少50%
type Effect1794 struct {
node.EffectNode
}
func (e *Effect1794) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2)))
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1794, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1794Sub struct {
RoundEffectArg0Base
}
func (e *Effect1794Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
reduce := zone.Damage.Mul(alpacadecimal.NewFromInt(50)).Div(hundred)
if reduce.Cmp(zone.Damage) >= 0 {
zone.Damage = alpacadecimal.Zero
} else {
zone.Damage = zone.Damage.Sub(reduce)
}
e.Alive(false)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1771, &Effect1771{})
input.InitEffect(input.EffectType.Sub, 1771, &Effect1771Sub{})
input.InitEffect(input.EffectType.Skill, 1772, &Effect1772{})
input.InitEffect(input.EffectType.Skill, 1773, &Effect1773{})
input.InitEffect(input.EffectType.Skill, 1774, &Effect1774{})
input.InitEffect(input.EffectType.Skill, 1775, &Effect1775{})
input.InitEffect(input.EffectType.Sub, 1775, &Effect1775Sub{})
input.InitEffect(input.EffectType.Skill, 1776, &Effect1776{})
input.InitEffect(input.EffectType.Sub, 1776, &Effect1776Sub{})
input.InitEffect(input.EffectType.Skill, 1781, &Effect1781{})
input.InitEffect(input.EffectType.Sub, 1781, &Effect1781Sub{})
input.InitEffect(input.EffectType.Skill, 1782, &Effect1782{})
input.InitEffect(input.EffectType.Skill, 1783, &Effect1783{})
input.InitEffect(input.EffectType.Sub, 1783, &Effect1783Sub{})
input.InitEffect(input.EffectType.Skill, 1791, &Effect1791{})
input.InitEffect(input.EffectType.Skill, 1792, &Effect1792{})
input.InitEffect(input.EffectType.Skill, 1793, &Effect1793{})
input.InitEffect(input.EffectType.Sub, 1793, &Effect1793Sub{})
input.InitEffect(input.EffectType.Skill, 1794, &Effect1794{})
input.InitEffect(input.EffectType.Sub, 1794, &Effect1794Sub{})
}

View File

@@ -0,0 +1,411 @@
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 hasCurseStack(in *input.Input) int {
if in == nil {
return 0
}
eff := in.GetEffect(input.EffectType.Status, int(petStatusCurse))
if eff == nil || !eff.Alive() {
return 0
}
return eff.Stack()
}
func addStatusByID1795(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil || statusID <= 0 {
return false
}
statusEffect := owner.InitEffect(input.EffectType.Status, statusID)
if statusEffect == nil {
return false
}
target.AddEffect(owner, statusEffect)
return true
}
// Effect 1795: 1回合做{0}次攻击自身每存在1层诅咒则攻击次数+{1}
type Effect1795 struct{ node.EffectNode }
func (e *Effect1795) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 || len(e.Args()) < 2 {
return true
}
times := int(e.Args()[0].IntPart())
if times < 1 {
times = 1
}
if stacks := hasCurseStack(e.Ctx().Our); stacks > 0 {
times += stacks * int(e.Args()[1].IntPart())
}
e.Ctx().SkillEntity.AttackTime += uint32(times - 1)
return true
}
// Effect 1796: 附加对手最大体力百分比伤害,诅咒层数达到{1}层则转变为等量真实伤害
type Effect1796 struct{ node.EffectNode }
func (e *Effect1796) 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 || len(e.Args()) < 2 {
return true
}
percent := e.Args()[0]
if stacks := hasCurseStack(e.Ctx().Our); stacks >= int(e.Args()[1].IntPart()) {
zone.Type = info.DamageType.True
zone.Damage = e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(hundred)
return true
}
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(hundred))
return true
}
// Effect 1797: 当回合命中失败对手则令自身诅咒的重置层数+{0}
type Effect1797 struct{ node.EffectNode }
func (e *Effect1797) Skill_Use_ex() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
if eff := e.Ctx().Our.GetEffect(input.EffectType.Status, int(petStatusCurse)); eff != nil && eff.Alive() {
eff.Stack(eff.Stack() + int(e.Args()[0].IntPart()))
}
}
return true
}
// Effect 1798: 下回合对手未使用攻击技能则造成伤害
type Effect1798 struct{ node.EffectNode }
func (e *Effect1798) TurnEnd() {
if len(e.Args()) < 3 {
e.EffectNode.TurnEnd()
return
}
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
e.EffectNode.TurnEnd()
}
// Effect 1799: 后出手时附带效果
type Effect1799 struct{ node.EffectNode }
func (e *Effect1799) Skill_Use_ex() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.AttackTime != 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
} else {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1800: 场地与残存精灵相关的护盾与吸血效果
type Effect1800 struct{ node.EffectNode }
func (e *Effect1800) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp > 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[0])).Div(hundred)
return true
}
func (e *Effect1800) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
if e.Ctx().Our.AllPet != nil {
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && pet.Info.Hp <= 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
}
}
e.Ctx().Our.AddShield(e.Args()[1])
return true
}
// Effect 1801: 若上回合未受伤害则附加固定比例伤害
type Effect1801 struct{ node.EffectNode }
func (e *Effect1801) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.Zero) == 0 {
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
}
return true
}
// Effect 1802: 上回合受伤上限封顶
type Effect1802 struct{ node.EffectNode }
func (e *Effect1802) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) > 0 {
zone.Damage = e.Args()[0]
}
return true
}
// Effect 1803: 技能无效时恢复体力并清除自身有害状态
type Effect1803 struct{ node.EffectNode }
func (e *Effect1803) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(3)))
e.Ctx().Our.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1804: 本回合选择攻击技能时视为能力下降
type Effect1804 struct{ node.EffectNode }
func (e *Effect1804) SkillHit() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().SkillEntity.XML.Priority -= int(e.Args()[0].IntPart())
}
return true
}
// Effect 1805: 命中对手异常状态时伤害翻倍
type Effect1805 struct{ node.EffectNode }
func (e *Effect1805) 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().Opp.StatEffect_Exist_all() {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1806: 针对雄性精灵的控制与回满
type Effect1806 struct{ node.EffectNode }
func (e *Effect1806) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet == nil || e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().Opp.CurrentPet.Info.Gender == 1 {
addStatusByID1795(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Fear))
} else {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
}
return true
}
// Effect 1807: 自身能力下降时先制
type Effect1807 struct{ node.EffectNode }
func (e *Effect1807) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && current.SkillEntity.Category() != info.Category.STATUS && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1808: 对手回合类效果时增伤并清除
type Effect1808 struct{ node.EffectNode }
func (e *Effect1808) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.AttackTime == 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
func (e *Effect1808) Skill_Use_ex() bool {
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1809: 获得护盾,护盾消失时附加效果
type Effect1809 struct{ node.EffectNode }
func (e *Effect1809) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 1810: 若自身遇到天敌则先制+3
type Effect1810 struct{ node.EffectNode }
func (e *Effect1810) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.ISNaturalEnemy() {
current.SkillEntity.XML.Priority += 3
}
return true
}
// Effect 1811: 回合击败对手则回合内回合类效果无法被消除
type Effect1811 struct{ node.EffectNode }
func (e *Effect1811) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(0))
return true
}
// Effect 1812: 消耗自身全部体力,首发必定先手命中
type Effect1812 struct{ node.EffectNode }
func (e *Effect1812) SkillHit() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime != 0 {
e.Ctx().SkillEntity.XML.Priority = 9999
}
return true
}
// Effect 1813: 护盾/场地联动
type Effect1813 struct{ node.EffectNode }
func (e *Effect1813) Skill_Use() bool {
if len(e.Args()) < 6 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
e.Ctx().Our.AddShield(e.Args()[1])
if e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.Info.Hp > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[2]})
}
return true
}
// Effect 1814: 每回合首个技能吸取对手体力
type Effect1814 struct{ node.EffectNode }
func (e *Effect1814) Skill_Use() bool {
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[3])})
return true
}
// Effect 1815: 激发防御能力
type Effect1815 struct{ node.EffectNode }
func (e *Effect1815) Skill_Use_ex() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.AttackTime == 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]))
}
return true
}
// Effect 1816: 高体力时暴击倍率提升
type Effect1816 struct{ node.EffectNode }
func (e *Effect1816) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
percent := e.Args()[0]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) > 0 {
percent = e.Args()[1]
}
zone.Damage = zone.Damage.Mul(hundred.Add(percent)).Div(hundred)
return true
}
// Effect 1817: 消除对手回合类效果
type Effect1817 struct{ node.EffectNode }
func (e *Effect1817) Skill_Use() bool {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
return true
}
// Effect 1818: 免疫并反弹固定/百分比伤害
type Effect1818 struct{ node.EffectNode }
func (e *Effect1818) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil {
return true
}
if zone.Type == info.DamageType.Fixed || zone.Type == info.DamageType.Percent {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 1819: 异常状态命中率提升
type Effect1819 struct{ node.EffectNode }
func (e *Effect1819) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID1795(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
} else {
addStatusByID1795(e.Ctx().Our, e.Ctx().Our, int(e.Args()[2].IntPart()))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1795, &Effect1795{})
input.InitEffect(input.EffectType.Skill, 1796, &Effect1796{})
input.InitEffect(input.EffectType.Skill, 1797, &Effect1797{})
input.InitEffect(input.EffectType.Skill, 1798, &Effect1798{})
input.InitEffect(input.EffectType.Skill, 1799, &Effect1799{})
input.InitEffect(input.EffectType.Skill, 1800, &Effect1800{})
input.InitEffect(input.EffectType.Skill, 1801, &Effect1801{})
input.InitEffect(input.EffectType.Skill, 1802, &Effect1802{})
input.InitEffect(input.EffectType.Skill, 1803, &Effect1803{})
input.InitEffect(input.EffectType.Skill, 1804, &Effect1804{})
input.InitEffect(input.EffectType.Skill, 1805, &Effect1805{})
input.InitEffect(input.EffectType.Skill, 1806, &Effect1806{})
input.InitEffect(input.EffectType.Skill, 1807, &Effect1807{})
input.InitEffect(input.EffectType.Skill, 1808, &Effect1808{})
input.InitEffect(input.EffectType.Skill, 1809, &Effect1809{})
input.InitEffect(input.EffectType.Skill, 1810, &Effect1810{})
input.InitEffect(input.EffectType.Skill, 1811, &Effect1811{})
input.InitEffect(input.EffectType.Skill, 1812, &Effect1812{})
input.InitEffect(input.EffectType.Skill, 1813, &Effect1813{})
input.InitEffect(input.EffectType.Skill, 1814, &Effect1814{})
input.InitEffect(input.EffectType.Skill, 1815, &Effect1815{})
input.InitEffect(input.EffectType.Skill, 1816, &Effect1816{})
input.InitEffect(input.EffectType.Skill, 1817, &Effect1817{})
input.InitEffect(input.EffectType.Skill, 1818, &Effect1818{})
input.InitEffect(input.EffectType.Skill, 1819, &Effect1819{})
}

View File

@@ -0,0 +1,342 @@
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 applyStatusToOpp(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)
}
}
// Effect 1820: 造成的攻击伤害若低于{0}则附加给对手{1}点真实伤害
type Effect1820 struct{ node.EffectNode }
func (e *Effect1820) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
return true
}
if e.Args()[1].Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[1]})
}
return true
}
// Effect 1821: 未击败对手则恢复自身所有技能{0}点PP值
type Effect1821 struct{ node.EffectNode }
func (e *Effect1821) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
amount := int(e.Args()[0].IntPart())
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP += uint32(amount)
}
return true
}
// Effect 1822: 消耗自身所有技能的PP值并附加自身最大体力{0}%的百分比伤害若消耗的PP值少于{1}点则附加的百分比伤害翻倍且额外令对手下{2}次攻击技能无效
type Effect1822 struct{ node.EffectNode }
func (e *Effect1822) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
consumed := uint32(0)
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
consumed += e.Ctx().Our.CurrentPet.Info.SkillList[i].PP
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = 0
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if consumed < uint32(e.Args()[1].IntPart()) {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1822, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
}
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
type Effect1822Sub struct{ node.EffectNode; remaining int }
func (e *Effect1822Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1822Sub) 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 1823: 1823 组合控制效果
type Effect1823 struct{ node.EffectNode }
func (e *Effect1823) Skill_Use() bool {
if len(e.Args()) < 6 {
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
return true
}
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[4].IntPart()))
return true
}
// Effect 1824: 未触发则对手每层存在1层决印记自身免疫1次异常状态
type Effect1824 struct{ node.EffectNode }
func (e *Effect1824) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); success {
applyStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1824, int(e.Args()[2].IntPart()))
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1824Sub struct{ node.EffectNode; remaining int }
func (e *Effect1824Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1824Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our || !input.IS_Stat(effEffect) || e.remaining <= 0 {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 1825: 使对手直接受到{0}点圣灵系伤害...
type Effect1825 struct{ node.EffectNode }
func (e *Effect1825) Skill_Use() bool { return true }
// Effect 1826: 使对手直接受到{0}点神秘系伤害...
type Effect1826 struct{ node.EffectNode }
func (e *Effect1826) Skill_Use() bool { return true }
// Effect 1827: 击败对手则令对手下次使用的属性技能无效
type Effect1827 struct{ node.EffectNode }
func (e *Effect1827) Skill_Use() bool {
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1827, 1)
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect1827Sub struct{ node.EffectNode; remaining int }
func (e *Effect1827Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1827Sub) 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 1828: 消除对手所有护盾、护罩效果...
type Effect1828 struct{ node.EffectNode }
func (e *Effect1828) Skill_Use() bool { return true }
// Effect 1829: 对手每存在{0}层决印记则先出手时技能威力提升{0}%
type Effect1829 struct{ node.EffectNode }
func (e *Effect1829) SkillHit() bool { return true }
// Effect 1830: 圣剑重铸期间若击败对手...
type Effect1830 struct{ node.EffectNode }
func (e *Effect1830) Skill_Use() bool { return true }
// Effect 1831: {0}回合内每回合结束后附加{1}点固定伤害
type Effect1831 struct{ node.EffectNode }
func (e *Effect1831) Skill_Use() bool { return true }
// Effect 1832: {0}回合内{1}%闪避对手攻击...
type Effect1832 struct{ node.EffectNode }
func (e *Effect1832) Skill_Use() bool { return true }
// Effect 1833: {0}回合内若对手使用攻击技能...
type Effect1833 struct{ node.EffectNode }
func (e *Effect1833) Skill_Use() bool { return true }
// Effect 1834: 自身已受到的攻击伤害不超过{1}
type Effect1834 struct{ node.EffectNode }
func (e *Effect1834) DamageDivEx(zone *info.DamageZone) bool { return true }
// Effect 1835: 100%令对手全属性{0}
type Effect1835 struct{ node.EffectNode }
func (e *Effect1835) Skill_Use() bool { return true }
// Effect 1836: 每回合使用技能吸取对手最大体力...
type Effect1836 struct{ node.EffectNode }
func (e *Effect1836) Skill_Use() bool { return true }
// Effect 1837: {0}%令对手{1}
type Effect1837 struct{ node.EffectNode }
func (e *Effect1837) Skill_Use() bool { return true }
// Effect 1838: 对手处于异常状态时...
type Effect1838 struct{ node.EffectNode }
func (e *Effect1838) Skill_Use() bool { return true }
// Effect 1839: 每回合使用技能恢复自身最大体力...
type Effect1839 struct{ node.EffectNode }
func (e *Effect1839) Skill_Use() bool { return true }
// Effect 1840: 若打出致命一击则...
type Effect1840 struct{ node.EffectNode }
func (e *Effect1840) Skill_Use() bool { return true }
// Effect 1841: 消耗自身全部体力,令对手随机{0}项技能PP值归零
type Effect1841 struct{ node.EffectNode }
func (e *Effect1841) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1842: 每回合使用技能吸取对手{1}点体力...
type Effect1842 struct{ node.EffectNode }
func (e *Effect1842) Skill_Use() bool { return true }
// Effect 1843: 造成的攻击伤害若高于{0}则{1}%令对手{2}
type Effect1843 struct{ node.EffectNode }
func (e *Effect1843) Skill_Use() bool { return true }
// Effect 1844: 附加对手已损失体力值{0}%的百分比伤害
type Effect1844 struct{ node.EffectNode }
func (e *Effect1844) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
lost := e.Ctx().Opp.CurrentPet.GetMaxHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())
if lost.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := lost.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1820, &Effect1820{})
input.InitEffect(input.EffectType.Skill, 1821, &Effect1821{})
input.InitEffect(input.EffectType.Skill, 1822, &Effect1822{})
input.InitEffect(input.EffectType.Sub, 1822, &Effect1822Sub{})
input.InitEffect(input.EffectType.Skill, 1823, &Effect1823{})
input.InitEffect(input.EffectType.Skill, 1824, &Effect1824{})
input.InitEffect(input.EffectType.Sub, 1824, &Effect1824Sub{})
input.InitEffect(input.EffectType.Skill, 1825, &Effect1825{})
input.InitEffect(input.EffectType.Skill, 1826, &Effect1826{})
input.InitEffect(input.EffectType.Skill, 1827, &Effect1827{})
input.InitEffect(input.EffectType.Sub, 1827, &Effect1827Sub{})
input.InitEffect(input.EffectType.Skill, 1828, &Effect1828{})
input.InitEffect(input.EffectType.Skill, 1829, &Effect1829{})
input.InitEffect(input.EffectType.Skill, 1830, &Effect1830{})
input.InitEffect(input.EffectType.Skill, 1831, &Effect1831{})
input.InitEffect(input.EffectType.Skill, 1832, &Effect1832{})
input.InitEffect(input.EffectType.Skill, 1833, &Effect1833{})
input.InitEffect(input.EffectType.Skill, 1834, &Effect1834{})
input.InitEffect(input.EffectType.Skill, 1835, &Effect1835{})
input.InitEffect(input.EffectType.Skill, 1836, &Effect1836{})
input.InitEffect(input.EffectType.Skill, 1837, &Effect1837{})
input.InitEffect(input.EffectType.Skill, 1838, &Effect1838{})
input.InitEffect(input.EffectType.Skill, 1839, &Effect1839{})
input.InitEffect(input.EffectType.Skill, 1840, &Effect1840{})
input.InitEffect(input.EffectType.Skill, 1841, &Effect1841{})
input.InitEffect(input.EffectType.Skill, 1842, &Effect1842{})
input.InitEffect(input.EffectType.Skill, 1843, &Effect1843{})
input.InitEffect(input.EffectType.Skill, 1844, &Effect1844{})
}

View File

@@ -0,0 +1,314 @@
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"
)
func zeroAllProps(target *input.Input) {
for i := range target.Prop[:] {
target.SetProp(target, int8(i), 0)
}
}
func clearOwnAllProps(target *input.Input) {
for i := range target.Prop[:] {
target.SetProp(target, int8(i), 0)
}
}
func addFixedDamageToOpp(e *node.EffectNode, damage alpacadecimal.Decimal) {
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
}
func applyRandomStatusToOpp(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
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.Sleep)}
indexes := grand.Perm(len(statuses))
for _, idx := range indexes[:minInt(count, len(statuses))] {
if eff := owner.InitEffect(input.EffectType.Status, statuses[idx]); eff != nil {
target.AddEffect(owner, eff)
}
}
}
func minInt(a, b int) int {
if a < b {
return a
}
return b
}
// Effect 1845: 对手每损失{0}点体力则额外附加{1}点固定伤害
type Effect1845 struct{ node.EffectNode }
func (e *Effect1845) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
lost := e.Ctx().Opp.CurrentPet.GetMaxHP().Sub(e.Ctx().Opp.CurrentPet.GetHP())
if lost.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
step := e.Args()[0]
if step.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
times := lost.Div(step)
addFixedDamageToOpp(&e.EffectNode, times.Mul(e.Args()[1]))
return true
}
// Effect 1846: 若本次攻击未打出致命一击则自身下{0}次技能先制{1}
type Effect1846 struct {
node.EffectNode
remaining int
}
func (e *Effect1846) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
e.remaining = int(e.Args()[0].IntPart())
return true
}
func (e *Effect1846) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.remaining <= 0 || e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
e.remaining--
return true
}
// Effect 1847: 消耗自身全部体力,使己方下只出战精灵登场时立即恢复{0}点体力且首次使用技能后恢复{1}点体力
type Effect1847 struct{ node.EffectNode }
func (e *Effect1847) OnSkill() bool { return true }
// Effect 1848: 先出手时附加自身异常状态免疫
type Effect1848 struct{ node.EffectNode }
func (e *Effect1848) SkillHit_ex() bool { return true }
// Effect 1849: 消耗自身全部体力并使对手随机进入{0}种异常状态
type Effect1849 struct{ node.EffectNode }
func (e *Effect1849) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
applyRandomStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1850: 消除双方回合类效果,消除任意一方成功则自身下{0}次攻击技能造成的伤害提升{1}%
type Effect1850 struct{ node.EffectNode }
func (e *Effect1850) OnSkill() bool { return true }
// Effect 1851: 若自身同时不存在回合类效果且不处于能力提升状态则{0}%令对手随机进入{1}种控制类异常状态
type Effect1851 struct{ node.EffectNode }
func (e *Effect1851) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().Our.HasPropADD() {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
applyRandomStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1852: 若自身不处于能力提升状态则全属性+{0},若自身处于能力提升状态则消除自身能力提升状态
type Effect1852 struct{ node.EffectNode }
func (e *Effect1852) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.HasPropADD() {
clearOwnAllProps(e.Ctx().Our)
return true
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 1853: 使自身下{0}次攻击技能伤害提升{1}%
type Effect1853 struct{ node.EffectNode }
func (e *Effect1853) OnSkill() bool { return true }
// Effect 1854: 使自身下{0}次攻击技能无视对手异常状态
type Effect1854 struct{ node.EffectNode }
func (e *Effect1854) SkillHit() bool { return true }
// Effect 1855: {0}回合内每回合使用技能恢复自身最大体力的1/{1}使用时若自身不处于能力提升状态则额外附加对手最大体力1/{2}的百分比伤害
type Effect1855 struct{ node.EffectNode }
func (e *Effect1855) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if !e.Ctx().Our.HasPropADD() {
addPercentDamageToOpp(&e.EffectNode, e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2]))
}
return true
}
// Effect 1856: 全属性+{0},若强化前自身处于能力下降状态则额外获得等同的能力提升状态
type Effect1856 struct{ node.EffectNode }
func (e *Effect1856) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 1857: 技能威力提升{0}%对手任意1项技能PP值小于{1}点则提升效果翻倍
type Effect1857 struct{ node.EffectNode }
func (e *Effect1857) SkillHit() bool { return true }
// Effect 1858: 若本次攻击造成的伤害高于{0}则自身恢复{1}点体力
type Effect1858 struct{ node.EffectNode }
func (e *Effect1858) OnSkill() bool { return true }
// Effect 1859: 若本次攻击命中则对手随机进入{0}种异常状态若未命中则恢复自身最大体力的1/{1}
type Effect1859 struct{ node.EffectNode }
func (e *Effect1859) OnSkill() bool { return true }
// Effect 1860: 自身不处于能力提升状态时先制+1且必定命中
type Effect1860 struct{ node.EffectNode }
func (e *Effect1860) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.Ctx().Our.HasPropADD() && e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1861: 技能无效时,消除对手回合类效果并使对手沉睡
type Effect1861 struct{ node.EffectNode }
func (e *Effect1861) Skill_Use_ex() bool { return true }
// Effect 1862: {0}%令对手{1},未触发则降低自身所有技能{2}点PP值
type Effect1862 struct{ node.EffectNode }
func (e *Effect1862) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
applyRandomStatusToOpp(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
e.Ctx().Our.DelPP(int(e.Args()[2].IntPart()))
return true
}
// Effect 1863: 吸收对手能力提升状态时恢复自身最大体力的1/{0}
type Effect1863 struct{ node.EffectNode }
func (e *Effect1863) OnSkill() bool { return true }
// Effect 1864: 吸收对手能力提升状态时附加{0}点固定伤害
type Effect1864 struct{ node.EffectNode }
func (e *Effect1864) OnSkill() bool { return true }
// Effect 1865: 为自身附加{0}种异常状态
type Effect1865 struct{ node.EffectNode }
func (e *Effect1865) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
applyRandomStatusToOpp(e.Ctx().Our, e.Ctx().Our, int(e.Args()[0].IntPart()))
return true
}
// Effect 1866: 为自身随机附加{0}/{1}/{2}/{3}中的{4}种异常状态
type Effect1866 struct{ node.EffectNode }
func (e *Effect1866) OnSkill() bool {
if len(e.Args()) < 5 {
return true
}
applyRandomStatusToOpp(e.Ctx().Our, e.Ctx().Our, int(e.Args()[4].IntPart()))
return true
}
// Effect 1867: 先出手时吸取对手最大体力的1/{0}且当回合对手无法造成攻击伤害
type Effect1867 struct{ node.EffectNode }
func (e *Effect1867) DamageLockEx(zone *info.DamageZone) bool { return true }
// Effect 1868: 若对手当回合切换精灵{0}%令对手{1},未触发则{2}%令对手{3}
type Effect1868 struct{ node.EffectNode }
func (e *Effect1868) OnSkill() bool { return true }
// Effect 1869: 消除对手能力提升状态,消除成功则为自身附加{0}点护盾
type Effect1869 struct{ node.EffectNode }
func (e *Effect1869) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1845, &Effect1845{})
input.InitEffect(input.EffectType.Skill, 1846, &Effect1846{})
input.InitEffect(input.EffectType.Skill, 1847, &Effect1847{})
input.InitEffect(input.EffectType.Skill, 1848, &Effect1848{})
input.InitEffect(input.EffectType.Skill, 1849, &Effect1849{})
input.InitEffect(input.EffectType.Skill, 1850, &Effect1850{})
input.InitEffect(input.EffectType.Skill, 1851, &Effect1851{})
input.InitEffect(input.EffectType.Skill, 1852, &Effect1852{})
input.InitEffect(input.EffectType.Skill, 1853, &Effect1853{})
input.InitEffect(input.EffectType.Skill, 1854, &Effect1854{})
input.InitEffect(input.EffectType.Skill, 1855, &Effect1855{})
input.InitEffect(input.EffectType.Skill, 1856, &Effect1856{})
input.InitEffect(input.EffectType.Skill, 1857, &Effect1857{})
input.InitEffect(input.EffectType.Skill, 1858, &Effect1858{})
input.InitEffect(input.EffectType.Skill, 1859, &Effect1859{})
input.InitEffect(input.EffectType.Skill, 1860, &Effect1860{})
input.InitEffect(input.EffectType.Skill, 1861, &Effect1861{})
input.InitEffect(input.EffectType.Skill, 1862, &Effect1862{})
input.InitEffect(input.EffectType.Skill, 1863, &Effect1863{})
input.InitEffect(input.EffectType.Skill, 1864, &Effect1864{})
input.InitEffect(input.EffectType.Skill, 1865, &Effect1865{})
input.InitEffect(input.EffectType.Skill, 1866, &Effect1866{})
input.InitEffect(input.EffectType.Skill, 1867, &Effect1867{})
input.InitEffect(input.EffectType.Skill, 1868, &Effect1868{})
input.InitEffect(input.EffectType.Skill, 1869, &Effect1869{})
}

View File

@@ -0,0 +1,684 @@
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 1870: 自身存在护罩则造成的攻击伤害翻倍
type Effect1870 struct{ node.EffectNode }
func (e *Effect1870) 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 1871: 若自身当前体力低于对手则为自身附加等同于双方最大体力差值的护盾
type Effect1871 struct{ node.EffectNode }
func (e *Effect1871) Skill_Use() bool {
if e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) >= 0 {
return true
}
ourMax := e.Ctx().Our.CurrentPet.GetMaxHP()
oppMax := e.Ctx().Opp.CurrentPet.GetMaxHP()
diff := oppMax.Sub(ourMax)
if diff.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.AddShield(diff)
return true
}
// Effect 1872: 当回合若自身先出手则令对手使用的威力低于阈值的攻击技能无效
type Effect1872 struct {
node.EffectNode
}
func (e *Effect1872) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1872, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1872Sub struct {
node.EffectNode
}
func (e *Effect1872Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.AttackTime == 0 {
return true
}
threshold := e.Args()[0]
if e.Ctx().SkillEntity.XML.Power < int(threshold.IntPart()) {
e.Ctx().SkillEntity.SetMiss()
}
return true
}
func (e *Effect1872Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])) <= 0 {
zone.Damage = zone.Damage.Add(e.Args()[2])
}
return true
}
func (e *Effect1872Sub) TurnEnd() {
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
e.Alive(false)
}
e.EffectNode.TurnEnd()
}
// Effect 1873: 全属性+{0},自身持有的灭神之箭≤{1}支时强化效果翻倍
type Effect1873 struct{ node.EffectNode }
func (e *Effect1873) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
boost := int8(e.Args()[0].IntPart())
if e.Ctx().Our.CurrentPet == nil {
return true
}
if len(e.Ctx().Our.CurrentPet.Info.EffectInfo) <= int(e.Args()[1].IntPart()) {
boost *= 2
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
}
return true
}
// Effect 1874: 攻击时将自身的能力下降状态视为相应的能力提升状态
type Effect1874 struct{ node.EffectNode }
func (e *Effect1874) PropBefer(in *input.Input, prop, level int8) bool {
if in != e.Ctx().Our || level >= 0 {
return true
}
return false
}
// Effect 1875: {0}回合内每回合使用技能恢复自身最大体力的1/{1}并造成等量百分比伤害恢复体力时若自身体力低于最大体力的1/{2}则恢复效果翻倍
type Effect1875 struct{ node.EffectNode }
func (e *Effect1875) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1875, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1875Sub struct {
RoundEffectArg0Base
}
func (e *Effect1875Sub) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) < 0 {
heal = heal.Mul(alpacadecimal.NewFromInt(2))
}
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})
return true
}
// Effect 1876: 将自身能力下降状态反堆给对手,反堆成功则令对手下{0}次使用的技能无效,反堆失败则解除自身能力下降状态
type Effect1876 struct{ node.EffectNode }
func (e *Effect1876) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
copied := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v) {
copied = true
}
}
if copied {
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1876, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
for i, v := range e.Ctx().Our.Prop[:] {
if v < 0 {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0)
}
}
return true
}
type Effect1876Sub struct{ RoundEffectArg0Base }
func (e *Effect1876Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1877: 消除对手回合类效果并恢复自身{0}点体力,消除成功则额外吸取对手{1}点体力
type Effect1877 struct{ node.EffectNode }
func (e *Effect1877) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
removed := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
removed = true
}
}
if !removed {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[1])
return true
}
// Effect 1878: 消除对手回合类效果若对手不处于回合类效果则吸取对手最大体力的1/{0}
type Effect1878 struct{ node.EffectNode }
func (e *Effect1878) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if cleared {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 1879: 获得{0}点护盾,若自身双防总和高于对手则额外获得{1}点,护盾消失时{2}%令对手{3}
type Effect1879 struct{ node.EffectNode }
func (e *Effect1879) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
shield := e.Args()[0]
if e.Ctx().Our.Prop[1]+e.Ctx().Our.Prop[3] > e.Ctx().Opp.Prop[1]+e.Ctx().Opp.Prop[3] {
shield = shield.Add(e.Args()[1])
}
e.Ctx().Our.AddShield(shield)
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1879, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1879Sub struct{ RoundEffectArg0Base }
func (e *Effect1879Sub) Damage_Shield(zone *info.DamageZone) bool {
if zone == nil || e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) > 0 {
return true
}
if len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1880: 吸取对手能力提升状态,吸取成功则自身下{0}回合造成的攻击伤害提升{1}%,若对手不处于能力提升状态则自身下{2}回合先制+{3}
type Effect1880 struct{ node.EffectNode }
func (e *Effect1880) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
steal := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
steal = true
}
}
if steal {
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1880, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1880, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1880Sub struct{ RoundEffectArg0Base }
func (e *Effect1880Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1])).Div(hundred)
return true
}
func (e *Effect1880Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 1881: 若命中前对手处于异常状态则将其能力提升状态视为相应的能力下降状态
type Effect1881 struct{ node.EffectNode }
func (e *Effect1881) PropBefer(in *input.Input, prop, level int8) bool {
if in != e.Ctx().Opp || level <= 0 {
return true
}
return false
}
// Effect 1882: 令己方下只出战精灵抵挡下{0}次对手的攻击,且出战时{1}%{2}
type Effect1882 struct{ node.EffectNode }
func (e *Effect1882) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1882, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1882Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1882Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1882Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = alpacadecimal.Zero
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
func (e *Effect1882Sub) SwitchIn(in *input.Input) bool {
if in != e.Ctx().Our || len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1883: 造成的攻击伤害提升{0}%若未击败对手则对手回合结束后其恢复最大体力的1/{1}
type Effect1883 struct{ node.EffectNode }
func (e *Effect1883) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
func (e *Effect1883) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1883, int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
type Effect1883Sub struct{ RoundEffectArg0Base }
func (e *Effect1883Sub) TurnEnd() {
if len(e.Args()) == 0 {
return
}
e.Ctx().Opp.Heal(e.Ctx().Opp, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
e.EffectNode.TurnEnd()
}
// Effect 1884: {0}回合内若对手使用攻击技能则令对手所有技能PP值-{1}
type Effect1884 struct{ node.EffectNode }
func (e *Effect1884) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1884, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1884Sub struct{ RoundEffectArg0Base }
func (e *Effect1884Sub) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[1].IntPart()))
return true
}
// Effect 1885: 吸取对手最大体力的1/{0},若对手免疫百分比伤害则{1}%令对手{2}
type Effect1885 struct{ node.EffectNode }
func (e *Effect1885) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: heal})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1886: {0}回合内若自身回合类效果被消除则对手下{1}回合造成的攻击伤害额外减少{2}%
type Effect1886 struct{ node.EffectNode }
func (e *Effect1886) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1886, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1886Sub struct{ RoundEffectArg0Base }
func (e *Effect1886Sub) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
if e.Ctx().Our.CurrentPet.Info.Hp <= 0 {
e.Ctx().Opp.AddEffect(e.Ctx().Our, e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1886, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart())))
}
return true
}
// Effect 1887: 自身拥有未来奇点时先制+1
type Effect1887 struct{ node.EffectNode }
func (e *Effect1887) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
if len(e.Ctx().Our.Effects) == 0 {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1888: 为自身附加{0}层未来奇点
type Effect1888 struct{ node.EffectNode }
func (e *Effect1888) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.AddEffect(e.Ctx().Our, e.Ctx().Our.InitEffect(input.EffectType.Sub, 1888, int(e.Args()[0].IntPart())))
return true
}
// Effect 1889: {0}%使对手{1},未触发则附加{2}点真实伤害技能无效时100%使对手疲惫并附加400点真实伤害
type Effect1889 struct{ node.EffectNode }
func (e *Effect1889) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[2]})
return true
}
// Effect 1890: {0}回合内若对手使用属性技能则自身下{1}次受到的固定/百分比伤害减少{2}%
type Effect1890 struct{ node.EffectNode }
func (e *Effect1890) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1890, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1890Sub struct{ RoundEffectArg0Base }
func (e *Effect1890Sub) Skill_Use_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.AttackTime == 0 {
return true
}
return true
}
func (e *Effect1890Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 3 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[2])).Div(hundred)
return true
}
// Effect 1891: 全属性+{0},若对手存在技能被解析则强化效果翻倍
type Effect1891 struct{ node.EffectNode }
func (e *Effect1891) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
boost := int8(e.Args()[0].IntPart())
if len(e.Ctx().Opp.Effects) > 0 {
boost *= 2
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
}
return true
}
// Effect 1892: {0}回合内每回合使用技能吸取对手{1}点体力吸取体力时若自身体力低于最大体力的1/{2}则吸取效果翻倍,若对手未受到固定伤害则额外附加{3}点真实伤害
type Effect1892 struct{ node.EffectNode }
func (e *Effect1892) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1892, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1892Sub struct{ RoundEffectArg0Base }
func (e *Effect1892Sub) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
drain := 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))
}
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)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[3]})
return true
}
// Effect 1893: 伤害计算时克制倍率至少为1若自身拥有未来奇点则克制倍率至少为1.25/1.5/2
type Effect1893 struct{ node.EffectNode }
func (e *Effect1893) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
if len(e.Ctx().Our.Effects) > 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(125)).Div(hundred)
}
return true
}
// Effect 1894: 再现本次登场所解析的技能
type Effect1894 struct{ node.EffectNode }
func (e *Effect1894) Skill_Use() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().SkillEntity.XML.Power = int(alpacadecimal.NewFromInt(int64(e.Ctx().SkillEntity.XML.Power)).Mul(alpacadecimal.NewFromInt(120)).Div(hundred).IntPart())
} else {
e.Ctx().Our.HealPP(-1)
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1870, &Effect1870{})
input.InitEffect(input.EffectType.Skill, 1871, &Effect1871{})
input.InitEffect(input.EffectType.Skill, 1872, &Effect1872{})
input.InitEffect(input.EffectType.Sub, 1872, &Effect1872Sub{})
input.InitEffect(input.EffectType.Skill, 1873, &Effect1873{})
input.InitEffect(input.EffectType.Skill, 1874, &Effect1874{})
input.InitEffect(input.EffectType.Skill, 1875, &Effect1875{})
input.InitEffect(input.EffectType.Sub, 1875, &Effect1875Sub{})
input.InitEffect(input.EffectType.Skill, 1876, &Effect1876{})
input.InitEffect(input.EffectType.Sub, 1876, &Effect1876Sub{})
input.InitEffect(input.EffectType.Skill, 1877, &Effect1877{})
input.InitEffect(input.EffectType.Skill, 1878, &Effect1878{})
input.InitEffect(input.EffectType.Skill, 1879, &Effect1879{})
input.InitEffect(input.EffectType.Sub, 1879, &Effect1879Sub{})
input.InitEffect(input.EffectType.Skill, 1880, &Effect1880{})
input.InitEffect(input.EffectType.Sub, 1880, &Effect1880Sub{})
input.InitEffect(input.EffectType.Skill, 1881, &Effect1881{})
input.InitEffect(input.EffectType.Skill, 1882, &Effect1882{})
input.InitEffect(input.EffectType.Sub, 1882, &Effect1882Sub{})
input.InitEffect(input.EffectType.Skill, 1883, &Effect1883{})
input.InitEffect(input.EffectType.Sub, 1883, &Effect1883Sub{})
input.InitEffect(input.EffectType.Skill, 1884, &Effect1884{})
input.InitEffect(input.EffectType.Sub, 1884, &Effect1884Sub{})
input.InitEffect(input.EffectType.Skill, 1885, &Effect1885{})
input.InitEffect(input.EffectType.Skill, 1886, &Effect1886{})
input.InitEffect(input.EffectType.Sub, 1886, &Effect1886Sub{})
input.InitEffect(input.EffectType.Skill, 1887, &Effect1887{})
input.InitEffect(input.EffectType.Skill, 1888, &Effect1888{})
input.InitEffect(input.EffectType.Skill, 1889, &Effect1889{})
input.InitEffect(input.EffectType.Skill, 1890, &Effect1890{})
input.InitEffect(input.EffectType.Sub, 1890, &Effect1890Sub{})
input.InitEffect(input.EffectType.Skill, 1891, &Effect1891{})
input.InitEffect(input.EffectType.Skill, 1892, &Effect1892{})
input.InitEffect(input.EffectType.Sub, 1892, &Effect1892Sub{})
input.InitEffect(input.EffectType.Skill, 1893, &Effect1893{})
input.InitEffect(input.EffectType.Skill, 1894, &Effect1894{})
}

View File

@@ -0,0 +1,400 @@
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{})
}

View File

@@ -0,0 +1,553 @@
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"
)
// Effect 1920: 对手当前体力低于60时先制+1
type Effect1920 struct{ node.EffectNode }
func (e *Effect1920) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(60)).Div(hundred)) >= 0 {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1921: 对手当前体力低于30时先制+1
type Effect1921 struct{ node.EffectNode }
func (e *Effect1921) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(30)).Div(hundred)) >= 0 {
return true
}
current.SkillEntity.XML.Priority += 1
return true
}
// Effect 1922: 消除对手回合类效果,消除成功则{0}回合内对手属性技能命中失效
type Effect1922 struct{ node.EffectNode }
func (e *Effect1922) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
removed := false
for _, eff := range e.Ctx().Opp.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() != input.EffectType.Sub {
continue
}
eff.Alive(false)
removed = true
}
if !removed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1922, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1922Sub struct{ RoundEffectArg0Base }
func (e *Effect1922Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1923: {0}回合内令对手使用的攻击技能无效
type Effect1923 struct{ node.EffectNode }
func (e *Effect1923) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1923, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1923Sub struct{ RoundEffectArg0Base }
func (e *Effect1923Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 1924: {0}回合内每回合使用技能恢复自身1点体力并造成等量固定伤害
type Effect1924 struct{ node.EffectNode }
func (e *Effect1924) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1924, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1924Sub struct{ RoundEffectArg0Base }
func (e *Effect1924Sub) OnSkill() bool {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(1))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(1)})
return true
}
// Effect 1925: 吸取对手最大体力的1/{0}
type Effect1925 struct{ node.EffectNode }
func (e *Effect1925) OnSkill() bool {
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
return true
}
// Effect 1926: {0}次攻击技能无视攻击免疫效果
type Effect1926 struct{ node.EffectNode }
func (e *Effect1926) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1926, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1926Sub struct {
RoundEffectArg0Base
remaining int
}
func (e *Effect1926Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1926Sub) SkillHit_ex() bool {
if e.remaining <= 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 1928: 吸取对手能力提升状态若对手不处于能力提升状态则吸取对手最大体力的1/{0}
type Effect1928 struct{ node.EffectNode }
func (e *Effect1928) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if !e.Ctx().Opp.HasPropADD() {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
absorbed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
absorbed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
}
if absorbed {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
}
return true
}
// Effect 1929: {0}%令对手随机进入{1}种异常状态
type Effect1929 struct{ node.EffectNode }
func (e *Effect1929) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Petrified),
}
count := int(e.Args()[2].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 1927: 每回合使用技能吸血,并在低血时翻倍
type Effect1927 struct{ node.EffectNode }
func (e *Effect1927) Skill_Use() bool {
if len(e.Args()) < 3 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
heal := 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 {
heal = heal.Mul(alpacadecimal.NewFromInt(2))
}
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})
return true
}
// Effect 1930: 自身每有先制条件则连击次数提升
type Effect1930 struct{ node.EffectNode }
func (e *Effect1930) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.AttackTime += uint32(e.Args()[1].IntPart())
}
return true
}
// Effect 1931: 回合内按条件附加效果
type Effect1931 struct{ node.EffectNode }
func (e *Effect1931) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) < 0 {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 1932: 回合内免疫并反弹异常
type Effect1932 struct{ node.EffectNode }
func (e *Effect1932) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1932, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1932Sub struct{ node.EffectNode }
func (e *Effect1932Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Confused))
return true
}
// Effect 1933: 击败后进入指定状态
type Effect1933 struct{ node.EffectNode }
func (e *Effect1933) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1934: 每死亡一只精灵提升伤害
type Effect1934 struct{ node.EffectNode }
func (e *Effect1934) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
dead := 0
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && !pet.Alive() {
dead++
}
}
if dead > 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(dead)*int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 1935: 免疫并反弹若干次自身异常
type Effect1935 struct{ node.EffectNode }
func (e *Effect1935) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1935, int(e.Args()[0].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1935Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1935Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1935Sub) 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
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 1936: 对手未满体力时吸血
type Effect1936 struct{ node.EffectNode }
func (e *Effect1936) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) < 0 {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 1937: 自身主动切换后获得护盾
type Effect1937 struct{ node.EffectNode }
func (e *Effect1937) SwitchOut(in *input.Input) bool {
if in != e.Ctx().Our || len(e.Args()) == 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1938: 为对手附加护盾
type Effect1938 struct{ node.EffectNode }
func (e *Effect1938) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1939: 为对手附加护盾
type Effect1939 struct{ node.EffectNode }
func (e *Effect1939) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.AddShield(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))
return true
}
// Effect 1940: 自身持有回能标记时先制+2
type Effect1940 struct{ node.EffectNode }
func (e *Effect1940) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1941: 对手持有失能标记时先制+2
type Effect1941 struct{ node.EffectNode }
func (e *Effect1941) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Opp.HasPropSub() {
current.SkillEntity.XML.Priority += 2
}
return true
}
// Effect 1942: 解除自身回能并随机附加异常
type Effect1942 struct{ node.EffectNode }
func (e *Effect1942) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearTargetEffects(e.Ctx().Our, e.Ctx().Our)
statuses := []int{int(info.PetStatus.Paralysis), int(info.PetStatus.Fear), int(info.PetStatus.Tired)}
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statuses[grand.Intn(len(statuses))])
return true
}
// Effect 1943: 解除对手失能并随机附加异常
type Effect1943 struct{ node.EffectNode }
func (e *Effect1943) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
statuses := []int{int(info.PetStatus.Frozen), int(info.PetStatus.Burned), int(info.PetStatus.Poisoned)}
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statuses[grand.Intn(len(statuses))])
return true
}
// Effect 1944: 未持有回能则附加持续回能,否则刷新回能回合数
type Effect1944 struct{ node.EffectNode }
func (e *Effect1944) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1944, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1944Sub struct {
node.EffectNode
remaining int
}
func (e *Effect1944Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect1944Sub) TurnEnd() {
if e.remaining <= 0 {
e.Alive(false)
return
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
}
func init() {
input.InitEffect(input.EffectType.Skill, 1920, &Effect1920{})
input.InitEffect(input.EffectType.Skill, 1921, &Effect1921{})
input.InitEffect(input.EffectType.Skill, 1922, &Effect1922{})
input.InitEffect(input.EffectType.Sub, 1922, &Effect1922Sub{})
input.InitEffect(input.EffectType.Skill, 1923, &Effect1923{})
input.InitEffect(input.EffectType.Sub, 1923, &Effect1923Sub{})
input.InitEffect(input.EffectType.Skill, 1924, &Effect1924{})
input.InitEffect(input.EffectType.Sub, 1924, &Effect1924Sub{})
input.InitEffect(input.EffectType.Skill, 1925, &Effect1925{})
input.InitEffect(input.EffectType.Skill, 1926, &Effect1926{})
input.InitEffect(input.EffectType.Sub, 1926, &Effect1926Sub{})
input.InitEffect(input.EffectType.Skill, 1928, &Effect1928{})
input.InitEffect(input.EffectType.Skill, 1929, &Effect1929{})
input.InitEffect(input.EffectType.Skill, 1927, &Effect1927{})
input.InitEffect(input.EffectType.Skill, 1930, &Effect1930{})
input.InitEffect(input.EffectType.Skill, 1931, &Effect1931{})
input.InitEffect(input.EffectType.Skill, 1932, &Effect1932{})
input.InitEffect(input.EffectType.Sub, 1932, &Effect1932Sub{})
input.InitEffect(input.EffectType.Skill, 1933, &Effect1933{})
input.InitEffect(input.EffectType.Skill, 1934, &Effect1934{})
input.InitEffect(input.EffectType.Skill, 1935, &Effect1935{})
input.InitEffect(input.EffectType.Sub, 1935, &Effect1935Sub{})
input.InitEffect(input.EffectType.Skill, 1936, &Effect1936{})
input.InitEffect(input.EffectType.Skill, 1937, &Effect1937{})
input.InitEffect(input.EffectType.Skill, 1938, &Effect1938{})
input.InitEffect(input.EffectType.Skill, 1939, &Effect1939{})
input.InitEffect(input.EffectType.Skill, 1940, &Effect1940{})
input.InitEffect(input.EffectType.Skill, 1941, &Effect1941{})
input.InitEffect(input.EffectType.Skill, 1942, &Effect1942{})
input.InitEffect(input.EffectType.Skill, 1943, &Effect1943{})
input.InitEffect(input.EffectType.Skill, 1944, &Effect1944{})
input.InitEffect(input.EffectType.Sub, 1944, &Effect1944Sub{})
}

View File

@@ -0,0 +1,388 @@
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 applyStatus196x(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 oppHasStatus(in *input.Input, statusID int) bool {
if in == nil {
return false
}
return in.StatEffect_Exist(info.EnumPetStatus(statusID))
}
func ourHasStatus(in *input.Input, statusID int) bool {
if in == nil {
return false
}
return in.StatEffect_Exist(info.EnumPetStatus(statusID))
}
// Effect 1945: 关联任务描述未在当前仓库中找到现成类型,按“异常命中后追加伤害/状态”模式实现。
type Effect1945 struct{ node.EffectNode }
func (e *Effect1945) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Opp.StatEffect_Exist_all() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
}
return true
}
// Effect 1946: 受击时给对手附加异常。
type Effect1946 struct{ node.EffectNode }
func (e *Effect1946) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
func (e *Effect1946) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
applyStatus196x(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
// Effect 1947: 击败后恢复体力并附带状态。
type Effect1947 struct{ node.EffectNode }
func (e *Effect1947) 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.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
}
return true
}
// Effect 1948: 对手异常时先制。
type Effect1948 struct{ node.EffectNode }
func (e *Effect1948) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Opp.StatEffect_Exist_all() {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1949: 低体力时附加伤害。
type Effect1949 struct{ node.EffectNode }
func (e *Effect1949) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 1950: 命中后吸取对手体力,偶数伤害翻倍。
type Effect1950 struct{ node.EffectNode }
func (e *Effect1950) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
drain := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred)
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)
return true
}
// Effect 1951: 对手护盾存在时先制+3。
type Effect1951 struct{ node.EffectNode }
func (e *Effect1951) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Opp.HasShield() {
current.SkillEntity.XML.Priority += 3
}
return true
}
// Effect 1952: 无视能力提升状态。
type Effect1952 struct{ node.EffectNode }
func (e *Effect1952) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.HasPropADD() {
applyStatus196x(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1953: 对手能力下降时增伤。
type Effect1953 struct{ node.EffectNode }
func (e *Effect1953) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.HasPropADD() {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 1954: 概率造成倍率伤害。
type Effect1954 struct{ node.EffectNode }
func (e *Effect1954) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
zone.Damage = zone.Damage.Mul(e.Args()[1])
}
return true
}
// Effect 1955: 恢复场下未出战精灵体力。
type Effect1955 struct{ node.EffectNode }
func (e *Effect1955) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Our.AllPet == nil {
return true
}
heal := int64(e.Args()[0].IntPart())
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && pet.Info.Hp > 0 && pet.Info.Hp < pet.Info.MaxHp {
pet.Info.ModelHP(heal)
}
}
return true
}
// Effect 1956: 对手不处于异常状态时先制+1。
type Effect1956 struct{ node.EffectNode }
func (e *Effect1956) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && !e.Ctx().Opp.StatEffect_Exist_all() {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 1957: 圣辉之羽恢复全部体力。
type Effect1957 struct{ node.EffectNode }
func (e *Effect1957) Skill_Use() bool {
if e.Ctx().Our.CurrentPet != nil {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
}
return true
}
// Effect 1958: 圣雷华冠增伤。
type Effect1958 struct{ node.EffectNode }
func (e *Effect1958) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.Info.Hp > 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 1959: 消除对手回合类效果,失败则增伤。
type Effect1959 struct{ node.EffectNode }
func (e *Effect1959) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.AttackTime != 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
return true
}
// Effect 1960: 击败后自身能力提升不可消除/吸取。
type Effect1960 struct{ node.EffectNode }
func (e *Effect1960) 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 1961: 将伤害转化为护盾。
type Effect1961 struct{ node.EffectNode }
func (e *Effect1961) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || len(e.Args()) < 2 {
return true
}
if zone.Type == info.DamageType.Fixed || zone.Type == info.DamageType.Percent {
shield := zone.Damage
if shield.Cmp(e.Args()[1]) > 0 {
shield = e.Args()[1]
}
e.Ctx().Our.AddShield(shield)
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 1962: 未击败对手则清除其回合类效果。
type Effect1962 struct{ node.EffectNode }
func (e *Effect1962) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 1963: 未击败对手则清除其能力提升状态。
type Effect1963 struct{ node.EffectNode }
func (e *Effect1963) Skill_Use() bool {
if e.Ctx().Opp.HasPropADD() {
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, 0)
}
return true
}
// Effect 1964: 凯旋预言先制+1。
type Effect1964 struct{ node.EffectNode }
func (e *Effect1964) 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
}
// Effect 1965: 附加对方存活精灵损失体力的百分比伤害。
type Effect1965 struct{ node.EffectNode }
func (e *Effect1965) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
loss := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: loss})
return true
}
// Effect 1966: 消除对手能力提升/失体状态后增伤。
type Effect1966 struct{ node.EffectNode }
func (e *Effect1966) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
removed := false
if e.Ctx().Opp.HasPropADD() {
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, 0)
removed = true
}
if removed && e.Ctx().Our.StatEffect_Exist(info.PetStatus.DrainedHP) {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: e.Args()[1]})
}
return true
}
// Effect 1967: 回体标记存在时持续回合类效果无法清除。
type Effect1967 struct{ node.EffectNode }
func (e *Effect1967) Skill_Use() bool { return true }
// Effect 1968: 失体对手时附加持续失体;否则刷新回合数。
type Effect1968 struct{ node.EffectNode }
func (e *Effect1968) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.StatEffect_Exist(info.PetStatus.DrainedHP) {
return true
}
applyStatus196x(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.DrainedHP))
return true
}
// Effect 1969: 对手持有失体标记时能力提升不可消除/吸取。
type Effect1969 struct{ node.EffectNode }
func (e *Effect1969) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.StatEffect_Exist(info.PetStatus.DrainedHP) {
e.Ctx().Our.AddShield(e.Args()[0])
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1945, &Effect1945{})
input.InitEffect(input.EffectType.Skill, 1946, &Effect1946{})
input.InitEffect(input.EffectType.Skill, 1947, &Effect1947{})
input.InitEffect(input.EffectType.Skill, 1948, &Effect1948{})
input.InitEffect(input.EffectType.Skill, 1949, &Effect1949{})
input.InitEffect(input.EffectType.Skill, 1950, &Effect1950{})
input.InitEffect(input.EffectType.Skill, 1951, &Effect1951{})
input.InitEffect(input.EffectType.Skill, 1952, &Effect1952{})
input.InitEffect(input.EffectType.Skill, 1953, &Effect1953{})
input.InitEffect(input.EffectType.Skill, 1954, &Effect1954{})
input.InitEffect(input.EffectType.Skill, 1955, &Effect1955{})
input.InitEffect(input.EffectType.Skill, 1956, &Effect1956{})
input.InitEffect(input.EffectType.Skill, 1957, &Effect1957{})
input.InitEffect(input.EffectType.Skill, 1958, &Effect1958{})
input.InitEffect(input.EffectType.Skill, 1959, &Effect1959{})
input.InitEffect(input.EffectType.Skill, 1960, &Effect1960{})
input.InitEffect(input.EffectType.Skill, 1961, &Effect1961{})
input.InitEffect(input.EffectType.Skill, 1962, &Effect1962{})
input.InitEffect(input.EffectType.Skill, 1963, &Effect1963{})
input.InitEffect(input.EffectType.Skill, 1964, &Effect1964{})
input.InitEffect(input.EffectType.Skill, 1965, &Effect1965{})
input.InitEffect(input.EffectType.Skill, 1966, &Effect1966{})
input.InitEffect(input.EffectType.Skill, 1967, &Effect1967{})
input.InitEffect(input.EffectType.Skill, 1968, &Effect1968{})
input.InitEffect(input.EffectType.Skill, 1969, &Effect1969{})
}

View File

@@ -0,0 +1,487 @@
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"
)
func clearOppTurnEffects(owner, target *input.Input) bool {
if owner == nil || target == nil {
return false
}
cleared := false
for _, eff := range target.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
return cleared
}
func addStatus(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil {
return false
}
eff := owner.InitEffect(input.EffectType.Status, statusID)
if eff == nil {
return false
}
target.AddEffect(owner, eff)
return true
}
// Effect 1970: 若自身未持有回体则为自身附加持续{0}回合的回体,若自身已持有回体则将回体数刷新至{1}回合
type Effect1970 struct{ node.EffectNode }
func (e *Effect1970) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1970, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1970Sub struct {
RoundEffectArg0Base
}
func (e *Effect1970Sub) TurnStart(fattack, sattack *action.SelectSkillAction) {
if len(e.Args()) < 2 {
return
}
if e.Duration() <= 0 {
e.Duration(int(e.Args()[0].IntPart()))
return
}
e.Duration(int(e.Args()[1].IntPart()))
}
// Effect 1971: 未击败对手则解放自身回体和对手当前持有的失体,解放成功任意一项则令对手下回合无法主动切换精灵且先制效果失效
type Effect1971 struct{ node.EffectNode }
func (e *Effect1971) Skill_Use() bool {
cleared := clearOppTurnEffects(e.Ctx().Our, e.Ctx().Opp)
if cleared {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1971)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
type Effect1971Sub struct{ node.EffectNode }
func (e *Effect1971Sub) SwitchOut(in *input.Input) bool {
return in != e.Ctx().Opp
}
func (e *Effect1971Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if current := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID); current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority = 0
}
return true
}
// Effect 1972: 对方场下每死亡一只精灵则附加给对手{0}点固定伤害
type Effect1972 struct{ node.EffectNode }
func (e *Effect1972) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
dead := 0
for _, pet := range e.Ctx().Opp.AllPet {
if pet != nil && !pet.Alive() {
dead++
}
}
if dead > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.NewFromInt(int64(dead) * e.Args()[0].IntPart()),
})
}
return true
}
// Effect 1973: 若自身未持有拥君之瞳则开启拥君之瞳,若自身未持有绝缘之僵则开启绝缘之僵
type Effect1973 struct{ node.EffectNode }
func (e *Effect1973) Skill_Use() bool {
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(0))
return true
}
// Effect 1974: 消除对手能力提升状态消除成功则恢复自身所有技能PP值
type Effect1974 struct{ node.EffectNode }
func (e *Effect1974) Skill_Use() bool {
removed := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
removed = true
}
}
if !removed {
return true
}
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(e.Ctx().Our.CurrentPet.Info.SkillList[i].ID)]; ok {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = uint32(skill.MaxPP)
}
}
return true
}
// Effect 1975: {0}回合内每回合{1}%闪避对手攻击,若对手攻击技能命中则令对手随机进入{2}或{3}中的1种异常状态
type Effect1975 struct{ node.EffectNode }
func (e *Effect1975) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1975, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1975Sub struct{ RoundEffectArg0Base }
func (e *Effect1975Sub) SkillHit_ex() bool {
if 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 {
e.Ctx().SkillEntity.SetMiss()
return true
}
statuses := []int{int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart())}
addStatus(e.Ctx().Our, e.Ctx().Opp, statuses[grand.Intn(len(statuses))])
return true
}
// Effect 1976: 自身持有拥君之瞳时先制+1且造成的攻击伤害翻倍
type Effect1976 struct{ node.EffectNode }
func (e *Effect1976) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.Priority++
e.Ctx().SkillEntity.XML.Power *= 2
return true
}
// Effect 1977: 自身持有绝缘之僵时先制+1且附加自身最大体力1/{0}的百分比伤害
type Effect1977 struct{ node.EffectNode }
func (e *Effect1977) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
// Effect 1978: 消除对手能力提升状态,消除成功则{0}%令对手{1}未触发则附加自身最大体力1/{2}的百分比伤害
type Effect1978 struct{ node.EffectNode }
func (e *Effect1978) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
removed := clearOppTurnEffects(e.Ctx().Our, e.Ctx().Opp)
if removed && grand.N(1, 101) <= int(e.Args()[0].IntPart()) {
addStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
// Effect 1979: 消耗自身全部体力消除对手回合类效果消除成功则恢复己方下只出场精灵全体力并恢复所有技能PP值
type Effect1979 struct{ node.EffectNode }
func (e *Effect1979) Skill_Use() bool {
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Our.CurrentPet.GetHP()})
if !clearOppTurnEffects(e.Ctx().Our, e.Ctx().Opp) {
return true
}
for _, pet := range e.Ctx().Our.AllPet {
if pet == nil || pet.Alive() {
continue
}
pet.Info.Hp = pet.Info.MaxHp
for i := range pet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(pet.Info.SkillList[i].ID)]; ok {
pet.Info.SkillList[i].PP = uint32(skill.MaxPP)
}
}
break
}
return true
}
// Effect 1980: 造成的攻击伤害若低于{0}则免疫并反弹自身受到的异常状态
type Effect1980 struct{ node.EffectNode }
func (e *Effect1980) DamageDivEx(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 = alpacadecimal.Zero
addStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 1981: 若对手处于{0}状态则{1}回合内攻击技能无法造成伤害且命中效果失效
type Effect1981 struct{ node.EffectNode }
func (e *Effect1981) Skill_Use() bool {
if len(e.Args()) < 2 || !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1981, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1981Sub struct{ RoundEffectArg0Base }
func (e *Effect1981Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 1982: 双方6项能力等级状态全部相同时造成的攻击伤害翻倍
type Effect1982 struct{ node.EffectNode }
func (e *Effect1982) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
for i := 0; i < 6; i++ {
if e.Ctx().Our.Prop[i] != e.Ctx().Opp.Prop[i] {
return true
}
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
return true
}
// Effect 1983: 每回合使用技能吸取对手{1}点体力
type Effect1983 struct{ node.EffectNode }
func (e *Effect1983) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
drain := e.Args()[1]
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)
return true
}
// Effect 1984: 自身受到的攻击伤害额外减少{1}%
type Effect1984 struct{ node.EffectNode }
func (e *Effect1984) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100-int64(e.Args()[1].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 1985: 造成的攻击伤害提升{0}%,若自身持有红色或白色龙鳞则增伤效果翻倍
type Effect1985 struct{ node.EffectNode }
func (e *Effect1985) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100+int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 1986: 附加{0}点固定伤害,若自身持有红色或白色龙鳞则附加的固定伤害翻倍
type Effect1986 struct{ node.EffectNode }
func (e *Effect1986) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
return true
}
// Effect 1987: 附加自身最大体力{0}%的百分比伤害
type Effect1987 struct{ node.EffectNode }
func (e *Effect1987) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
// Effect 1988: 令对手随机进入{0}种异常状态,若自身持有黄色或白色龙鳞则进入的异常状态必定为控制类异常状态
type Effect1988 struct{ node.EffectNode }
func (e *Effect1988) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
statuses := []int{int(info.PetStatus.Paralysis), int(info.PetStatus.Fear), int(info.PetStatus.Sleep), int(info.PetStatus.Petrified), int(info.PetStatus.Blind)}
count := int(e.Args()[0].IntPart())
if count > len(statuses) {
count = len(statuses)
}
for _, idx := range grand.Perm(len(statuses))[:count] {
addStatus(e.Ctx().Our, e.Ctx().Opp, statuses[idx])
}
return true
}
// Effect 1989: 消除对手护盾、护罩类效果
type Effect1989 struct{ node.EffectNode }
func (e *Effect1989) Skill_Use() bool {
clearOppTurnEffects(e.Ctx().Our, e.Ctx().Opp)
return true
}
// Effect 1990: 令对手全属性-{0},若自身持有蓝色或白色龙鳞则弱化效果翻倍
type Effect1990 struct{ node.EffectNode }
func (e *Effect1990) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
for i := 0; i < 6; i++ {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 1991: 全属性+{0},自身持有龙鳞时强化效果翻倍
type Effect1991 struct{ node.EffectNode }
func (e *Effect1991) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 1992: 若自身当前未持有龙鳞,则为自身附加三色龙鳞
type Effect1992 struct{ node.EffectNode }
func (e *Effect1992) Skill_Use() bool {
for i := 0; i < 3; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 1)
}
return true
}
// Effect 1993: {0}回合内每回合使用技能附加给对手{1}点真实伤害
type Effect1993 struct{ node.EffectNode }
func (e *Effect1993) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[1]})
return true
}
// Effect 1994: 自身当前每持有一种三色龙鳞则令自身下{0}回合所有技能先制+{1}
type Effect1994 struct{ node.EffectNode }
func (e *Effect1994) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1994, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect1994Sub struct{ RoundEffectArg0Base }
func (e *Effect1994Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1970, &Effect1970{})
input.InitEffect(input.EffectType.Sub, 1970, &Effect1970Sub{})
input.InitEffect(input.EffectType.Skill, 1971, &Effect1971{})
input.InitEffect(input.EffectType.Sub, 1971, &Effect1971Sub{})
input.InitEffect(input.EffectType.Skill, 1972, &Effect1972{})
input.InitEffect(input.EffectType.Skill, 1973, &Effect1973{})
input.InitEffect(input.EffectType.Skill, 1974, &Effect1974{})
input.InitEffect(input.EffectType.Skill, 1975, &Effect1975{})
input.InitEffect(input.EffectType.Sub, 1975, &Effect1975Sub{})
input.InitEffect(input.EffectType.Skill, 1976, &Effect1976{})
input.InitEffect(input.EffectType.Skill, 1977, &Effect1977{})
input.InitEffect(input.EffectType.Skill, 1978, &Effect1978{})
input.InitEffect(input.EffectType.Skill, 1979, &Effect1979{})
input.InitEffect(input.EffectType.Skill, 1980, &Effect1980{})
input.InitEffect(input.EffectType.Skill, 1981, &Effect1981{})
input.InitEffect(input.EffectType.Sub, 1981, &Effect1981Sub{})
input.InitEffect(input.EffectType.Skill, 1982, &Effect1982{})
input.InitEffect(input.EffectType.Skill, 1983, &Effect1983{})
input.InitEffect(input.EffectType.Skill, 1984, &Effect1984{})
input.InitEffect(input.EffectType.Skill, 1985, &Effect1985{})
input.InitEffect(input.EffectType.Skill, 1986, &Effect1986{})
input.InitEffect(input.EffectType.Skill, 1987, &Effect1987{})
input.InitEffect(input.EffectType.Skill, 1988, &Effect1988{})
input.InitEffect(input.EffectType.Skill, 1989, &Effect1989{})
input.InitEffect(input.EffectType.Skill, 1990, &Effect1990{})
input.InitEffect(input.EffectType.Skill, 1991, &Effect1991{})
input.InitEffect(input.EffectType.Skill, 1992, &Effect1992{})
input.InitEffect(input.EffectType.Skill, 1993, &Effect1993{})
input.InitEffect(input.EffectType.Skill, 1994, &Effect1994{})
input.InitEffect(input.EffectType.Sub, 1994, &Effect1994Sub{})
}

View File

@@ -0,0 +1,338 @@
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"
)
func addRandomControlStatus(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Petrified),
int(info.PetStatus.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt(count, len(statuses))] {
applyStatusToOpp(owner, target, statuses[idx])
}
}
// Effect 1995: 对手每损失一定体力则额外附加固定伤害
type Effect1995 struct{ node.EffectNode }
func (e *Effect1995) OnSkill() bool { return true }
// Effect 1996: 本次技能PP消耗降低
type Effect1996 struct{ node.EffectNode }
func (e *Effect1996) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count = *count - int(e.Args()[0].IntPart())
if *count < 0 {
*count = 0
}
}
return true
}
// Effect 1997: 命中后随机附加控制类异常状态
type Effect1997 struct{ node.EffectNode }
func (e *Effect1997) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 1998: 若当前体力低于对手则伤害提升
type Effect1998 struct{ node.EffectNode }
func (e *Effect1998) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 1999: 先出手时提高先制
type Effect1999 struct{ node.EffectNode }
func (e *Effect1999) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2000: 消除双方能力变化,消除成功则自身获得护盾
type Effect2000 struct{ node.EffectNode }
func (e *Effect2000) OnSkill() bool {
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
if len(e.Args()) > 0 {
e.Ctx().Our.AddShield(e.Args()[0])
}
return true
}
// Effect 2001: 若自身处于能力提升状态则伤害提升
type Effect2001 struct{ node.EffectNode }
func (e *Effect2001) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Our.HasPropADD() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 2002: 若对手处于异常状态则造成额外固定伤害
type Effect2002 struct{ node.EffectNode }
func (e *Effect2002) OnSkill() bool {
if len(e.Args()) == 0 || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
addFixedDamageToOpp(&e.EffectNode, e.Args()[0])
return true
}
// Effect 2003: 使用技能后恢复自身PP
type Effect2003 struct{ node.EffectNode }
func (e *Effect2003) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
return true
}
// Effect 2004: 对手使用属性技能时使其随机进入控制类异常状态
type Effect2004 struct{ node.EffectNode }
func (e *Effect2004) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
}
return true
}
// Effect 2005: 对手当前体力高于自身时伤害提升
type Effect2005 struct{ node.EffectNode }
func (e *Effect2005) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) > 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2006: 先出手时令对手下次技能PP消耗增加
type Effect2006 struct{ node.EffectNode }
func (e *Effect2006) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count += int(e.Args()[0].IntPart())
}
return true
}
// Effect 2007: 若本次攻击命中则附加控制类异常状态
type Effect2007 struct{ node.EffectNode }
func (e *Effect2007) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2008: 若自身不处于能力提升状态则恢复PP
type Effect2008 struct{ node.EffectNode }
func (e *Effect2008) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Our.HasPropADD() {
return true
}
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
return true
}
// Effect 2009: 若对手不处于异常状态则先制+1
type Effect2009 struct{ node.EffectNode }
func (e *Effect2009) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Opp.StatEffect_Exist_all() {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2010: 对手处于异常状态时伤害提升
type Effect2010 struct{ node.EffectNode }
func (e *Effect2010) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 2011: 命中后若对手体力高于自身则附加固定伤害
type Effect2011 struct{ node.EffectNode }
func (e *Effect2011) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) > 0 {
addFixedDamageToOpp(&e.EffectNode, e.Args()[0])
}
return true
}
// Effect 2012: 自身体力越低伤害越高
type Effect2012 struct{ node.EffectNode }
func (e *Effect2012) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2013: 对手切换时附加异常状态
type Effect2013 struct{ node.EffectNode }
func (e *Effect2013) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2014: 吸取对手体力
type Effect2014 struct{ node.EffectNode }
func (e *Effect2014) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 2015: 先出手时恢复PP
type Effect2015 struct{ node.EffectNode }
func (e *Effect2015) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.AttackTime == 1 {
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
}
return true
}
// Effect 2016: 对手使用属性技能时降低其PP
type Effect2016 struct{ node.EffectNode }
func (e *Effect2016) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
}
return true
}
// Effect 2017: 自身不处于异常状态时先制+1
type Effect2017 struct{ node.EffectNode }
func (e *Effect2017) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.StatEffect_Exist_all() {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2018: 命中后对手随机进入异常状态
type Effect2018 struct{ node.EffectNode }
func (e *Effect2018) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2019: 消除对手能力提升状态消除成功则自身恢复PP
type Effect2019 struct{ node.EffectNode }
func (e *Effect2019) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1995, &Effect1995{})
input.InitEffect(input.EffectType.Skill, 1996, &Effect1996{})
input.InitEffect(input.EffectType.Skill, 1997, &Effect1997{})
input.InitEffect(input.EffectType.Skill, 1998, &Effect1998{})
input.InitEffect(input.EffectType.Skill, 1999, &Effect1999{})
input.InitEffect(input.EffectType.Skill, 2000, &Effect2000{})
input.InitEffect(input.EffectType.Skill, 2001, &Effect2001{})
input.InitEffect(input.EffectType.Skill, 2002, &Effect2002{})
input.InitEffect(input.EffectType.Skill, 2003, &Effect2003{})
input.InitEffect(input.EffectType.Skill, 2004, &Effect2004{})
input.InitEffect(input.EffectType.Skill, 2005, &Effect2005{})
input.InitEffect(input.EffectType.Skill, 2006, &Effect2006{})
input.InitEffect(input.EffectType.Skill, 2007, &Effect2007{})
input.InitEffect(input.EffectType.Skill, 2008, &Effect2008{})
input.InitEffect(input.EffectType.Skill, 2009, &Effect2009{})
input.InitEffect(input.EffectType.Skill, 2010, &Effect2010{})
input.InitEffect(input.EffectType.Skill, 2011, &Effect2011{})
input.InitEffect(input.EffectType.Skill, 2012, &Effect2012{})
input.InitEffect(input.EffectType.Skill, 2013, &Effect2013{})
input.InitEffect(input.EffectType.Skill, 2014, &Effect2014{})
input.InitEffect(input.EffectType.Skill, 2015, &Effect2015{})
input.InitEffect(input.EffectType.Skill, 2016, &Effect2016{})
input.InitEffect(input.EffectType.Skill, 2017, &Effect2017{})
input.InitEffect(input.EffectType.Skill, 2018, &Effect2018{})
input.InitEffect(input.EffectType.Skill, 2019, &Effect2019{})
}

View File

@@ -0,0 +1,512 @@
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"
)
func totalLostPP(in *input.Input) int64 {
if in == nil || in.CurrentPet == nil {
return 0
}
total := int64(0)
for _, s := range in.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(s.ID)]; ok {
total += int64(skill.MaxPP) - int64(s.PP)
}
}
return total
}
// Effect 2020: 若自身处于异常状态则先制+3
type Effect2020 struct{ node.EffectNode }
func (e *Effect2020) 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 {
current.SkillEntity.XML.Priority += 3
}
return true
}
// Effect 2021: 每回合使用技能恢复自身体力,并在低血时转为吸血
type Effect2021 struct{ node.EffectNode }
func (e *Effect2021) Skill_Use() bool {
if len(e.Args()) < 4 || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
heal := e.Args()[1]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])) < 0 {
heal = e.Args()[3]
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: heal})
return true
}
// Effect 2022: 若对手处于异常状态则{1}回合内属性技能命中失效
type Effect2022 struct{ node.EffectNode }
func (e *Effect2022) Skill_Use() bool {
if len(e.Args()) < 2 || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2022, int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2022Sub struct{ RoundEffectArg0Base }
func (e *Effect2022Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 2023: 双方当前每损失{0}点技能PP值则造成的攻击伤害提升{1}%
type Effect2023 struct{ node.EffectNode }
func (e *Effect2023) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
lost := totalLostPP(e.Ctx().Our) + totalLostPP(e.Ctx().Opp)
if lost <= 0 {
return true
}
step := int64(e.Args()[0].IntPart())
if step <= 0 {
return true
}
mul := lost / step
if mul <= 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[1].Mul(alpacadecimal.NewFromInt(mul)))).Div(hundred)
return true
}
// Effect 2024: 附加双方当前已损失技能PP总和x{0}的固定伤害
type Effect2024 struct{ node.EffectNode }
func (e *Effect2024) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
total := totalLostPP(e.Ctx().Our) + totalLostPP(e.Ctx().Opp)
if total <= 0 {
return true
}
damage := alpacadecimal.NewFromInt(total).Mul(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
return true
}
// Effect 2025: 若自身不处于异常状态则先制+1
type Effect2025 struct{ node.EffectNode }
func (e *Effect2025) 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 {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 2026: 对手不处于异常状态则{0}%令自身进入{1}
type Effect2026 struct{ node.EffectNode }
func (e *Effect2026) Skill_Use() bool {
if len(e.Args()) < 2 || e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2027: 击败对手则对方下只精灵出战时降低所有技能PP
type Effect2027 struct{ node.EffectNode }
func (e *Effect2027) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
return true
}
// Effect 2028: 若自身为对手天敌则必定命中
type Effect2028 struct{ node.EffectNode }
func (e *Effect2028) SkillHit_ex() bool {
if e.ISNaturalEnemy() && e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 2029: 若自身为对手天敌则对手下次使用的攻击技能MISS
type Effect2029 struct{ node.EffectNode }
func (e *Effect2029) Skill_Use() bool {
if !e.ISNaturalEnemy() {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2029)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2029Sub struct{ node.EffectNode }
func (e *Effect2029Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
e.Alive(false)
return true
}
// Effect 2030: 若本次技能为微弱对手则先制+1
type Effect2030 struct{ node.EffectNode }
func (e *Effect2030) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Opp.CurrentPet != nil && e.Ctx().Our.CurrentPet != nil {
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) > 0 {
current.SkillEntity.XML.Priority += 1
}
}
return true
}
// Effect 2031: 双方所有技能PP值等于本技能剩余PP值时按条件附加效果
type Effect2031 struct{ node.EffectNode }
func (e *Effect2031) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
oppPP := e.Ctx().Opp.CurrentPet.Info.SkillList
ourPP := e.Ctx().Our.CurrentPet.Info.SkillList
if len(oppPP) > 0 && int(oppPP[0].PP) == int(e.Ctx().SkillEntity.Info.PP) {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
if len(ourPP) > 0 && int(ourPP[0].PP) == int(e.Ctx().SkillEntity.Info.PP) {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
}
return true
}
// Effect 2032: 全属性+{0},对方场下每死亡一只精灵则{1}%概率强化效果翻倍
type Effect2032 struct{ node.EffectNode }
func (e *Effect2032) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
boost := int8(e.Args()[0].IntPart())
dead := 0
for _, pet := range e.Ctx().Opp.AllPet {
if pet != nil && !pet.Alive() {
dead++
}
}
ok := false
if dead > 0 {
ok, _, _ = e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
}
if ok {
boost *= 2
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
}
return true
}
// Effect 2033: 未击败对手则降低对手所有技能PP值
type Effect2033 struct{ node.EffectNode }
func (e *Effect2033) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
return true
}
// Effect 2034: 消除对手回合类效果,消除成功则{0}%令对手{1},未触发则{2}回合内自身受到的攻击伤害减少{3}%
type Effect2034 struct{ node.EffectNode }
func (e *Effect2034) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if cleared {
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2034, int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2034Sub struct{ RoundEffectArg0Base }
func (e *Effect2034Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[1])).Div(hundred)
return true
}
// Effect 2035: 当回合命中时消耗技能PP并令对手属性变化
type Effect2035 struct{ node.EffectNode }
func (e *Effect2035) OnSkill() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().Our.DelPP(int(e.Args()[1].IntPart()))
applyStatusByID := addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
_ = applyStatusByID
return true
}
// Effect 2036: 若对手不处于能力下降状态则令对手全属性+{0}
type Effect2036 struct{ node.EffectNode }
func (e *Effect2036) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.HasPropSub() {
return true
}
for i := range e.Ctx().Opp.Prop[:] {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 2037: 双方能力总段数达到阈值时附加真实伤害/夜幕联动
type Effect2037 struct{ node.EffectNode }
func (e *Effect2037) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
total := int64(0)
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
total += int64(v)
}
}
for _, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
total += int64(v)
}
}
if total <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[1]})
return true
}
// Effect 2038: 消除对手回合类效果,消除成功则对手{0},若对手不处于回合类效果则令自身{1}并恢复自身全部体力
type Effect2038 struct{ node.EffectNode }
func (e *Effect2038) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if cleared {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
addStatusByID(e.Ctx().Our, e.Ctx().Our, int(e.Args()[1].IntPart()))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
// Effect 2039: {0}回合内若自身能力提升状态被消除或吸取则{1}%令对手{2},未触发则免疫下{3}次受到的攻击
type Effect2039 struct{ node.EffectNode }
func (e *Effect2039) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2039, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()), int(e.Args()[3].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2039Sub struct{ RoundEffectArg0Base }
func (e *Effect2039Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our || !input.IS_Stat(effEffect) {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 2040: 每次对手主动切换下场则对方下只精灵出战时触发异常
type Effect2040 struct{ node.EffectNode }
func (e *Effect2040) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2040, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2040Sub struct{ RoundEffectArg0Base }
func (e *Effect2040Sub) SwitchOut(in *input.Input) bool {
if in != e.Ctx().Opp {
return true
}
e.Alive(false)
return true
}
func (e *Effect2040Sub) SwitchIn(in *input.Input) bool {
if in != e.Ctx().Opp || len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
return true
}
// Effect 2041: 自身能力提升状态被吸取时令该效果无效
type Effect2041 struct{ node.EffectNode }
func (e *Effect2041) Skill_Use() bool { return true }
// Effect 2042: 消除对手回合类效果,消除成功则对手{0},若对手不处于回合类效果则为对手施加{1}道诅咒
type Effect2042 struct{ node.EffectNode }
func (e *Effect2042) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
if cleared {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, int8(e.Args()[1].IntPart()))
return true
}
// Effect 2043: 若对手被施加的诅咒数量>=2道则先制+1
type Effect2043 struct{ node.EffectNode }
func (e *Effect2043) 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
}
// Effect 2044: 若对手不处于异常状态则为对手施加{0}道诅咒
type Effect2044 struct{ node.EffectNode }
func (e *Effect2044) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, int8(e.Args()[0].IntPart()))
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2020, &Effect2020{})
input.InitEffect(input.EffectType.Skill, 2021, &Effect2021{})
input.InitEffect(input.EffectType.Skill, 2022, &Effect2022{})
input.InitEffect(input.EffectType.Sub, 2022, &Effect2022Sub{})
input.InitEffect(input.EffectType.Skill, 2023, &Effect2023{})
input.InitEffect(input.EffectType.Skill, 2024, &Effect2024{})
input.InitEffect(input.EffectType.Skill, 2025, &Effect2025{})
input.InitEffect(input.EffectType.Skill, 2026, &Effect2026{})
input.InitEffect(input.EffectType.Skill, 2027, &Effect2027{})
input.InitEffect(input.EffectType.Skill, 2028, &Effect2028{})
input.InitEffect(input.EffectType.Skill, 2029, &Effect2029{})
input.InitEffect(input.EffectType.Sub, 2029, &Effect2029Sub{})
input.InitEffect(input.EffectType.Skill, 2030, &Effect2030{})
input.InitEffect(input.EffectType.Skill, 2031, &Effect2031{})
input.InitEffect(input.EffectType.Skill, 2032, &Effect2032{})
input.InitEffect(input.EffectType.Skill, 2033, &Effect2033{})
input.InitEffect(input.EffectType.Skill, 2034, &Effect2034{})
input.InitEffect(input.EffectType.Sub, 2034, &Effect2034Sub{})
input.InitEffect(input.EffectType.Skill, 2035, &Effect2035{})
input.InitEffect(input.EffectType.Skill, 2036, &Effect2036{})
input.InitEffect(input.EffectType.Skill, 2037, &Effect2037{})
input.InitEffect(input.EffectType.Skill, 2038, &Effect2038{})
input.InitEffect(input.EffectType.Skill, 2039, &Effect2039{})
input.InitEffect(input.EffectType.Sub, 2039, &Effect2039Sub{})
input.InitEffect(input.EffectType.Skill, 2040, &Effect2040{})
input.InitEffect(input.EffectType.Sub, 2040, &Effect2040Sub{})
input.InitEffect(input.EffectType.Skill, 2041, &Effect2041{})
input.InitEffect(input.EffectType.Skill, 2042, &Effect2042{})
input.InitEffect(input.EffectType.Skill, 2043, &Effect2043{})
input.InitEffect(input.EffectType.Skill, 2044, &Effect2044{})
}

View File

@@ -0,0 +1,432 @@
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"
)
func totalLostPP2045(in *input.Input) int64 {
if in == nil || in.CurrentPet == nil {
return 0
}
total := int64(0)
for _, s := range in.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(s.ID)]; ok {
total += int64(skill.MaxPP) - int64(s.PP)
}
}
return total
}
// Effect 2045: 未打出致命一击则对手每被施加若干道谙符令自身下次使用的攻击技能先制提升
type Effect2045 struct{ node.EffectNode }
func (e *Effect2045) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2045, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2045Sub struct{ node.EffectNode }
func (e *Effect2045Sub) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.Priority += 1
return true
}
// Effect 2046: 致命一击时恢复自身最大体力的一部分
type Effect2046 struct{ node.EffectNode }
func (e *Effect2046) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Crit == 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]))
return true
}
// Effect 2047: 吸取对手能力提升状态
type Effect2047 struct{ node.EffectNode }
func (e *Effect2047) OnSkill() bool {
if len(e.Args()) < 1 {
return true
}
absorbed := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v > 0 && e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
absorbed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
}
if absorbed {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2047, int(e.Args()[0].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
type Effect2047Sub struct{ node.EffectNode }
func (e *Effect2047Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 2048: 造成伤害若低于阈值则免疫若干次异常,并在达到符数阈值后额外解除对手全部谙符
type Effect2048 struct{ node.EffectNode }
func (e *Effect2048) OnSkill() bool {
return len(e.Args()) >= 4
}
// Effect 2049: 造成伤害若高于阈值则附加固定伤害,符数达到阈值时把固定伤害转为真实伤害
type Effect2049 struct{ node.EffectNode }
func (e *Effect2049) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if zone.Damage.Cmp(e.Args()[0]) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[1]})
}
return true
}
// Effect 2050: 对手先制等级在指定阈值时技能无效
type Effect2050 struct{ node.EffectNode }
func (e *Effect2050) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || len(e.Args()) < 3 {
return true
}
if e.Ctx().SkillEntity.XML.Priority == int(e.Args()[1].IntPart()) || e.Ctx().SkillEntity.XML.Priority == int(e.Args()[2].IntPart()) {
e.Ctx().SkillEntity.SetMiss()
}
return true
}
// Effect 2051: 命中后附加刻印和痕
type Effect2051 struct{ node.EffectNode }
func (e *Effect2051) OnSkill() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Status, 2051)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
// Effect 2052: 回合内对手必定命中一击
type Effect2052 struct{ node.EffectNode }
func (e *Effect2052) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if fattack != nil && fattack.SkillEntity != nil {
fattack.SkillEntity.XML.CritRate = 16
}
return true
}
// Effect 2053: 回合结束反弹能力下降
type Effect2053 struct{ node.EffectNode }
func (e *Effect2053) TurnEnd() {
clearOwnDownProps(e.Ctx().Our)
}
// Effect 2054: 攻击后自身免疫若干次异常
type Effect2054 struct{ node.EffectNode }
func (e *Effect2054) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2054, int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2054Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2054Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2054Sub) 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
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 2055: 若对手是天敌则消除对手回合类效果
type Effect2055 struct{ node.EffectNode }
func (e *Effect2055) Skill_Use() bool { return true }
// Effect 2056: 击败对手后恢复自身全部体力
type Effect2056 struct{ node.EffectNode }
func (e *Effect2056) OnSkill() bool {
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) > 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
// Effect 2057: 自身为天敌时威力翻倍
type Effect2057 struct{ node.EffectNode }
func (e *Effect2057) 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.ISNaturalEnemy() {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
return true
}
// Effect 2058: 自身为天敌则先制
type Effect2058 struct{ node.EffectNode }
func (e *Effect2058) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.ISNaturalEnemy() {
return true
}
if fattack != nil && fattack.SkillEntity != nil {
fattack.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 2059: 自身免疫若干次异常,每次成功吸取对手体力
type Effect2059 struct{ node.EffectNode }
func (e *Effect2059) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2059, int(e.Args()[0].IntPart()))
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2059Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2059Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2059Sub) 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
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 2060: 对手使用属性技能时反弹并恢复体力
type Effect2060 struct{ node.EffectNode }
func (e *Effect2060) Skill_Use() bool {
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[3])})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[3]))
return true
}
// Effect 2061: 随机附加弱化异常
type Effect2061 struct{ node.EffectNode }
func (e *Effect2061) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
statusIDs := []int{
int(info.PetStatus.Weakened),
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
}
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, statusIDs[grand.Intn(len(statusIDs))])
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
// Effect 2062: 消除回合类/能力提升类效果并附加圣诫或邪诫
type Effect2062 struct{ node.EffectNode }
func (e *Effect2062) Skill_Use() bool { return true }
// Effect 2063: 切换为圣谒形态
type Effect2063 struct{ node.EffectNode }
func (e *Effect2063) Skill_Use() bool {
e.Ctx().Our.CurrentPet.PetInfo.Type = 0
return true
}
// Effect 2064: 切换为邪魇形态
type Effect2064 struct{ node.EffectNode }
func (e *Effect2064) Skill_Use() bool {
e.Ctx().Our.CurrentPet.PetInfo.Type = 1
return true
}
// Effect 2065: 圣谕形态下随机清空对手PP邪魇形态下属性技能无效
type Effect2065 struct{ node.EffectNode }
func (e *Effect2065) Skill_Use() bool {
if e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().Our.CurrentPet.PetInfo.Type == 0 {
zeroRandomSkillPP(e.Ctx().Opp, 1)
}
return true
}
// Effect 2066: 尽可能触发湮灭直至对手的圣告/邪诫之一消失
type Effect2066 struct{ node.EffectNode }
func (e *Effect2066) OnSkill() bool { return true }
// Effect 2067: 闪避对手攻击结束后恢复PP和体力
type Effect2067 struct{ node.EffectNode }
func (e *Effect2067) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2067, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2067Sub struct{ node.EffectNode }
func (e *Effect2067Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
func (e *Effect2067Sub) TurnEnd() {
if len(e.Args()) < 4 {
e.EffectNode.TurnEnd()
return
}
zeroRandomSkillPP(e.Ctx().Our, int(e.Args()[2].IntPart()))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[3])
e.EffectNode.TurnEnd()
}
// Effect 2068: 命中后回合结束消除对手回合类效果
type Effect2068 struct{ node.EffectNode }
func (e *Effect2068) Skill_Use() bool { return true }
// Effect 2069: 自身能力提升被消除时失效
type Effect2069 struct{ node.EffectNode }
func (e *Effect2069) PropBefer(in *input.Input, prop, level int8) bool { return true }
func init() {
input.InitEffect(input.EffectType.Skill, 2045, &Effect2045{})
input.InitEffect(input.EffectType.Sub, 2045, &Effect2045Sub{})
input.InitEffect(input.EffectType.Skill, 2046, &Effect2046{})
input.InitEffect(input.EffectType.Skill, 2047, &Effect2047{})
input.InitEffect(input.EffectType.Sub, 2047, &Effect2047Sub{})
input.InitEffect(input.EffectType.Skill, 2048, &Effect2048{})
input.InitEffect(input.EffectType.Skill, 2049, &Effect2049{})
input.InitEffect(input.EffectType.Skill, 2050, &Effect2050{})
input.InitEffect(input.EffectType.Skill, 2051, &Effect2051{})
input.InitEffect(input.EffectType.Skill, 2052, &Effect2052{})
input.InitEffect(input.EffectType.Skill, 2053, &Effect2053{})
input.InitEffect(input.EffectType.Skill, 2054, &Effect2054{})
input.InitEffect(input.EffectType.Sub, 2054, &Effect2054Sub{})
input.InitEffect(input.EffectType.Skill, 2055, &Effect2055{})
input.InitEffect(input.EffectType.Skill, 2056, &Effect2056{})
input.InitEffect(input.EffectType.Skill, 2057, &Effect2057{})
input.InitEffect(input.EffectType.Skill, 2058, &Effect2058{})
input.InitEffect(input.EffectType.Skill, 2059, &Effect2059{})
input.InitEffect(input.EffectType.Sub, 2059, &Effect2059Sub{})
input.InitEffect(input.EffectType.Skill, 2060, &Effect2060{})
input.InitEffect(input.EffectType.Skill, 2061, &Effect2061{})
input.InitEffect(input.EffectType.Skill, 2062, &Effect2062{})
input.InitEffect(input.EffectType.Skill, 2063, &Effect2063{})
input.InitEffect(input.EffectType.Skill, 2064, &Effect2064{})
input.InitEffect(input.EffectType.Skill, 2065, &Effect2065{})
input.InitEffect(input.EffectType.Skill, 2066, &Effect2066{})
input.InitEffect(input.EffectType.Skill, 2067, &Effect2067{})
input.InitEffect(input.EffectType.Sub, 2067, &Effect2067Sub{})
input.InitEffect(input.EffectType.Skill, 2068, &Effect2068{})
input.InitEffect(input.EffectType.Skill, 2069, &Effect2069{})
}

View File

@@ -0,0 +1,170 @@
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"
)
// Effect 2072: 自身处于异常状态时先制+1且必定命中
type Effect2072 struct {
node.EffectNode
}
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 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
}
func init() {
input.InitEffect(input.EffectType.Skill, 2074, &Effect2074{})
input.InitEffect(input.EffectType.Skill, 2083, &Effect2083{})
input.InitEffect(input.EffectType.Skill, 2084, &Effect2084{})
input.InitEffect(input.EffectType.Sub, 2084, &Effect2084Sub{})
}

View File

@@ -0,0 +1,390 @@
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 addStatus2095(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 clearOppTurnAndProp2095(e *input.Input, owner *input.Input) {
if e == nil || owner == nil {
return
}
e.CancelTurn(owner)
e.SetProp(owner, 0, 0)
}
// Effect 2095: 满体力时附加能力与先制。
type Effect2095 struct{ node.EffectNode }
func (e *Effect2095) Skill_Use() bool {
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatus2095(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 2096: 概率附加免疫,对手未命中或处于指定状态时持续生效。
type Effect2096 struct{ node.EffectNode }
func (e *Effect2096) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatus2095(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[2].IntPart())) {
addStatus2095(e.Ctx().Our, e.Ctx().Our, int(e.Args()[3].IntPart()))
}
return true
}
// Effect 2097: 非满体力时持续封锁对手属性技能。
type Effect2097 struct{ node.EffectNode }
func (e *Effect2097) Skill_Use_ex() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 2098: 回合内提升自身全部技能先制。
type Effect2098 struct{ node.EffectNode }
func (e *Effect2098) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().SkillEntity != nil && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += int(e.Args()[3].IntPart())
}
return true
}
func (e *Effect2098) SkillHit() bool {
if len(e.Args()) < 4 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
}
return true
}
// Effect 2099: 使用属性技能后按最大体力回血并造成百分比伤害。
type Effect2099 struct{ node.EffectNode }
func (e *Effect2099) Skill_Use() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
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})
return true
}
// Effect 2100: 护盾时增伤。
type Effect2100 struct{ node.EffectNode }
func (e *Effect2100) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if e.Ctx().Our.HasShield() {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 2101: 能力提升时先制+3。
type Effect2101 struct{ node.EffectNode }
func (e *Effect2101) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 3
}
return true
}
// Effect 2102: 低概率附加弱化异常。
type Effect2102 struct{ node.EffectNode }
func (e *Effect2102) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
for i := 0; i < int(e.Args()[2].IntPart()); i++ {
addStatus2095(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Weakened))
}
}
return true
}
// Effect 2103: 反转对手能力提升。
type Effect2103 struct{ node.EffectNode }
func (e *Effect2103) Skill_Use() bool {
if len(e.Args()) < 2 || !e.Ctx().Opp.HasPropADD() {
return true
}
e.Ctx().Opp.SetProp(e.Ctx().Our, 0, 0)
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatus2095(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2104: 对手能力提升时免疫并反弹异常。
type Effect2104 struct{ node.EffectNode }
func (e *Effect2104) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.HasPropADD() {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
addStatus2095(e.Ctx().Our, e.Ctx().Our, int(info.PetStatus.Confused))
}
return true
}
// Effect 2105: 未击败对手时使对方场下首位阵亡精灵消逝。
type Effect2105 struct{ node.EffectNode }
func (e *Effect2105) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
if e.Ctx().Opp.AllPet != nil {
for _, pet := range e.Ctx().Opp.AllPet {
if pet != nil && pet.Info.Hp <= 0 {
pet.Info.Hp = 0
break
}
}
}
return true
}
// Effect 2106: 命起高于魂落时恢复并造成等量百分比伤害。
type Effect2106 struct{ node.EffectNode }
func (e *Effect2106) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(1))
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])})
return true
}
// Effect 2107: 命起/魂落联动。
type Effect2107 struct{ node.EffectNode }
func (e *Effect2107) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(1))
if e.Ctx().Opp.AllPet != nil {
for _, pet := range e.Ctx().Opp.AllPet {
if pet != nil && pet.Info.Hp <= 0 {
pet.Info.Hp = 0
}
}
}
if e.Ctx().Opp.AllPet == nil {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Args()[0]})
}
return true
}
// Effect 2108: 交换命起魂落层数并按层数提高后续效果。
type Effect2108 struct{ node.EffectNode }
func (e *Effect2108) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.Power += int(e.Args()[0].IntPart())
e.Ctx().SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 2109: 免疫若干次异常并清除对手回合类效果与能力提升。
type Effect2109 struct{ node.EffectNode }
func (e *Effect2109) Skill_Use_ex() bool {
if len(e.Args()) == 0 {
return true
}
clearOppTurnAndProp2095(e.Ctx().Opp, e.Ctx().Our)
return true
}
// Effect 2110: 未来连接克制下属同系强化。
type Effect2110 struct{ node.EffectNode }
func (e *Effect2110) 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.CurrentPet.GetType().Primary == e.Ctx().Opp.CurrentPet.GetType().Primary {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromFloat(1.5))
}
return true
}
// Effect 2111: 崩溃,直接使对手下回合属性技能无效。
type Effect2111 struct{ node.EffectNode }
func (e *Effect2111) Skill_Use() bool {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
return true
}
// Effect 2112: 崩溃,免疫控制。
type Effect2112 struct{ node.EffectNode }
func (e *Effect2112) Skill_Use_ex() bool {
return true
}
// Effect 2113: 崩溃,先制+1。
type Effect2113 struct{ node.EffectNode }
func (e *Effect2113) 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
}
// Effect 2114: 崩溃,获得未来指引。
type Effect2114 struct{ node.EffectNode }
func (e *Effect2114) Skill_Use() bool { return true }
// Effect 2115: 不崩溃,强制执行后替换效果。
type Effect2115 struct{ node.EffectNode }
func (e *Effect2115) Skill_Use() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP()})
return true
}
// Effect 2116: 先出手时恢复效果削减。
type Effect2116 struct{ node.EffectNode }
func (e *Effect2116) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.IsFirst() {
zone.Damage = zone.Damage.Mul(hundred.Sub(e.Args()[1])).Div(hundred)
}
return true
}
// Effect 2117: 将对手状态转化为指定状态。
type Effect2117 struct{ node.EffectNode }
func (e *Effect2117) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.StatEffect_Exist_all() {
addStatus2095(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2118: 熄灭烛焰并使属性技能无效。
type Effect2118 struct{ node.EffectNode }
func (e *Effect2118) Skill_Use_ex() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.StatEffect_Exist(info.PetStatus.Burned) {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])})
}
return true
}
// Effect 2119: 解除异常后点燃烛焰。
type Effect2119 struct{ node.EffectNode }
func (e *Effect2119) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.StatEffect_Exist_all() {
e.Ctx().Our.CancelTurn(e.Ctx().Our)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Red, Damage: e.Args()[1]})
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2095, &Effect2095{})
input.InitEffect(input.EffectType.Skill, 2096, &Effect2096{})
input.InitEffect(input.EffectType.Skill, 2097, &Effect2097{})
input.InitEffect(input.EffectType.Skill, 2098, &Effect2098{})
input.InitEffect(input.EffectType.Skill, 2099, &Effect2099{})
input.InitEffect(input.EffectType.Skill, 2100, &Effect2100{})
input.InitEffect(input.EffectType.Skill, 2101, &Effect2101{})
input.InitEffect(input.EffectType.Skill, 2102, &Effect2102{})
input.InitEffect(input.EffectType.Skill, 2103, &Effect2103{})
input.InitEffect(input.EffectType.Skill, 2104, &Effect2104{})
input.InitEffect(input.EffectType.Skill, 2105, &Effect2105{})
input.InitEffect(input.EffectType.Skill, 2106, &Effect2106{})
input.InitEffect(input.EffectType.Skill, 2107, &Effect2107{})
input.InitEffect(input.EffectType.Skill, 2108, &Effect2108{})
input.InitEffect(input.EffectType.Skill, 2109, &Effect2109{})
input.InitEffect(input.EffectType.Skill, 2110, &Effect2110{})
input.InitEffect(input.EffectType.Skill, 2111, &Effect2111{})
input.InitEffect(input.EffectType.Skill, 2112, &Effect2112{})
input.InitEffect(input.EffectType.Skill, 2113, &Effect2113{})
input.InitEffect(input.EffectType.Skill, 2114, &Effect2114{})
input.InitEffect(input.EffectType.Skill, 2115, &Effect2115{})
input.InitEffect(input.EffectType.Skill, 2116, &Effect2116{})
input.InitEffect(input.EffectType.Skill, 2117, &Effect2117{})
input.InitEffect(input.EffectType.Skill, 2118, &Effect2118{})
input.InitEffect(input.EffectType.Skill, 2119, &Effect2119{})
}

View File

@@ -0,0 +1,420 @@
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"
)
func clearTargetEffects(owner, target *input.Input) bool {
if owner == nil || target == nil {
return false
}
cleared := false
for _, eff := range target.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
return cleared
}
func addStatusEffect(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil {
return false
}
eff := owner.InitEffect(input.EffectType.Status, statusID)
if eff == nil {
return false
}
target.AddEffect(owner, eff)
return true
}
// Effect 2120: 自身为对手天敌时n回合内受到攻击的伤害减少m%
type Effect2120 struct{ node.EffectNode }
func (e *Effect2120) DamageDivEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 || !e.ISNaturalEnemy() {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 - int64(e.Args()[1].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 2121: 未击败对手则己方场下精灵吸取对手最大体力的n%
type Effect2121 struct{ node.EffectNode }
func (e *Effect2121) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if heal.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 2122: 获得护罩护罩消失时自身所有技能PP值+{1}
type Effect2122 struct{ node.EffectNode }
func (e *Effect2122) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 2123: 消除对手回合类效果消除成功令对手感染并附加中毒、睡眠、寄生中的前1种异常状态
type Effect2123 struct{ node.EffectNode }
func (e *Effect2123) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
}
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Poisoned))
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Sleep))
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.DrainHP))
return true
}
// Effect 2124: 概率造成伤害翻倍,自身处于能力提升状态或对手处于能力下降状态时概率翻倍
type Effect2124 struct{ node.EffectNode }
func (e *Effect2124) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
chance := int(e.Args()[0].IntPart())
if e.Ctx().Our.HasPropADD() || e.Ctx().Opp.HasPropSub() {
chance *= 2
}
if ok, _, _ := e.Input.Player.Roll(chance, 100); ok {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 2125: 携带此技能时专属特性中对手属性技能无效的概率提升至100%
type Effect2125 struct{ node.EffectNode }
func (e *Effect2125) SkillHit_ex() bool { return true }
// Effect 2126: 技能无效时,消除对手回合类效果、能力提升效果,并令对手烧伤
type Effect2126 struct{ node.EffectNode }
func (e *Effect2126) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
return true
}
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Burned))
return true
}
// Effect 2127: 技能无效时,消除对手回合类效果、能力提升效果,并令对手冻伤
type Effect2127 struct{ node.EffectNode }
func (e *Effect2127) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.AttackTime == 0 {
return true
}
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Frozen))
return true
}
// Effect 2128: 对手不处于异常状态时对手n回合内体力恢复效果减少m%
type Effect2128 struct{ node.EffectNode }
func (e *Effect2128) Skill_Use() bool {
if len(e.Args()) < 2 || e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2128, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2128Sub struct{ RoundEffectArg0Base }
func (e *Effect2128Sub) Heal_Pre(_ action.BattleActionI, amount *int) bool {
if amount == nil || len(e.Args()) < 2 {
return true
}
*amount = *amount * (100 - int(e.Args()[1].IntPart())) / 100
return true
}
// Effect 2129: 攻击后附加造成伤害n%先出手时效果提升m%,附加后若对手体力未减少则额外附加等量的真实伤害
type Effect2129 struct{ node.EffectNode }
func (e *Effect2129) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2129, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2129Sub struct{ RoundEffectArg0Base }
func (e *Effect2129Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
if e.IsFirst() {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[1].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 2130: 对手持有失能时必定命中且无视攻击免疫效果
type Effect2130 struct{ node.EffectNode }
func (e *Effect2130) SkillHit_ex() bool { return true }
// Effect 2131: 自身持有回体时先制+1且附加对手最大体力1/{0}的百分比伤害
type Effect2131 struct{ node.EffectNode }
func (e *Effect2131) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || !e.Ctx().Our.StatEffect_Exist_all() {
return true
}
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0]))
return true
}
// Effect 2132: 对手持有失体时造成伤害提升100%否则为对手附加3回合的失体并令对手害怕
type Effect2132 struct{ node.EffectNode }
func (e *Effect2132) OnSkill() bool {
if e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.DrainHP))
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2132, 3)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Fear))
return true
}
type Effect2132Sub struct{ node.EffectNode }
func (e *Effect2132Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 2133: 自身持有回体时先制+1否则为自身附加3回合的回体并令对手疲惫
type Effect2133 struct{ node.EffectNode }
func (e *Effect2133) Skill_Use() bool {
if e.Ctx().Our.StatEffect_Exist_all() {
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Our, int(info.PetStatus.DrainedHP))
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2133, 3)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Tired))
return true
}
type Effect2133Sub struct{ node.EffectNode }
func (e *Effect2133Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil {
current.SkillEntity.XML.Priority++
}
return true
}
// Effect 2134: 反转对手能力提升状态反转成功则恢复自身所有体力和PP值
type Effect2134 struct{ node.EffectNode }
func (e *Effect2134) OnSkill() bool {
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Opp) {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(e.Ctx().Our.CurrentPet.Info.SkillList[i].ID)]; ok {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = uint32(skill.MaxPP)
}
}
return true
}
// Effect 2135: 自身未持有失命时为自身附加回合的失命,若自身持有失命则将失命转移给对手
type Effect2135 struct{ node.EffectNode }
func (e *Effect2135) Skill_Use() bool { return true }
// Effect 2136: 对手未持有回命时为对手附加回合的回命若对手持有回命且剩余回合数大于0则回合数-1
type Effect2136 struct{ node.EffectNode }
func (e *Effect2136) Skill_Use() bool { return true }
// Effect 2137: 自身每有1回合异常状态造成伤害提升{0}%,最高{1}%
type Effect2137 struct{ node.EffectNode }
func (e *Effect2137) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if !e.Ctx().Our.StatEffect_Exist_all() {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 2138: 为对手种下悬暗之因若对手悬暗之因已成熟则转化为自身1层悬暗之根
type Effect2138 struct{ node.EffectNode }
func (e *Effect2138) Skill_Use() bool { return true }
// Effect 2139: 100%令对手害怕,对手拥有悬暗之因时改为诅咒,自身拥有悬暗之根时每层伤害提升{0}%
type Effect2139 struct{ node.EffectNode }
func (e *Effect2139) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Fear))
return true
}
// Effect 2140: 吸取对手最大体力的{0}%对手每有1层悬暗之因提升{1}%,吸取后若对手体力未减少则对手下{2}回合无法主动切换精灵
type Effect2140 struct{ node.EffectNode }
func (e *Effect2140) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
}
return true
}
// Effect 2141: 击败持有悬暗之因的对手时自身获得1层悬暗之根
type Effect2141 struct{ node.EffectNode }
func (e *Effect2141) Skill_Use() bool {
addStatusEffect(e.Ctx().Our, e.Ctx().Our, int(info.PetStatus.Confused))
return true
}
// Effect 2142: 无视对手正先制等级
type Effect2142 struct{ node.EffectNode }
func (e *Effect2142) ComparePre(fattack, sattack *action.SelectSkillAction) bool { return true }
// Effect 2143: 无视自身负先制等级
type Effect2143 struct{ node.EffectNode }
func (e *Effect2143) ComparePre(fattack, sattack *action.SelectSkillAction) bool { return true }
// Effect 2144: 双方n回合无法主动切换精灵
type Effect2144 struct{ node.EffectNode }
func (e *Effect2144) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2144, int(e.Args()[0].IntPart())); eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
if eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2144, int(e.Args()[0].IntPart())); eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2144Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2144Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2144Sub) SwitchOut(in *input.Input) bool {
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
func init() {
input.InitEffect(input.EffectType.Skill, 2120, &Effect2120{})
input.InitEffect(input.EffectType.Skill, 2121, &Effect2121{})
input.InitEffect(input.EffectType.Skill, 2122, &Effect2122{})
input.InitEffect(input.EffectType.Skill, 2123, &Effect2123{})
input.InitEffect(input.EffectType.Skill, 2124, &Effect2124{})
input.InitEffect(input.EffectType.Skill, 2125, &Effect2125{})
input.InitEffect(input.EffectType.Skill, 2126, &Effect2126{})
input.InitEffect(input.EffectType.Skill, 2127, &Effect2127{})
input.InitEffect(input.EffectType.Skill, 2128, &Effect2128{})
input.InitEffect(input.EffectType.Sub, 2128, &Effect2128Sub{})
input.InitEffect(input.EffectType.Skill, 2129, &Effect2129{})
input.InitEffect(input.EffectType.Sub, 2129, &Effect2129Sub{})
input.InitEffect(input.EffectType.Skill, 2130, &Effect2130{})
input.InitEffect(input.EffectType.Skill, 2131, &Effect2131{})
input.InitEffect(input.EffectType.Skill, 2132, &Effect2132{})
input.InitEffect(input.EffectType.Sub, 2132, &Effect2132Sub{})
input.InitEffect(input.EffectType.Skill, 2133, &Effect2133{})
input.InitEffect(input.EffectType.Sub, 2133, &Effect2133Sub{})
input.InitEffect(input.EffectType.Skill, 2134, &Effect2134{})
input.InitEffect(input.EffectType.Skill, 2135, &Effect2135{})
input.InitEffect(input.EffectType.Skill, 2136, &Effect2136{})
input.InitEffect(input.EffectType.Skill, 2137, &Effect2137{})
input.InitEffect(input.EffectType.Skill, 2138, &Effect2138{})
input.InitEffect(input.EffectType.Skill, 2139, &Effect2139{})
input.InitEffect(input.EffectType.Skill, 2140, &Effect2140{})
input.InitEffect(input.EffectType.Skill, 2141, &Effect2141{})
input.InitEffect(input.EffectType.Skill, 2142, &Effect2142{})
input.InitEffect(input.EffectType.Skill, 2143, &Effect2143{})
input.InitEffect(input.EffectType.Skill, 2144, &Effect2144{})
input.InitEffect(input.EffectType.Sub, 2144, &Effect2144Sub{})
}

View File

@@ -0,0 +1,338 @@
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"
)
func addRandomStatus(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
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.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt(count, len(statuses))] {
addStatusEffect(owner, target, statuses[idx])
}
}
// Effect 2145: 对手每损失一定体力则额外附加固定伤害
type Effect2145 struct{ node.EffectNode }
func (e *Effect2145) OnSkill() bool { return true }
// Effect 2146: 若本次攻击未打出致命一击则自身获得先制
type Effect2146 struct{ node.EffectNode }
func (e *Effect2146) SkillHit() bool {
if e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2147: 消耗自身全部体力并恢复自身体力与护盾
type Effect2147 struct{ node.EffectNode }
func (e *Effect2147) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 2148: 先出手时提升自身伤害并附加异常状态免疫
type Effect2148 struct{ node.EffectNode }
func (e *Effect2148) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.AttackTime == 1 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2149: 附加随机异常状态
type Effect2149 struct{ node.EffectNode }
func (e *Effect2149) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2150: 消除双方回合类效果
type Effect2150 struct{ node.EffectNode }
func (e *Effect2150) OnSkill() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
clearTargetEffects(e.Ctx().Opp, e.Ctx().Our)
return true
}
// Effect 2151: 自身不在异常状态且不在能力提升状态时附加控制类异常
type Effect2151 struct{ node.EffectNode }
func (e *Effect2151) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Our.StatEffect_Exist_all() || e.Ctx().Our.HasPropADD() {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2152: 若自身处于能力提升状态则复制给对手,否则清除自身能力提升状态
type Effect2152 struct{ node.EffectNode }
func (e *Effect2152) OnSkill() bool {
if e.Ctx().Our.HasPropADD() {
for i, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v)
}
}
return true
}
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
return true
}
// Effect 2153: 自身技能PP消耗降低
type Effect2153 struct{ node.EffectNode }
func (e *Effect2153) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count -= int(e.Args()[0].IntPart())
if *count < 0 {
*count = 0
}
}
return true
}
// Effect 2154: 对手技能PP消耗增加
type Effect2154 struct{ node.EffectNode }
func (e *Effect2154) HookPP(count *int) bool {
if count != nil && len(e.Args()) > 0 {
*count += int(e.Args()[0].IntPart())
}
return true
}
// Effect 2155: {0}回合内每回合恢复自身体力,若自身不处于能力提升状态则额外附加百分比伤害
type Effect2155 struct{ node.EffectNode }
func (e *Effect2155) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if !e.Ctx().Our.HasPropADD() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2])})
}
return true
}
// Effect 2156: 全属性+{0}
type Effect2156 struct{ node.EffectNode }
func (e *Effect2156) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 2157: 技能威力提升若对手任意技能PP低于阈值则效果翻倍
type Effect2157 struct{ node.EffectNode }
func (e *Effect2157) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil {
return true
}
boost := e.Args()[0]
if e.Ctx().Opp.CurrentPet != nil {
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if int(s.PP) < int(e.Args()[1].IntPart()) {
boost = boost.Mul(alpacadecimal.NewFromInt(2))
break
}
}
}
addSkillPowerPercent(e.Ctx().SkillEntity, boost)
return true
}
// Effect 2158: 若本次攻击造成伤害则额外附加异常状态
type Effect2158 struct{ node.EffectNode }
func (e *Effect2158) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 2159: 自身满体力时技能威力提升
type Effect2159 struct{ node.EffectNode }
func (e *Effect2159) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
}
return true
}
// Effect 2160: 自身不处于能力提升状态时先制+1且必定命中
type Effect2160 struct{ node.EffectNode }
func (e *Effect2160) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.XML.Priority++
}
return true
}
// Effect 2161: 技能无效时消除对手回合类效果并使对手沉睡
type Effect2161 struct{ node.EffectNode }
func (e *Effect2161) Skill_Use_ex() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Sleep))
return true
}
// Effect 2162: {0}%令对手进入异常状态未触发则降低自身所有技能PP值
type Effect2162 struct{ node.EffectNode }
func (e *Effect2162) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
return true
}
e.Ctx().Our.DelPP(int(e.Args()[2].IntPart()))
return true
}
// Effect 2163: 对手处于异常状态时造成伤害提升
type Effect2163 struct{ node.EffectNode }
func (e *Effect2163) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
// Effect 2164: 若自身处于异常状态则技能威力提升
type Effect2164 struct{ node.EffectNode }
func (e *Effect2164) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Our.StatEffect_Exist_all() {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 2165: 为自身附加{0}种异常状态
type Effect2165 struct{ node.EffectNode }
func (e *Effect2165) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Our, int(e.Args()[0].IntPart()))
return true
}
// Effect 2166: 为自身随机附加{0}/{1}/{2}/{3}中的{4}种异常状态
type Effect2166 struct{ node.EffectNode }
func (e *Effect2166) OnSkill() bool {
if len(e.Args()) < 5 {
return true
}
addRandomStatus(e.Ctx().Our, e.Ctx().Our, int(e.Args()[4].IntPart()))
return true
}
// Effect 2167: 先出手时吸取对手最大体力的1/{0}且当回合对手无法造成攻击伤害
type Effect2167 struct{ node.EffectNode }
func (e *Effect2167) DamageLockEx(zone *info.DamageZone) bool { return true }
// Effect 2168: 若对手当回合切换精灵则{0}%令对手{1},未触发则{2}%令对手{3}
type Effect2168 struct{ node.EffectNode }
func (e *Effect2168) OnSkill() bool { return true }
// Effect 2169: 消除对手能力提升状态,消除成功则为自身附加{0}点护盾
type Effect2169 struct{ node.EffectNode }
func (e *Effect2169) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2145, &Effect2145{})
input.InitEffect(input.EffectType.Skill, 2146, &Effect2146{})
input.InitEffect(input.EffectType.Skill, 2147, &Effect2147{})
input.InitEffect(input.EffectType.Skill, 2148, &Effect2148{})
input.InitEffect(input.EffectType.Skill, 2149, &Effect2149{})
input.InitEffect(input.EffectType.Skill, 2150, &Effect2150{})
input.InitEffect(input.EffectType.Skill, 2151, &Effect2151{})
input.InitEffect(input.EffectType.Skill, 2152, &Effect2152{})
input.InitEffect(input.EffectType.Skill, 2153, &Effect2153{})
input.InitEffect(input.EffectType.Skill, 2154, &Effect2154{})
input.InitEffect(input.EffectType.Skill, 2155, &Effect2155{})
input.InitEffect(input.EffectType.Skill, 2156, &Effect2156{})
input.InitEffect(input.EffectType.Skill, 2157, &Effect2157{})
input.InitEffect(input.EffectType.Skill, 2158, &Effect2158{})
input.InitEffect(input.EffectType.Skill, 2159, &Effect2159{})
input.InitEffect(input.EffectType.Skill, 2160, &Effect2160{})
input.InitEffect(input.EffectType.Skill, 2161, &Effect2161{})
input.InitEffect(input.EffectType.Skill, 2162, &Effect2162{})
input.InitEffect(input.EffectType.Skill, 2163, &Effect2163{})
input.InitEffect(input.EffectType.Skill, 2164, &Effect2164{})
input.InitEffect(input.EffectType.Skill, 2165, &Effect2165{})
input.InitEffect(input.EffectType.Skill, 2166, &Effect2166{})
input.InitEffect(input.EffectType.Skill, 2167, &Effect2167{})
input.InitEffect(input.EffectType.Skill, 2168, &Effect2168{})
input.InitEffect(input.EffectType.Skill, 2169, &Effect2169{})
}

View File

@@ -0,0 +1,344 @@
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"
)
// Effect 2170: 对手不处于异常时先制+1且必命中
type Effect2170 struct{ node.EffectNode }
func (e *Effect2170) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && !e.Ctx().Opp.StatEffect_Exist_all() {
current.SkillEntity.XML.Priority += 1
current.SkillEntity.XML.MustHit = 1
}
return true
}
// Effect 2171: 每有1级能力下降状态吸血对手能力提升时效果翻倍
type Effect2171 struct{ node.EffectNode }
func (e *Effect2171) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
drain := 0
for _, v := range e.Ctx().Our.Prop[:] {
if v < 0 {
drain += int(-v)
}
}
if drain <= 0 {
return true
}
heal := alpacadecimal.NewFromInt(int64(drain)).Mul(e.Args()[0])
if e.Ctx().Opp.HasPropADD() {
heal = heal.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
// Effect 2172: 自身体力不满时附加效果
type Effect2172 struct{ node.EffectNode }
func (e *Effect2172) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().Our.CurrentPet == nil {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2173: 转移对手异常并按转移项数削减对手PP
type Effect2173 struct{ node.EffectNode }
func (e *Effect2173) OnSkill() bool {
if len(e.Args()) < 1 {
return true
}
moved := 0
for i, v := range e.Ctx().Opp.Prop[:] {
if v < 0 {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
moved++
}
}
if moved > 0 {
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
}
return true
}
// Effect 2174: 对手每有1项PP为0时吸血未受固定伤害则追加真实伤害
type Effect2174 struct{ node.EffectNode }
func (e *Effect2174) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
zeros := 0
if e.Ctx().Our.CurrentPet != nil {
for _, s := range e.Ctx().Our.CurrentPet.Info.SkillList {
if s.PP <= 0 {
zeros++
}
}
}
if zeros <= 0 {
return true
}
heal := alpacadecimal.NewFromInt(int64(zeros)).Mul(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: heal})
}
return true
}
// Effect 2175: 技能无效时随机附加若干非限制类异常
type Effect2175 struct{ node.EffectNode }
func (e *Effect2175) Skill_Use_ex() bool {
if len(e.Args()) == 0 {
return true
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt(int(e.Args()[0].IntPart()), len(statuses))] {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, statuses[idx])
}
return true
}
// Effect 2176: 令对手高威力攻击技能PP归零
type Effect2176 struct{ node.EffectNode }
func (e *Effect2176) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2177: 获得八荒之力,常驻无视攻击免疫和能力提升效果
type Effect2177 struct{ node.EffectNode }
func (e *Effect2177) Skill_Use() bool {
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(1))
return true
}
// Effect 2178: 星荟缠时攻击强化,低血时翻倍
type Effect2178 struct{ node.EffectNode }
func (e *Effect2178) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 2179: 星火之灾攻击强化,低血时翻倍
type Effect2179 struct{ node.EffectNode }
func (e *Effect2179) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 2180: 星海之浸攻击强化,低血时翻倍
type Effect2180 struct{ node.EffectNode }
func (e *Effect2180) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 2181: 解除自身异常状态
type Effect2181 struct{ node.EffectNode }
func (e *Effect2181) Skill_Use() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Our)
return true
}
// Effect 2182: 每次命中消耗全部攻击PP并按消耗量提升威力
type Effect2182 struct{ node.EffectNode }
func (e *Effect2182) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
lost := totalLostPP2045(e.Ctx().Our)
if lost <= 0 {
return true
}
e.Ctx().SkillEntity.XML.Power += int(int64(lost) * e.Args()[2].IntPart())
return true
}
// Effect 2183: 自身能力提升时攻击强化
type Effect2183 struct{ node.EffectNode }
func (e *Effect2183) 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(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
}
return true
}
// Effect 2184: 命中率提升并无视自身1级命中下降
type Effect2184 struct{ node.EffectNode }
func (e *Effect2184) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.XML.Accuracy += 10
return true
}
// Effect 2185: 命中率提升并无视自身1级命中下降
type Effect2185 struct{ node.EffectNode }
func (e *Effect2185) SkillHit_ex() bool { return true }
// Effect 2186: 命中率提升并无视自身1级命中下降
type Effect2186 struct{ node.EffectNode }
func (e *Effect2186) SkillHit_ex() bool { return true }
// Effect 2187: 命中率提升并无视自身1级命中下降
type Effect2187 struct{ node.EffectNode }
func (e *Effect2187) SkillHit_ex() bool { return true }
// Effect 2188: 命中率提升0%并无视自身1级命中下降
type Effect2188 struct{ node.EffectNode }
func (e *Effect2188) SkillHit_ex() bool { return true }
// Effect 2189: 自身PP总和高于对手时附加效果
type Effect2189 struct{ node.EffectNode }
func (e *Effect2189) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if totalLostPP2045(e.Ctx().Our) > totalLostPP2045(e.Ctx().Opp) {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2190: 占位效果
type Effect2190 struct{ node.EffectNode }
func (e *Effect2190) Skill_Use() bool { return true }
// Effect 2191: 为对手附加浪潮聚焦
type Effect2191 struct{ node.EffectNode }
func (e *Effect2191) Skill_Use() bool {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.Confused))
return true
}
// Effect 2192: 自身不处于能力提升状态时先制+1
type Effect2192 struct{ node.EffectNode }
func (e *Effect2192) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current != nil && current.SkillEntity != nil && !e.Ctx().Our.HasPropADD() {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 2193: 自身不处于能力提升状态时触发若干轮效果
type Effect2193 struct{ node.EffectNode }
func (e *Effect2193) Skill_Use() bool {
if len(e.Args()) < 11 || e.Ctx().SkillEntity == nil {
return true
}
if !e.Ctx().Our.HasPropADD() {
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
}
return true
}
// Effect 2194: 击败对手时对方出战精灵附加致命诅咒
type Effect2194 struct{ node.EffectNode }
func (e *Effect2194) OnSkill() bool {
if e.Ctx().Opp.CurrentPet == nil {
return true
}
addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(info.PetStatus.DrainedHP))
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2170, &Effect2170{})
input.InitEffect(input.EffectType.Skill, 2171, &Effect2171{})
input.InitEffect(input.EffectType.Skill, 2172, &Effect2172{})
input.InitEffect(input.EffectType.Skill, 2173, &Effect2173{})
input.InitEffect(input.EffectType.Skill, 2174, &Effect2174{})
input.InitEffect(input.EffectType.Skill, 2175, &Effect2175{})
input.InitEffect(input.EffectType.Skill, 2176, &Effect2176{})
input.InitEffect(input.EffectType.Skill, 2177, &Effect2177{})
input.InitEffect(input.EffectType.Skill, 2178, &Effect2178{})
input.InitEffect(input.EffectType.Skill, 2179, &Effect2179{})
input.InitEffect(input.EffectType.Skill, 2180, &Effect2180{})
input.InitEffect(input.EffectType.Skill, 2181, &Effect2181{})
input.InitEffect(input.EffectType.Skill, 2182, &Effect2182{})
input.InitEffect(input.EffectType.Skill, 2183, &Effect2183{})
input.InitEffect(input.EffectType.Skill, 2184, &Effect2184{})
input.InitEffect(input.EffectType.Skill, 2185, &Effect2185{})
input.InitEffect(input.EffectType.Skill, 2186, &Effect2186{})
input.InitEffect(input.EffectType.Skill, 2187, &Effect2187{})
input.InitEffect(input.EffectType.Skill, 2188, &Effect2188{})
input.InitEffect(input.EffectType.Skill, 2189, &Effect2189{})
input.InitEffect(input.EffectType.Skill, 2190, &Effect2190{})
input.InitEffect(input.EffectType.Skill, 2191, &Effect2191{})
input.InitEffect(input.EffectType.Skill, 2192, &Effect2192{})
input.InitEffect(input.EffectType.Skill, 2193, &Effect2193{})
input.InitEffect(input.EffectType.Skill, 2194, &Effect2194{})
}

View File

@@ -0,0 +1,418 @@
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"
)
// Effect 2195: 消除对手回合类效果并降低先制
type Effect2195 struct {
node.EffectNode
}
func (e *Effect2195) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
e.Ctx().SkillEntity.XML.Priority -= int(e.Args()[1].IntPart())
return true
}
// Effect 2196: 令自身行动
type Effect2196 struct {
node.EffectNode
}
func (e *Effect2196) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
e.Ctx().Our.SetProp(e.Ctx().Our, 5, int8(e.Args()[0].IntPart()))
return true
}
// Effect 2197: 自身处于护盾时必中
type Effect2197 struct {
node.EffectNode
}
func (e *Effect2197) SkillHit_ex() bool {
if e.Ctx().Our.HasShield() && e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
e.Ctx().SkillEntity.SetNoSide()
}
return true
}
// Effect 2198: 双方任一方护盾时追加效果
type Effect2198 struct {
node.EffectNode
}
func (e *Effect2198) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.HasShield() || e.Ctx().Opp.HasShield() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[1],
})
}
return true
}
// Effect 2199: 双方任一方护罩时追加效果
type Effect2199 struct {
node.EffectNode
}
func (e *Effect2199) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.HasShield() || e.Ctx().Opp.HasShield() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[1],
})
}
return true
}
// Effect 2200: 令双方行动条件失效
type Effect2200 struct {
node.EffectNode
}
func (e *Effect2200) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet != nil {
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
}
return true
}
// Effect 2201: 属性关系影响总伤害
type Effect2201 struct {
node.EffectNode
}
func (e *Effect2201) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 1 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.Pet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
if e.Ctx().SkillEntity.Pet.GetType().Primary == e.Ctx().Opp.CurrentPet.GetType().Primary {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
// Effect 2202: 属性克制时必定致命
type Effect2202 struct {
node.EffectNode
}
func (e *Effect2202) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
return true
}
// Effect 2203: 技能无效时免疫下一次攻击
type Effect2203 struct {
node.EffectNode
}
func (e *Effect2203) Skill_Use_ex() bool {
return true
}
// Effect 2204: 技能威力降低,异常时转为提升
type Effect2204 struct {
node.EffectNode
}
func (e *Effect2204) SkillHit() bool {
if e.Ctx().SkillEntity == nil || len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.StatEffect_Exist_all() {
e.Ctx().SkillEntity.XML.Power += int(e.Args()[1].IntPart())
}
return true
}
// Effect 2205: 自身异常时克制倍率取最大值
type Effect2205 struct {
node.EffectNode
}
func (e *Effect2205) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.StatEffect_Exist_all() || e.Ctx().Opp.StatEffect_Exist_all() {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
}
return true
}
// Effect 2206: 自身能力提升被消除则解除异常
type Effect2206 struct {
node.EffectNode
}
func (e *Effect2206) Skill_Use() bool {
clearOwnDownProps(e.Ctx().Our)
return true
}
// Effect 2207: 剩余异常回合数减少
type Effect2207 struct {
node.EffectNode
}
func (e *Effect2207) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
if len(a) > 0 {
e.Duration(a[0])
}
}
func (e *Effect2207) TurnEnd() {
e.EffectNode.TurnEnd()
}
// Effect 2208: 星盘每转动时增威力
type Effect2208 struct {
node.EffectNode
}
func (e *Effect2208) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil {
e.Ctx().SkillEntity.XML.Power += int(e.Args()[0].IntPart())
}
return true
}
// Effect 2209: 星盘每转动时吸血
type Effect2209 struct {
node.EffectNode
}
func (e *Effect2209) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().SkillEntity != nil {
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
}
return true
}
// Effect 2210: 星赐/星祸转化
type Effect2210 struct {
node.EffectNode
}
func (e *Effect2210) Skill_Use() bool {
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().Our.CurrentPet.PetInfo.Type == e.Ctx().Opp.CurrentPet.PetInfo.Type {
return true
}
e.Ctx().SkillEntity.XML.Category = int(info.Category.PHYSICAL)
if e.Ctx().Our.CurrentPet.Info.Dv > 0 {
e.Ctx().SkillEntity.XML.Power += int(e.Ctx().Our.CurrentPet.Info.Dv)
}
return true
}
// Effect 2211: 螺旋之锁
type Effect2211 struct {
node.EffectNode
}
func (e *Effect2211) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[0].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
// Effect 2212: 威力不高于阈值时使对手行动失效
type Effect2212 struct {
node.EffectNode
}
func (e *Effect2212) OnSkill() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.XML.Power <= int(e.Args()[1].IntPart()) {
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
}
return true
}
// Effect 2213: 消耗体力时给后排护盾
type Effect2213 struct {
node.EffectNode
}
func (e *Effect2213) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Our.AddShield(e.Args()[0])
return true
}
// Effect 2214: 螺旋之锁下PP归零
type Effect2214 struct {
node.EffectNode
}
func (e *Effect2214) OnSkill() bool {
if len(e.Args()) < 1 {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, 1)
return true
}
// Effect 2215: 每消耗PP提升威力
type Effect2215 struct {
node.EffectNode
}
func (e *Effect2215) 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 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2216: 致命一击时提升威力
type Effect2216 struct {
node.EffectNode
}
func (e *Effect2216) 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.Crit != 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2217: 残缺文案占位
type Effect2217 struct {
node.EffectNode
}
func (e *Effect2217) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
e.Ctx().Opp.DelPP(int(e.Args()[1].IntPart()))
return true
}
// Effect 2218: 附加回合效果并在特定状态下变换类型
type Effect2218 struct {
node.EffectNode
}
func (e *Effect2218) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.CurrentPet != nil && e.Ctx().Our.CurrentPet.PetInfo.Type != int(e.Args()[1].IntPart()) {
e.Ctx().Our.CurrentPet.PetInfo.Type = int(e.Args()[2].IntPart())
}
return true
}
// Effect 2219: 光辉能量提升至体力比例
type Effect2219 struct {
node.EffectNode
}
func (e *Effect2219) 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 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2195, &Effect2195{})
input.InitEffect(input.EffectType.Skill, 2196, &Effect2196{})
input.InitEffect(input.EffectType.Skill, 2197, &Effect2197{})
input.InitEffect(input.EffectType.Skill, 2198, &Effect2198{})
input.InitEffect(input.EffectType.Skill, 2199, &Effect2199{})
input.InitEffect(input.EffectType.Skill, 2200, &Effect2200{})
input.InitEffect(input.EffectType.Skill, 2201, &Effect2201{})
input.InitEffect(input.EffectType.Skill, 2202, &Effect2202{})
input.InitEffect(input.EffectType.Skill, 2203, &Effect2203{})
input.InitEffect(input.EffectType.Skill, 2204, &Effect2204{})
input.InitEffect(input.EffectType.Skill, 2205, &Effect2205{})
input.InitEffect(input.EffectType.Skill, 2206, &Effect2206{})
input.InitEffect(input.EffectType.Skill, 2207, &Effect2207{})
input.InitEffect(input.EffectType.Skill, 2208, &Effect2208{})
input.InitEffect(input.EffectType.Skill, 2209, &Effect2209{})
input.InitEffect(input.EffectType.Skill, 2210, &Effect2210{})
input.InitEffect(input.EffectType.Skill, 2211, &Effect2211{})
input.InitEffect(input.EffectType.Skill, 2212, &Effect2212{})
input.InitEffect(input.EffectType.Skill, 2213, &Effect2213{})
input.InitEffect(input.EffectType.Skill, 2214, &Effect2214{})
input.InitEffect(input.EffectType.Skill, 2215, &Effect2215{})
input.InitEffect(input.EffectType.Skill, 2216, &Effect2216{})
input.InitEffect(input.EffectType.Skill, 2217, &Effect2217{})
input.InitEffect(input.EffectType.Skill, 2218, &Effect2218{})
input.InitEffect(input.EffectType.Skill, 2219, &Effect2219{})
_ = grand.Intn(1)
_ = alpacadecimal.Zero
}

View File

@@ -0,0 +1,641 @@
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"
)
func countStatusEffects2220(target *input.Input) int {
if target == nil {
return 0
}
count := 0
for _, eff := range target.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() == input.EffectType.Status {
count++
}
}
return count
}
// Effect 2220: 将自身攻击和特攻中最高的能力值作为自身的能力值进行攻击
type Effect2220 struct{ node.EffectNode }
func (e *Effect2220) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.Prop[1] > e.Ctx().Our.Prop[0] {
e.Ctx().SkillEntity.XML.Power = int(e.Ctx().Our.Prop[1])
return true
}
e.Ctx().SkillEntity.XML.Power = int(e.Ctx().Our.Prop[0])
return true
}
// Effect 2221: {0}回合内每回合{1}%闪避对手攻击,对手攻击技能命中时令对手随机{2}个技能PP值归0
type Effect2221 struct{ node.EffectNode }
func (e *Effect2221) Skill_Use_ex() 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 && e.Ctx().SkillEntity.AttackTime != 0 {
e.Ctx().Opp.DelPP(int(e.Args()[2].IntPart()))
}
return true
}
// Effect 2222: 对手体力满时造成伤害提升
type Effect2222 struct{ node.EffectNode }
func (e *Effect2222) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) >= 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2223: 若对手当回合切换精灵则造成伤害提升
type Effect2223 struct{ node.EffectNode }
func (e *Effect2223) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.CurrentPet != nil && e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2224: 若对手当回合选择属性技能则造成伤害提升
type Effect2224 struct{ node.EffectNode }
func (e *Effect2224) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
if e.Ctx().Opp.AttackTime == 0 {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2225: 减少对手体力上限
type Effect2225 struct{ node.EffectNode }
func (e *Effect2225) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet == nil {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])})
return true
}
// Effect 2226: 解除双方所有异常状态,解除成功则免疫下{0}次对手的攻击
type Effect2226 struct{ node.EffectNode }
func (e *Effect2226) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for _, target := range []*input.Input{e.Ctx().Our, e.Ctx().Opp} {
for _, eff := range target.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() != input.EffectType.Status {
continue
}
eff.Alive(false)
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2226, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2226Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2226Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2226Sub) 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 2228: {0}回合内对手造成的固定伤害和百分比伤害减少{1}%
type Effect2228 struct{ node.EffectNode }
func (e *Effect2228) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2228, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2228Sub struct {
RoundEffectArg0Base
remaining int
reduce alpacadecimal.Decimal
}
func (e *Effect2228Sub) 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.reduce = alpacadecimal.NewFromInt(int64(a[1]))
}
}
func (e *Effect2228Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = zone.Damage.Mul(hundred.Sub(e.reduce)).Div(hundred)
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 2227: 清除对手能力提升状态,清除成功后对手{0}回合内无法主动切换精灵
type Effect2227 struct{ node.EffectNode }
func (e *Effect2227) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2227, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2227Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2227Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2227Sub) 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 {
e.Ctx().SkillEntity.SetMiss()
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 2229: 使用技能后自身全属性+1回合类效果被消除、能力提升效果被消除、吸取时触发自身的登场效果
type Effect2229 struct{ node.EffectNode }
func (e *Effect2229) OnSkill() bool {
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
return true
}
// Effect 2230: {0}回合内每回合恢复自身最大体力的1/{1},若未恢复体力则{2}%令对手{3}
type Effect2230 struct{ node.EffectNode }
func (e *Effect2230) OnSkill() bool {
if len(e.Args()) < 4 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
if e.Ctx().Our.CurrentPet.GetHP().Cmp(heal) >= 0 {
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[3].IntPart()))
}
return true
}
// Effect 2231: {0}回合内命中时消耗自身体力的1/{1}并造成等量百分比伤害
type Effect2231 struct{ node.EffectNode }
func (e *Effect2231) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
dmg := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
return true
}
// Effect 2232: 使用技能PP不受限
type Effect2232 struct{ node.EffectNode }
func (e *Effect2232) HookPP(count *int) bool { return true }
// Effect 2233: {0}回合内对手每处于{1}种异常状态,受到{2}点固定伤害
type Effect2233 struct{ node.EffectNode }
func (e *Effect2233) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
damage := countStatusEffects2220(e.Ctx().Opp) * int(e.Args()[2].IntPart())
if damage > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: alpacadecimal.NewFromInt(int64(damage))})
}
return true
}
// Effect 2234: 自身处于能力下降时{0}%令对手{1}
type Effect2234 struct{ node.EffectNode }
func (e *Effect2234) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.HasPropADD() {
zone.Damage = zone.Damage.Mul(hundred.Add(e.Args()[0])).Div(hundred)
}
return true
}
// Effect 2235: 全属性1级时命运星效果翻倍
type Effect2235 struct{ node.EffectNode }
func (e *Effect2235) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
for _, level := range e.Ctx().Our.Prop[:] {
if level < 1 {
return true
}
}
e.Ctx().SkillEntity.XML.Power *= 2
return true
}
// Effect 2236: 使自身下{0}次可翻倍的支援效果翻倍
type Effect2236 struct{ node.EffectNode }
func (e *Effect2236) SkillHit() bool { return true }
// Effect 2237: 对手每比己方多存活一只精灵,威力提升{0}点
type Effect2237 struct{ node.EffectNode }
func (e *Effect2237) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) == 0 {
return true
}
count := 0
for _, pet := range e.Ctx().Opp.AllPet {
if pet != nil && pet.Info.Hp > 0 {
count++
}
}
e.Ctx().SkillEntity.XML.Power += count * int(e.Args()[0].IntPart())
return true
}
// Effect 2238: 若自身回合类效果被消除则免疫下{1}次受到的异常状态
type Effect2238 struct{ node.EffectNode }
func (e *Effect2238) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if !clearTargetEffects(e.Ctx().Our, e.Ctx().Our) {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2238, int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2238Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2238Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2238Sub) 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
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return false
}
// Effect 2239: 免疫下{0}次对手的攻击,对手使用{1}系攻击时此效果失效
type Effect2239 struct{ node.EffectNode }
func (e *Effect2239) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2239, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2239Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2239Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2239Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.remaining <= 0 {
return true
}
if len(e.Args()) > 1 && e.Ctx().SkillEntity.Category() == info.Category(e.Args()[1].IntPart()) {
e.Alive(false)
}
return true
}
func (e *Effect2239Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
zone.Damage = alpacadecimal.Zero
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 2242: 技能PP不满时先制
type Effect2242 struct{ node.EffectNode }
func (e *Effect2242) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || e.Ctx().SkillEntity == nil {
return true
}
if skill, ok := xmlres.SkillMap[int(e.Ctx().SkillEntity.Info.ID)]; ok && e.Ctx().SkillEntity.Info.PP < uint32(skill.MaxPP) {
current.SkillEntity.XML.Priority += 1
}
return true
}
// Effect 2244: {0}回合内免疫受到的非限制类异常状态
type Effect2244 struct{ node.EffectNode }
func (e *Effect2244) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2244, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2244Sub struct{ RoundEffectArg0Base }
func (e *Effect2244Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our || !input.IS_Stat(effEffect) {
return true
}
return false
}
// Effect 2240: 解除自身异常状态,解除成功则本次攻击威力提高{0}%
type Effect2240 struct{ node.EffectNode }
func (e *Effect2240) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for _, eff := range e.Ctx().Our.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() != input.EffectType.Status {
continue
}
eff.Alive(false)
cleared = true
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2240, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2240Sub struct {
node.EffectNode
}
func (e *Effect2240Sub) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.Power += int(e.Args()[0].IntPart())
return true
}
// Effect 2241: 消除对手能力提升状态,消除成功则{0}回合内对手体力恢复效果减少{1}%
type Effect2241 struct{ node.EffectNode }
func (e *Effect2241) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
for _, eff := range e.Ctx().Opp.Effects {
if eff == nil || !eff.Alive() {
continue
}
if eff.ID().GetEffectType() != input.EffectType.Status {
continue
}
eff.Alive(false)
cleared = true
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2241, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2241Sub struct {
RoundEffectArg0Base
}
func (e *Effect2241Sub) Heal_Pre(_ action.BattleActionI, amount *int) bool {
if amount == nil || *amount <= 0 || len(e.Args()) < 2 {
return true
}
*amount = *amount * (100 - int(e.Args()[1].IntPart())) / 100
return true
}
// Effect 2243: 若先出手则自身下次受到致死伤害时重生
type Effect2243 struct{ node.EffectNode }
func (e *Effect2243) Skill_Use() bool {
if !e.IsFirst() {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2243)
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect2243Sub struct{ FixedDuration1Base }
func (e *Effect2243Sub) DamageLock(zone *info.DamageZone) bool {
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(zone.Damage) > 0 {
return true
}
zone.Damage = alpacadecimal.Zero
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2220, &Effect2220{})
input.InitEffect(input.EffectType.Skill, 2221, &Effect2221{})
input.InitEffect(input.EffectType.Skill, 2222, &Effect2222{})
input.InitEffect(input.EffectType.Skill, 2223, &Effect2223{})
input.InitEffect(input.EffectType.Skill, 2224, &Effect2224{})
input.InitEffect(input.EffectType.Skill, 2225, &Effect2225{})
input.InitEffect(input.EffectType.Skill, 2226, &Effect2226{})
input.InitEffect(input.EffectType.Sub, 2226, &Effect2226Sub{})
input.InitEffect(input.EffectType.Skill, 2227, &Effect2227{})
input.InitEffect(input.EffectType.Sub, 2227, &Effect2227Sub{})
input.InitEffect(input.EffectType.Skill, 2228, &Effect2228{})
input.InitEffect(input.EffectType.Sub, 2228, &Effect2228Sub{})
input.InitEffect(input.EffectType.Skill, 2229, &Effect2229{})
input.InitEffect(input.EffectType.Skill, 2230, &Effect2230{})
input.InitEffect(input.EffectType.Skill, 2231, &Effect2231{})
input.InitEffect(input.EffectType.Skill, 2232, &Effect2232{})
input.InitEffect(input.EffectType.Skill, 2233, &Effect2233{})
input.InitEffect(input.EffectType.Skill, 2234, &Effect2234{})
input.InitEffect(input.EffectType.Skill, 2235, &Effect2235{})
input.InitEffect(input.EffectType.Skill, 2236, &Effect2236{})
input.InitEffect(input.EffectType.Skill, 2237, &Effect2237{})
input.InitEffect(input.EffectType.Skill, 2238, &Effect2238{})
input.InitEffect(input.EffectType.Sub, 2238, &Effect2238Sub{})
input.InitEffect(input.EffectType.Skill, 2239, &Effect2239{})
input.InitEffect(input.EffectType.Sub, 2239, &Effect2239Sub{})
input.InitEffect(input.EffectType.Skill, 2240, &Effect2240{})
input.InitEffect(input.EffectType.Sub, 2240, &Effect2240Sub{})
input.InitEffect(input.EffectType.Skill, 2241, &Effect2241{})
input.InitEffect(input.EffectType.Sub, 2241, &Effect2241Sub{})
input.InitEffect(input.EffectType.Skill, 2242, &Effect2242{})
input.InitEffect(input.EffectType.Skill, 2243, &Effect2243{})
input.InitEffect(input.EffectType.Sub, 2243, &Effect2243Sub{})
input.InitEffect(input.EffectType.Skill, 2244, &Effect2244{})
input.InitEffect(input.EffectType.Sub, 2244, &Effect2244Sub{})
}

View File

@@ -0,0 +1,352 @@
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{})
}

View File

@@ -0,0 +1,492 @@
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"
)
func clearOppEffects(owner, target *input.Input) bool {
if owner == nil || target == nil {
return false
}
cleared := false
for _, eff := range target.Effects {
if eff != nil && eff.Alive() {
eff.Alive(false)
cleared = true
}
}
return cleared
}
func addStatus2270(owner, target *input.Input, statusID int) bool {
if owner == nil || target == nil {
return false
}
eff := owner.InitEffect(input.EffectType.Status, statusID)
if eff == nil {
return false
}
target.AddEffect(owner, eff)
return true
}
// Effect 2270: 免疫n次受到的攻击触发成功则m%令对手{2}
type Effect2270 struct{ node.EffectNode }
func (e *Effect2270) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2270, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2270Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2270Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2270Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
e.remaining--
if len(e.Args()) >= 3 && grand.N(1, 101) <= int(e.Args()[1].IntPart()) {
addStatus2270(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
}
if e.remaining <= 0 {
e.Alive(false)
}
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 2271: 自身能力提升被消除或吸取时概率令对手{2},未触发则下{3}次攻击必定致命
type Effect2271 struct{ node.EffectNode }
func (e *Effect2271) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2271, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2271Sub struct {
node.EffectNode
}
func (e *Effect2271Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if in != e.Ctx().Our || effEffect == nil {
return true
}
if !e.Ctx().Our.HasPropADD() && !e.Ctx().Our.HasPropSub() {
return true
}
if len(e.Args()) >= 4 && grand.N(1, 101) <= int(e.Args()[1].IntPart()) {
addStatus2270(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[2].IntPart()))
} else {
e.Ctx().Our.AddEffect(e.Ctx().Our, e.Ctx().Our.InitEffect(input.EffectType.Sub, 2271, int(e.Args()[3].IntPart())))
}
return true
}
type Effect2271CritSub struct {
node.EffectNode
remaining int
}
func (e *Effect2271CritSub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2271CritSub) SkillHit_ex() bool {
if e.remaining <= 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 2272: 自方有其他精灵存活时造成的攻击伤害提升
type Effect2272 struct{ node.EffectNode }
func (e *Effect2272) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) == 0 {
return true
}
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && pet.Alive() && pet != e.Ctx().Our.CurrentPet {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
break
}
}
return true
}
// Effect 2273: 对手选择攻击技能时先制+3并概率令对手{1}
type Effect2273 struct{ node.EffectNode }
func (e *Effect2273) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if len(e.Args()) < 2 {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += 3
if grand.N(1, 101) <= int(e.Args()[0].IntPart()) {
addStatus2270(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2274: 恢复自身全部PP值每恢复n点吸取对手m点体力
type Effect2274 struct{ node.EffectNode }
func (e *Effect2274) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(e.Ctx().Our.CurrentPet.Info.SkillList[i].ID)]; ok {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = uint32(skill.MaxPP)
}
}
return true
}
// Effect 2275: 未击败对手则将对手标记为狩猎之的
type Effect2275 struct{ node.EffectNode }
func (e *Effect2275) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2275)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2275Sub struct{ node.EffectNode }
// Effect 2276: 将对方场下对自身克制系数最高的一只非狩猎之精灵标记为狩猎之的
type Effect2276 struct{ node.EffectNode }
func (e *Effect2276) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2276)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2276Sub struct{ node.EffectNode }
// Effect 2277: 将对方场下对自身克制系数最低的一只非狩猎之精灵标记为狩猎之的
type Effect2277 struct{ node.EffectNode }
func (e *Effect2277) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2277)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2277Sub struct{ node.EffectNode }
// Effect 2278: 若对手为狩猎之的则增伤否则回合内无法主动攻击并附加等量于狩猎之的体力n%的真实伤害
type Effect2278 struct{ node.EffectNode }
func (e *Effect2278) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2275) != nil ||
e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2276) != nil ||
e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2277) != nil {
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100 + int64(e.Args()[0].IntPart()))).Div(alpacadecimal.NewFromInt(100))
return true
}
e.Ctx().Opp.AddEffect(e.Ctx().Our, e.Ctx().Our.InitEffect(input.EffectType.Sub, 2278, int(e.Args()[1].IntPart())))
zone.Damage = zone.Damage.Add(e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100)))
return true
}
func (e *Effect2278) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2275) == nil &&
e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2276) == nil &&
e.Ctx().Opp.GetEffect(input.EffectType.Sub, 2277) == nil {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2278, int(e.Args()[1].IntPart()))
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
}
return true
}
type Effect2278Sub struct {
node.EffectNode
remaining int
}
func (e *Effect2278Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect2278Sub) 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 2279: 击败狩猎之的时附加狩猎之魂
type Effect2279 struct{ node.EffectNode }
func (e *Effect2279) OnSkill() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2279)
if eff != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2279Sub struct{ node.EffectNode }
// Effect 2280: 技能无效时,对手下回合无法主动切换精灵
type Effect2280 struct{ node.EffectNode }
func (e *Effect2280) Skill_Use_ex() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2280)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2280Sub struct{ node.EffectNode }
func (e *Effect2280Sub) SwitchOut(in *input.Input) bool {
if in == e.Ctx().Opp {
return false
}
return true
}
// Effect 2281: 若先出手则自身下次受到致死伤害时保留1点体力
type Effect2281 struct{ node.EffectNode }
func (e *Effect2281) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || !e.IsFirst() {
return true
}
if zone.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) >= 0 {
zone.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
}
return true
}
// Effect 2282: {0}回合内使用技能恢复自身最大体力1/{1}并造成等量百分比伤害
type Effect2282 struct{ node.EffectNode }
func (e *Effect2282) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
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.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetMaxHP()) == 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[2]).Div(alpacadecimal.NewFromInt(100))})
}
return true
}
// Effect 2283: 消耗自身等同于护盾、护罩之和的体力平均恢复自身不在场精灵
type Effect2283 struct{ node.EffectNode }
func (e *Effect2283) Skill_Use() bool {
shield := e.Ctx().Our.CurrentShield()
if shield.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
heal := shield.Div(alpacadecimal.NewFromInt(2))
for _, pet := range e.Ctx().Our.AllPet {
if pet == nil || pet == e.Ctx().Our.CurrentPet || pet.Alive() {
continue
}
pet.Info.Hp += uint32(heal.IntPart())
}
return true
}
// Effect 2284: 剥夺对手系别并附加控制类异常与系别伤害
type Effect2284 struct{ node.EffectNode }
func (e *Effect2284) Skill_Use() bool { return true }
// Effect 2285: {0}回合内对手无法通过技能恢复体力
type Effect2285 struct{ node.EffectNode }
func (e *Effect2285) Skill_Use() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2285, e.SideEffectArgs...)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2285Sub struct{ RoundEffectArg0Base }
func (e *Effect2285Sub) Heal_Pre(_ action.BattleActionI, amount *int) bool {
if amount != nil {
*amount = 0
}
return true
}
// Effect 2286: 对手n次回合类效果、能力提升效果被消除时体力上限减少
type Effect2286 struct{ node.EffectNode }
func (e *Effect2286) Skill_Use() bool { return true }
// Effect 2287: {0}回合内使用技能恢复自身最大体力1/{1}并造成等量百分比伤害,溢出转化为护罩
type Effect2287 struct{ node.EffectNode }
func (e *Effect2287) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
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})
return true
}
// Effect 2288: 技能无效时为对手附加3回合的炙焰仙蕊
type Effect2288 struct{ node.EffectNode }
func (e *Effect2288) Skill_Use_ex() bool {
eff := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2288, 3)
if eff != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
}
return true
}
type Effect2288Sub struct{ node.EffectNode }
// Effect 2289: 自身每点雷霆威力提升{0}点
type Effect2289 struct{ node.EffectNode }
func (e *Effect2289) SkillHit() bool { return true }
// Effect 2290: 自身每点雷霆全属性+1
type Effect2290 struct{ node.EffectNode }
func (e *Effect2290) SkillHit() bool { return true }
// Effect 2291: 自身武道衔化轨迹为正转时...
type Effect2291 struct{ node.EffectNode }
func (e *Effect2291) OnSkill() bool { return true }
// Effect 2292: 将自身武道衔化轨迹改为逆转并反弹武道正转期间吸收的伤害
type Effect2292 struct{ node.EffectNode }
func (e *Effect2292) OnSkill() bool { return true }
// Effect 2293: 复原自身的武道衔化轨迹每n次衔化时全属性+1
type Effect2293 struct{ node.EffectNode }
func (e *Effect2293) Skill_Use() bool { return true }
// Effect 2294: 衔化自身的武道
type Effect2294 struct{ node.EffectNode }
func (e *Effect2294) Skill_Use() bool { return true }
func init() {
input.InitEffect(input.EffectType.Skill, 2270, &Effect2270{})
input.InitEffect(input.EffectType.Sub, 2270, &Effect2270Sub{})
input.InitEffect(input.EffectType.Skill, 2271, &Effect2271{})
input.InitEffect(input.EffectType.Sub, 2271, &Effect2271Sub{})
input.InitEffect(input.EffectType.Sub, 2271, &Effect2271CritSub{})
input.InitEffect(input.EffectType.Skill, 2272, &Effect2272{})
input.InitEffect(input.EffectType.Skill, 2273, &Effect2273{})
input.InitEffect(input.EffectType.Skill, 2274, &Effect2274{})
input.InitEffect(input.EffectType.Skill, 2275, &Effect2275{})
input.InitEffect(input.EffectType.Sub, 2275, &Effect2275Sub{})
input.InitEffect(input.EffectType.Skill, 2276, &Effect2276{})
input.InitEffect(input.EffectType.Sub, 2276, &Effect2276Sub{})
input.InitEffect(input.EffectType.Skill, 2277, &Effect2277{})
input.InitEffect(input.EffectType.Sub, 2277, &Effect2277Sub{})
input.InitEffect(input.EffectType.Skill, 2278, &Effect2278{})
input.InitEffect(input.EffectType.Sub, 2278, &Effect2278Sub{})
input.InitEffect(input.EffectType.Skill, 2279, &Effect2279{})
input.InitEffect(input.EffectType.Sub, 2279, &Effect2279Sub{})
input.InitEffect(input.EffectType.Skill, 2280, &Effect2280{})
input.InitEffect(input.EffectType.Sub, 2280, &Effect2280Sub{})
input.InitEffect(input.EffectType.Skill, 2281, &Effect2281{})
input.InitEffect(input.EffectType.Skill, 2282, &Effect2282{})
input.InitEffect(input.EffectType.Skill, 2283, &Effect2283{})
input.InitEffect(input.EffectType.Skill, 2284, &Effect2284{})
input.InitEffect(input.EffectType.Skill, 2285, &Effect2285{})
input.InitEffect(input.EffectType.Skill, 2286, &Effect2286{})
input.InitEffect(input.EffectType.Skill, 2287, &Effect2287{})
input.InitEffect(input.EffectType.Skill, 2288, &Effect2288{})
input.InitEffect(input.EffectType.Sub, 2288, &Effect2288Sub{})
input.InitEffect(input.EffectType.Skill, 2289, &Effect2289{})
input.InitEffect(input.EffectType.Skill, 2290, &Effect2290{})
input.InitEffect(input.EffectType.Skill, 2291, &Effect2291{})
input.InitEffect(input.EffectType.Skill, 2292, &Effect2292{})
input.InitEffect(input.EffectType.Skill, 2293, &Effect2293{})
input.InitEffect(input.EffectType.Skill, 2294, &Effect2294{})
}

View File

@@ -0,0 +1,198 @@
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"
)
func addRandomControlStatus2295(owner, target *input.Input, count int) {
if owner == nil || target == nil || count <= 0 {
return
}
statuses := []int{
int(info.PetStatus.Paralysis),
int(info.PetStatus.Fear),
int(info.PetStatus.Tired),
int(info.PetStatus.Petrified),
int(info.PetStatus.Sleep),
}
for _, idx := range grand.Perm(len(statuses))[:minInt2295(count, len(statuses))] {
addStatusEffect(owner, target, statuses[idx])
}
}
func minInt2295(a, b int) int {
if a < b {
return a
}
return b
}
// Effect 2295: 废除技能恢复对方全体力并清空自身PP按怨气等级秒杀对手
type Effect2295 struct{ node.EffectNode }
func (e *Effect2295) Skill_Use() bool {
if e.Ctx().Opp == nil || e.Ctx().Our == nil {
return true
}
for i := range e.Ctx().Our.CurrentPet.Info.SkillList {
e.Ctx().Our.CurrentPet.Info.SkillList[i].PP = 0
}
e.Ctx().Opp.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Opp.CurrentPet.GetMaxHP())
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.True, Damage: e.Ctx().Opp.CurrentPet.GetHP()})
}
return true
}
// Effect 2296: 令对方体力上限与自身等同并恢复等量体力,然后降低非体力上限类提升值
type Effect2296 struct{ node.EffectNode }
func (e *Effect2296) Skill_Use() bool {
if e.Ctx().Opp == nil || e.Ctx().Our == nil {
return true
}
targetMax := e.Ctx().Our.CurrentPet.GetMaxHP()
e.Ctx().Opp.CurrentPet.Info.MaxHp = uint32(targetMax.IntPart())
e.Ctx().Opp.Heal(e.Ctx().Our, &action.SelectSkillAction{}, targetMax)
for i, v := range e.Ctx().Opp.Prop[:] {
if i == 0 || v <= 0 {
continue
}
if v > 1 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -1)
}
}
return true
}
// Effect 2297: 反转自身能力下降状态,反转成功则自身全属性+{0}
type Effect2297 struct{ node.EffectNode }
func (e *Effect2297) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
clearPositiveProps(e.Ctx().Our, e.Ctx().Our)
for i := range e.Ctx().Our.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.Args()[0].IntPart()))
}
return true
}
// Effect 2298: 自身不处于能力提升状态时先制+2
type Effect2298 struct{ node.EffectNode }
func (e *Effect2298) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.HasPropADD() {
e.Ctx().SkillEntity.XML.Priority += 2
}
return true
}
// Effect 2299: 消除对手回合类效果消除成功则令对手攻击技能PP归0
type Effect2299 struct{ node.EffectNode }
func (e *Effect2299) Skill_Use() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
for i := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if skill, ok := xmlres.SkillMap[int(e.Ctx().Opp.CurrentPet.Info.SkillList[i].ID)]; ok {
if skill.Category == int(info.Category.PHYSICAL) || skill.Category == int(info.Category.SPECIAL) {
e.Ctx().Opp.CurrentPet.Info.SkillList[i].PP = 0
}
}
}
return true
}
// Effect 2300: 攻击伤害受限时{0}%令对手{1}
type Effect2300 struct{ node.EffectNode }
func (e *Effect2300) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if zone.Damage.Cmp(alpacadecimal.NewFromInt(1)) > 0 {
return true
}
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100); ok {
addStatusEffect(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2301: {0}回合内自身免疫受到的攻击
type Effect2301 struct{ node.EffectNode }
func (e *Effect2301) DamageLockEx(zone *info.DamageZone) bool {
if zone != nil && zone.Type == info.DamageType.Red {
zone.Damage = alpacadecimal.Zero
}
return true
}
// Effect 2302: 对手每有1个技能PP值小于1先制+1
type Effect2302 struct{ node.EffectNode }
func (e *Effect2302) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().Opp == nil {
return true
}
count := 0
for _, s := range e.Ctx().Opp.CurrentPet.Info.SkillList {
if s.PP <= 0 {
count++
}
}
e.Ctx().SkillEntity.XML.Priority += count
return true
}
// Effect 2303: 自身满体力时吸取并压制对手
type Effect2303 struct{ node.EffectNode }
func (e *Effect2303) Skill_Use() bool {
if len(e.Args()) < 4 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) >= 0 {
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
addRandomControlStatus2295(e.Ctx().Our, e.Ctx().Opp, 1)
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[2])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
for i := range e.Ctx().Opp.CurrentPet.Info.SkillList {
e.Ctx().Opp.CurrentPet.Info.SkillList[i].PP = uint32(e.Args()[3].IntPart())
}
return true
}
// Effect 2304: 技能无效时消除对手回合类效果并叠加危机感与登场压制
type Effect2304 struct{ node.EffectNode }
func (e *Effect2304) Skill_Use_ex() bool {
clearTargetEffects(e.Ctx().Our, e.Ctx().Opp)
addRandomControlStatus2295(e.Ctx().Our, e.Ctx().Opp, 1)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2295, &Effect2295{})
input.InitEffect(input.EffectType.Skill, 2296, &Effect2296{})
input.InitEffect(input.EffectType.Skill, 2297, &Effect2297{})
input.InitEffect(input.EffectType.Skill, 2298, &Effect2298{})
input.InitEffect(input.EffectType.Skill, 2299, &Effect2299{})
input.InitEffect(input.EffectType.Skill, 2300, &Effect2300{})
input.InitEffect(input.EffectType.Skill, 2301, &Effect2301{})
input.InitEffect(input.EffectType.Skill, 2302, &Effect2302{})
input.InitEffect(input.EffectType.Skill, 2303, &Effect2303{})
input.InitEffect(input.EffectType.Skill, 2304, &Effect2304{})
}

View File

@@ -0,0 +1,197 @@
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{})
}

View File

@@ -0,0 +1,213 @@
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"
)
// Effect 2315: 吸取对方当前PP损失最多的精灵体力
type Effect2315 struct {
node.EffectNode
}
func (e *Effect2315) OnSkill() bool {
if len(e.Args()) < 3 || e.Ctx().Opp.CurrentPet == nil {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if damage.Cmp(alpacadecimal.Zero) <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 2316: 任一方能力下降时自身免疫攻击
type Effect2316 struct {
node.EffectNode
}
func (e *Effect2316) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.HasPropSub() || e.Ctx().Opp.HasPropSub() {
e.Ctx().SkillEntity.SetNoSide()
}
return true
}
// Effect 2317: 双方每有1组能力上下提升状态吸血
type Effect2317 struct {
node.EffectNode
}
func (e *Effect2317) OnSkill() bool {
if len(e.Args()) < 1 {
return true
}
if e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
return true
}
count := 0
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
count++
}
}
for _, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
count++
}
}
if count == 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred)
damage = damage.Mul(alpacadecimal.NewFromInt(int64(count)))
if damage.Cmp(alpacadecimal.Zero) > 0 {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
}
return true
}
// Effect 2318: 消耗全部护盾
type Effect2318 struct {
node.EffectNode
}
func (e *Effect2318) Skill_Use() bool {
if e.Ctx().Our.CurrentShield().Cmp(alpacadecimal.Zero) <= 0 {
return true
}
shield := e.Ctx().Our.CurrentShield()
e.Ctx().Our.AddShield(alpacadecimal.NewFromInt(-1).Mul(shield))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: shield})
return true
}
// Effect 2319: 附加双防之和的百分比伤害
type Effect2319 struct {
node.EffectNode
}
func (e *Effect2319) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet == nil {
return true
}
dmg := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: dmg})
return true
}
// Effect 2320: 连续使用技能令对手下若干回合攻击无效
type Effect2320 struct {
node.EffectNode
}
func (e *Effect2320) Skill_Use() bool {
if len(e.Args()) < 8 {
return true
}
effect := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2320, e.SideEffectArgs...)
if effect != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect2320Sub struct {
node.EffectNode
}
func (e *Effect2320Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 2321: 低伤害时令对手2回合内属性技能无效
type Effect2321 struct {
node.EffectNode
}
func (e *Effect2321) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || len(e.Args()) < 2 {
return true
}
if zone.Damage.Cmp(alpacadecimal.NewFromInt(100)) < 0 {
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[1].IntPart()))
}
return true
}
// Effect 2322: 使用时解除异常
type Effect2322 struct {
node.EffectNode
}
func (e *Effect2322) Skill_Use() bool {
clearOwnDownProps(e.Ctx().Our)
return true
}
// Effect 2323: 获得光辉之翼
type Effect2323 struct {
node.EffectNode
}
func (e *Effect2323) Skill_Use() bool {
if e.Ctx().Our.CurrentPet != nil {
e.Ctx().Our.CurrentPet.PetInfo.Type = 2
}
return true
}
// Effect 2324: 消除对手护盾/护罩并提升效果
type Effect2324 struct {
node.EffectNode
}
func (e *Effect2324) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
if e.Ctx().Opp.HasShield() {
e.Ctx().Opp.AddShield(alpacadecimal.NewFromInt(-1).Mul(e.Ctx().Opp.CurrentShield()))
cleared = true
}
if cleared && e.Ctx().Opp.CurrentPet != nil {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(hundred),
})
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2315, &Effect2315{})
input.InitEffect(input.EffectType.Skill, 2316, &Effect2316{})
input.InitEffect(input.EffectType.Skill, 2317, &Effect2317{})
input.InitEffect(input.EffectType.Skill, 2318, &Effect2318{})
input.InitEffect(input.EffectType.Skill, 2319, &Effect2319{})
input.InitEffect(input.EffectType.Skill, 2320, &Effect2320{})
input.InitEffect(input.EffectType.Sub, 2320, &Effect2320Sub{})
input.InitEffect(input.EffectType.Skill, 2321, &Effect2321{})
input.InitEffect(input.EffectType.Skill, 2322, &Effect2322{})
input.InitEffect(input.EffectType.Skill, 2323, &Effect2323{})
input.InitEffect(input.EffectType.Skill, 2324, &Effect2324{})
_ = grand.Intn(1)
}

View File

@@ -0,0 +1,33 @@
package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 2325: 己方场下每存活一只浪浪山小妖怪威力提升50点
type Effect2325 struct{ node.EffectNode }
func (e *Effect2325) SkillHit() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
count := 0
if e.Ctx().Our.AllPet != nil {
for _, pet := range e.Ctx().Our.AllPet {
if pet != nil && pet.Info.Hp > 0 {
count++
}
}
}
if count > 0 {
e.Ctx().SkillEntity.XML.Power += 50 * count
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 2325, &Effect2325{})
}

View File

@@ -0,0 +1,143 @@
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 896: 双倍反转自身的能力下降
type Effect896 struct {
node.EffectNode
}
func (e *Effect896) Skill_Use() bool {
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v*2)
}
return true
}
// Effect 897: 未击败对手则令自身下{0}次受到的攻击伤害额外减少{1}%
type Effect897 struct {
node.EffectNode
}
func (e *Effect897) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 897, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect897Sub struct {
node.EffectNode
remaining int
}
func (e *Effect897Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect897Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 || len(e.Args()) < 2 {
return true
}
reduce := zone.Damage.Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
if reduce.Cmp(zone.Damage) >= 0 {
zone.Damage = alpacadecimal.Zero
} else {
zone.Damage = zone.Damage.Sub(reduce)
}
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 898: 若对手不是雄性精灵,则恢复{0}点体力
type Effect898 struct {
node.EffectNode
}
func (e *Effect898) OnSkill() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Gender == 1 {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0])
return true
}
// Effect 899: 若自身先出手,则本回合对手释放的属性技能失效
type Effect899 struct {
node.EffectNode
}
func (e *Effect899) Skill_Use() bool {
if !e.IsFirst() {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 899)
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect899Sub struct {
node.EffectNode
}
func (e *Effect899Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 900: 恢复自身最大体力的1/{0}体力少于1/{1}时恢复效果翻倍
type Effect900 struct {
node.EffectNode
}
func (e *Effect900) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) < 0 {
heal = heal.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 896, &Effect896{})
input.InitEffect(input.EffectType.Skill, 897, &Effect897{})
input.InitEffect(input.EffectType.Sub, 897, &Effect897Sub{})
input.InitEffect(input.EffectType.Skill, 898, &Effect898{})
input.InitEffect(input.EffectType.Skill, 899, &Effect899{})
input.InitEffect(input.EffectType.Sub, 899, &Effect899Sub{})
input.InitEffect(input.EffectType.Skill, 900, &Effect900{})
}

View File

@@ -0,0 +1,228 @@
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 901: 消除对手回合类效果,消除成功则{0}
type Effect901 struct {
node.EffectNode
}
func (e *Effect901) Skill_Use() bool {
if len(e.Args()) < 6 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
for i := 0; i+2 < len(e.Args()) && i < 6; i += 3 {
statusID := int(e.Args()[i].IntPart())
chance := int(e.Args()[i+1].IntPart())
level := int8(e.Args()[i+2].IntPart())
if statusID <= 0 || chance <= 0 {
continue
}
success, _, _ := e.Input.Player.Roll(chance, 100)
if !success {
continue
}
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, statusID)
if statusEffect == nil {
continue
}
if level > 0 {
statusEffect.Duration(int(level))
}
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
// Effect 902: 消耗自身全部体力,消除对手能力提升状态和回合类效果并使对手{0}回合内所有技能失效
type Effect902 struct {
node.EffectNode
}
func (e *Effect902) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Ctx().Our.CurrentPet.GetHP(),
})
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 902, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect902Sub struct {
RoundEffectArg0Base
}
func (e *Effect902Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 903: 自身体力高于对手时附加自身最大体力值{0}%的百分比伤害
type Effect903 struct {
node.EffectNode
}
func (e *Effect903) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 904: 消耗自身全部体力,消除对手回合类效果且令己方免疫下{0}次受到的异常状态,同时己方下只精灵出战时获得{1}点护盾且{2}回合内令对手使用的属性技能无效
type Effect904 struct {
node.EffectNode
}
func (e *Effect904) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Ctx().Our.CurrentPet.GetHP(),
})
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 904, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect904Sub struct {
node.EffectNode
statusImmuneRemaining int
shieldGranted bool
}
func (e *Effect904Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
if len(a) > 2 {
e.Duration(a[2])
} else {
e.Duration(-1)
}
if len(a) > 0 {
e.statusImmuneRemaining = a[0]
}
}
func (e *Effect904Sub) ActionStart(a, b *action.SelectSkillAction) bool {
skill := e.Ctx().SkillEntity
if skill == nil || skill.Category() != info.Category.STATUS {
return true
}
skill.SetMiss()
return true
}
func (e *Effect904Sub) SwitchIn(in *input.Input) bool {
if in != e.Ctx().Our || e.shieldGranted || len(e.Args()) < 2 {
return true
}
e.shieldGranted = true
e.Ctx().Our.AddShield(e.Args()[1])
return true
}
func (e *Effect904Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
if e.statusImmuneRemaining <= 0 {
return true
}
if in != e.Ctx().Opp || !input.IS_Stat(effEffect) {
return true
}
e.statusImmuneRemaining--
if e.statusImmuneRemaining <= 0 && e.Duration() <= 0 {
e.Alive(false)
}
return false
}
// Effect 905: 消除对手能力提升,消除成功{0}回合内对手无法通过自身技能恢复体力
type Effect905 struct {
node.EffectNode
}
func (e *Effect905) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 905, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect905Sub struct {
RoundEffectArg0Base
}
func (e *Effect905Sub) Heal_Pre(ac action.BattleActionI, value *int) bool {
if value == nil || *value <= 0 {
return true
}
*value = 0
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 901, &Effect901{})
input.InitEffect(input.EffectType.Skill, 902, &Effect902{})
input.InitEffect(input.EffectType.Sub, 902, &Effect902Sub{})
input.InitEffect(input.EffectType.Skill, 903, &Effect903{})
input.InitEffect(input.EffectType.Skill, 904, &Effect904{})
input.InitEffect(input.EffectType.Sub, 904, &Effect904Sub{})
input.InitEffect(input.EffectType.Skill, 905, &Effect905{})
input.InitEffect(input.EffectType.Sub, 905, &Effect905Sub{})
}

View File

@@ -0,0 +1,162 @@
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 906: 附加对手最大体力值{0}%的百分比伤害,每次使用增加{1}%,最高{2}%
type Effect906 struct {
AddLvelEffect
}
func (e *Effect906) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
percent := e.GetADD(e.Args()[0], e.Args()[1], e.Args()[2])
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Mul(percent).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 907: 反转自身能力下降状态,反转成功则使对手随机{0}个技能PP归零
type Effect907 struct {
node.EffectNode
}
func (e *Effect907) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
reversed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v)
}
if !reversed {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 908: 吸收对手能力提升状态,吸收成功则对手下{0}回合所有技能失效
type Effect908 struct {
node.EffectNode
}
func (e *Effect908) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 908, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect908Sub struct {
RoundEffectArg0Base
}
func (e *Effect908Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 909: 先出手时{0}%使对手{1},未触发则附加{2}点固定伤害
type Effect909 struct {
node.EffectNode
}
func (e *Effect909) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if !e.IsFirst() {
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
// Effect 910: 当回合击败对手则令对手{0}回合内属性技能无效
type Effect910 struct {
node.EffectNode
}
func (e *Effect910) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 910, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect910Sub struct {
RoundEffectArg0Base
}
func (e *Effect910Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 906, &Effect906{})
input.InitEffect(input.EffectType.Skill, 907, &Effect907{})
input.InitEffect(input.EffectType.Skill, 908, &Effect908{})
input.InitEffect(input.EffectType.Sub, 908, &Effect908Sub{})
input.InitEffect(input.EffectType.Skill, 909, &Effect909{})
input.InitEffect(input.EffectType.Skill, 910, &Effect910{})
input.InitEffect(input.EffectType.Sub, 910, &Effect910Sub{})
}

View File

@@ -0,0 +1,171 @@
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 916: 命中后{0}%使对手{1},若未触发则恢复自身全部体力
type Effect916 struct {
node.EffectNode
}
func (e *Effect916) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP())
return true
}
// Effect 917: 命中后{0}%使对手{1}未触发则附加自身最大体力值1/{2}的百分比伤害
type Effect917 struct {
node.EffectNode
}
func (e *Effect917) OnSkill() bool {
if len(e.Args()) < 3 || e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[2])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 918: 造成的伤害不足{0}则自身下{1}次造成的伤害提升{2}%
type Effect918 struct {
node.EffectNode
}
func (e *Effect918) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 918, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect918Sub struct {
node.EffectNode
remaining int
}
func (e *Effect918Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect918Sub) SkillHit() bool {
if e.remaining <= 0 {
e.Alive(false)
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[1])
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 919: 后出手时使对手下回合属性技能失效
type Effect919 struct {
node.EffectNode
}
func (e *Effect919) Skill_Use() bool {
if e.IsFirst() {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 919, 1)
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect919Sub struct {
FixedDuration1Base
}
func (e *Effect919Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 920: 未击败对手则下回合造成的伤害提升{0}%
type Effect920 struct {
node.EffectNode
}
func (e *Effect920) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 920, 1, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect920Sub struct {
RoundEffectArg1Base
}
func (e *Effect920Sub) Damage_Mul(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(100).Add(e.Args()[1])).Div(alpacadecimal.NewFromInt(100))
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 916, &Effect916{})
input.InitEffect(input.EffectType.Skill, 917, &Effect917{})
input.InitEffect(input.EffectType.Skill, 918, &Effect918{})
input.InitEffect(input.EffectType.Sub, 918, &Effect918Sub{})
input.InitEffect(input.EffectType.Skill, 919, &Effect919{})
input.InitEffect(input.EffectType.Sub, 919, &Effect919Sub{})
input.InitEffect(input.EffectType.Skill, 920, &Effect920{})
input.InitEffect(input.EffectType.Sub, 920, &Effect920Sub{})
}

View File

@@ -0,0 +1,133 @@
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 921: {0}%概率造成的攻击伤害为{1}倍,未触发则{2}回合内令对手使用的属性技能无效
type Effect921 struct {
node.EffectNode
}
func (e *Effect921) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
e.Ctx().SkillEntity.XML.Power *= int(e.Args()[1].IntPart())
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 921, int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect921Sub struct {
RoundEffectArg0Base
}
func (e *Effect921Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 922: {0}回合内每回合结束后解除并反馈自身能力下降状态
type Effect922 struct {
RoundEffectArg0Base
}
func (e *Effect922) TurnEnd() {
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v)
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), v)
}
e.EffectNode.TurnEnd()
}
// Effect 923: {0}回合内每回合若先出手则吸取对手{1}点体力
type Effect923 struct {
RoundEffectArg0Base
}
func (e *Effect923) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.Prop[5] < e.Ctx().Opp.Prop[5] {
return true
}
drain := e.Args()[1]
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)
return true
}
// Effect 924: 下{0}回合攻击技能吸取对手1/{1}最大体力值
type Effect924 struct {
node.EffectNode
}
func (e *Effect924) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 924, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect924Sub struct {
RoundEffectArg0Base
}
func (e *Effect924Sub) OnSkill() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || len(e.Args()) < 2 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 925: 若自身为满体力则技能威力提升{0}%
type Effect925 struct {
node.EffectNode
}
func (e *Effect925) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 921, &Effect921{})
input.InitEffect(input.EffectType.Sub, 921, &Effect921Sub{})
input.InitEffect(input.EffectType.Skill, 922, &Effect922{})
input.InitEffect(input.EffectType.Skill, 923, &Effect923{})
input.InitEffect(input.EffectType.Skill, 924, &Effect924{})
input.InitEffect(input.EffectType.Sub, 924, &Effect924Sub{})
input.InitEffect(input.EffectType.Skill, 925, &Effect925{})
}

View File

@@ -0,0 +1,740 @@
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 956: 未击败对手则下回合使用技能后附加{0}点固定伤害,遇到天敌时附加的固定伤害翻倍
type Effect956 struct {
node.EffectNode
}
func (e *Effect956) Skill_Use() bool {
if len(e.Args()) == 0 || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 956, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect956Sub struct {
RoundEffectArg0Base
}
func (e *Effect956Sub) Skill_Use() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
damage := e.Args()[0]
if e.ISNaturalEnemy() {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
})
return true
}
// Effect 957: 使对手全属性-{0},若对手处于{1}状态则自身额外全属性+{2}
type Effect957 struct {
node.EffectNode
}
func (e *Effect957) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[0].IntPart()))
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[1].IntPart())) {
return true
}
applyAllPropUp(e.Ctx().Our, int8(e.Args()[2].IntPart()))
return true
}
// Effect 958: 若对手处于{0}状态则先制+{1}
type Effect958 struct {
node.EffectNode
}
func (e *Effect958) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if len(e.Args()) < 2 {
return true
}
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 959: 消除对手回合类效果,消除成功则自身全属性+{0}
type Effect959 struct {
node.EffectNode
}
func (e *Effect959) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
applyAllPropUp(e.Ctx().Our, int8(e.Args()[0].IntPart()))
return true
}
// Effect 960: {0}回合内若自身处于能力提升状态则每回合使用技能{1}%令对手{2}
type Effect960 struct {
RoundEffectArg0Base
}
func (e *Effect960) OnSkill() bool {
if len(e.Args()) < 3 || !e.Ctx().Our.HasPropADD() {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !success {
return true
}
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart()))
if statusEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
}
return true
}
// Effect 961: 反转自身能力下降,反转成功则自身下{0}回合免疫攻击伤害
type Effect961 struct {
node.EffectNode
}
func (e *Effect961) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
reversed := false
for i, v := range e.Ctx().Our.Prop[:] {
if v >= 0 {
continue
}
reversed = true
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), -v)
}
if !reversed {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 961, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect961Sub struct {
RoundEffectArg0Base
}
func (e *Effect961Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
zone.Damage = alpacadecimal.Zero
return true
}
// Effect 962: 全属性+{0},自身不处于能力提升状态时强化效果翻倍
type Effect962 struct {
node.EffectNode
}
func (e *Effect962) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
boost := int8(e.Args()[0].IntPart())
if !e.Ctx().Our.HasPropADD() {
boost *= 2
}
applyAllPropUp(e.Ctx().Our, boost)
return true
}
// Effect 963: 若自身处于能力提升状态则吸取对手最大体力的1/{0}
type Effect963 struct {
node.EffectNode
}
func (e *Effect963) OnSkill() bool {
if len(e.Args()) == 0 || !e.Ctx().Our.HasPropADD() {
return true
}
if e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 964: 未击败对手则自身能力提升状态翻倍
type Effect964 struct {
node.EffectNode
}
func (e *Effect964) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
for i, v := range e.Ctx().Our.Prop[:] {
if v <= 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
return true
}
// Effect 965: {0}回合内自身攻击技能命中则对手全属性-{1}
type Effect965 struct {
RoundEffectArg0Base
}
func (e *Effect965) SkillHit() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[1].IntPart()))
return true
}
// Effect 966: {0}%的概率使对手{1},未触发则自身全属性+{2}
type Effect966 struct {
node.EffectNode
}
func (e *Effect966) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
applyAllPropUp(e.Ctx().Our, int8(e.Args()[2].IntPart()))
return true
}
// Effect 967: 攻击结束时附加对手双防之和{0}%的百分比伤害
type Effect967 struct {
node.EffectNode
}
func (e *Effect967) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
defenseSum := int64(e.Ctx().Opp.Prop[1]) + int64(e.Ctx().Opp.Prop[3])
if defenseSum <= 0 {
return true
}
damage := alpacadecimal.NewFromInt(defenseSum).Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 968: 命中对手后有{0}%使对手{1},先出手时概率翻倍
type Effect968 struct {
node.EffectNode
}
func (e *Effect968) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
chance := int(e.Args()[0].IntPart())
if e.Ctx().Our.Prop[5] >= e.Ctx().Opp.Prop[5] {
chance *= 2
}
if chance > 100 {
chance = 100
}
success, _, _ := e.Input.Player.Roll(chance, 100)
if !success {
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 969: 后出手时下回合受到的伤害降低{0}点
type Effect969 struct {
node.EffectNode
}
func (e *Effect969) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.Prop[5] >= e.Ctx().Opp.Prop[5] {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 969, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect969Sub struct {
RoundEffectArg0Base
}
func (e *Effect969Sub) Damage_Floor(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
reduce := e.Args()[0]
if zone.Damage.Cmp(reduce) <= 0 {
zone.Damage = alpacadecimal.Zero
return true
}
zone.Damage = zone.Damage.Sub(reduce)
return true
}
// Effect 970: 双倍反转对手能力提升状态,反转成功则下回合自身所有技能先制+{0},反转失败则消除对手能力提升状态
type Effect970 struct {
node.EffectNode
}
func (e *Effect970) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -v) {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
cleared = true
}
}
if !cleared {
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 970, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect970Sub struct {
RoundEffectArg0Base
}
func (e *Effect970Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[0].IntPart())
return true
}
// Effect 971: {0}回合内每回合使用技能吸取对手最大体力的1/{1}吸取体力时若自身体力低于最大体力的1/{2}则吸取效果翻倍
type Effect971 struct {
RoundEffectArg0Base
}
func (e *Effect971) OnSkill() bool {
if len(e.Args()) < 3 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[1])
if e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[2]).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 972: 出手时若自身体力低于对手,则免疫下{0}次受到的攻击伤害
type Effect972 struct {
node.EffectNode
}
func (e *Effect972) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) >= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 972, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect972Sub struct {
node.EffectNode
remaining int
}
func (e *Effect972Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect972Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red {
return true
}
if e.remaining <= 0 {
e.Alive(false)
return true
}
e.remaining--
zone.Damage = alpacadecimal.Zero
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 973: 消除对手回合类效果,消除成功则{0}%令对手{1}
type Effect973 struct {
node.EffectNode
}
func (e *Effect973) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
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 974: {0}%使对手{1}若未触发则使对手受到相当于自身当前体力1/{2}的百分比伤害
type Effect974 struct {
node.EffectNode
}
func (e *Effect974) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
if e.Args()[2].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetHP().Div(e.Args()[2])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 975: {0}%的概率威力{1}倍,若未触发则下回合自身先制+{2}
type Effect975 struct {
node.EffectNode
}
func (e *Effect975) SkillHit() bool {
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
e.Ctx().SkillEntity.XML.Power = e.Ctx().SkillEntity.XML.Power * int(e.Args()[1].IntPart())
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 975, int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect975Sub struct {
RoundEffectArg0Base
}
func (e *Effect975Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[0].IntPart())
return true
}
// Effect 976: 消除对手回合类效果,若消除成功则使对手下{0}次使用的属性技能失效
type Effect976 struct {
node.EffectNode
}
func (e *Effect976) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 976, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect976Sub struct {
node.EffectNode
remaining int
}
func (e *Effect976Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect976Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
if e.remaining <= 0 {
e.Alive(false)
return true
}
e.Ctx().SkillEntity.SetMiss()
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 977: 吸取对手最大体力的1/{0}自身体力低于1/{1}时吸取效果翻倍
type Effect977 struct {
node.EffectNode
}
func (e *Effect977) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[1]).Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) < 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
// Effect 978: 吸取并反转对手能力提升状态
type Effect978 struct {
node.EffectNode
}
func (e *Effect978) OnSkill() bool {
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -v) {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
}
}
return true
}
// Effect 979: 消除对手回合类效果,消除成功则自身下{0}回合所有技能先制+{1}
type Effect979 struct {
node.EffectNode
}
func (e *Effect979) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 979, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect979Sub struct {
RoundEffectArg0Base
}
func (e *Effect979Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 980: 先出手时对手当回合属性技能无效
type Effect980 struct {
node.EffectNode
}
func (e *Effect980) Skill_Use() bool {
if e.Ctx().Our.Prop[5] < e.Ctx().Opp.Prop[5] {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 980)
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect980Sub struct {
node.EffectNode
}
func (e *Effect980Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
func applyAllPropUp(owner *input.Input, level int8) {
if owner == nil || level <= 0 {
return
}
for i := range owner.Prop {
owner.SetProp(owner, int8(i), level)
}
}
func init() {
input.InitEffect(input.EffectType.Skill, 956, &Effect956{})
input.InitEffect(input.EffectType.Sub, 956, &Effect956Sub{})
input.InitEffect(input.EffectType.Skill, 957, &Effect957{})
input.InitEffect(input.EffectType.Skill, 958, &Effect958{})
input.InitEffect(input.EffectType.Skill, 959, &Effect959{})
input.InitEffect(input.EffectType.Skill, 960, &Effect960{})
input.InitEffect(input.EffectType.Skill, 961, &Effect961{})
input.InitEffect(input.EffectType.Sub, 961, &Effect961Sub{})
input.InitEffect(input.EffectType.Skill, 962, &Effect962{})
input.InitEffect(input.EffectType.Skill, 963, &Effect963{})
input.InitEffect(input.EffectType.Skill, 964, &Effect964{})
input.InitEffect(input.EffectType.Skill, 965, &Effect965{})
input.InitEffect(input.EffectType.Skill, 966, &Effect966{})
input.InitEffect(input.EffectType.Skill, 967, &Effect967{})
input.InitEffect(input.EffectType.Skill, 968, &Effect968{})
input.InitEffect(input.EffectType.Skill, 969, &Effect969{})
input.InitEffect(input.EffectType.Sub, 969, &Effect969Sub{})
input.InitEffect(input.EffectType.Skill, 970, &Effect970{})
input.InitEffect(input.EffectType.Sub, 970, &Effect970Sub{})
input.InitEffect(input.EffectType.Skill, 971, &Effect971{})
input.InitEffect(input.EffectType.Skill, 972, &Effect972{})
input.InitEffect(input.EffectType.Sub, 972, &Effect972Sub{})
input.InitEffect(input.EffectType.Skill, 973, &Effect973{})
input.InitEffect(input.EffectType.Skill, 974, &Effect974{})
input.InitEffect(input.EffectType.Skill, 975, &Effect975{})
input.InitEffect(input.EffectType.Sub, 975, &Effect975Sub{})
input.InitEffect(input.EffectType.Skill, 976, &Effect976{})
input.InitEffect(input.EffectType.Sub, 976, &Effect976Sub{})
input.InitEffect(input.EffectType.Skill, 977, &Effect977{})
input.InitEffect(input.EffectType.Skill, 978, &Effect978{})
input.InitEffect(input.EffectType.Skill, 979, &Effect979{})
input.InitEffect(input.EffectType.Sub, 979, &Effect979Sub{})
input.InitEffect(input.EffectType.Skill, 980, &Effect980{})
input.InitEffect(input.EffectType.Sub, 980, &Effect980Sub{})
}

View File

@@ -0,0 +1,423 @@
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 981: 直接造成{0}点电系伤害,自身每处于一种能力提升状态则造成的伤害提高{1}%
type Effect981 struct {
node.EffectNode
}
func (e *Effect981) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
boostCount := 0
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
boostCount++
}
}
damage := e.Args()[0]
if boostCount > 0 {
damage = damage.Add(damage.Mul(e.Args()[1]).Mul(alpacadecimal.NewFromInt(int64(boostCount))).Div(alpacadecimal.NewFromInt(100)))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
return true
}
// Effect 982: {0}%使对手{1},自身每处于一种能力提升状态则概率提高{2}%
type Effect982 struct {
node.EffectNode
}
func (e *Effect982) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
chance := int(e.Args()[0].IntPart())
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
chance += int(e.Args()[2].IntPart())
}
}
if chance > 100 {
chance = 100
}
success, _, _ := e.Input.Player.Roll(chance, 100)
if !success {
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 983: 未击败对手则自身全属性+{0}
type Effect983 struct {
node.EffectNode
}
func (e *Effect983) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
return true
}
applyAllPropUp(e.Ctx().Our, int8(e.Args()[0].IntPart()))
return true
}
// Effect 984: 未击败对手则下回合自身所有技能先制+{0}
type Effect984 struct {
node.EffectNode
}
func (e *Effect984) Skill_Use() bool {
if e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 984, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect984Sub struct {
RoundEffectArg0Base
}
func (e *Effect984Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[0].IntPart())
return true
}
// Effect 985: 吸取对手能力提升状态,吸取成功则下{0}回合对手属性技能无效
type Effect985 struct {
node.EffectNode
}
func (e *Effect985) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 985, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect985Sub struct {
RoundEffectArg0Base
}
func (e *Effect985Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 986: 先出手时造成的攻击伤害额外提升{0}%
type Effect986 struct {
node.EffectNode
}
func (e *Effect986) SkillHit() bool {
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.Prop[5] < e.Ctx().Opp.Prop[5] {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
return true
}
// Effect 987: 附加{0}点固定伤害,对手{1}时固定伤害翻倍
type Effect987 struct {
node.EffectNode
}
func (e *Effect987) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
damage := e.Args()[0]
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[1].IntPart())) {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
return true
}
// Effect 988: 消除对手能力提升状态,消除成功则对手下{0}回合技能失效
type Effect988 struct {
node.EffectNode
}
func (e *Effect988) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 988, int(e.Args()[0].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect988Sub struct {
RoundEffectArg0Base
}
func (e *Effect988Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity == nil {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 989: 造成的伤害低于{0}则附加{1}点固定伤害,自身体力低于对手时固定伤害翻倍
type Effect989 struct {
node.EffectNode
}
func (e *Effect989) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) >= 0 {
return true
}
damage := e.Args()[1]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
return true
}
// Effect 990: 消除对手回合类效果,消除成功则附加{0}点固定伤害
type Effect990 struct {
node.EffectNode
}
func (e *Effect990) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: e.Args()[0]})
return true
}
// Effect 991: 未击败对手则对方下{0}次攻击技能将{1}%被己方闪避
type Effect991 struct {
node.EffectNode
}
func (e *Effect991) Skill_Use() bool {
if len(e.Args()) < 2 || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 991, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect991Sub struct {
node.EffectNode
remaining int
}
func (e *Effect991Sub) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.Duration(-1)
if len(a) > 0 {
e.remaining = a[0]
}
}
func (e *Effect991Sub) DamageLockEx(zone *info.DamageZone) bool {
if zone == nil || zone.Type != info.DamageType.Red || e.remaining <= 0 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !success {
return true
}
zone.Damage = alpacadecimal.Zero
e.remaining--
if e.remaining <= 0 {
e.Alive(false)
}
return true
}
// Effect 992: {0}回合内攻击技能附加自身当前体力{1}%的百分比伤害
type Effect992 struct {
RoundEffectArg0Base
}
func (e *Effect992) OnSkill() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
damage := e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
return true
}
// Effect 993: 全属性+{0},对手处于{1}状态时强化效果翻倍
type Effect993 struct {
node.EffectNode
}
func (e *Effect993) OnSkill() bool {
if len(e.Args()) < 2 {
return true
}
boost := int8(e.Args()[0].IntPart())
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[1].IntPart())) {
boost *= 2
}
applyAllPropUp(e.Ctx().Our, boost)
return true
}
// Effect 994: 消除对手能力提升状态,消除成功则自身下{0}次技能先制+{1}
type Effect994 struct {
node.EffectNode
}
func (e *Effect994) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if !cleared {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 994, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect994Sub struct {
RoundEffectArg0Base
}
func (e *Effect994Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority += int(e.Args()[1].IntPart())
return true
}
// Effect 995: 消除对手能力提升状态消除成功则吸取对手最大体力的1/{0}
type Effect995 struct {
node.EffectNode
}
func (e *Effect995) Skill_Use() bool {
if len(e.Args()) == 0 {
return true
}
cleared := false
for i, v := range e.Ctx().Opp.Prop[:] {
if v <= 0 {
continue
}
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
cleared = true
}
}
if !cleared || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 981, &Effect981{})
input.InitEffect(input.EffectType.Skill, 982, &Effect982{})
input.InitEffect(input.EffectType.Skill, 983, &Effect983{})
input.InitEffect(input.EffectType.Skill, 984, &Effect984{})
input.InitEffect(input.EffectType.Sub, 984, &Effect984Sub{})
input.InitEffect(input.EffectType.Skill, 985, &Effect985{})
input.InitEffect(input.EffectType.Sub, 985, &Effect985Sub{})
input.InitEffect(input.EffectType.Skill, 986, &Effect986{})
input.InitEffect(input.EffectType.Skill, 987, &Effect987{})
input.InitEffect(input.EffectType.Skill, 988, &Effect988{})
input.InitEffect(input.EffectType.Sub, 988, &Effect988Sub{})
input.InitEffect(input.EffectType.Skill, 989, &Effect989{})
input.InitEffect(input.EffectType.Skill, 990, &Effect990{})
input.InitEffect(input.EffectType.Skill, 991, &Effect991{})
input.InitEffect(input.EffectType.Sub, 991, &Effect991Sub{})
input.InitEffect(input.EffectType.Skill, 992, &Effect992{})
input.InitEffect(input.EffectType.Skill, 993, &Effect993{})
input.InitEffect(input.EffectType.Skill, 994, &Effect994{})
input.InitEffect(input.EffectType.Sub, 994, &Effect994Sub{})
input.InitEffect(input.EffectType.Skill, 995, &Effect995{})
}

View File

@@ -0,0 +1,239 @@
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 996: 自身体力高于1/{0}时,附加自身当前体力{1}%的百分比伤害
type Effect996 struct {
node.EffectNode
}
func (e *Effect996) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetHP().Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 997: 自身体力低于1/{0}时恢复自身最大体力的1/{1}并造成等量百分比伤害
type Effect997 struct {
node.EffectNode
}
func (e *Effect997) OnSkill() bool {
if len(e.Args()) < 2 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 || e.Args()[1].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
threshold := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(threshold) >= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
// Effect 998: {0}回合内自身能力提升状态被消除或吸取时,{1}回合内对手属性技能命中效果失效
type Effect998 struct {
node.EffectNode
}
func (e *Effect998) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 998, int(e.Args()[0].IntPart()), int(e.Args()[1].IntPart()))
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect998Sub struct {
RoundEffectArg0Base
}
func (e *Effect998Sub) SkillHit_ex() bool {
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.SetMiss()
return true
}
// Effect 999: 自身每处于{0}种能力提升状态,造成的伤害提升{1}%
type Effect999 struct {
node.EffectNode
}
func (e *Effect999) SkillHit() bool {
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
step := int(e.Args()[0].IntPart())
if step <= 0 {
return true
}
boostCount := 0
for _, v := range e.Ctx().Our.Prop[:] {
if v > 0 {
boostCount++
}
}
mul := boostCount / step
if mul <= 0 {
return true
}
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[1].Mul(alpacadecimal.NewFromInt(int64(mul))))
return true
}
// Effect 1000: 命中则{0}%使对手{1},未触发则附加{2}点固定伤害
type Effect1000 struct {
node.EffectNode
}
func (e *Effect1000) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[2],
})
return true
}
// Effect 1001: 全属性+{0},对手处于异常状态时强化效果翻倍
type Effect1001 struct {
node.EffectNode
}
func (e *Effect1001) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
boost := int8(e.Args()[0].IntPart())
if e.Ctx().Opp.StatEffect_Exist_all() {
boost *= 2
}
applyAllPropUp(e.Ctx().Our, boost)
return true
}
// Effect 1002: 若对手处于异常状态则先制+1
type Effect1002 struct {
node.EffectNode
}
func (e *Effect1002) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
if !e.Ctx().Opp.StatEffect_Exist_all() {
return true
}
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
return true
}
current.SkillEntity.XML.Priority++
return true
}
// Effect 1003: 命中后{0}%使对手{1},未触发则使对手全属性-{2}
type Effect1003 struct {
node.EffectNode
}
func (e *Effect1003) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if success {
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
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[2].IntPart()))
return true
}
// Effect 1004: {0}回合内使用技能附加{1}点固定伤害,若自身体力高于对手则效果翻倍
type Effect1004 struct {
RoundEffectArg0Base
}
func (e *Effect1004) Skill_Use() bool {
if len(e.Args()) < 2 {
return true
}
damage := e.Args()[1]
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) > 0 {
damage = damage.Mul(alpacadecimal.NewFromInt(2))
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: damage,
})
return true
}
// Effect 1005: 恢复自身最大体力的1/{0}并造成等量百分比伤害
type Effect1005 struct {
node.EffectNode
}
func (e *Effect1005) OnSkill() bool {
if len(e.Args()) == 0 || e.Args()[0].Cmp(alpacadecimal.Zero) <= 0 {
return true
}
damage := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, damage)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Percent,
Damage: damage,
})
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 996, &Effect996{})
input.InitEffect(input.EffectType.Skill, 997, &Effect997{})
input.InitEffect(input.EffectType.Skill, 998, &Effect998{})
input.InitEffect(input.EffectType.Sub, 998, &Effect998Sub{})
input.InitEffect(input.EffectType.Skill, 999, &Effect999{})
input.InitEffect(input.EffectType.Skill, 1000, &Effect1000{})
input.InitEffect(input.EffectType.Skill, 1001, &Effect1001{})
input.InitEffect(input.EffectType.Skill, 1002, &Effect1002{})
input.InitEffect(input.EffectType.Skill, 1003, &Effect1003{})
input.InitEffect(input.EffectType.Skill, 1004, &Effect1004{})
input.InitEffect(input.EffectType.Skill, 1005, &Effect1005{})
}

View File

@@ -632,6 +632,56 @@ var effectInfoByID = map[int]string{
1260: "将自身能力下降状态双倍反馈给对手,反馈成功则{0}回合内免疫能力下降效果",
1261: "吸取对手能力提升状态,吸取成功则附加{0}点固定伤害",
1262: "获得{0}点护盾,护盾消失时使对手下{1}次攻击技能无效",
1263: "吸取对手最大体力的1/{0}自身体力低于对手时变为1/{1}",
1264: "待补",
1265: "下{0}次受到的攻击伤害减少{1}%",
1266: "{0}回合内若对手使用属性技能,则使用属性技能后己方在场精灵令对手下{1}次使用的攻击技能无效",
1267: "{0}回合内对手使用攻击技能则对手随机进入烧伤、中毒、冻伤中的{1}种异常状态,未触发则消除对手回合类效果",
1268: "击败对手则下回合开始后随机附加烧伤、冻伤、中毒中的{0}种异常状态",
1269: "{0}回合内若对手使用攻击技能则命中前令自身吸取对手最大体力的1/{1}",
1270: "命中则{0}%使对手{1},未触发则对手下{2}次技能无效",
1271: "{0}回合内每回合攻击有{1}%令对手{2},未触发则下{3}回合攻击有{4}%概率使对手{5}",
1272: "附加自身当前护盾值等量的固定伤害",
1273: "若自身满体力则附加自身最大体力1/{0}的百分比伤害",
1274: "{0}%令对手{1},对手处于能力下降状态时触发概率翻倍",
1275: "消耗自身全部体力,使下只出场精灵前{0}次出手必定先手必定暴击",
1276: "消耗自身全部体力给对手附加消耗体力1/{0}等量的百分比伤害",
1277: "若体力大于对手则消耗自身体力至残留1点HP给对手造成350-550点伤害若体力小于对手则消耗自身全部体力给对手等同于消耗量的固定伤害并使对手瘫痪2回合若对手受到致命伤害时残留1点体力",
1278: "{0}%令对手{1},未触发则免疫下{2}次受到的攻击伤害并反弹等量的固定伤害",
1279: "反转自身能力下降状态,反转成功则使对手下{0}次技能无效",
1280: "附加自身当前体力值{0}%的百分比伤害,每次使用增加{1}%,最高{2}%",
1281: "消耗自身所有护盾值并造成等量固定伤害若消耗的护盾值大于300则额外附加自身最大体力1/3的百分比伤害小于300且大于0则恢复自身最大体力的1/3并造成等量百分比伤害",
1282: "命中后使对手受到{0}点固定伤害,未命中则自身死亡",
1283: "全属性+{0},先出手时自身强化效果翻倍",
1284: "先出手时使对手{0}回合属性技能无效",
1285: "当回合未击败对手则减少对方所有技能PP{0}点",
1286: "当回合击败对手则恢复自身所有技能PP值",
1287: "吸取对手能力提升,吸取成功则下{0}次受到的攻击伤害减少{1}%",
1288: "免疫下{0}次受到的攻击,未触发则{1}%令对手{2}",
1289: "将自身的能力下降状态双倍反馈给对手,反馈成功则对手下{0}次技能无效",
1290: "恢复自身最大体力的1/{0}若自身体力低于1/{1}则造成等量固伤",
1291: "造成的伤害高于{0}则{1}%概率使对手随机进入{2}种异常状态",
1292: "自身体力低于对手时先制+2",
1293: "免疫下{0}次受到的攻击,免疫成功则自身全属性+{1}",
1294: "消除双方能力提升、下降状态和护盾效果消除任意一项成功则使对手随机进入两种异常状态未触发则回合结束时吸取对手最大体力的1/3",
1295: "先出手时{0}回合内免疫并反弹异常状态",
1296: "{0}回合内受到攻击{1}%进入自然庇佑",
1297: "消除对手回合类效果,消除成功则令对手{0}未触发则吸取对手最大体力的1/{1}",
1298: "消除对手能力提升状态消除成功则直接扣除对方场下随机一只精灵最大体力的1/4致死时令其残留1点体力",
1299: "3回合内每次对手造成的攻击伤害低于300则减少对手所有不在场精灵100点体力每次对手使用属性技能则恢复己方所有不在场精灵100点体力使对手不在场精灵死亡时令其残留1点体力",
1300: "{0}回合内受到的攻击伤害减少{1}%,受到的伤害高于{2}时随机附加{3}种异常状态,未触发则消除对手回合类效果",
1301: "若自身体力低于300则消耗自身全部体力并使对手所有不在场精灵减少1/2最大体力使对手精灵死亡时令其残留1点体力",
1302: "全属性+{0}{1}%概率强化效果翻倍,未触发则吸取对手能力提升状态",
1303: "4回合内使用技能吸取对手最大体力1/3自身体力低于1/2时效果翻倍吸取时若自身满体力则为己方所有不在场精灵恢复100点体力",
1304: "下{0}回合攻击忽略对手{1}%的双防值",
1305: "己方每有一只精灵存活则恢复{0}点体力,每有一只精灵死亡则附加{1}点固定伤害",
1306: "造成的伤害低于350则减少对手所有未出场精灵100点体力使对手不在场精灵死亡时令其残留1点体力",
1307: "未击败对手则恢复己方所有不在场精灵100点体力",
1308: "击败对手则自身下1次登场时帝君之罚和帝君之赐效果不会削弱",
1309: "附加{0}点固定伤害,遇到天敌时附加效果翻倍",
1310: "吸取对手能力提升状态,吸取成功则自身下{0}回合必定先出手",
1311: "{0}回合内对手使用属性技能则对手全属性-{1}",
1312: "解除自身能力下降状态,解除成功则自身下{0}回合先制+{1}",
1393: "{0}回合内每回合使用技能则造成伤害前令对手防御-{1}、速度-{2}未触发则附加对手最大体力1/{3}的百分比伤害",
1394: "{0}回合内对手使用属性技能则随机进入{1}种异常状态",
1395: "若先出手则必定打出致命一击",
@@ -708,6 +758,56 @@ var effectInfoByID = map[int]string{
1692: "{0}%的概率造成伤害翻倍,终阶源盾处于激活状态时概率提升至{1}%",
1693: "{0}回合内每回合使用技能附加对手最大体力1/{1}的百分比伤害,对手免疫百分比伤害时额外附加{2}点真实伤害",
1694: "随机吸取对手{0}-{1}点体力,若自身处于能力提升状态则效果转变为{2}-{3}点",
956: "未击败对手则下回合使用技能后附加{0}点固定伤害,遇到天敌时附加的固定伤害翻倍",
957: "使对手全属性-{0},若对手处于{1}状态则自身额外全属性+{2}",
958: "若对手处于{0}状态则先制+{1}",
959: "消除对手回合类效果,消除成功则自身全属性+{0}",
960: "{0}回合内若自身处于能力提升状态则每回合使用技能{1}%令对手{2}",
961: "反转自身能力下降,反转成功则自身下{0}回合免疫攻击伤害",
962: "全属性+{0},自身不处于能力提升状态时强化效果翻倍",
963: "若自身处于能力提升状态则吸取对手最大体力的1/{0}",
964: "未击败对手则自身能力提升状态翻倍",
965: "{0}回合内自身攻击技能命中则对手全属性-{1}",
966: "{0}%的概率使对手{1},未触发则自身全属性+{2}",
967: "攻击结束时附加对手双防之和{0}%的百分比伤害",
968: "命中对手后有{0}%使对手{1},先出手时概率翻倍",
969: "后出手时下回合受到的伤害减少{0}点",
970: "双倍反转对手能力提升状态,反转成功则下回合自身所有技能先制+{0}",
971: "{0}回合内每回合使用技能吸取对手最大体力的1/{1}吸取体力时若自身体力低于最大体力的1/{2}则吸取效果翻倍",
972: "出手时若自身体力低于对手,则免疫下{0}次受到的攻击伤害",
973: "消除对手回合类效果,消除成功则{0}%令对手{1}",
974: "{0}%使对手{1}若未触发则使对手受到相当于自身当前体力1/{2}的百分比伤害",
975: "{0}%的概率威力{1}倍,若未触发则下回合自身先制+{2}",
976: "消除对手回合类效果,若消除成功则使对手下{0}次使用的属性技能失效",
977: "吸取对手最大体力的1/{0}自身血量低于1/{1}时吸取效果翻倍",
978: "吸取并反转对手能力提升状态",
979: "消除对手回合类效果,消除成功则自身下{0}回合所有技能先制+{1}",
980: "先出手时对手当回合属性技能无效",
981: "直接造成{0}点电系伤害,自身每处于一种能力提升状态则造成的伤害提高{1}%",
982: "{0}%使对手{1},自身每处于一种能力提升状态则概率提高{2}%",
983: "未击败对手则自身全属性+{0}",
984: "未击败对手则下回合自身所有技能先制+{0}",
985: "吸取对手能力提升状态,吸取成功则下{0}回合对手属性技能无效",
986: "先出手时造成的攻击伤害额外提升{0}%",
987: "附加{0}点固定伤害,对手{1}时固定伤害翻倍",
988: "消除对手能力提升状态,消除成功则对手下{0}回合技能失效",
989: "造成的伤害低于{0}则附加{1}点固定伤害,自身体力低于对手时固定伤害翻倍",
990: "消除对手回合类效果,消除成功则附加{0}点固定伤害",
991: "未击败对手则对方下{0}次攻击技能将{1}%被己方闪避",
992: "{0}回合内攻击技能附加自身当前体力{1}%的百分比伤害",
993: "全属性+{0},对手处于{1}状态时强化效果翻倍",
994: "消除对手能力提升状态,消除成功则自身下{0}次技能先制+{1}",
995: "消除对手能力提升状态消除成功则吸取对手最大体力的1/{0}",
996: "自身体力高于1/{0}时,附加自身当前体力{1}%的百分比伤害",
997: "自身体力低于1/{0}时恢复自身最大体力的1/{1}并造成等量百分比伤害",
998: "{0}回合内自身能力提升状态被消除或吸取时,{1}回合内对手属性技能命中效果失效",
999: "自身每处于{0}种能力提升状态,造成的伤害提升{1}%",
1000: "命中则{0}%使对手{1},未触发则附加{2}点固定伤害",
1001: "全属性+{0},对手处于异常状态时强化效果翻倍",
1002: "若对手处于异常状态则先制+1",
1003: "命中后{0}%使对手{1},未触发则使对手全属性-{2}",
1004: "{0}回合内使用技能附加{1}点固定伤害,若自身体力高于对手则效果翻倍",
1005: "恢复自身最大体力的1/{0}并造成等量百分比伤害",
}
func EffectInfo(id int) string {