diff --git a/logic/service/fight/effect/525.go b/logic/service/fight/effect/525.go new file mode 100644 index 000000000..592bd2c0b --- /dev/null +++ b/logic/service/fight/effect/525.go @@ -0,0 +1,31 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" +) + +// 525 - {0}回合内有{1}%概率免疫对手的攻击伤害 +type Effect525 struct { + node.EffectNode +} + +func (e *Effect525) DamageLockEx(t *info.DamageZone) bool { + success, _, _ := e.Input.Player.Roll(int(e.SideEffectArgs[1]), 100) + if success { // 先出手 + t.Damage = alpacadecimal.Zero + } + + return true +} +func (e *Effect525) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(a[0]) // 持续n回合 +} +func init() { + input.InitEffect(input.EffectType.Skill, 525, &Effect525{}) + +} diff --git a/logic/service/fight/effect/530.go b/logic/service/fight/effect/530.go new file mode 100644 index 000000000..fb5fcce2c --- /dev/null +++ b/logic/service/fight/effect/530.go @@ -0,0 +1,30 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 530 - +type Effect530 struct { + node.EffectNode +} + +func (e *Effect530) Skill_Use() bool { + maxHp := e.Ctx().Our.CurrentPet.GetMaxHP() + healAmount := maxHp.Div(e.Args()[0]) // 1/n + if e.Ctx().Our.CurrentPet.GetHP().Cmp(healAmount) < 0{ // 先出手 + + // 回复1/n的最大体力值 + + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp) + } + + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 530, &Effect530{}) + +} diff --git a/logic/service/fight/effect/550.go b/logic/service/fight/effect/550.go new file mode 100644 index 000000000..a2d081896 --- /dev/null +++ b/logic/service/fight/effect/550.go @@ -0,0 +1,30 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 550 - +type Effect550 struct { + node.EffectNode +} + +func (e *Effect550) Skill_Use() bool { + maxHp := e.Ctx().Our.CurrentPet.GetMaxHP() + + if e.Ctx().Our.StatEffect_Exist_all() { // 先出手 + + // 回复1/n的最大体力值 + + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp) + } + + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 550, &Effect550{}) + +} diff --git a/logic/service/fight/effect/558.go b/logic/service/fight/effect/558.go new file mode 100644 index 000000000..98a74bec1 --- /dev/null +++ b/logic/service/fight/effect/558.go @@ -0,0 +1,29 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 558 - +type Effect558 struct { + node.EffectNode +} + +func (e *Effect558) Skill_Use() bool { + + if e.Ctx().Our.HasPropADD() || e.Ctx().Our.HasPropSub() { // 先出手 + + // 回复1/n的最大体力值 + return true + + } + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[0]) + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 558, &Effect558{}) + +} diff --git a/logic/service/fight/effect/565.go b/logic/service/fight/effect/565.go new file mode 100644 index 000000000..7f203ee25 --- /dev/null +++ b/logic/service/fight/effect/565.go @@ -0,0 +1,30 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 565 - +type Effect565 struct { + node.EffectNode +} + +func (e *Effect565) Skill_Use() bool { + if e.IsFirst() { // 先出手 + + // 回复1/n的最大体力值 + maxHp := e.Ctx().Our.CurrentPet.GetMaxHP() + healAmount := maxHp.Div(e.Args()[0]) // 1/n + + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount) + } + + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 565, &Effect565{}) + +}