115 lines
2.7 KiB
Go
115 lines
2.7 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 724: {0}回合内受到攻击{1}%恢复1/{2}体力
|
||
type Effect724 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect724) Skill_Use_ex() bool {
|
||
skill := e.Ctx().SkillEntity
|
||
if skill == nil || skill.Category() == info.Category.STATUS || skill.AttackTime == 0 {
|
||
return true
|
||
}
|
||
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||
if !success {
|
||
return true
|
||
}
|
||
|
||
healAmount := e.Ctx().Our.CurPet[0].GetMaxHP().Div(e.Args()[2])
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||
return true
|
||
}
|
||
|
||
// Effect 725: {0}回合内每回合有{1}%的概率降低对手最大体力的1/{2}
|
||
type Effect725 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect725) TurnEnd() {
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||
if success {
|
||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[2])
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Percent,
|
||
Damage: damage,
|
||
})
|
||
}
|
||
e.EffectNode.TurnEnd()
|
||
}
|
||
|
||
// Effect 726: 下{0}回合若对手先出手,则令对手当回合使用的攻击技能无效
|
||
type Effect726 struct {
|
||
RoundEffectArg0Base
|
||
armed bool
|
||
}
|
||
|
||
func (e *Effect726) SkillHit_ex() bool {
|
||
if !e.armed {
|
||
return true
|
||
}
|
||
|
||
skill := e.Ctx().SkillEntity
|
||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
if !e.Ctx().Opp.FightC.IsFirst(e.Ctx().Opp.Player) {
|
||
return true
|
||
}
|
||
|
||
skill.SetMiss()
|
||
return true
|
||
}
|
||
|
||
func (e *Effect726) TurnEnd() {
|
||
if !e.armed {
|
||
e.armed = true
|
||
}
|
||
e.EffectNode.TurnEnd()
|
||
}
|
||
|
||
// Effect 727: 后出手时将自身能力等级返回至上一回合结束时
|
||
type Effect727 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect727) Action_end() bool {
|
||
if e.IsFirst() || e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
|
||
e.Ctx().Our.AttackValue.Prop = e.Ctx().Our.LastTurnEndProp
|
||
return true
|
||
}
|
||
|
||
// Effect 728: 自身处于能力提升状态时,回合结束时直接减少对手1/{0}最大体力
|
||
type Effect728 struct {
|
||
RoundEffectArg0Base
|
||
}
|
||
|
||
func (e *Effect728) TurnEnd() {
|
||
if e.Ctx().Our.HasPropADD() {
|
||
damage := e.Ctx().Opp.CurPet[0].GetMaxHP().Div(e.Args()[0])
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Percent,
|
||
Damage: damage,
|
||
})
|
||
}
|
||
e.EffectNode.TurnEnd()
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 724, &Effect724{})
|
||
input.InitEffect(input.EffectType.Skill, 725, &Effect725{})
|
||
input.InitEffect(input.EffectType.Skill, 726, &Effect726{})
|
||
input.InitEffect(input.EffectType.Skill, 727, &Effect727{})
|
||
input.InitEffect(input.EffectType.Skill, 728, &Effect728{})
|
||
}
|