diff --git a/logic/service/fight/boss/NewSeIdx_405.go b/logic/service/fight/boss/NewSeIdx_405.go index b60694609..6bfc0e2f2 100644 --- a/logic/service/fight/boss/NewSeIdx_405.go +++ b/logic/service/fight/boss/NewSeIdx_405.go @@ -10,21 +10,37 @@ type NewSel405 struct { NewSel0 } -func (e *NewSel405) ActionStartEx(fattack, sattack *action.SelectSkillAction) bool { - //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 +func (e *NewSel405) ComparePre(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { + if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } + if fattack == nil { + return true + } + //先手是自己 + if fattack.PlayerID == e.Ctx().Our.UserID { + return true + } + if sattack == nil { + return true + } + if sattack == nil { + return true + } + if sattack.SkillEntity == nil { + return true + } // n%几率触发 success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) - if success && e.Ctx().SkillEntity != nil { - // 先制+1(提升优先级) - e.Ctx().SkillEntity.AttackTime = e.Ctx().SkillEntity.AttackTime + 1 + if !success { + } + //对调 + sattack.SkillEntity.Priority += 1 return true } - func init() { input.InitEffect(input.EffectType.NewSel, 405, &NewSel405{}) } diff --git a/logic/service/fight/effect/198.go b/logic/service/fight/effect/198.go new file mode 100644 index 000000000..8f7f23811 --- /dev/null +++ b/logic/service/fight/effect/198.go @@ -0,0 +1,30 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/gogf/gf/v2/util/grand" +) + +// 198 - 随机使对手n种能力等级-m +type Effect198 struct { + node.EffectNode +} + +func (e *Effect198) OnSkill() bool { + numStats := int(e.Args()[0].IntPart()) // n种能力 + reduction := int8(e.Args()[1].IntPart()) // 等级-m + + // 随机选择n种能力 + for i := 0; i < numStats; i++ { + e.Ctx().Opp.SetProp(e.Ctx().Our, int8(grand.Intn(5)), reduction, info.AbilityOpType.SUB) + } + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 198, &Effect198{}) + +} diff --git a/logic/service/fight/effect/454.go b/logic/service/fight/effect/454.go new file mode 100644 index 000000000..5c3c8e086 --- /dev/null +++ b/logic/service/fight/effect/454.go @@ -0,0 +1,47 @@ +package effect + +import ( + "blazing/logic/service/fight/action" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 454 - 当自身血量少于1/n时先制+m(写死了先制只能+1) +type Effect454 struct { + node.EffectNode +} + +func (e *Effect454) ComparePre(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) bool { + + if fattack == nil { + return true + } + //先手是自己 + if fattack.PlayerID == e.Ctx().Our.UserID { + return true + } + if sattack == nil { + return true + } + if sattack == nil { + return true + } + if sattack.SkillEntity == nil { + return true + } + maxHp := e.Ctx().Our.CurrentPet.GetMaxHP() + currentHp := e.Ctx().Our.CurrentPet.GetHP() + + threshold := maxHp.Div(e.Args()[0]) // 1/n + + if currentHp.Cmp(threshold) < 0 { + sattack.SkillEntity.Priority += 1 + } + //对调 + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 454, &Effect454{}) + +} diff --git a/logic/service/fight/effect/473.go b/logic/service/fight/effect/473.go new file mode 100644 index 000000000..9af75c39c --- /dev/null +++ b/logic/service/fight/effect/473.go @@ -0,0 +1,29 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +// 473 - 若造成的伤害不足m,则自身XX等级+n +type Effect473 struct { + node.EffectNode +} + +func (e *Effect473) SkillUseed() bool { + damageThreshold := int(e.Args()[0].IntPart()) + damageDone := e.Ctx().Our.SumDamage + + if damageDone.IntPart() < int64(damageThreshold) { + effectType := int(e.Args()[1].IntPart()) // XX类型 + effectValue := int(e.Args()[2].IntPart()) // 等级+n + e.Ctx().Our.SetProp(e.Ctx().Our, int8(effectType), int8(effectValue), info.AbilityOpType.ADD) + } + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 473, &Effect473{}) + +} diff --git a/logic/service/fight/effect/488.go b/logic/service/fight/effect/488.go new file mode 100644 index 000000000..d6127efc9 --- /dev/null +++ b/logic/service/fight/effect/488.go @@ -0,0 +1,32 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" +) + +// 488 - 若对手的体力小于400,则造成的伤害增加10% +type Effect488 struct { + node.EffectNode +} + +func (e *Effect488) Damage_Mul(t *info.DamageZone) bool { + if e.Ctx().SkillEntity == nil { + return true + } + + opponentHp := e.Ctx().Opp.CurrentPet.GetHP() + + if opponentHp.Cmp(alpacadecimal.NewFromInt(400)) < 0 { + t.Damage = t.Damage.Mul(alpacadecimal.NewFromFloat(1.1)) + } + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 488, &Effect488{}) + +} diff --git a/logic/service/fight/effect/back.go1 b/logic/service/fight/effect/back.go1 index 3dd532793..75904812a 100644 --- a/logic/service/fight/effect/back.go1 +++ b/logic/service/fight/effect/back.go1 @@ -543,40 +543,7 @@ func (e *Effect444) OnSkill() bool { return true } -// 198 - 随机使对手n种能力等级-m -type Effect198 struct { - node.EffectNode -} - -func (e *Effect198) OnSkill() bool { - numStats := int(e.Args()[0].IntPart()) // n种能力 - reduction := int(e.Args()[1].IntPart()) // 等级-m - - // 定义可降低的能力列表 - stats := []int{ - int(info.PetStatus.AtkDown), - int(info.PetStatus.DefDown), - int(info.PetStatus.SpAtkDown), - int(info.PetStatus.SpDefDown), - int(info.PetStatus.SpeedDown), - int(info.PetStatus.AccuracyDown), - } - - // 随机选择n种能力 - for i := 0; i < numStats && i < len(stats); i++ { - randomIndex := int(e.Input.FightC.GetRand().Int31n(int32(len(stats)))) - selectedStat := stats[randomIndex] - - statEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStat) - if statEffect != nil { - statEffect.SetArgs(e.Ctx().Our, reduction) - e.Ctx().Opp.AddEffect(e.Ctx().Our, statEffect) - } - } - - return true -} - + // 475 - 若造成的伤害不足m,则下n回合的攻击必定致命一击 type Effect475 struct { node.EffectNode @@ -643,29 +610,7 @@ func (e *Effect430) OnSkill() bool { return true } - -// 473 - 若造成的伤害不足m,则自身XX等级+n -type Effect473 struct { - node.EffectNode -} - -func (e *Effect473) SkillHit_ex() bool { - damageThreshold := int(e.Args()[0].IntPart()) - damageDone := e.Ctx().Our.SumDamage - - if damageDone.IntPart() < int64(damageThreshold) { - effectType := int(e.Args()[1].IntPart()) // XX类型 - effectValue := int(e.Args()[2].IntPart()) // 等级+n - - statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, effectType) - if statusEffect != nil { - statusEffect.SetArgs(e.Ctx().Our, effectValue) - e.Ctx().Our.AddEffect(e.Ctx().Our, statusEffect) - } - } - - return true -} + // 465 - m%令对手疲惫n回合,每次使用几率提升x%,最高y% type Effect465 struct { @@ -706,24 +651,7 @@ func (e *Effect465) SetArgs(t *input.Input, a ...int) { e.incrementPerUse = a[3] // 每次使用几率提升x% } -// 454 - 当自身血量少于1/n时先制+m(写死了先制只能+1) -type Effect454 struct { - node.EffectNode -} - -func (e *Effect454) Skill_Pre() bool { - maxHp := e.Ctx().Our.CurrentPet.GetMaxHP() - currentHp := e.Ctx().Our.CurrentPet.GetHP() - - threshold := maxHp.Div(e.Args()[0]) // 1/n - - if currentHp.Cmp(threshold) < 0 { - // 血量少于1/n,先制+1(固定为1) - e.Ctx().Our.TempSpeedBoost = true - } - - return true -} + // 501 - 若造成的伤害不足m,则对手XX等级-n type Effect501 struct { @@ -1045,25 +973,7 @@ func (e *Effect156) SetArgs(t *input.Input, a ...int) { e.EffectNode.Duration(a[0]) // 持续n回合 } -// 488 - 若对手的体力小于400,则造成的伤害增加10% -type Effect488 struct { - node.EffectNode -} - -func (e *Effect488) SkillHit() bool { - if e.Ctx().SkillEntity == nil { - return true - } - - opponentHp := e.Ctx().Opp.CurrentPet.GetHP() - - if opponentHp.Cmp(alpacadecimal.NewFromInt(400)) < 0 { - // 伤害增加10% - e.Ctx().SkillEntity.Power = int(float64(e.Ctx().SkillEntity.Power) * 1.1) - } - - return true -} + // 437 - 若对手处于能力强化状态,则对手XX等级m type Effect437 struct {