diff --git a/logic/service/fight/boss/NewSeIdx_404.go b/logic/service/fight/boss/NewSeIdx_404.go index 64244293b..2064d2fc2 100644 --- a/logic/service/fight/boss/NewSeIdx_404.go +++ b/logic/service/fight/boss/NewSeIdx_404.go @@ -27,6 +27,17 @@ func (e *NewSel404) DamageDivEx(t *info.DamageZone) bool { return true } +type NewSel127 struct { + NewSel404 +} + +func (e *NewSel127) SetArgs(t *input.Input, a ...int) { + + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(e.EffectNode.SideEffectArgs[1]) + +} func init() { input.InitEffect(input.EffectType.NewSel, 404, &NewSel404{}) + input.InitEffect(input.EffectType.NewSel, 127, &NewSel127{}) } diff --git a/logic/service/fight/effect/effect_154.go b/logic/service/fight/effect/effect_154.go new file mode 100644 index 000000000..595797c48 --- /dev/null +++ b/logic/service/fight/effect/effect_154.go @@ -0,0 +1,27 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/node" +) + +type Effect154 struct { + node.EffectNode +} + +func init() { + initskill(154, &Effect154{}) + +} + +// 命中之后 +func (e *Effect154) OnSkill() bool { + if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { + e.Input.Heal( + e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(e.Args()[1]), + ) + } + + return true +} diff --git a/logic/service/fight/effect/effect_182.go b/logic/service/fight/effect/effect_182.go new file mode 100644 index 000000000..005e2944f --- /dev/null +++ b/logic/service/fight/effect/effect_182.go @@ -0,0 +1,35 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +/** + * 182 + */ + +func init() { + + input.InitEffect(input.EffectType.Skill, 182, &Effect182{}) + +} + +type Effect182 struct { + node.EffectNode +} + +func (e *Effect182) OnSkill() bool { + + if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { + // 3. 概率判定(Args()[1]为触发概率) + success, _, _ := e.Input.Player.Roll(int(e.Args()[2].IntPart()), 100) + if !success { + return true + } + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1].IntPart()), int8(e.Args()[3].IntPart()), info.AbilityOpType.ADD) + } + + return true +} diff --git a/logic/service/fight/effect/effect_408_463.go b/logic/service/fight/effect/effect_408_463.go new file mode 100644 index 000000000..7fbda38db --- /dev/null +++ b/logic/service/fight/effect/effect_408_463.go @@ -0,0 +1,38 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" +) + +func init() { + input.InitEffect(input.EffectType.Skill, 408, &Effect408{}) + input.InitEffect(input.EffectType.Skill, 463, &Effect408{}) +} + +type Effect408 struct { + node.EffectNode +} + +func (e *Effect408) DamageSubEx(t *info.DamageZone) bool { + + if t.Type != info.DamageType.Red { + return true + } + + if t.Damage.Cmp(e.Args()[1]) > 0 { + t.Damage = t.Damage.Sub(e.Args()[1]) + } else { + t.Damage = alpacadecimal.Zero + } + return true +} +func (e *Effect408) SetArgs(t *input.Input, a ...int) { + + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) + +} diff --git a/logic/service/fight/effect/effect_448.go b/logic/service/fight/effect/effect_448.go new file mode 100644 index 000000000..9149cc9ea --- /dev/null +++ b/logic/service/fight/effect/effect_448.go @@ -0,0 +1,42 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +type Effect448 struct { + node.EffectNode + rev bool +} + +func (e *Effect448) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) +} +func (e *Effect448) OnSkill() bool { + + for i, v := range e.SideEffectArgs[1:] { + if e.rev { + e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(v), info.AbilityOpType.SUB) + } else { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v), info.AbilityOpType.ADD) + } + + } + + return true +} + +// ----------------------------------------------------------- +// 初始化 +// ----------------------------------------------------------- +func init() { + input.InitEffect(input.EffectType.Skill, 448, &Effect448{ + rev: true, + }) + input.InitEffect(input.EffectType.Skill, 433, &Effect448{ + rev: false, + }) +} diff --git a/logic/service/fight/effect/effect_467.go b/logic/service/fight/effect/effect_467.go index 934c3b264..e4b47254f 100644 --- a/logic/service/fight/effect/effect_467.go +++ b/logic/service/fight/effect/effect_467.go @@ -22,7 +22,7 @@ type Effect467 struct { func (e *Effect467) OnSkill() bool { - if e.Ctx().Our.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { + if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, Damage: e.Args()[1], diff --git a/logic/service/fight/effect/effect_508.go b/logic/service/fight/effect/effect_508.go new file mode 100644 index 000000000..2bd00bba1 --- /dev/null +++ b/logic/service/fight/effect/effect_508.go @@ -0,0 +1,50 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" +) + +func init() { + input.InitEffect(input.EffectType.Skill, 508, &Effect508{}) + +} + +type Effect508 struct { + node.EffectNode + Can bool +} + +func (e *Effect508) OnSkill() bool { + + e.Can = true + + return true +} + +func (e *Effect508) DamageSubEx(t *info.DamageZone) bool { + + if !e.Can { + return true + } + + if t.Type != info.DamageType.Red { + return true + } + + if t.Damage.Cmp(e.Args()[1]) > 0 { + t.Damage = t.Damage.Sub(e.Args()[1]) + } else { + t.Damage = alpacadecimal.Zero + } + return true +} +func (e *Effect508) SetArgs(t *input.Input, a ...int) { + + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) + +} diff --git a/logic/service/fight/input/prop.go b/logic/service/fight/input/prop.go index ce75e1f8d..6e949b5cf 100644 --- a/logic/service/fight/input/prop.go +++ b/logic/service/fight/input/prop.go @@ -23,6 +23,9 @@ func (target *Input) SetProp(source *Input, prop, level int8, opType info.EnumAb switch t { case info.AbilityOpType.ADD: // 属性提升,上限为6 + if l < 0 { + l = -l + } newValue = utils.Min(target.AttackValue.Prop[p]+l, 6) if newValue > target.AttackValue.Prop[p] { //fmt.Println("属性值会增加") @@ -32,6 +35,9 @@ func (target *Input) SetProp(source *Input, prop, level int8, opType info.EnumAb return false case info.AbilityOpType.SUB: + if l > 0 { + l = -l + } // 属性降低,下限为-6 newValue = utils.Max(target.AttackValue.Prop[p]+l, -6) if newValue < target.AttackValue.Prop[p] {