46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
)
|
||
|
||
// 403. n%几率令对手m回合内每回合减少r点体力(a1: n, a2: m, a3: r)
|
||
// TODO: 需要实现一个持续伤害的状态效果
|
||
type NewSel403 struct {
|
||
NewSel0
|
||
// 记录剩余减伤回合数
|
||
remainingTurns int
|
||
}
|
||
|
||
func (e *NewSel403) Action_end_ex() bool {
|
||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet[0].Info.CatchTime {
|
||
return true
|
||
}
|
||
if e.remainingTurns > 0 {
|
||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||
Type: info.DamageType.Fixed,
|
||
Damage: e.Args()[2],
|
||
})
|
||
}
|
||
|
||
// n%几率触发
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||
if !success {
|
||
return true
|
||
}
|
||
e.remainingTurns = int(e.Args()[1].IntPart())
|
||
|
||
return true
|
||
}
|
||
func (e *NewSel403) TurnEnd() {
|
||
// 每回合减少减伤效果剩余回合数
|
||
if e.remainingTurns > 0 {
|
||
e.remainingTurns--
|
||
}
|
||
}
|
||
func init() {
|
||
input.InitEffect(input.EffectType.NewSel, 403, &NewSel403{})
|
||
}
|