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\AttackFrontal.cs" />
|
||||||
<Compile Include="Traits\Attack\AttackGarrisoned.cs" />
|
<Compile Include="Traits\Attack\AttackGarrisoned.cs" />
|
||||||
<Compile Include="Traits\Attack\AttackOmni.cs" />
|
<Compile Include="Traits\Attack\AttackOmni.cs" />
|
||||||
|
<Compile Include="Traits\Attack\AttackSuicides.cs" />
|
||||||
<Compile Include="Traits\Attack\AttackTurreted.cs" />
|
<Compile Include="Traits\Attack\AttackTurreted.cs" />
|
||||||
<Compile Include="Traits\Attack\AttackWander.cs" />
|
<Compile Include="Traits\Attack\AttackWander.cs" />
|
||||||
<Compile Include="Traits\AutoTarget.cs" />
|
<Compile Include="Traits\AutoTarget.cs" />
|
||||||
|
|||||||
@@ -14,30 +14,27 @@ using OpenRA.Activities;
|
|||||||
using OpenRA.Mods.Common;
|
using OpenRA.Mods.Common;
|
||||||
using OpenRA.Mods.Common.Activities;
|
using OpenRA.Mods.Common.Activities;
|
||||||
using OpenRA.Mods.Common.Orders;
|
using OpenRA.Mods.Common.Orders;
|
||||||
using OpenRA.Mods.Common.Traits;
|
|
||||||
using OpenRA.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";
|
[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;
|
this.info = info;
|
||||||
}
|
move = self.Trait<IMove>();
|
||||||
|
|
||||||
static void Explode(Actor self)
|
|
||||||
{
|
|
||||||
self.World.AddFrameEndTask(w => self.InflictDamage(self, int.MaxValue, null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IOrderTargeter> Orders
|
public IEnumerable<IOrderTargeter> Orders
|
||||||
@@ -77,11 +74,13 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
|
|
||||||
self.SetTargetLine(target, Color.Red);
|
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")
|
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);
|
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);
|
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,6 @@
|
|||||||
<Compile Include="Traits\Buildings\ClonesProducedUnits.cs" />
|
<Compile Include="Traits\Buildings\ClonesProducedUnits.cs" />
|
||||||
<Compile Include="Traits\Chronoshiftable.cs" />
|
<Compile Include="Traits\Chronoshiftable.cs" />
|
||||||
<Compile Include="Traits\Cloneable.cs" />
|
<Compile Include="Traits\Cloneable.cs" />
|
||||||
<Compile Include="Traits\DemoTruck.cs" />
|
|
||||||
<Compile Include="Traits\Disguise.cs" />
|
<Compile Include="Traits\Disguise.cs" />
|
||||||
<Compile Include="Traits\GpsRemoveFrozenActor.cs" />
|
<Compile Include="Traits\GpsRemoveFrozenActor.cs" />
|
||||||
<Compile Include="Traits\HarvesterHuskModifier.cs" />
|
<Compile Include="Traits\HarvesterHuskModifier.cs" />
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ Rules:
|
|||||||
Explodes:
|
Explodes:
|
||||||
Weapon: CrateNuke
|
Weapon: CrateNuke
|
||||||
EmptyWeapon: CrateNuke
|
EmptyWeapon: CrateNuke
|
||||||
DemoTruck:
|
AttackSuicides:
|
||||||
SHOK:
|
SHOK:
|
||||||
Health:
|
Health:
|
||||||
HP: 800
|
HP: 800
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ Rules:
|
|||||||
Explodes:
|
Explodes:
|
||||||
Weapon: CrateNuke
|
Weapon: CrateNuke
|
||||||
EmptyWeapon: CrateNuke
|
EmptyWeapon: CrateNuke
|
||||||
DemoTruck:
|
AttackSuicides:
|
||||||
SHOK:
|
SHOK:
|
||||||
Health:
|
Health:
|
||||||
HP: 800
|
HP: 800
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ DTRK:
|
|||||||
Explodes:
|
Explodes:
|
||||||
Weapon: MiniNuke
|
Weapon: MiniNuke
|
||||||
EmptyWeapon: MiniNuke
|
EmptyWeapon: MiniNuke
|
||||||
DemoTruck:
|
AttackSuicides:
|
||||||
-DamageMultiplier@IRONCURTAIN:
|
-DamageMultiplier@IRONCURTAIN:
|
||||||
KillsSelf:
|
KillsSelf:
|
||||||
UpgradeTypes: invulnerability
|
UpgradeTypes: invulnerability
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ HUNTER:
|
|||||||
HP: 500
|
HP: 500
|
||||||
Armor:
|
Armor:
|
||||||
Type: Light
|
Type: Light
|
||||||
DemoTruck:
|
AttackSuicides:
|
||||||
Explodes:
|
Explodes:
|
||||||
Weapon: SuicideBomb
|
Weapon: SuicideBomb
|
||||||
EmptyWeapon: SuicideBomb
|
EmptyWeapon: SuicideBomb
|
||||||
|
|||||||
Reference in New Issue
Block a user