RA special infantry all in mod dll now
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa.Effects
|
||||
{
|
||||
class DelayedAction : IEffect
|
||||
public class DelayedAction : IEffect
|
||||
{
|
||||
Action a;
|
||||
int delay;
|
||||
|
||||
@@ -5,7 +5,7 @@ using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa
|
||||
{
|
||||
static class Exts
|
||||
public static class Exts
|
||||
{
|
||||
public static bool HasModifier(this Modifiers k, Modifiers mod)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace OpenRa.Graphics
|
||||
{
|
||||
class Animation
|
||||
public class Animation
|
||||
{
|
||||
string name;
|
||||
public Sequence CurrentSequence { get; private set; }
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using System.Xml;
|
||||
using Ijw.DirectX;
|
||||
|
||||
namespace OpenRa.Graphics
|
||||
{
|
||||
class Sequence
|
||||
public class Sequence
|
||||
{
|
||||
readonly Sprite[] sprites;
|
||||
readonly int start, length;
|
||||
|
||||
@@ -134,8 +134,6 @@
|
||||
<Compile Include="Sync.cs" />
|
||||
<Compile Include="Traits\AcceptsOre.cs" />
|
||||
<Compile Include="Traits\Activities\Attack.cs" />
|
||||
<Compile Include="Traits\Activities\CaptureBuilding.cs" />
|
||||
<Compile Include="Traits\Activities\Demolish.cs" />
|
||||
<Compile Include="Traits\Activities\EnterTransport.cs" />
|
||||
<Compile Include="Traits\Activities\Fly.cs" />
|
||||
<Compile Include="Traits\Activities\FlyAttack.cs" />
|
||||
@@ -166,7 +164,6 @@
|
||||
<Compile Include="Graphics\OverlayRenderer.cs" />
|
||||
<Compile Include="Graphics\WorldRenderer.cs" />
|
||||
<Compile Include="Traits\Activities\Idle.cs" />
|
||||
<Compile Include="Traits\Activities\Infiltrate.cs" />
|
||||
<Compile Include="Traits\Activities\Land.cs" />
|
||||
<Compile Include="Traits\Activities\Rearm.cs" />
|
||||
<Compile Include="Traits\Activities\Repair.cs" />
|
||||
@@ -216,12 +213,10 @@
|
||||
<Compile Include="Traits\BelowUnits.cs" />
|
||||
<Compile Include="Traits\Buildable.cs" />
|
||||
<Compile Include="Traits\Building.cs" />
|
||||
<Compile Include="Traits\C4Demolition.cs" />
|
||||
<Compile Include="Traits\Cargo.cs" />
|
||||
<Compile Include="Traits\Chronoshiftable.cs" />
|
||||
<Compile Include="Traits\ChronoshiftPaletteEffect.cs" />
|
||||
<Compile Include="Traits\Chronosphere.cs" />
|
||||
<Compile Include="Traits\EngineerCapture.cs" />
|
||||
<Compile Include="Traits\Explodes.cs" />
|
||||
<Compile Include="Traits\Fake.cs" />
|
||||
<Compile Include="Traits\GeneratesGap.cs" />
|
||||
@@ -236,12 +231,10 @@
|
||||
<Compile Include="Traits\LimitedAmmo.cs" />
|
||||
<Compile Include="Traits\Passenger.cs" />
|
||||
<Compile Include="Traits\ProvidesRadar.cs" />
|
||||
<Compile Include="Traits\RenderSpy.cs" />
|
||||
<Compile Include="Traits\Repairable.cs" />
|
||||
<Compile Include="Traits\Reservable.cs" />
|
||||
<Compile Include="Traits\Selectable.cs" />
|
||||
<Compile Include="Traits\SelfHealing.cs" />
|
||||
<Compile Include="Traits\Spy.cs" />
|
||||
<Compile Include="Traits\SquishByTank.cs" />
|
||||
<Compile Include="Traits\Plane.cs" />
|
||||
<Compile Include="Traits\ProductionQueue.cs" />
|
||||
@@ -268,7 +261,6 @@
|
||||
<Compile Include="Traits\StoresOre.cs" />
|
||||
<Compile Include="Traits\Submarine.cs" />
|
||||
<Compile Include="Traits\TakeCover.cs" />
|
||||
<Compile Include="Traits\Thief.cs" />
|
||||
<Compile Include="Traits\TraitsInterfaces.cs" />
|
||||
<Compile Include="Traits\Turreted.cs" />
|
||||
<Compile Include="Traits\Unit.cs" />
|
||||
|
||||
@@ -6,7 +6,7 @@ using OpenRa.GameRules;
|
||||
|
||||
namespace OpenRa.Traits.Activities
|
||||
{
|
||||
class Move : IActivity
|
||||
public class Move : IActivity
|
||||
{
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
|
||||
namespace OpenRa.Traits.Activities
|
||||
{
|
||||
class Steal : IActivity
|
||||
{
|
||||
Actor target;
|
||||
|
||||
public Steal(Actor target) { this.target = target; }
|
||||
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead) return NextActivity;
|
||||
if (target.Owner == self.Owner) return NextActivity;
|
||||
|
||||
foreach (var t in target.traits.WithInterface<IAcceptThief>())
|
||||
t.OnSteal(target, self);
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self) { target = null; NextActivity = null; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRa.Traits
|
||||
public object Create(Actor self) { return new Building(self); }
|
||||
}
|
||||
|
||||
class Building : INotifyDamage, IResolveOrder, ITick
|
||||
public class Building : INotifyDamage, IResolveOrder, ITick
|
||||
{
|
||||
readonly Actor self;
|
||||
public readonly BuildingInfo Info;
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.GameRules;
|
||||
using System.Collections.Generic;
|
||||
using OpenRa.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
@@ -81,8 +77,8 @@ namespace OpenRa.Traits
|
||||
return PipType.Yellow;
|
||||
if (!a.traits.Contains<AttackBase>())
|
||||
return PipType.Yellow; // noncombat [E6,SPY,THF]
|
||||
if (a.traits.Contains<C4Demolition>())
|
||||
return PipType.Red; // E7
|
||||
|
||||
// todo: fix E7 color again.
|
||||
|
||||
return PipType.Green;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
namespace OpenRa.Traits
|
||||
{
|
||||
class RenderInfantryInfo : RenderSimpleInfo
|
||||
public class RenderInfantryInfo : RenderSimpleInfo
|
||||
{
|
||||
public override object Create(Actor self) { return new RenderInfantry(self); }
|
||||
}
|
||||
|
||||
class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamage
|
||||
public class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamage
|
||||
{
|
||||
public RenderInfantry(Actor self)
|
||||
: base(self)
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRa.Graphics;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
{
|
||||
abstract class RenderSimpleInfo : ITraitInfo
|
||||
public abstract class RenderSimpleInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Image = null;
|
||||
|
||||
public abstract object Create(Actor self);
|
||||
}
|
||||
|
||||
abstract class RenderSimple : IRender, ITick
|
||||
public abstract class RenderSimple : IRender, ITick
|
||||
{
|
||||
public Dictionary<string, AnimationWithOffset> anims = new Dictionary<string, AnimationWithOffset>();
|
||||
public Animation anim { get { return anims[""].Animation; } protected set { anims[""].Animation = value; } }
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa.Traits.Activities
|
||||
namespace OpenRa.Mods.RA.Activities
|
||||
{
|
||||
class CaptureBuilding : IActivity
|
||||
{
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Effects;
|
||||
using OpenRa.Effects;
|
||||
using OpenRa.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Traits.Activities
|
||||
namespace OpenRa.Mods.RA.Activities
|
||||
{
|
||||
class Demolish : IActivity
|
||||
{
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
namespace OpenRa.Traits.Activities
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa.Mods.RA.Activities
|
||||
{
|
||||
class Infiltrate : IActivity
|
||||
{
|
||||
33
OpenRa.Mods.RA/Activities/Steal.cs
Normal file
33
OpenRa.Mods.RA/Activities/Steal.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa.Mods.RA.Activities
|
||||
{
|
||||
class Steal : IActivity
|
||||
{
|
||||
Actor target;
|
||||
|
||||
public Steal(Actor target) { this.target = target; }
|
||||
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead) return NextActivity;
|
||||
if (target.Owner == self.Owner) return NextActivity;
|
||||
|
||||
foreach (var t in target.traits.WithInterface<IAcceptThief>())
|
||||
t.OnSteal(target, self);
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self) { target = null; NextActivity = null; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Mods.RA.Activities;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
namespace OpenRa.Mods.RA
|
||||
{
|
||||
class C4DemolitionInfo : StatelessTraitInfo<C4Demolition> { }
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.Mods.RA.Activities;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
namespace OpenRa.Mods.RA
|
||||
{
|
||||
class EngineerCaptureInfo : StatelessTraitInfo<EngineerCapture> { }
|
||||
|
||||
@@ -46,10 +46,19 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Activities\CaptureBuilding.cs" />
|
||||
<Compile Include="Activities\Demolish.cs" />
|
||||
<Compile Include="Activities\Infiltrate.cs" />
|
||||
<Compile Include="Activities\Steal.cs" />
|
||||
<Compile Include="C4Demolition.cs" />
|
||||
<Compile Include="EngineerCapture.cs" />
|
||||
<Compile Include="Mine.cs" />
|
||||
<Compile Include="MineImmune.cs" />
|
||||
<Compile Include="Minelayer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RenderSpy.cs" />
|
||||
<Compile Include="Spy.cs" />
|
||||
<Compile Include="Thief.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRa.FileFormats\OpenRa.FileFormats.csproj">
|
||||
|
||||
@@ -3,8 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Graphics;
|
||||
using OpenRa.Traits;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
namespace OpenRa.Mods.RA
|
||||
{
|
||||
class RenderSpyInfo : RenderInfantryInfo
|
||||
{
|
||||
@@ -3,8 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Traits.Activities;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.Mods.RA.Activities;
|
||||
|
||||
namespace OpenRa.Traits
|
||||
namespace OpenRa.Mods.RA
|
||||
{
|
||||
class SpyInfo : StatelessTraitInfo<Spy> { }
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using OpenRa.Traits.Activities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
namespace OpenRa.Traits
|
||||
using OpenRa.Mods.RA.Activities;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Mods.RA
|
||||
{
|
||||
class ThiefInfo : StatelessTraitInfo<Thief> { }
|
||||
|
||||
Reference in New Issue
Block a user