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"
|
||
)
|
||
|
||
// 74. 每次物理或特殊攻击命中对手后,有百分之n的概率给对手叠加一层衰弱(a1: n)
|
||
type NewSel74 struct {
|
||
NewSel0
|
||
}
|
||
|
||
func (e *NewSel74) Action_end_ex() bool {
|
||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||
if e.ID().GetCatchTime() != e.Ctx().Our.CurPet[0].Info.CatchTime {
|
||
return true
|
||
}
|
||
if e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
|
||
// 只处理物理或特殊攻击
|
||
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
return true
|
||
}
|
||
|
||
// 检查概率是否触发
|
||
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
|
||
if !success {
|
||
return true
|
||
}
|
||
|
||
// 给对手叠加衰弱状态(假设衰弱状态为特殊状态)
|
||
// 这里用99表示衰弱状态,实际应根据游戏定义调整
|
||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Weakened))
|
||
if statusEffect != nil {
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Opp, statusEffect)
|
||
}
|
||
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.NewSel, 74, &NewSel74{})
|
||
}
|