rename DemoTruck to AttackSuicides
generalize move to add Aircraft support give it a description don't require Explodes as it is just a soft dependency use a regular self kill
This commit is contained in:
@@ -270,6 +270,7 @@
|
||||
<Compile Include="Traits\Attack\AttackFrontal.cs" />
|
||||
<Compile Include="Traits\Attack\AttackGarrisoned.cs" />
|
||||
<Compile Include="Traits\Attack\AttackOmni.cs" />
|
||||
<Compile Include="Traits\Attack\AttackSuicides.cs" />
|
||||
<Compile Include="Traits\Attack\AttackTurreted.cs" />
|
||||
<Compile Include="Traits\Attack\AttackWander.cs" />
|
||||
<Compile Include="Traits\AutoTarget.cs" />
|
||||
|
||||
@@ -14,30 +14,27 @@ using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Orders;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Traits
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
class DemoTruckInfo : ITraitInfo, Requires<ExplodesInfo>
|
||||
[Desc("Does a suicide attack where it moves next to the target when used in combination with `Explodes`.")]
|
||||
class AttackSuicidesInfo : ITraitInfo, Requires<IMoveInfo>
|
||||
{
|
||||
[VoiceReference] public readonly string Voice = "Action";
|
||||
|
||||
public object Create(ActorInitializer init) { return new DemoTruck(init.Self, this); }
|
||||
public object Create(ActorInitializer init) { return new AttackSuicides(init.Self, this); }
|
||||
}
|
||||
|
||||
class DemoTruck : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
class AttackSuicides : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
{
|
||||
readonly DemoTruckInfo info;
|
||||
readonly AttackSuicidesInfo info;
|
||||
readonly IMove move;
|
||||
|
||||
public DemoTruck(Actor self, DemoTruckInfo info)
|
||||
public AttackSuicides(Actor self, AttackSuicidesInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
static void Explode(Actor self)
|
||||
{
|
||||
self.World.AddFrameEndTask(w => self.InflictDamage(self, int.MaxValue, null));
|
||||
move = self.Trait<IMove>();
|
||||
}
|
||||
|
||||
public IEnumerable<IOrderTargeter> Orders
|
||||
@@ -77,11 +74,13 @@ namespace OpenRA.Mods.RA.Traits
|
||||
self.CancelActivity();
|
||||
|
||||
self.SetTargetLine(target, Color.Red);
|
||||
self.QueueActivity(new MoveAdjacentTo(self, target));
|
||||
self.QueueActivity(new CallFunc(() => Explode(self)));
|
||||
|
||||
self.QueueActivity(move.MoveToTarget(self, target));
|
||||
|
||||
self.QueueActivity(new CallFunc(() => self.Kill(self)));
|
||||
}
|
||||
else if (order.OrderString == "Detonate")
|
||||
Explode(self);
|
||||
self.Kill(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2883,6 +2883,12 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
node.Key = "WithDockedOverlay" + node.Key.Substring(18);
|
||||
}
|
||||
|
||||
if (engineVersion < 20160116)
|
||||
{
|
||||
if (node.Key == "DemoTruck")
|
||||
node.Key = "AttackSuicides";
|
||||
}
|
||||
|
||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
<Compile Include="Traits\Buildings\ClonesProducedUnits.cs" />
|
||||
<Compile Include="Traits\Chronoshiftable.cs" />
|
||||
<Compile Include="Traits\Cloneable.cs" />
|
||||
<Compile Include="Traits\DemoTruck.cs" />
|
||||
<Compile Include="Traits\Disguise.cs" />
|
||||
<Compile Include="Traits\GpsRemoveFrozenActor.cs" />
|
||||
<Compile Include="Traits\HarvesterHuskModifier.cs" />
|
||||
|
||||
@@ -344,7 +344,7 @@ Rules:
|
||||
Explodes:
|
||||
Weapon: CrateNuke
|
||||
EmptyWeapon: CrateNuke
|
||||
DemoTruck:
|
||||
AttackSuicides:
|
||||
SHOK:
|
||||
Health:
|
||||
HP: 800
|
||||
|
||||
@@ -239,7 +239,7 @@ Rules:
|
||||
Explodes:
|
||||
Weapon: CrateNuke
|
||||
EmptyWeapon: CrateNuke
|
||||
DemoTruck:
|
||||
AttackSuicides:
|
||||
SHOK:
|
||||
Health:
|
||||
HP: 800
|
||||
|
||||
@@ -643,7 +643,7 @@ DTRK:
|
||||
Explodes:
|
||||
Weapon: MiniNuke
|
||||
EmptyWeapon: MiniNuke
|
||||
DemoTruck:
|
||||
AttackSuicides:
|
||||
-DamageMultiplier@IRONCURTAIN:
|
||||
KillsSelf:
|
||||
UpgradeTypes: invulnerability
|
||||
|
||||
@@ -324,7 +324,7 @@ HUNTER:
|
||||
HP: 500
|
||||
Armor:
|
||||
Type: Light
|
||||
DemoTruck:
|
||||
AttackSuicides:
|
||||
Explodes:
|
||||
Weapon: SuicideBomb
|
||||
EmptyWeapon: SuicideBomb
|
||||
|
||||
Reference in New Issue
Block a user