Added debug cheat button to grow map resources.

This commit is contained in:
Pizzaoverhead
2014-02-15 17:30:36 +00:00
parent c3b5495177
commit e0b40e2088
10 changed files with 74 additions and 38 deletions

View File

@@ -13,6 +13,7 @@ namespace OpenRA.Traits
public class DeveloperModeInfo : ITraitInfo
{
public int Cash = 20000;
public int ResourceGrowth = 100;
public bool FastBuild = false;
public bool FastCharge = false;
public bool DisableShroud = false;
@@ -79,6 +80,15 @@ namespace OpenRA.Traits
self.Trait<PlayerResources>().GiveCash(Info.Cash);
break;
}
case "DevGrowResources":
{
foreach (var a in self.World.ActorsWithTrait<ISeedableResource>())
{
for (var i = 0; i < Info.ResourceGrowth; i++)
a.Trait.Seed(a.Actor);
}
break;
}
case "DevShroudDisable":
{
DisableShroud ^= true;

View File

@@ -75,6 +75,7 @@ namespace OpenRA.Traits
public interface INotifyOwnerChanged { void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner); }
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
public interface INotifyHarvest { void Harvested(Actor self, ResourceType resource); }
public interface ISeedableResource { void Seed(Actor self); }
public interface IAcceptInfiltrator { void OnInfiltrate(Actor self, Actor infiltrator); }
public interface IDemolishable