32 lines
772 B
Go
32 lines
772 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
// Effect 146: {0}回合内受到物理攻击时有{1}%概率使对方中毒
|
|
type Effect146 struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect146) Skill_Use_ex() bool {
|
|
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL {
|
|
chance := e.Args()[1].IntPart() // m%
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
if success {
|
|
poisonEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(info.PetStatus.Poisoned))
|
|
if poisonEffect != nil {
|
|
e.TargetInput().AddEffect(e.CarrierInput(), poisonEffect)
|
|
}
|
|
}
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 146, &Effect146{})
|
|
|
|
}
|