Require force move for all undeploy-triggering orders.
This commit is contained in:
@@ -33,6 +33,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
[Desc("Require the force-move modifier to display the move cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoAircraft(init, this); }
|
||||
}
|
||||
|
||||
@@ -66,6 +69,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public bool AircraftCanEnter(Actor a, TargetModifiers modifiers)
|
||||
{
|
||||
if (Info.RequiresForceMove && !modifiers.HasModifier(TargetModifiers.ForceMove))
|
||||
return false;
|
||||
|
||||
return AircraftCanEnter(a);
|
||||
}
|
||||
|
||||
public bool AircraftCanEnter(Actor a)
|
||||
{
|
||||
return !self.AppearsHostileTo(a) && Info.DockActors.Contains(a.Info.Name);
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
[Desc("Require the force-move modifier to display the enter cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoEntersTunnels(this); }
|
||||
}
|
||||
|
||||
@@ -50,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
get
|
||||
{
|
||||
if (!IsTraitDisabled)
|
||||
yield return new EntersTunnels.EnterTunnelOrderTargeter(Info.EnterCursor, Info.EnterBlockedCursor);
|
||||
yield return new EntersTunnels.EnterTunnelOrderTargeter(Info.EnterCursor, Info.EnterBlockedCursor, () => Info.RequiresForceMove);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
[Desc("Require the force-move modifier to display the enter cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoPassenger(this); }
|
||||
}
|
||||
|
||||
@@ -62,6 +65,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return null;
|
||||
}
|
||||
|
||||
bool IsCorrectCargoType(Actor target, TargetModifiers modifiers)
|
||||
{
|
||||
if (Info.RequiresForceMove && !modifiers.HasModifier(TargetModifiers.ForceMove))
|
||||
return false;
|
||||
|
||||
return IsCorrectCargoType(target);
|
||||
}
|
||||
|
||||
bool IsCorrectCargoType(Actor target)
|
||||
{
|
||||
var ci = target.Info.TraitInfo<CargoInfo>();
|
||||
|
||||
@@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
[Desc("Require the force-move modifier to display the enter cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoRepairable(this); }
|
||||
}
|
||||
|
||||
@@ -62,6 +65,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return health.DamageState > DamageState.Undamaged && transforms.Any(t => !t.IsTraitDisabled && !t.IsTraitPaused);
|
||||
}
|
||||
|
||||
bool CanRepairAt(Actor target, TargetModifiers modifiers)
|
||||
{
|
||||
if (Info.RequiresForceMove && !modifiers.HasModifier(TargetModifiers.ForceMove))
|
||||
return false;
|
||||
|
||||
return CanRepairAt(target);
|
||||
}
|
||||
|
||||
bool CanRepairAt(Actor target)
|
||||
{
|
||||
return Info.RepairActors.Contains(target.Info.Name);
|
||||
|
||||
Reference in New Issue
Block a user