Some parts of some buildings are pathable.
- not handling WEAP/FIX yet; that's special-case logic.
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.Tiles(a.unitInfo.Name, a.Location))
|
foreach (var t in Footprint.UnpathableTiles(a.unitInfo.Name, 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.Tiles(a.unitInfo.Name, a.Location))
|
foreach (var t in Footprint.UnpathableTiles(a.unitInfo.Name, a.Location))
|
||||||
if (IsValid(t))
|
if (IsValid(t))
|
||||||
influence[t.X, t.Y] = null;
|
influence[t.X, t.Y] = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,23 @@ namespace OpenRa.Game.GameRules
|
|||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<int2> UnpathableTiles( string name, int2 position )
|
||||||
|
{
|
||||||
|
var footprint = Rules.Footprint.GetFootprint( name );
|
||||||
|
var j = 0;
|
||||||
|
|
||||||
|
foreach( var row in footprint )
|
||||||
|
{
|
||||||
|
var i = 0;
|
||||||
|
foreach( var c in row )
|
||||||
|
{
|
||||||
|
if( c == 'x' )
|
||||||
|
yield return position + new int2( i, j );
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@
|
|||||||
|
|
||||||
x : ftur sbag brik fenc gun pbox hbox silo gap kenn *
|
x : ftur sbag brik fenc gun pbox hbox silo gap kenn *
|
||||||
_ x : tsla agun
|
_ x : tsla agun
|
||||||
xx xx xx : powr dome barr tent domf hpad atek
|
xx xx == : powr dome barr tent domf hpad atek
|
||||||
xxx xxx xxx : fact facf syrf syrd weap weaf spen spef apwr stek
|
xxx xxx === : fact facf weap weaf apwr stek
|
||||||
|
xxx xxx xxx : syrf syrd spen spef
|
||||||
xx : sam mslo
|
xx : sam mslo
|
||||||
_x_ xxx xxx xxx : proc
|
_x_ xxx x== === : proc
|
||||||
xxx xxx : afld
|
xxx xxx : afld
|
||||||
_x_ xxx _x_ : fix
|
_x_ xxx _x_ : fix
|
||||||
__ xx : iron
|
xx xx : iron
|
||||||
|
|||||||
Reference in New Issue
Block a user