@@ -24,6 +24,8 @@ namespace OpenRA.GameRules
|
||||
public readonly Dictionary<string, float> Versus;
|
||||
[Desc("Can this damage resource patches?")]
|
||||
public readonly bool DestroyResources = false;
|
||||
[Desc("Will this splatter resources and which?")]
|
||||
public readonly string AddsResourceType = null;
|
||||
[Desc("Explosion effect to use.")]
|
||||
public readonly string Explosion = null;
|
||||
[Desc("Palette to use for explosion effect.")]
|
||||
|
||||
@@ -153,6 +153,13 @@ namespace OpenRA.Traits
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanSpawnResourceAt(ResourceType newResourceType, CPos cell)
|
||||
{
|
||||
var currentResourceType = GetResource(cell);
|
||||
return currentResourceType == newResourceType
|
||||
|| (currentResourceType == null && AllowResourceAt(newResourceType, cell));
|
||||
}
|
||||
|
||||
CellContents CreateResourceCell(ResourceType t, CPos p)
|
||||
{
|
||||
world.Map.CustomTerrain[p.X, p.Y] = world.TileSet.GetTerrainIndex(t.Info.TerrainType);
|
||||
|
||||
Reference in New Issue
Block a user