118 lines
2.7 KiB
Go
118 lines
2.7 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
func matchSkillMode(skill *info.SkillEntity, mode int) bool {
|
|
if skill == nil {
|
|
return false
|
|
}
|
|
|
|
switch mode {
|
|
case 0:
|
|
return skill.Category() == info.Category.PHYSICAL
|
|
case 1:
|
|
return skill.Category() == info.Category.SPECIAL
|
|
case 2:
|
|
return skill.Category() == info.Category.STATUS
|
|
case 3:
|
|
return skill.Category() != info.Category.STATUS
|
|
default:
|
|
return skill.Category() != info.Category.STATUS
|
|
}
|
|
}
|
|
|
|
// Effect 653: {0},若对手处于能力下降状态,强化效果翻倍
|
|
type Effect653 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect653) OnSkill() bool {
|
|
doubleBoost := e.Ctx().Opp.HasPropSub()
|
|
for i, delta := range e.SideEffectArgs {
|
|
if delta == 0 {
|
|
continue
|
|
}
|
|
|
|
if doubleBoost && delta > 0 {
|
|
delta *= 2
|
|
}
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(delta))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 654: {0}回合内{1}%的概率使对手{2}Miss
|
|
type Effect654 struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect654) SkillHit_ex() bool {
|
|
skill := e.Ctx().SkillEntity
|
|
if !matchSkillMode(skill, int(e.Args()[2].IntPart())) {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
|
if success {
|
|
skill.SetMiss()
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 655: 消除{0}状态,消除成功则{1}的{2}
|
|
type Effect655 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect655) Skill_Use() bool {
|
|
if !clearStatusEffects(e.Ctx().Our, int(e.Args()[0].IntPart())) {
|
|
return true
|
|
}
|
|
|
|
target := effectRelativeInput(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
applyEffectPropChanges(target, e.Ctx().Our, e.SideEffectArgs[2:], false)
|
|
return true
|
|
}
|
|
|
|
// Effect 656: {0}%的概率令对手随机{1}项技能PP值归零
|
|
type Effect656 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect656) OnSkill() bool {
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
|
if success {
|
|
zeroRandomSkillPP(e.Ctx().Opp, int(e.Args()[1].IntPart()))
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 657: 消除{0}状态,消除成功则附加{1}点固定伤害
|
|
type Effect657 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect657) Skill_Use() bool {
|
|
if !clearStatusEffects(e.Ctx().Our, int(e.Args()[0].IntPart())) {
|
|
return true
|
|
}
|
|
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: e.Args()[1],
|
|
})
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 653, &Effect653{})
|
|
input.InitEffect(input.EffectType.Skill, 654, &Effect654{})
|
|
input.InitEffect(input.EffectType.Skill, 655, &Effect655{})
|
|
input.InitEffect(input.EffectType.Skill, 656, &Effect656{})
|
|
input.InitEffect(input.EffectType.Skill, 657, &Effect657{})
|
|
}
|