137 lines
2.9 KiB
Go
137 lines
2.9 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 719: 未击败对手则{0}%令对手{1}
|
|
type Effect719 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect719) Skill_Use() bool {
|
|
if len(e.Args()) < 2 || e.Ctx().Opp.CurrentPet.Info.Hp <= 0 {
|
|
return true
|
|
}
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
|
if !success {
|
|
return true
|
|
}
|
|
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[1].IntPart()))
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 720: 若先出手则当回合闪避对手的攻击技能
|
|
type Effect720 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect720) Skill_Use() bool {
|
|
if !e.IsFirst() {
|
|
return true
|
|
}
|
|
|
|
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect720Sub{}, -1)
|
|
return true
|
|
}
|
|
|
|
type Effect720Sub struct {
|
|
FixedDuration1Base
|
|
}
|
|
|
|
func (e *Effect720Sub) SkillHit_ex() bool {
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
e.Ctx().SkillEntity.SetMiss()
|
|
return true
|
|
}
|
|
|
|
// Effect 721: 后出手时使对手下{0}回合攻击技能MISS
|
|
type Effect721 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect721) Skill_Use() bool {
|
|
if e.IsFirst() {
|
|
return true
|
|
}
|
|
|
|
addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect721Sub{}, -1)
|
|
return true
|
|
}
|
|
|
|
type Effect721Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect721Sub) SkillHit_ex() bool {
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
e.Ctx().SkillEntity.SetMiss()
|
|
return true
|
|
}
|
|
|
|
// Effect 722: 将自身相应的能力提升赋予给对手相应的能力下降
|
|
type Effect722 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect722) OnSkill() bool {
|
|
for i, v := range e.Ctx().Our.Prop[:] {
|
|
if v <= 0 {
|
|
continue
|
|
}
|
|
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), -v)
|
|
}
|
|
return true
|
|
}
|
|
|
|
// Effect 723: 后出手时令对手下{0}回合先制-{1}
|
|
type Effect723 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect723) Skill_Use() bool {
|
|
if e.IsFirst() {
|
|
return true
|
|
}
|
|
|
|
addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &Effect723Sub{}, -1)
|
|
return true
|
|
}
|
|
|
|
type Effect723Sub struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect723Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
|
priorityDown := int(e.Args()[1].IntPart())
|
|
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
|
if current == nil || current.SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
current.SkillEntity.XML.Priority -= priorityDown
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 719, &Effect719{})
|
|
input.InitEffect(input.EffectType.Skill, 720, &Effect720{})
|
|
input.InitEffect(input.EffectType.Skill, 721, &Effect721{})
|
|
input.InitEffect(input.EffectType.Skill, 722, &Effect722{})
|
|
input.InitEffect(input.EffectType.Skill, 723, &Effect723{})
|
|
}
|