27 lines
534 B
Go
27 lines
534 B
Go
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
|
||
}
|