Port to new traits model (untested)
This commit is contained in:
@@ -7,6 +7,12 @@ using OpenRa.Game.Traits;
|
|||||||
|
|
||||||
namespace OpenRa.Game.Traits
|
namespace OpenRa.Game.Traits
|
||||||
{
|
{
|
||||||
|
class GeneratesGapInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
public readonly int Range = 10;
|
||||||
|
public object Create(Actor self) { return new GeneratesGap(self); }
|
||||||
|
}
|
||||||
|
|
||||||
class GeneratesGap
|
class GeneratesGap
|
||||||
{
|
{
|
||||||
Actor self;
|
Actor self;
|
||||||
@@ -17,12 +23,13 @@ namespace OpenRa.Game.Traits
|
|||||||
|
|
||||||
public IEnumerable<int2>GetShroudedTiles()
|
public IEnumerable<int2>GetShroudedTiles()
|
||||||
{
|
{
|
||||||
|
int range = self.Info.Traits.Get<GeneratesGapInfo>().Range;
|
||||||
|
|
||||||
// Gap Generator building; powered down
|
// Gap Generator building; powered down
|
||||||
if (self.traits.Contains<Building>() && self.traits.Get<Building>().Disabled)
|
if (self.traits.Contains<Building>() && self.traits.Get<Building>().Disabled)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
// It won't let me return Game.FindTilesInCircle directly...?
|
foreach (var t in Game.FindTilesInCircle(self.Location, range))
|
||||||
foreach (var t in Game.FindTilesInCircle(self.Location, Rules.General.GapRadius))
|
|
||||||
yield return t;
|
yield return t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
merge-ra.yaml
Normal file
7
merge-ra.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
MGG:
|
||||||
|
GeneratesGap:
|
||||||
|
Range: 10
|
||||||
|
|
||||||
|
GAP:
|
||||||
|
GeneratesGap:
|
||||||
|
Range: 10
|
||||||
92
ra.yaml
92
ra.yaml
@@ -1,3 +1,49 @@
|
|||||||
|
MGG:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 11
|
||||||
|
Tab: Vehicle
|
||||||
|
Prerequisites: weap,atek
|
||||||
|
Owner: allies
|
||||||
|
Cost: 600
|
||||||
|
Description: Mobile Gap Generator
|
||||||
|
LongDesc: Regenerates Fog of War in a small area \naround the unit.\n Unarmed
|
||||||
|
Selectable:
|
||||||
|
Priority: 3
|
||||||
|
Unit:
|
||||||
|
HP: 110
|
||||||
|
Armor: light
|
||||||
|
Crewed: yes
|
||||||
|
Sight: 4
|
||||||
|
Speed: 9
|
||||||
|
RenderUnitSpinner:
|
||||||
|
Offset: 0,6,0,-3
|
||||||
|
|
||||||
|
GAP:
|
||||||
|
Inherits: DefaultDefense
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 10
|
||||||
|
Tab: Defense
|
||||||
|
Prerequisites: atek
|
||||||
|
Owner: allies
|
||||||
|
Cost: 500
|
||||||
|
Description: Gap Generator
|
||||||
|
LongDesc: Regenerates the Fog of War nearby, \nobscuring the area.\n Unarmed
|
||||||
|
Selectable:
|
||||||
|
Priority: 3
|
||||||
|
Building:
|
||||||
|
Power: -60
|
||||||
|
RequiresPower: true
|
||||||
|
Footprint: _ x
|
||||||
|
Dimensions: 1,2
|
||||||
|
Capturable: true
|
||||||
|
HP: 1000
|
||||||
|
Armor: wood
|
||||||
|
Crewed: yes
|
||||||
|
Sight: 10
|
||||||
|
RenderBuilding:
|
||||||
|
IronCurtainable:
|
||||||
|
|
||||||
V2RL:
|
V2RL:
|
||||||
Inherits: DefaultVehicle
|
Inherits: DefaultVehicle
|
||||||
Buildable:
|
Buildable:
|
||||||
@@ -150,27 +196,6 @@ MRJ:
|
|||||||
RenderUnitSpinner:
|
RenderUnitSpinner:
|
||||||
Offset: 0,4,0,-6
|
Offset: 0,4,0,-6
|
||||||
|
|
||||||
MGG:
|
|
||||||
Inherits: DefaultVehicle
|
|
||||||
Buildable:
|
|
||||||
TechLevel: 11
|
|
||||||
Tab: Vehicle
|
|
||||||
Prerequisites: weap,atek
|
|
||||||
Owner: allies
|
|
||||||
Cost: 600
|
|
||||||
Description: Mobile Gap Generator
|
|
||||||
LongDesc: Regenerates Fog of War in a small area \naround the unit.\n Unarmed
|
|
||||||
Selectable:
|
|
||||||
Priority: 3
|
|
||||||
Unit:
|
|
||||||
HP: 110
|
|
||||||
Armor: light
|
|
||||||
Crewed: yes
|
|
||||||
Sight: 4
|
|
||||||
Speed: 9
|
|
||||||
RenderUnitSpinner:
|
|
||||||
Offset: 0,6,0,-3
|
|
||||||
|
|
||||||
ARTY:
|
ARTY:
|
||||||
Inherits: DefaultVehicle
|
Inherits: DefaultVehicle
|
||||||
Buildable:
|
Buildable:
|
||||||
@@ -856,31 +881,6 @@ FTUR:
|
|||||||
AutoTarget:
|
AutoTarget:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
|
||||||
GAP:
|
|
||||||
Inherits: DefaultDefense
|
|
||||||
Buildable:
|
|
||||||
TechLevel: 10
|
|
||||||
Tab: Defense
|
|
||||||
Prerequisites: atek
|
|
||||||
Owner: allies
|
|
||||||
Cost: 500
|
|
||||||
Description: Gap Generator
|
|
||||||
LongDesc: Regenerates the Fog of War nearby, \nobscuring the area.\n Unarmed
|
|
||||||
Selectable:
|
|
||||||
Priority: 3
|
|
||||||
Building:
|
|
||||||
Power: -60
|
|
||||||
RequiresPower: true
|
|
||||||
Footprint: _ x
|
|
||||||
Dimensions: 1,2
|
|
||||||
Capturable: true
|
|
||||||
HP: 1000
|
|
||||||
Armor: wood
|
|
||||||
Crewed: yes
|
|
||||||
Sight: 10
|
|
||||||
RenderBuilding:
|
|
||||||
IronCurtainable:
|
|
||||||
|
|
||||||
SAM:
|
SAM:
|
||||||
Inherits: DefaultDefense
|
Inherits: DefaultDefense
|
||||||
Buildable:
|
Buildable:
|
||||||
|
|||||||
Reference in New Issue
Block a user