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

27 lines
534 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package rule
import (
"blazing/logic/service/common"
"blazing/modules/player/model"
)
// Rule315 自身不大于1/n血量击败
// args[0] = 分母n血量 <= MaxHp/n 时满足条件
type Rule315 struct {
RuleBase
}
func (r *Rule315) Exec(f common.FightI, t *model.FightOverInfo) bool {
if t.WinnerId == f.Ownerid() { //获胜
n := int32(r.args[0])
if n > 0 {
attack := f.GetAttackValue(false)
maxHp := int32(attack.MaxHp)
if maxHp > 0 && attack.RemainHp*n <= maxHp {
return true
}
}
}
return false
}