Demotruck logic
This commit is contained in:
@@ -200,6 +200,7 @@
|
|||||||
<Compile Include="Traits\Chronoshiftable.cs" />
|
<Compile Include="Traits\Chronoshiftable.cs" />
|
||||||
<Compile Include="Traits\ChronoshiftPaletteEffect.cs" />
|
<Compile Include="Traits\ChronoshiftPaletteEffect.cs" />
|
||||||
<Compile Include="Traits\Chronosphere.cs" />
|
<Compile Include="Traits\Chronosphere.cs" />
|
||||||
|
<Compile Include="Traits\DemoTruck.cs" />
|
||||||
<Compile Include="Traits\EngineerCapture.cs" />
|
<Compile Include="Traits\EngineerCapture.cs" />
|
||||||
<Compile Include="Traits\Explodes.cs" />
|
<Compile Include="Traits\Explodes.cs" />
|
||||||
<Compile Include="Traits\ChronoshiftDeploy.cs" />
|
<Compile Include="Traits\ChronoshiftDeploy.cs" />
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace OpenRa.Game.Orders
|
|||||||
var loc = mi.Location + Game.viewport.Location;
|
var loc = mi.Location + Game.viewport.Location;
|
||||||
var underCursor = Game.FindUnits(loc, loc)
|
var underCursor = Game.FindUnits(loc, loc)
|
||||||
.Where(a => a.Owner == Game.LocalPlayer
|
.Where(a => a.Owner == Game.LocalPlayer
|
||||||
&& a.traits.Contains<Unit>()
|
&& a.traits.WithInterface<IChronoshiftable>().Any()
|
||||||
&& a.Info.Selectable).FirstOrDefault();
|
&& a.Info.Selectable).FirstOrDefault();
|
||||||
|
|
||||||
var unit = underCursor != null ? underCursor.Info as UnitInfo : null;
|
var unit = underCursor != null ? underCursor.Info as UnitInfo : null;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Drawing;
|
|||||||
|
|
||||||
namespace OpenRa.Game.Traits
|
namespace OpenRa.Game.Traits
|
||||||
{
|
{
|
||||||
class Chronoshiftable : IOrder, ISpeedModifier, ITick
|
class Chronoshiftable : IOrder, ISpeedModifier, ITick, IChronoshiftable
|
||||||
{
|
{
|
||||||
// Return-to-sender logic
|
// Return-to-sender logic
|
||||||
int2 chronoshiftOrigin;
|
int2 chronoshiftOrigin;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace OpenRa.Game.Traits
|
|||||||
bool IsCrushableBy(UnitMovementType umt, Player player);
|
bool IsCrushableBy(UnitMovementType umt, Player player);
|
||||||
bool IsPathableCrush(UnitMovementType umt, Player player);
|
bool IsPathableCrush(UnitMovementType umt, Player player);
|
||||||
}
|
}
|
||||||
|
interface IChronoshiftable{}
|
||||||
struct Renderable
|
struct Renderable
|
||||||
{
|
{
|
||||||
public readonly Sprite Sprite;
|
public readonly Sprite Sprite;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Voice=VehicleVoice
|
|||||||
|
|
||||||
[DTRK]
|
[DTRK]
|
||||||
Description=Demo Truck
|
Description=Demo Truck
|
||||||
Traits=Unit, Mobile, AttackBase, RenderUnit, Chronoshiftable
|
Traits=Unit, Mobile, AttackBase, RenderUnit, DemoTruck
|
||||||
Voice=VehicleVoice
|
Voice=VehicleVoice
|
||||||
|
|
||||||
[QTNK]
|
[QTNK]
|
||||||
|
|||||||
Reference in New Issue
Block a user