Add ForceFireIgnoresActors to AttackBase.
This commit is contained in:
@@ -34,6 +34,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Allow firing into the fog to target frozen actors without requiring force-fire.")]
|
[Desc("Allow firing into the fog to target frozen actors without requiring force-fire.")]
|
||||||
public readonly bool TargetFrozenActors = false;
|
public readonly bool TargetFrozenActors = false;
|
||||||
|
|
||||||
|
[Desc("Force-fire mode ignores actors and targets the ground instead.")]
|
||||||
|
public readonly bool ForceFireIgnoresActors = false;
|
||||||
|
|
||||||
[VoiceReference] public readonly string Voice = "Action";
|
[VoiceReference] public readonly string Voice = "Action";
|
||||||
|
|
||||||
public override abstract object Create(ActorInitializer init);
|
public override abstract object Create(ActorInitializer init);
|
||||||
@@ -402,6 +405,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (modifiers.HasModifier(TargetModifiers.ForceMove))
|
if (modifiers.HasModifier(TargetModifiers.ForceMove))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (ab.Info.ForceFireIgnoresActors && modifiers.HasModifier(TargetModifiers.ForceAttack))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Disguised actors are revealed by the attack cursor
|
// Disguised actors are revealed by the attack cursor
|
||||||
// HACK: works around limitations in the targeting code that force the
|
// HACK: works around limitations in the targeting code that force the
|
||||||
// targeting and attacking logic (which should be logically separate)
|
// targeting and attacking logic (which should be logically separate)
|
||||||
|
|||||||
Reference in New Issue
Block a user