Files
bl/logic/service/fight/effect/911_915.go
xinian 87fdccaddf
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat: 实现大量技能效果及战斗逻辑修复
2026-03-30 00:51:18 +08:00

191 lines
4.2 KiB
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 911: 全属性+{0},自身处于能力提升状态时强化效果翻倍
type Effect911 struct {
node.EffectNode
}
func (e *Effect911) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
boostValue := int8(e.Args()[0].IntPart())
if e.Ctx().Our.HasPropADD() {
boostValue *= 2
}
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boostValue)
}
return true
}
// Effect 912: 若对手处于能力下降则使对手随机{0}个技能的PP归零
type Effect912 struct {
node.EffectNode
}
func (e *Effect912) OnSkill() bool {
if len(e.Args()) == 0 {
return true
}
if !e.Ctx().Opp.HasPropSub() {
return true
}
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[0].IntPart()))
return true
}
// Effect 913: 消除对手回合类效果,消除成功则下回合自身造成的攻击伤害额外提升{0}%
type Effect913 struct {
node.EffectNode
}
func (e *Effect913) 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
}
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect913Sub{}, -1)
return true
}
type Effect913Sub struct {
FixedDuration1Base
}
func (e *Effect913Sub) 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(hundred.Add(e.Args()[0])).Div(hundred)
return true
}
// Effect 914: 若对手处于{0}状态则{1}回合内{2}%令对手使用的技能无效
type Effect914 struct {
node.EffectNode
}
func (e *Effect914) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
if !e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) {
return true
}
effect := e.Ctx().Our.InitEffect(
input.EffectType.Sub,
914,
int(e.Args()[1].IntPart()),
int(e.Args()[2].IntPart()),
)
if effect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, effect)
}
return true
}
type Effect914Sub struct {
RoundEffectArg0Base
}
func (e *Effect914Sub) ActionStart(a, b *action.SelectSkillAction) bool {
if len(e.Args()) < 2 {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !success {
return true
}
e.Ctx().SkillEntity.SetNoSide()
e.Ctx().SkillEntity.AttackTime = 0
return true
}
// Effect 915: 消除对手回合类效果,消除成功则自身下{0}回合攻击有{1}%使对手{2}
type Effect915 struct {
node.EffectNode
}
func (e *Effect915) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
before := activeTurnEffectCount(e.Ctx().Opp)
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
if before <= 0 {
return true
}
effect := e.Ctx().Our.InitEffect(
input.EffectType.Sub,
915,
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 Effect915Sub struct {
RoundEffectArg0Base
}
func (e *Effect915Sub) OnSkill() bool {
if len(e.Args()) < 3 {
return true
}
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 {
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
}
func init() {
input.InitEffect(input.EffectType.Skill, 911, &Effect911{})
input.InitEffect(input.EffectType.Skill, 912, &Effect912{})
input.InitEffect(input.EffectType.Skill, 913, &Effect913{})
input.InitEffect(input.EffectType.Sub, 913, &Effect913Sub{})
input.InitEffect(input.EffectType.Skill, 914, &Effect914{})
input.InitEffect(input.EffectType.Sub, 914, &Effect914Sub{})
input.InitEffect(input.EffectType.Skill, 915, &Effect915{})
input.InitEffect(input.EffectType.Sub, 915, &Effect915Sub{})
}