start of demolition support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -109,6 +109,7 @@
|
||||
<Compile Include="Traits\AcceptsOre.cs" />
|
||||
<Compile Include="Traits\Activities\Attack.cs" />
|
||||
<Compile Include="Traits\Activities\Circle.cs" />
|
||||
<Compile Include="Traits\Activities\Demolish.cs" />
|
||||
<Compile Include="Traits\Activities\Fly.cs" />
|
||||
<Compile Include="Traits\Activities\FlyTimed.cs" />
|
||||
<Compile Include="Traits\Activities\IActivity.cs" />
|
||||
@@ -176,6 +177,7 @@
|
||||
<Compile Include="Traits\AutoTarget.cs" />
|
||||
<Compile Include="Traits\BelowUnits.cs" />
|
||||
<Compile Include="Traits\Building.cs" />
|
||||
<Compile Include="Traits\C4Demolition.cs" />
|
||||
<Compile Include="Traits\Explodes.cs" />
|
||||
<Compile Include="Traits\ChronoshiftDeploy.cs" />
|
||||
<Compile Include="Traits\Fake.cs" />
|
||||
@@ -267,4 +269,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
30
OpenRa.Game/Traits/Activities/Demolish.cs
Normal file
30
OpenRa.Game/Traits/Activities/Demolish.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits.Activities
|
||||
{
|
||||
class Demolish : IActivity
|
||||
{
|
||||
Actor target;
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
public Demolish( Actor target )
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead) return NextActivity;
|
||||
|
||||
// 1. run to adj tile
|
||||
// 2. spawn timed demolition (for +3/4s)
|
||||
// 3. run away --- where?
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self) { target = null; NextActivity = null; }
|
||||
}
|
||||
}
|
||||
29
OpenRa.Game/Traits/C4Demolition.cs
Normal file
29
OpenRa.Game/Traits/C4Demolition.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Game.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class C4Demolition : IOrder
|
||||
{
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
if (underCursor == null) return null;
|
||||
if (underCursor.Owner == self.Owner && !mi.Modifiers.HasModifier(Modifiers.Ctrl)) return null;
|
||||
if (!underCursor.traits.Contains<Building>()) return null;
|
||||
|
||||
return new Order("C4", self, underCursor, int2.Zero, null);
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "C4")
|
||||
{
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new Demolish(order.TargetActor));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ E3 Works
|
||||
E4 Flamer origin is wrong
|
||||
E6 Capture action missing, repair action missing
|
||||
E7 C4 action missing
|
||||
MEDI Heal targeting is wrong
|
||||
MEDI Works
|
||||
SPY Infiltrate action missing
|
||||
THF Steal action missing
|
||||
C1,C2,Einstein,Kosygin Not implemented
|
||||
@@ -47,7 +47,7 @@ MIG Weapons don't work
|
||||
Ships
|
||||
CA Works
|
||||
SS Works
|
||||
DD AA weapon doesn't work, depth charges don't work
|
||||
DD depth charges don't work
|
||||
PT depth charges don't work
|
||||
LST Cargo doesn't work
|
||||
|
||||
|
||||
Reference in New Issue
Block a user