Rename C4Demolition to Demolition.
This commit is contained in:
@@ -297,7 +297,6 @@
|
||||
<Compile Include="Traits\Buildings\RepairsUnits.cs" />
|
||||
<Compile Include="Traits\Buildings\Reservable.cs" />
|
||||
<Compile Include="Traits\Burns.cs" />
|
||||
<Compile Include="Traits\C4Demolition.cs" />
|
||||
<Compile Include="Traits\Health.cs" />
|
||||
<Compile Include="Traits\PowerTooltip.cs" />
|
||||
<Compile Include="Traits\Render\VeteranProductionIconOverlay.cs" />
|
||||
@@ -325,6 +324,7 @@
|
||||
<Compile Include="Traits\CustomSellValue.cs" />
|
||||
<Compile Include="Traits\CustomSelectionSize.cs" />
|
||||
<Compile Include="Traits\Demolishable.cs" />
|
||||
<Compile Include="Traits\Demolition.cs" />
|
||||
<Compile Include="Traits\DetectCloaked.cs" />
|
||||
<Compile Include="Traits\EjectOnDeath.cs" />
|
||||
<Compile Include="Traits\EmitInfantryOnSell.cs" />
|
||||
|
||||
@@ -17,21 +17,21 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Scripting
|
||||
{
|
||||
[ScriptPropertyGroup("Combat")]
|
||||
public class DemolitionProperties : ScriptActorProperties, Requires<IMoveInfo>, Requires<C4DemolitionInfo>
|
||||
public class DemolitionProperties : ScriptActorProperties, Requires<IMoveInfo>, Requires<DemolitionInfo>
|
||||
{
|
||||
readonly C4DemolitionInfo info;
|
||||
readonly DemolitionInfo info;
|
||||
|
||||
public DemolitionProperties(ScriptContext context, Actor self)
|
||||
: base(context, self)
|
||||
{
|
||||
info = Self.Info.TraitInfo<C4DemolitionInfo>();
|
||||
info = Self.Info.TraitInfo<DemolitionInfo>();
|
||||
}
|
||||
|
||||
[ScriptActorPropertyActivity]
|
||||
[Desc("Demolish the target actor.")]
|
||||
public void Demolish(Actor target)
|
||||
{
|
||||
Self.QueueActivity(new Demolish(Self, target, info.EnterBehaviour, info.C4Delay,
|
||||
Self.QueueActivity(new Demolish(Self, target, info.EnterBehaviour, info.DetonationDelay,
|
||||
info.Flashes, info.FlashesDelay, info.FlashInterval, info.FlashDuration));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
class C4DemolitionInfo : ITraitInfo
|
||||
class DemolitionInfo : ITraitInfo
|
||||
{
|
||||
[Desc("Delay to demolish the target once the C4 is planted. " +
|
||||
[Desc("Delay to demolish the target once the explosive device is planted. " +
|
||||
"Measured in game ticks. Default is 1.8 seconds.")]
|
||||
public readonly int C4Delay = 45;
|
||||
public readonly int DetonationDelay = 45;
|
||||
|
||||
[Desc("Number of times to flash the target.")]
|
||||
public readonly int Flashes = 3;
|
||||
@@ -43,21 +43,21 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Voice string when planting explosive charges.")]
|
||||
[VoiceReference] public readonly string Voice = "Action";
|
||||
|
||||
public object Create(ActorInitializer init) { return new C4Demolition(this); }
|
||||
public object Create(ActorInitializer init) { return new Demolition(this); }
|
||||
}
|
||||
|
||||
class C4Demolition : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
class Demolition : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
{
|
||||
readonly C4DemolitionInfo info;
|
||||
readonly DemolitionInfo info;
|
||||
|
||||
public C4Demolition(C4DemolitionInfo info)
|
||||
public Demolition(DemolitionInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public IEnumerable<IOrderTargeter> Orders
|
||||
{
|
||||
get { yield return new C4DemolitionOrderTargeter(); }
|
||||
get { yield return new DemolitionOrderTargeter("c4"); }
|
||||
}
|
||||
|
||||
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.CancelActivity();
|
||||
|
||||
self.SetTargetLine(target, Color.Red);
|
||||
self.QueueActivity(new Demolish(self, target.Actor, info.EnterBehaviour, info.C4Delay,
|
||||
self.QueueActivity(new Demolish(self, target.Actor, info.EnterBehaviour, info.DetonationDelay,
|
||||
info.Flashes, info.FlashesDelay, info.FlashInterval, info.FlashDuration));
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return order.OrderString == "C4" ? info.Voice : null;
|
||||
}
|
||||
|
||||
class C4DemolitionOrderTargeter : UnitOrderTargeter
|
||||
class DemolitionOrderTargeter : UnitOrderTargeter
|
||||
{
|
||||
public C4DemolitionOrderTargeter()
|
||||
: base("C4", 6, "c4", true, false) { }
|
||||
public DemolitionOrderTargeter(string cursor)
|
||||
: base("C4", 6, cursor, true, false) { }
|
||||
|
||||
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
|
||||
{
|
||||
@@ -777,6 +777,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
node.Value.Nodes.RemoveAll(x => x.Key == "StartsRevealed");
|
||||
}
|
||||
|
||||
if (engineVersion < 20160515)
|
||||
{
|
||||
// Use generic naming for building demolition using explosives.
|
||||
if (node.Key == "C4Demolition")
|
||||
node.Key = "Demolition";
|
||||
|
||||
foreach (var n in node.Value.Nodes)
|
||||
if (n.Key == "C4Delay")
|
||||
n.Key = "DetonationDelay";
|
||||
}
|
||||
|
||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +174,8 @@ RMBO:
|
||||
Range: 6c0
|
||||
AutoTarget:
|
||||
ScanRadius: 6
|
||||
C4Demolition:
|
||||
C4Delay: 45
|
||||
Demolition:
|
||||
DetonationDelay: 45
|
||||
Voice: Demolish
|
||||
Armament:
|
||||
Weapon: Sniper
|
||||
|
||||
@@ -241,8 +241,8 @@ saboteur:
|
||||
HP: 400
|
||||
Mobile:
|
||||
Speed: 43
|
||||
C4Demolition:
|
||||
C4Delay: 0
|
||||
Demolition:
|
||||
DetonationDelay: 0
|
||||
Flashes: 0
|
||||
EnterBehaviour: Suicide
|
||||
-AutoTarget:
|
||||
|
||||
@@ -267,8 +267,8 @@ E7:
|
||||
Voice: Move
|
||||
RevealsShroud:
|
||||
Range: 6c0
|
||||
C4Demolition:
|
||||
C4Delay: 45
|
||||
Demolition:
|
||||
DetonationDelay: 45
|
||||
Voice: Demolish
|
||||
Passenger:
|
||||
PipType: Red
|
||||
|
||||
@@ -125,8 +125,8 @@ GHOST:
|
||||
CrushSound: squishy2.aud
|
||||
AttackFrontal:
|
||||
Voice: Attack
|
||||
C4Demolition:
|
||||
C4Delay: 45
|
||||
Demolition:
|
||||
DetonationDelay: 45
|
||||
Voice: Attack
|
||||
WithInfantryBody:
|
||||
AttackSequence: shoot
|
||||
|
||||
Reference in New Issue
Block a user