Moved footprint info onto its building.
This commit is contained in:
@@ -20,14 +20,14 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
void AddInfluence(Actor a)
|
void AddInfluence(Actor a)
|
||||||
{
|
{
|
||||||
foreach (var t in Footprint.UnpathableTiles(a.unitInfo.Name, a.Location))
|
foreach (var t in Footprint.UnpathableTiles(a.unitInfo, a.Location))
|
||||||
if (IsValid(t))
|
if (IsValid(t))
|
||||||
influence[t.X, t.Y] = a;
|
influence[t.X, t.Y] = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveInfluence(Actor a)
|
void RemoveInfluence(Actor a)
|
||||||
{
|
{
|
||||||
foreach (var t in Footprint.UnpathableTiles(a.unitInfo.Name, a.Location))
|
foreach (var t in Footprint.UnpathableTiles(a.unitInfo, a.Location))
|
||||||
if (IsValid(t))
|
if (IsValid(t))
|
||||||
influence[t.X, t.Y] = null;
|
influence[t.X, t.Y] = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,15 @@ namespace OpenRa.Game.GameRules
|
|||||||
var parts = x.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
|
var parts = x.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
|
||||||
|
|
||||||
var ret = Array.CreateInstance( fieldType.GetElementType(), parts.Length );
|
var ret = Array.CreateInstance( fieldType.GetElementType(), parts.Length );
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for( int i = 0 ; i < parts.Length ; i++ )
|
||||||
ret.SetValue( GetValue( fieldType.GetElementType(), parts[ i ].Trim() ), i );
|
ret.SetValue( GetValue( fieldType.GetElementType(), parts[ i ].Trim() ), i );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
else if( fieldType == typeof( int2 ) )
|
||||||
|
{
|
||||||
|
var parts = x.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
|
||||||
|
return new int2( int.Parse( parts[ 0 ] ), int.Parse( parts[ 1 ] ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw new InvalidOperationException( "FieldLoader: don't know how to load field of type " + fieldType.ToString() );
|
throw new InvalidOperationException( "FieldLoader: don't know how to load field of type " + fieldType.ToString() );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,74 +7,57 @@ using OpenRa.Game.Graphics;
|
|||||||
|
|
||||||
namespace OpenRa.Game.GameRules
|
namespace OpenRa.Game.GameRules
|
||||||
{
|
{
|
||||||
class Footprint
|
static class Footprint
|
||||||
{
|
{
|
||||||
Dictionary<string, string[]> buildingFootprints;
|
public static IEnumerable<int2> Tiles( UnitInfo unitInfo, int2 position )
|
||||||
|
|
||||||
public string[] GetFootprint(string name)
|
|
||||||
{
|
{
|
||||||
string[] val;
|
var buildingInfo = unitInfo as UnitInfo.BuildingInfo;
|
||||||
if (!buildingFootprints.TryGetValue(name, out val))
|
var dim = buildingInfo.Dimensions;
|
||||||
buildingFootprints.TryGetValue("*", out val);
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Footprint(Stream s)
|
var footprint = buildingInfo.Footprint.ToCharArray().Where( x => !char.IsWhiteSpace( x ) );
|
||||||
{
|
if( buildingInfo.Bib )
|
||||||
var lines = Util.ReadAllLines(s).Where(a => !a.StartsWith("#"));
|
|
||||||
|
|
||||||
Func<string,string[]> words =
|
|
||||||
b => b.Split( new[] { ' ', '\t' },
|
|
||||||
StringSplitOptions.RemoveEmptyEntries );
|
|
||||||
|
|
||||||
var buildings = lines
|
|
||||||
.Select(a => a.Split(':'))
|
|
||||||
.SelectMany(a => words(a[1])
|
|
||||||
.Select( b => new { Name=b, Pat=words(a[0]) } ));
|
|
||||||
|
|
||||||
buildingFootprints = buildings
|
|
||||||
.ToDictionary(a => a.Name, a => a.Pat);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IEnumerable<int2> Tiles(string name, int2 position)
|
|
||||||
{
|
|
||||||
var footprint = Rules.Footprint.GetFootprint(name);
|
|
||||||
var j = 0;
|
|
||||||
|
|
||||||
int maxWidth = 0;
|
|
||||||
foreach (var row in footprint)
|
|
||||||
if (row.Length > maxWidth)
|
|
||||||
maxWidth = row.Length;
|
|
||||||
|
|
||||||
foreach (var row in footprint)
|
|
||||||
{
|
{
|
||||||
var i = 0;
|
dim.Y += 1;
|
||||||
foreach (var c in row)
|
footprint = footprint.Concat( new char[ dim.X ] );
|
||||||
|
}
|
||||||
|
foreach( var tile in TilesWhere( unitInfo.Name, dim, footprint.ToArray(), a => a != '_' ) )
|
||||||
|
yield return tile + position - AdjustForBuildingSize( buildingInfo );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<int2> UnpathableTiles( UnitInfo unitInfo, int2 position )
|
||||||
|
{
|
||||||
|
var buildingInfo = unitInfo as UnitInfo.BuildingInfo;
|
||||||
|
|
||||||
|
var footprint = buildingInfo.Footprint.ToCharArray().Where( x => !char.IsWhiteSpace( x ) ).ToArray();
|
||||||
|
foreach( var tile in TilesWhere( unitInfo.Name, buildingInfo.Dimensions, footprint, a => a == 'x' ) )
|
||||||
|
yield return tile + position;
|
||||||
|
}
|
||||||
|
|
||||||
|
static IEnumerable<int2> TilesWhere( string name, int2 dim, char[] footprint, Func<char, bool> cond )
|
||||||
|
{
|
||||||
|
if( footprint.Length != dim.X * dim.Y )
|
||||||
|
throw new InvalidOperationException( "Invalid footprint for " + name );
|
||||||
|
int index = 0;
|
||||||
|
for( int y = 0 ; y < dim.Y ; y++ )
|
||||||
|
{
|
||||||
|
for( int x = 0 ; x < dim.X ; x++ )
|
||||||
{
|
{
|
||||||
if (c != '_')
|
if( cond( footprint[ index ] ) )
|
||||||
yield return position + new int2(i, j) - new int2(maxWidth / 2, footprint.Length / 2);
|
yield return new int2( x, y );
|
||||||
++i;
|
++index;
|
||||||
}
|
}
|
||||||
++j;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<int2> UnpathableTiles( string name, int2 position )
|
public static int2 AdjustForBuildingSize( string name )
|
||||||
{
|
{
|
||||||
var footprint = Rules.Footprint.GetFootprint( name );
|
return AdjustForBuildingSize( Rules.UnitInfo[ name ] as UnitInfo.BuildingInfo );
|
||||||
var j = 0;
|
}
|
||||||
|
|
||||||
foreach( var row in footprint )
|
public static int2 AdjustForBuildingSize( UnitInfo.BuildingInfo unitInfo )
|
||||||
{
|
{
|
||||||
var i = 0;
|
var dim = unitInfo.Dimensions;
|
||||||
foreach( var c in row )
|
return new int2( dim.X / 2, ( dim.Y + 1 ) / 2 );
|
||||||
{
|
|
||||||
if( c == 'x' )
|
|
||||||
yield return position + new int2( i, j );
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
++j;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ namespace OpenRa.Game
|
|||||||
public static InfoLoader<WeaponInfo> WeaponInfo;
|
public static InfoLoader<WeaponInfo> WeaponInfo;
|
||||||
public static InfoLoader<WarheadInfo> WarheadInfo;
|
public static InfoLoader<WarheadInfo> WarheadInfo;
|
||||||
public static InfoLoader<ProjectileInfo> ProjectileInfo;
|
public static InfoLoader<ProjectileInfo> ProjectileInfo;
|
||||||
public static Footprint Footprint;
|
|
||||||
|
|
||||||
public static void LoadRules( string mapFileName )
|
public static void LoadRules( string mapFileName )
|
||||||
{
|
{
|
||||||
@@ -38,8 +37,6 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
ProjectileInfo = new InfoLoader<ProjectileInfo>(
|
ProjectileInfo = new InfoLoader<ProjectileInfo>(
|
||||||
Pair.New<string, Func<string, ProjectileInfo>>("ProjectileTypes", _ => new ProjectileInfo()));
|
Pair.New<string, Func<string, ProjectileInfo>>("ProjectileTypes", _ => new ProjectileInfo()));
|
||||||
|
|
||||||
Footprint = new Footprint(FileSystem.Open("footprint.txt"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ namespace OpenRa.Game.GameRules
|
|||||||
|
|
||||||
public class InfantryInfo : MobileInfo
|
public class InfantryInfo : MobileInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
public readonly bool C4 = false;
|
public readonly bool C4 = false;
|
||||||
public readonly bool FraidyCat = false;
|
public readonly bool FraidyCat = false;
|
||||||
public readonly bool Infiltrate = false;
|
public readonly bool Infiltrate = false;
|
||||||
@@ -78,6 +77,9 @@ namespace OpenRa.Game.GameRules
|
|||||||
|
|
||||||
public class BuildingInfo : UnitInfo
|
public class BuildingInfo : UnitInfo
|
||||||
{
|
{
|
||||||
|
public readonly int2 Dimensions = new int2( 1, 1 );
|
||||||
|
public readonly string Footprint = "x";
|
||||||
|
|
||||||
public readonly bool BaseNormal = true;
|
public readonly bool BaseNormal = true;
|
||||||
public readonly int Adjacent = 1;
|
public readonly int Adjacent = 1;
|
||||||
public readonly bool Bib = false;
|
public readonly bool Bib = false;
|
||||||
|
|||||||
@@ -24,13 +24,15 @@ namespace OpenRa.Game.Graphics
|
|||||||
|
|
||||||
public void Scroll(float2 delta)
|
public void Scroll(float2 delta)
|
||||||
{
|
{
|
||||||
scrollPosition = (scrollPosition + delta).Constrain(float2.Zero, mapSize);
|
scrollPosition = ( scrollPosition + delta ).Constrain( float2.Zero, mapSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Viewport(float2 size, float2 mapSize, Renderer renderer)
|
public Viewport(float2 size, float2 mapSize, Renderer renderer)
|
||||||
{
|
{
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.mapSize = Game.CellSize * mapSize - size + new float2(128, 0);
|
this.mapSize = Game.CellSize * mapSize - size + new float2(128, 0);
|
||||||
|
if( this.mapSize.X < 0 ) this.mapSize.X = 0;
|
||||||
|
if( this.mapSize.Y < 0 ) this.mapSize.Y = 0;
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
cursorRenderer = new SpriteRenderer(renderer, true);
|
cursorRenderer = new SpriteRenderer(renderer, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace OpenRa.Game
|
|||||||
public IEnumerable<Order> Order(int2 xy)
|
public IEnumerable<Order> Order(int2 xy)
|
||||||
{
|
{
|
||||||
// todo: check that space is free
|
// todo: check that space is free
|
||||||
if (Footprint.Tiles(Name, xy).Any(t => !Game.IsCellBuildable(t, UnitMovementType.Wheel)))
|
if (Footprint.Tiles(Rules.UnitInfo[Name], xy).Any(t => !Game.IsCellBuildable(t, UnitMovementType.Wheel)))
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
yield return new PlaceBuildingOrder(this, xy);
|
yield return new PlaceBuildingOrder(this, xy);
|
||||||
|
|||||||
@@ -10,41 +10,34 @@ namespace OpenRa.Game
|
|||||||
PlaceBuilding building;
|
PlaceBuilding building;
|
||||||
int2 xy;
|
int2 xy;
|
||||||
|
|
||||||
public PlaceBuildingOrder(PlaceBuilding building, int2 xy)
|
public PlaceBuildingOrder( PlaceBuilding building, int2 xy )
|
||||||
{
|
{
|
||||||
this.building = building;
|
this.building = building;
|
||||||
this.xy = xy;
|
this.xy = xy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(bool leftMouseButton)
|
public override void Apply( bool leftMouseButton )
|
||||||
{
|
{
|
||||||
if (leftMouseButton)
|
if( leftMouseButton )
|
||||||
{
|
{
|
||||||
Game.world.AddFrameEndTask(_ =>
|
Game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
Log.Write("Player \"{0}\" builds {1}", building.Owner.PlayerName, building.Name);
|
Log.Write( "Player \"{0}\" builds {1}", building.Owner.PlayerName, building.Name );
|
||||||
|
|
||||||
//Adjust placement for cursor to be in middle
|
//Adjust placement for cursor to be in middle
|
||||||
var footprint = Rules.Footprint.GetFootprint(building.Name);
|
Game.world.Add( new Actor( building.Name, xy - GameRules.Footprint.AdjustForBuildingSize( building.Name ), building.Owner ) );
|
||||||
int maxWidth = 0;
|
|
||||||
foreach (var row in footprint)
|
|
||||||
if (row.Length > maxWidth)
|
|
||||||
maxWidth = row.Length;
|
|
||||||
|
|
||||||
Game.world.Add(new Actor(building.Name,
|
|
||||||
xy - new int2(maxWidth / 2, footprint.Length / 2), building.Owner));
|
|
||||||
|
|
||||||
Game.controller.orderGenerator = null;
|
Game.controller.orderGenerator = null;
|
||||||
Game.worldRenderer.uiOverlay.KillOverlay();
|
Game.worldRenderer.uiOverlay.KillOverlay();
|
||||||
});
|
} );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Game.world.AddFrameEndTask(_ =>
|
Game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
Game.controller.orderGenerator = null;
|
Game.controller.orderGenerator = null;
|
||||||
Game.worldRenderer.uiOverlay.KillOverlay();
|
Game.worldRenderer.uiOverlay.KillOverlay();
|
||||||
});
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,176 +1,176 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using OpenRa.FileFormats;
|
using OpenRa.FileFormats;
|
||||||
using OpenRa.Game.Graphics;
|
using OpenRa.Game.Graphics;
|
||||||
using OpenRa.TechTree;
|
using OpenRa.TechTree;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
using GRegion = OpenRa.Game.Graphics.Region;
|
using GRegion = OpenRa.Game.Graphics.Region;
|
||||||
|
|
||||||
class Sidebar
|
class Sidebar
|
||||||
{
|
{
|
||||||
TechTree.TechTree techTree;
|
TechTree.TechTree techTree;
|
||||||
|
|
||||||
SpriteRenderer spriteRenderer, clockRenderer;
|
SpriteRenderer spriteRenderer, clockRenderer;
|
||||||
Sprite blank;
|
Sprite blank;
|
||||||
readonly GRegion region;
|
readonly GRegion region;
|
||||||
|
|
||||||
public GRegion Region { get { return region; } }
|
public GRegion Region { get { return region; } }
|
||||||
public float Width { get { return spriteWidth * 2; } }
|
public float Width { get { return spriteWidth * 2; } }
|
||||||
|
|
||||||
Dictionary<string, Sprite> sprites = new Dictionary<string,Sprite>();
|
Dictionary<string, Sprite> sprites = new Dictionary<string,Sprite>();
|
||||||
const int spriteWidth = 64, spriteHeight = 48;
|
const int spriteWidth = 64, spriteHeight = 48;
|
||||||
|
|
||||||
static string[] groups = new string[] { "building", "vehicle", "boat", "infantry", "plane" };
|
static string[] groups = new string[] { "building", "vehicle", "boat", "infantry", "plane" };
|
||||||
|
|
||||||
Dictionary<string, string> itemGroups = new Dictionary<string,string>(); //item->group
|
Dictionary<string, string> itemGroups = new Dictionary<string,string>(); //item->group
|
||||||
Dictionary<string, Animation> clockAnimations = new Dictionary<string,Animation>(); //group->clockAnimation
|
Dictionary<string, Animation> clockAnimations = new Dictionary<string,Animation>(); //group->clockAnimation
|
||||||
Dictionary<string, SidebarItem> selectedItems = new Dictionary<string,SidebarItem>(); //group->selectedItem
|
Dictionary<string, SidebarItem> selectedItems = new Dictionary<string,SidebarItem>(); //group->selectedItem
|
||||||
|
|
||||||
List<SidebarItem> items = new List<SidebarItem>();
|
List<SidebarItem> items = new List<SidebarItem>();
|
||||||
|
|
||||||
public Sidebar( Renderer renderer )
|
public Sidebar( Renderer renderer )
|
||||||
{
|
{
|
||||||
this.techTree = Game.LocalPlayer.TechTree;
|
this.techTree = Game.LocalPlayer.TechTree;
|
||||||
this.techTree.BuildableItemsChanged += PopulateItemList;
|
this.techTree.BuildableItemsChanged += PopulateItemList;
|
||||||
region = GRegion.Create(Game.viewport, DockStyle.Right, 128, Paint, MouseHandler);
|
region = GRegion.Create(Game.viewport, DockStyle.Right, 128, Paint, MouseHandler);
|
||||||
Game.viewport.AddRegion( region );
|
Game.viewport.AddRegion( region );
|
||||||
spriteRenderer = new SpriteRenderer(renderer, false);
|
spriteRenderer = new SpriteRenderer(renderer, false);
|
||||||
clockRenderer = new SpriteRenderer(renderer, true);
|
clockRenderer = new SpriteRenderer(renderer, true);
|
||||||
|
|
||||||
LoadSprites( "BuildingTypes", "building" );
|
LoadSprites( "BuildingTypes", "building" );
|
||||||
LoadSprites( "VehicleTypes", "vehicle" );
|
LoadSprites( "VehicleTypes", "vehicle" );
|
||||||
LoadSprites( "InfantryTypes", "infantry" );
|
LoadSprites( "InfantryTypes", "infantry" );
|
||||||
LoadSprites( "ShipTypes", "boat" );
|
LoadSprites( "ShipTypes", "boat" );
|
||||||
LoadSprites( "PlaneTypes", "plane" );
|
LoadSprites( "PlaneTypes", "plane" );
|
||||||
|
|
||||||
foreach (string s in groups)
|
foreach (string s in groups)
|
||||||
{
|
{
|
||||||
clockAnimations.Add(s, new Animation("clock"));
|
clockAnimations.Add(s, new Animation("clock"));
|
||||||
clockAnimations[s].PlayRepeating("idle");
|
clockAnimations[s].PlayRepeating("idle");
|
||||||
selectedItems.Add(s, null);
|
selectedItems.Add(s, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
blank = SheetBuilder.Add(new Size((int)spriteWidth, (int)spriteHeight), 16);
|
blank = SheetBuilder.Add(new Size((int)spriteWidth, (int)spriteHeight), 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Build(SidebarItem item)
|
public void Build(SidebarItem item)
|
||||||
{
|
{
|
||||||
if (item != null)
|
if (item != null)
|
||||||
Game.controller.orderGenerator = new PlaceBuilding(Game.LocalPlayer,
|
Game.controller.orderGenerator = new PlaceBuilding(Game.LocalPlayer,
|
||||||
item.techTreeItem.tag.ToLowerInvariant());
|
item.techTreeItem.tag.ToLowerInvariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadSprites( string category, string group )
|
void LoadSprites( string category, string group )
|
||||||
{
|
{
|
||||||
foreach( var u in Rules.AllRules.GetSection( category ) )
|
foreach( var u in Rules.AllRules.GetSection( category ) )
|
||||||
{
|
{
|
||||||
var unit = Rules.UnitInfo[ u.Key ];
|
var unit = Rules.UnitInfo[ u.Key ];
|
||||||
|
|
||||||
if( unit.TechLevel != -1 )
|
if( unit.TechLevel != -1 )
|
||||||
sprites.Add( unit.Name, SpriteSheetBuilder.LoadSprite( unit.Name + "icon", ".shp" ) );
|
sprites.Add( unit.Name, SpriteSheetBuilder.LoadSprite( unit.Name + "icon", ".shp" ) );
|
||||||
itemGroups.Add( unit.Name, group );
|
itemGroups.Add( unit.Name, group );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawSprite(Sprite s, ref float2 p)
|
void DrawSprite(Sprite s, ref float2 p)
|
||||||
{
|
{
|
||||||
spriteRenderer.DrawSprite(s, p, 0);
|
spriteRenderer.DrawSprite(s, p, 0);
|
||||||
p.Y += spriteHeight;
|
p.Y += spriteHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fill(float height, float2 p)
|
void Fill(float height, float2 p)
|
||||||
{
|
{
|
||||||
while (p.Y < height)
|
while (p.Y < height)
|
||||||
DrawSprite(blank, ref p);
|
DrawSprite(blank, ref p);
|
||||||
}
|
}
|
||||||
|
|
||||||
int buildPos = 0;
|
int buildPos = 0;
|
||||||
int unitPos = 0;
|
int unitPos = 0;
|
||||||
|
|
||||||
void PopulateItemList()
|
void PopulateItemList()
|
||||||
{
|
{
|
||||||
buildPos = 0; unitPos = 0;
|
buildPos = 0; unitPos = 0;
|
||||||
|
|
||||||
items.Clear();
|
items.Clear();
|
||||||
|
|
||||||
foreach (Item i in techTree.BuildableItems)
|
foreach (Item i in techTree.BuildableItems)
|
||||||
{
|
{
|
||||||
Sprite sprite;
|
Sprite sprite;
|
||||||
if (!sprites.TryGetValue(i.tag, out sprite)) continue;
|
if (!sprites.TryGetValue(i.tag, out sprite)) continue;
|
||||||
|
|
||||||
items.Add(new SidebarItem(sprite, i, i.IsStructure ? buildPos : unitPos));
|
items.Add(new SidebarItem(sprite, i, i.IsStructure ? buildPos : unitPos));
|
||||||
|
|
||||||
if (i.IsStructure)
|
if (i.IsStructure)
|
||||||
buildPos += spriteHeight;
|
buildPos += spriteHeight;
|
||||||
else
|
else
|
||||||
unitPos += spriteHeight;
|
unitPos += spriteHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (string g in groups) selectedItems[g] = null;
|
foreach (string g in groups) selectedItems[g] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Paint()
|
void Paint()
|
||||||
{
|
{
|
||||||
foreach (SidebarItem i in items)
|
foreach (SidebarItem i in items)
|
||||||
i.Paint(spriteRenderer, region.Location);
|
i.Paint(spriteRenderer, region.Location);
|
||||||
|
|
||||||
Fill(region.Size.Y + region.Location.Y, new float2(region.Location.X, buildPos + region.Location.Y));
|
Fill(region.Size.Y + region.Location.Y, new float2(region.Location.X, buildPos + region.Location.Y));
|
||||||
Fill(region.Size.Y + region.Location.Y, new float2(region.Location.X + spriteWidth, unitPos + region.Location.Y));
|
Fill(region.Size.Y + region.Location.Y, new float2(region.Location.X + spriteWidth, unitPos + region.Location.Y));
|
||||||
|
|
||||||
spriteRenderer.Flush();
|
spriteRenderer.Flush();
|
||||||
|
|
||||||
foreach (var kvp in selectedItems)
|
foreach (var kvp in selectedItems)
|
||||||
{
|
{
|
||||||
if (kvp.Value != null)
|
if (kvp.Value != null)
|
||||||
{
|
{
|
||||||
clockRenderer.DrawSprite(clockAnimations[kvp.Key].Image, region.Location.ToFloat2() + kvp.Value.location, 0);
|
clockRenderer.DrawSprite(clockAnimations[kvp.Key].Image, region.Location.ToFloat2() + kvp.Value.location, 0);
|
||||||
clockAnimations[kvp.Key].Tick(1);
|
clockAnimations[kvp.Key].Tick(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clockRenderer.Flush();
|
clockRenderer.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SidebarItem GetItem(float2 point)
|
public SidebarItem GetItem(float2 point)
|
||||||
{
|
{
|
||||||
foreach (SidebarItem i in items)
|
foreach (SidebarItem i in items)
|
||||||
if (i.Clicked(point))
|
if (i.Clicked(point))
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseHandler(MouseInput mi)
|
void MouseHandler(MouseInput mi)
|
||||||
{
|
{
|
||||||
if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Down)
|
if (mi.Button == MouseButtons.Left && mi.Event == MouseInputEvent.Down)
|
||||||
{
|
{
|
||||||
var point = mi.Location.ToFloat2();
|
var point = mi.Location.ToFloat2();
|
||||||
var item = GetItem(point);
|
var item = GetItem(point);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
string group = itemGroups[item.techTreeItem.tag];
|
string group = itemGroups[item.techTreeItem.tag];
|
||||||
if (selectedItems[group] == null)
|
if (selectedItems[group] == null)
|
||||||
{
|
{
|
||||||
selectedItems[group] = item;
|
selectedItems[group] = item;
|
||||||
Build(item);
|
Build(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( mi.Button == MouseButtons.Right && mi.Event == MouseInputEvent.Down )
|
else if( mi.Button == MouseButtons.Right && mi.Event == MouseInputEvent.Down )
|
||||||
{
|
{
|
||||||
var point = mi.Location.ToFloat2();
|
var point = mi.Location.ToFloat2();
|
||||||
var item = GetItem(point);
|
var item = GetItem(point);
|
||||||
if( item != null )
|
if( item != null )
|
||||||
{
|
{
|
||||||
string group = itemGroups[ item.techTreeItem.tag ];
|
string group = itemGroups[ item.techTreeItem.tag ];
|
||||||
selectedItems[ group ] = null;
|
selectedItems[ group ] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,13 @@ namespace OpenRa.Game.Traits
|
|||||||
anim.PlayThen("make", () => anim.PlayRepeating("idle"));
|
anim.PlayThen("make", () => anim.PlayRepeating("idle"));
|
||||||
|
|
||||||
// at this point, we already know where we are, so we can safely place the bib in the smudge
|
// at this point, we already know where we are, so we can safely place the bib in the smudge
|
||||||
if (((UnitInfo.BuildingInfo)self.unitInfo).Bib)
|
var buildingInfo = (UnitInfo.BuildingInfo)self.unitInfo;
|
||||||
|
if (buildingInfo.Bib)
|
||||||
{
|
{
|
||||||
var fp = Rules.Footprint.GetFootprint(self.unitInfo.Name);
|
var size = buildingInfo.Dimensions.X;
|
||||||
var bibOffset = fp.Length - 2;
|
var bibOffset = buildingInfo.Dimensions.Y - 1;
|
||||||
var size = fp.First().Length;
|
|
||||||
var startIndex = (size == 2) ? SmallBibStart : LargeBibStart;
|
var startIndex = (size == 2) ? SmallBibStart : LargeBibStart;
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < 2 * size; i++)
|
for (int i = 0; i < 2 * size; i++)
|
||||||
{
|
{
|
||||||
var p = self.Location + Game.map.Offset + new int2(i % size, i / size + bibOffset);
|
var p = self.Location + Game.map.Offset + new int2(i % size, i / size + bibOffset);
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using OpenRa.Game.Graphics;
|
using OpenRa.Game.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using OpenRa.Game.GameRules;
|
using OpenRa.Game.GameRules;
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
class UiOverlay
|
class UiOverlay
|
||||||
{
|
{
|
||||||
SpriteRenderer spriteRenderer;
|
SpriteRenderer spriteRenderer;
|
||||||
Sprite buildOk;
|
Sprite buildOk;
|
||||||
Sprite buildBlocked;
|
Sprite buildBlocked;
|
||||||
|
|
||||||
public UiOverlay(SpriteRenderer spriteRenderer)
|
public UiOverlay(SpriteRenderer spriteRenderer)
|
||||||
{
|
{
|
||||||
this.spriteRenderer = spriteRenderer;
|
this.spriteRenderer = spriteRenderer;
|
||||||
|
|
||||||
buildOk = SynthesizeTile(0x80);
|
buildOk = SynthesizeTile(0x80);
|
||||||
buildBlocked = SynthesizeTile(0xe6);
|
buildBlocked = SynthesizeTile(0xe6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Sprite SynthesizeTile(byte paletteIndex)
|
static Sprite SynthesizeTile(byte paletteIndex)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[Game.CellSize * Game.CellSize];
|
byte[] data = new byte[Game.CellSize * Game.CellSize];
|
||||||
|
|
||||||
for (int i = 0; i < Game.CellSize; i++)
|
for (int i = 0; i < Game.CellSize; i++)
|
||||||
for (int j = 0; j < Game.CellSize; j++)
|
for (int j = 0; j < Game.CellSize; j++)
|
||||||
data[i * Game.CellSize + j] = ((i + j) % 4 < 2) ? (byte)0 : paletteIndex;
|
data[i * Game.CellSize + j] = ((i + j) % 4 < 2) ? (byte)0 : paletteIndex;
|
||||||
|
|
||||||
return SheetBuilder.Add( data, new Size(Game.CellSize,Game.CellSize) );
|
return SheetBuilder.Add( data, new Size(Game.CellSize,Game.CellSize) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
if (!hasOverlay)
|
if (!hasOverlay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var t in Footprint.Tiles(name,position))
|
foreach( var t in Footprint.Tiles( Rules.UnitInfo[ name ], position ) )
|
||||||
spriteRenderer.DrawSprite(Game.IsCellBuildable(t, UnitMovementType.Wheel)
|
spriteRenderer.DrawSprite( Game.IsCellBuildable( t, UnitMovementType.Wheel )
|
||||||
? buildOk : buildBlocked, Game.CellSize * t, 0);
|
? buildOk : buildBlocked, Game.CellSize * t, 0 );
|
||||||
|
|
||||||
spriteRenderer.Flush();
|
spriteRenderer.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasOverlay;
|
bool hasOverlay;
|
||||||
int2 position;
|
int2 position;
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
public void KillOverlay()
|
public void KillOverlay()
|
||||||
{
|
{
|
||||||
hasOverlay = false;
|
hasOverlay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCurrentOverlay(int2 cell, string name)
|
public void SetCurrentOverlay(int2 cell, string name)
|
||||||
{
|
{
|
||||||
hasOverlay = true;
|
hasOverlay = true;
|
||||||
position = cell;
|
position = cell;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,178 @@
|
|||||||
[BuildingTypes]
|
[BuildingTypes]
|
||||||
FCOM
|
FCOM
|
||||||
|
V01
|
||||||
|
V02
|
||||||
|
V03
|
||||||
|
V04
|
||||||
|
V05
|
||||||
|
V06
|
||||||
|
V07
|
||||||
|
V08
|
||||||
|
V09
|
||||||
|
V10
|
||||||
|
V11
|
||||||
|
V12
|
||||||
|
V13
|
||||||
|
V14
|
||||||
|
V15
|
||||||
|
V16
|
||||||
|
V17
|
||||||
|
V18
|
||||||
|
V19
|
||||||
|
V20
|
||||||
|
V21
|
||||||
|
V22
|
||||||
|
V23
|
||||||
|
V24
|
||||||
|
V25
|
||||||
|
V26
|
||||||
|
V27
|
||||||
|
V28
|
||||||
|
V29
|
||||||
|
V30
|
||||||
|
V31
|
||||||
|
V32
|
||||||
|
V33
|
||||||
|
V34
|
||||||
|
V35
|
||||||
|
V36
|
||||||
|
V37
|
||||||
|
BARL
|
||||||
|
BRL3
|
||||||
|
MISS
|
||||||
|
|
||||||
[FCOM]
|
[FCOM]
|
||||||
Description=Forward Command Post
|
Description=Forward Command Post
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
|
|
||||||
|
[V01]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V02]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V03]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V04]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V05]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V06]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V07]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V08]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V09]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V10]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V11]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V12]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V13]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V14]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V15]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V16]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V17]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V18]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V19]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V20]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V21]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V22]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V23]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V24]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V25]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V26]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V27]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V28]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V29]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V30]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V31]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V32]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V33]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V34]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V35]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V36]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[V37]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[BARL]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[BRL3]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
[MISS]
|
||||||
|
Traits=Building, RenderBuilding
|
||||||
|
Image=FCOM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[VehicleTypes]
|
||||||
|
TRUK
|
||||||
|
|
||||||
|
[TRUK]
|
||||||
|
Traits=Mobile, RenderUnit
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#
|
|
||||||
# Building footprints
|
|
||||||
#
|
|
||||||
|
|
||||||
# default is indicated by *
|
|
||||||
|
|
||||||
x : ftur sbag brik fenc gun pbox hbox silo gap kenn *
|
|
||||||
_ x : tsla agun
|
|
||||||
xx xx == : powr dome barr tent domf hpad atek
|
|
||||||
xxx xxx === : weap weaf stek
|
|
||||||
___ xxx xxx === : apwr
|
|
||||||
xxx xxx xxx === : fact facf
|
|
||||||
xxx xxx xxx : syrf syrd spen spef
|
|
||||||
xx : sam mslo
|
|
||||||
_x_ xxx x== === : proc
|
|
||||||
xxx xxx : afld
|
|
||||||
_x_ xxx _x_ : fix
|
|
||||||
xx xx : iron
|
|
||||||
80
rules.ini
80
rules.ini
@@ -1721,7 +1721,7 @@ Strength=1
|
|||||||
Points=1
|
Points=1
|
||||||
Armor=none
|
Armor=none
|
||||||
Cost=75
|
Cost=75
|
||||||
Repariable=false
|
Repairable=false
|
||||||
Adjacent=1
|
Adjacent=1
|
||||||
Sight=0
|
Sight=0
|
||||||
|
|
||||||
@@ -1731,7 +1731,7 @@ Strength=1
|
|||||||
Points=1
|
Points=1
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Cost=25
|
Cost=25
|
||||||
Repariable=false
|
Repairable=false
|
||||||
Adjacent=1
|
Adjacent=1
|
||||||
Sight=0
|
Sight=0
|
||||||
|
|
||||||
@@ -1739,7 +1739,7 @@ Sight=0
|
|||||||
[WOOD]
|
[WOOD]
|
||||||
Strength=1
|
Strength=1
|
||||||
Points=1
|
Points=1
|
||||||
Repariable=false
|
Repairable=false
|
||||||
Adjacent=1
|
Adjacent=1
|
||||||
Sight=0
|
Sight=0
|
||||||
|
|
||||||
@@ -1850,224 +1850,224 @@ BaseNormal=no
|
|||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
Capturable=true
|
Capturable=true
|
||||||
|
|
||||||
[V02]
|
[V02]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V03]
|
[V03]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V04]
|
[V04]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V05]
|
[V05]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V06]
|
[V06]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V07]
|
[V07]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V08]
|
[V08]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V09]
|
[V09]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V10]
|
[V10]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V11]
|
[V11]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V12]
|
[V12]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V13]
|
[V13]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V14]
|
[V14]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V15]
|
[V15]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V16]
|
[V16]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V17]
|
[V17]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V18]
|
[V18]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V19]
|
[V19]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V20]
|
[V20]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V21]
|
[V21]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V22]
|
[V22]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V23]
|
[V23]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V24]
|
[V24]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V25]
|
[V25]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V26]
|
[V26]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V27]
|
[V27]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V28]
|
[V28]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V29]
|
[V29]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V30]
|
[V30]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V31]
|
[V31]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V32]
|
[V32]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V33]
|
[V33]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V34]
|
[V34]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V35]
|
[V35]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V36]
|
[V36]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
[V37]
|
[V37]
|
||||||
Strength=400
|
Strength=400
|
||||||
Points=5
|
Points=5
|
||||||
Armor=wood
|
Armor=wood
|
||||||
Repariable=false
|
Repairable=false
|
||||||
|
|
||||||
|
|
||||||
; ******* Weapon Statistics *******
|
; ******* Weapon Statistics *******
|
||||||
|
|||||||
@@ -169,6 +169,13 @@
|
|||||||
<sequence name="make" start="0" length="*" src="gunmake" />
|
<sequence name="make" start="0" length="*" src="gunmake" />
|
||||||
</unit>
|
</unit>
|
||||||
|
|
||||||
|
<!-- AA gun -->
|
||||||
|
<unit name="agun">
|
||||||
|
<sequence name="idle" start="0" length="32"/>
|
||||||
|
<sequence name="damaged-idle" start="32" length="32"/>
|
||||||
|
<sequence name="make" start="0" length="*" src="agunmake" />
|
||||||
|
</unit>
|
||||||
|
|
||||||
<!-- sam site -->
|
<!-- sam site -->
|
||||||
<unit name="sam">
|
<unit name="sam">
|
||||||
<sequence name="idle" start="0" length="32"/>
|
<sequence name="idle" start="0" length="32"/>
|
||||||
@@ -204,6 +211,13 @@
|
|||||||
<sequence name="make" start="0" length="*" src="hboxmake" />
|
<sequence name="make" start="0" length="*" src="hboxmake" />
|
||||||
</unit>
|
</unit>
|
||||||
|
|
||||||
|
<!-- gap generator -->
|
||||||
|
<unit name="gap">
|
||||||
|
<sequence name="idle" start="0" length="32"/>
|
||||||
|
<sequence name="damaged-idle" start="32" length="32"/>
|
||||||
|
<sequence name="make" start="0" length="*" src="gapmake" />
|
||||||
|
</unit>
|
||||||
|
|
||||||
<!-- iron curtain -->
|
<!-- iron curtain -->
|
||||||
<unit name="iron">
|
<unit name="iron">
|
||||||
<sequence name="idle" start="0" length="11"/>
|
<sequence name="idle" start="0" length="11"/>
|
||||||
|
|||||||
83
units.ini
83
units.ini
@@ -18,16 +18,16 @@ Description=V2 Rocket
|
|||||||
Traits=Mobile, RenderUnit
|
Traits=Mobile, RenderUnit
|
||||||
[1TNK]
|
[1TNK]
|
||||||
Description=Light Tank
|
Description=Light Tank
|
||||||
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
||||||
[2TNK]
|
[2TNK]
|
||||||
Description=Medium Tank
|
Description=Medium Tank
|
||||||
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
||||||
[3TNK]
|
[3TNK]
|
||||||
Description=Heavy Tank
|
Description=Heavy Tank
|
||||||
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
||||||
[4TNK]
|
[4TNK]
|
||||||
Description=Mammoth Tank
|
Description=Mammoth Tank
|
||||||
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
||||||
[MRJ]
|
[MRJ]
|
||||||
Description=Radar Jammer
|
Description=Radar Jammer
|
||||||
Traits=Mobile, Turreted, RenderUnitTurreted ; temporary. It's not a turret, it's a spinney-thing
|
Traits=Mobile, Turreted, RenderUnitTurreted ; temporary. It's not a turret, it's a spinney-thing
|
||||||
@@ -45,7 +45,7 @@ Description=Mobile Construction Vehicle
|
|||||||
Traits=Mobile, McvDeploy, RenderUnit
|
Traits=Mobile, McvDeploy, RenderUnit
|
||||||
[JEEP]
|
[JEEP]
|
||||||
Description=Ranger
|
Description=Ranger
|
||||||
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted
|
||||||
[APC]
|
[APC]
|
||||||
Description=Armored Personnel Carrier
|
Description=Armored Personnel Carrier
|
||||||
Traits=Mobile, RenderUnit
|
Traits=Mobile, RenderUnit
|
||||||
@@ -143,105 +143,178 @@ SPEF
|
|||||||
DOMF
|
DOMF
|
||||||
; TODO? : campaign-specific stuff - FCOM, civilian buildings, etc
|
; TODO? : campaign-specific stuff - FCOM, civilian buildings, etc
|
||||||
|
|
||||||
|
|
||||||
|
; `Dimensions` is the size of a box that will include the whole building, excluding bib.
|
||||||
|
; ("bib-ness" can be altered in rules.ini; we can't expect people to change this, too)
|
||||||
|
; `Footprint` is the pathability and buildability of each cell occupied by the building
|
||||||
|
; _ : Not occupied by the building (e.g: the holes in the refinery and the service depot)
|
||||||
|
; x : Solid. cannot be walked on or built on.
|
||||||
|
; = : Occupied by a building, but can be walked on normally. (e.g: the drop-off point on the refinery)
|
||||||
[IRON]
|
[IRON]
|
||||||
Description=Iron Curtain
|
Description=Iron Curtain
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[ATEK]
|
[ATEK]
|
||||||
Description=Allied Tech Center
|
Description=Allied Tech Center
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[PDOX]
|
[PDOX]
|
||||||
Description=Chronosphere
|
Description=Chronosphere
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,1
|
||||||
|
Footprint=xx
|
||||||
[WEAP]
|
[WEAP]
|
||||||
Description=War Factory
|
Description=War Factory
|
||||||
Traits=Building, RenderWarFactory
|
Traits=Building, RenderWarFactory
|
||||||
|
Dimensions=3,2
|
||||||
|
Footprint=xxx xxx
|
||||||
[SYRD]
|
[SYRD]
|
||||||
Description=Shipyard
|
Description=Shipyard
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[SPEN]
|
[SPEN]
|
||||||
Description=Sub Pen
|
Description=Sub Pen
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[PBOX]
|
[PBOX]
|
||||||
Description=Pillbox
|
Description=Pillbox
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[HBOX]
|
[HBOX]
|
||||||
Description=Camo Pillbox
|
Description=Camo Pillbox
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[TSLA]
|
[TSLA]
|
||||||
Description=Tesla Coil
|
Description=Tesla Coil
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,2
|
||||||
|
Footprint=_ x
|
||||||
[GUN]
|
[GUN]
|
||||||
Description=Turret
|
Description=Turret
|
||||||
Traits=Building, Turreted, RenderBuildingTurreted
|
Traits=Building, Turreted, RenderBuildingTurreted
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[AGUN]
|
[AGUN]
|
||||||
Description=AA Gun
|
Description=AA Gun
|
||||||
Traits=Building, Turreted, RenderBuildingTurreted
|
Traits=Building, Turreted, RenderBuildingTurreted
|
||||||
|
Dimensions=1,2
|
||||||
|
Footprint=_ x
|
||||||
[FTUR]
|
[FTUR]
|
||||||
Description=Flame Turret
|
Description=Flame Turret
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[FACT]
|
[FACT]
|
||||||
Description=Construction Yard
|
Description=Construction Yard
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[PROC]
|
[PROC]
|
||||||
Description=Ore Refinery
|
Description=Ore Refinery
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=_x_ xxx x==
|
||||||
[SILO]
|
[SILO]
|
||||||
Description=Silo
|
Description=Silo
|
||||||
Traits=Building, RenderBuildingOre
|
Traits=Building, RenderBuildingOre
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[HPAD]
|
[HPAD]
|
||||||
Description=Helipad
|
Description=Helipad
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[DOME]
|
[DOME]
|
||||||
Description=Radar Dome
|
Description=Radar Dome
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[GAP]
|
[GAP]
|
||||||
Description=Gap Generator
|
Description=Gap Generator
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,2
|
||||||
|
Footprint=_ x
|
||||||
[SAM]
|
[SAM]
|
||||||
Description=SAM Site
|
Description=SAM Site
|
||||||
Traits=Building, Turreted, RenderBuildingTurreted
|
Traits=Building, Turreted, RenderBuildingTurreted
|
||||||
|
Dimensions=2,1
|
||||||
|
Footprint=xx
|
||||||
[MSLO]
|
[MSLO]
|
||||||
Description=Missile Silo
|
Description=Missile Silo
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,1
|
||||||
|
Footprint=xx
|
||||||
[AFLD]
|
[AFLD]
|
||||||
Description=Airstrip
|
Description=Airstrip
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,2
|
||||||
|
Footprint=xxx xxx
|
||||||
[POWR]
|
[POWR]
|
||||||
Description=Power Plant
|
Description=Power Plant
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[APWR]
|
[APWR]
|
||||||
Description=Advanced Power Plant
|
Description=Advanced Power Plant
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=___ xxx xxx
|
||||||
[STEK]
|
[STEK]
|
||||||
Description=Soviet Tech Center
|
Description=Soviet Tech Center
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,2
|
||||||
|
Footprint=xxx xxx
|
||||||
[BARR]
|
[BARR]
|
||||||
Description=Soviet Barracks
|
Description=Soviet Barracks
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[TENT]
|
[TENT]
|
||||||
Description=Allied Barracks
|
Description=Allied Barracks
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
[KENN]
|
[KENN]
|
||||||
Description=Kennel
|
Description=Kennel
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=1,1
|
||||||
|
Footprint=x
|
||||||
[FIX]
|
[FIX]
|
||||||
Description=Service Depot
|
Description=Service Depot
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=_x_ xxx _x_
|
||||||
[FACF]
|
[FACF]
|
||||||
Description=Fake Construction Yard
|
Description=Fake Construction Yard
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[WEAF]
|
[WEAF]
|
||||||
Description=Fake War Factory
|
Description=Fake War Factory
|
||||||
Traits=Building, RenderWarFactory
|
Traits=Building, RenderWarFactory
|
||||||
|
Dimensions=3,2
|
||||||
|
Footprint=xxx xxx
|
||||||
[SYRF]
|
[SYRF]
|
||||||
Description=Fake Shipyard
|
Description=Fake Shipyard
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[SPEF]
|
[SPEF]
|
||||||
Description=Fake Sub Pen
|
Description=Fake Sub Pen
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=3,3
|
||||||
|
Footprint=xxx xxx xxx
|
||||||
[DOMF]
|
[DOMF]
|
||||||
Description=Fake Radar Dome
|
Description=Fake Radar Dome
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
|
Dimensions=2,2
|
||||||
|
Footprint=xx xx
|
||||||
;[SBAG]
|
;[SBAG]
|
||||||
;Description=Sandbags
|
;Description=Sandbags
|
||||||
;[BRIK]
|
;[BRIK]
|
||||||
|
|||||||
Reference in New Issue
Block a user