refactor: 重构效果系统中的上下文引用
This commit is contained in:
@@ -66,7 +66,7 @@ func (e *EffectConditionalAddDamage) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
e.OpponentInput().Damage(e.CarrierInput(), &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Args()[0],
|
||||
})
|
||||
@@ -80,27 +80,27 @@ func (e *EffectConditionalAddDamage) OnSkill() bool {
|
||||
|
||||
// conditionIsBurned:判断对方是否处于烧伤状态
|
||||
func conditionIsBurned(e *EffectConditionalAddDamage) bool {
|
||||
return e.Ctx().Opp.StatEffect_Exist(info.PetStatus.Burned)
|
||||
return e.OpponentInput().StatEffect_Exist(info.PetStatus.Burned)
|
||||
}
|
||||
|
||||
// conditionIsFrozen:判断对方是否处于冻伤状态
|
||||
func conditionIsFrozen(e *EffectConditionalAddDamage) bool {
|
||||
return e.Ctx().Opp.StatEffect_Exist(info.PetStatus.Frozen)
|
||||
return e.OpponentInput().StatEffect_Exist(info.PetStatus.Frozen)
|
||||
}
|
||||
|
||||
// conditionIsTypeX:判断对方是否为X属性对方为X性则附加n点伤害
|
||||
func conditionIsTypeX(e *EffectConditionalAddDamage) bool {
|
||||
// 示例:假设Args[0]为目标属性值,判断对方属性是否匹配
|
||||
return e.Ctx().Opp.CurPet[0].Info.Gender == int(e.Args()[0].IntPart())
|
||||
return e.OpponentInput().CurPet[0].Info.Gender == int(e.Args()[0].IntPart())
|
||||
}
|
||||
|
||||
// conditionIsAbnormal:判断对方是否处于任意异常状态
|
||||
func conditionIsAbnormal(e *EffectConditionalAddDamage) bool {
|
||||
return e.Ctx().Opp.StatEffect_Exist_all()
|
||||
return e.OpponentInput().StatEffect_Exist_all()
|
||||
}
|
||||
|
||||
// conditionPropDown:判断对方是否处于能力下降状态
|
||||
func conditionPropDown(e *EffectConditionalAddDamage) bool {
|
||||
|
||||
return e.Ctx().Opp.HasPropSub()
|
||||
return e.OpponentInput().HasPropSub()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user