59 lines
1.2 KiB
Go
59 lines
1.2 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
func init() {
|
||
|
||
input.InitEffect(input.EffectType.Skill, 122, &Effect122{
|
||
isfrist: true,
|
||
rev: true,
|
||
})
|
||
input.InitEffect(input.EffectType.Skill, 148, &Effect122{
|
||
isfrist: false,
|
||
rev: true,
|
||
})
|
||
input.InitEffect(input.EffectType.Skill, 588, &Effect122{
|
||
isfrist: true,
|
||
rev: false,
|
||
})
|
||
input.InitEffect(input.EffectType.Skill, 186, &Effect122{
|
||
isfrist: false,
|
||
rev: false,
|
||
})
|
||
}
|
||
|
||
// -----------------------------------------------------------
|
||
// 效果122:先出手时,{1}%改变对方{0}等级{2}
|
||
// -----------------------------------------------------------
|
||
type Effect122 struct {
|
||
node.EffectNode
|
||
isfrist bool
|
||
rev bool
|
||
}
|
||
|
||
func (e *Effect122) OnSkill() bool {
|
||
|
||
if e.IsFirst() == e.isfrist {
|
||
propIndex := int(e.Args()[0].IntPart())
|
||
chance := int(e.Args()[1].IntPart())
|
||
changeAmount := int(e.Args()[2].IntPart())
|
||
|
||
ok, _, _ := e.Input.Player.Roll(chance, 100)
|
||
if ok {
|
||
|
||
if e.rev {
|
||
|
||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount))
|
||
} else {
|
||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount))
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
return true
|
||
}
|