more
This commit is contained in:
@@ -6,6 +6,13 @@ using OpenRa.Game.Effects;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class AttackBaseInfo : ITraitInfo
|
||||
{
|
||||
|
||||
|
||||
public object Create(Actor self) { return new AttackBase(self); }
|
||||
}
|
||||
|
||||
class AttackBase : IIssueOrder, IResolveOrder, ITick
|
||||
{
|
||||
[Sync] public Actor target;
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class AutoTargetInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new AutoTarget(self); }
|
||||
}
|
||||
|
||||
class AutoTarget : ITick, INotifyDamage
|
||||
{
|
||||
public AutoTarget(Actor self) {}
|
||||
|
||||
@@ -5,6 +5,11 @@ using System.Linq;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class ChronoshiftableInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new Chronoshiftable(self); }
|
||||
}
|
||||
|
||||
class Chronoshiftable : IResolveOrder, ISpeedModifier, ITick
|
||||
{
|
||||
// Return-to-sender logic
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public Production( Actor self ) { }
|
||||
|
||||
public virtual int2? CreationLocation( Actor self, UnitInfo producee )
|
||||
public virtual int2? CreationLocation( Actor self, LegacyUnitInfo producee )
|
||||
{
|
||||
return ( 1 / 24f * self.CenterLocation ).ToInt2();
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace OpenRa.Game.Traits
|
||||
return newUnit.Info.InitialFacing;
|
||||
}
|
||||
|
||||
public bool Produce( Actor self, UnitInfo producee )
|
||||
public bool Produce( Actor self, LegacyUnitInfo producee )
|
||||
{
|
||||
var location = CreationLocation( self, producee );
|
||||
if( location == null || Game.UnitInfluence.GetUnitsAt( location.Value ).Any() )
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRa.Game.Traits
|
||||
return null;
|
||||
}
|
||||
|
||||
public override int2? CreationLocation(Actor self, UnitInfo producee)
|
||||
public override int2? CreationLocation(Actor self, LegacyUnitInfo producee)
|
||||
{
|
||||
return FindAdjacentTile(self, producee.WaterBound ?
|
||||
UnitMovementType.Float : UnitMovementType.Wheel); /* hackety hack */
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderUnitReloadInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new RenderUnitReload(self); }
|
||||
}
|
||||
|
||||
class RenderUnitReload : RenderUnit
|
||||
{
|
||||
public RenderUnitReload(Actor self)
|
||||
|
||||
@@ -6,6 +6,11 @@ using OpenRa.Game.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RepairableInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new Repairable(self); }
|
||||
}
|
||||
|
||||
class Repairable : IIssueOrder, IResolveOrder
|
||||
{
|
||||
IDisposable reservation;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
interface IProducer
|
||||
{
|
||||
bool Produce( Actor self, UnitInfo producee );
|
||||
bool Produce( Actor self, LegacyUnitInfo producee );
|
||||
void SetPrimaryProducer(Actor self, bool isPrimary);
|
||||
}
|
||||
interface IOccupySpace { IEnumerable<int2> OccupiedCells(); }
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
|
||||
using OpenRa.Game.GameRules;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class UnitInfo : ITraitInfo
|
||||
{
|
||||
public readonly int HP = 0;
|
||||
public readonly ArmorType Armor = ArmorType.none;
|
||||
public readonly bool Crewed = false; // replace with trait?
|
||||
|
||||
public object Create(Actor self) { return new Unit(self); }
|
||||
}
|
||||
|
||||
class Unit : INotifyDamage
|
||||
{
|
||||
[Sync]
|
||||
|
||||
Reference in New Issue
Block a user