36 lines
760 B
Go
36 lines
760 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
// Effect 502: {0}回合内所有直接攻击都将降低对手1/{1}的HP
|
|
type Effect502 struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect502) OnSkill() bool {
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
if e.Ctx().SkillEntity.Category() != info.Category.STATUS { // 非属性技能,即直接攻击
|
|
// 计算对手最大体力的1/m
|
|
maxHp := e.Ctx().Opp.CurrentPet.GetMaxHP()
|
|
damage := maxHp.Div(e.Args()[1])
|
|
|
|
damageZone := &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: damage,
|
|
}
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 502, &Effect502{})
|
|
}
|