Files
bl/logic/service/fight/rule/rule314.go
2026-03-21 00:41:13 +08:00

27 lines
595 B
Go

package rule
import (
"blazing/logic/service/common"
"blazing/modules/player/model"
)
// Rule314 自身处于xx状态击败后获取奖励
// args[0] = 状态类型(对应 EnumPetStatus 枚举值)
type Rule314 struct {
RuleBase
}
func (r *Rule314) Exec(f common.FightI, t *model.FightOverInfo) bool {
if t.WinnerId == f.Ownerid() { //获胜
statusIdx := r.args[0]
if statusIdx >= 0 && statusIdx < 20 {
selfAttack := f.GetAttackValue(false)
// Status[i] != 255(NULL) 表示该状态存在
if selfAttack.Status[statusIdx] != 0 {
return true
}
}
}
return false
}