Add Actor.IsDisguised
This commit is contained in:
@@ -228,6 +228,11 @@ namespace OpenRA
|
|||||||
return (health.Value == null) ? false : health.Value.IsDead;
|
return (health.Value == null) ? false : health.Value.IsDead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsDisguised()
|
||||||
|
{
|
||||||
|
return effectiveOwner.Value != null && effectiveOwner.Value.Disguised;
|
||||||
|
}
|
||||||
|
|
||||||
public void Kill(Actor attacker)
|
public void Kill(Actor attacker)
|
||||||
{
|
{
|
||||||
if (health.Value == null)
|
if (health.Value == null)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
|
|||||||
if (stance == Stance.Ally)
|
if (stance == Stance.Ally)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.HasTrait<IgnoresDisguise>())
|
if (self.IsDisguised() && !toActor.HasTrait<IgnoresDisguise>())
|
||||||
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Ally;
|
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Ally;
|
||||||
|
|
||||||
return stance == Stance.Ally;
|
return stance == Stance.Ally;
|
||||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
|
|||||||
if (stance == Stance.Ally)
|
if (stance == Stance.Ally)
|
||||||
return false; /* otherwise, we'll hate friendly disguised spies */
|
return false; /* otherwise, we'll hate friendly disguised spies */
|
||||||
|
|
||||||
if (self.EffectiveOwner != null && self.EffectiveOwner.Disguised && !toActor.HasTrait<IgnoresDisguise>())
|
if (self.IsDisguised() && !toActor.HasTrait<IgnoresDisguise>())
|
||||||
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Enemy;
|
return toActor.Owner.Stances[self.EffectiveOwner.Owner] == Stance.Enemy;
|
||||||
|
|
||||||
return stance == Stance.Enemy;
|
return stance == Stance.Enemy;
|
||||||
|
|||||||
Reference in New Issue
Block a user