Add ore capping to MissionUtils. Add world.CreateActor extension in MissionUtils.

This commit is contained in:
Scott_NZ
2013-02-04 21:38:44 +13:00
parent 9013e8376c
commit 3c5967a623
3 changed files with 21 additions and 28 deletions

View File

@@ -167,7 +167,7 @@ namespace OpenRA.Mods.RA.Missions
foreach (var patrol in patrols)
patrol.DoPatrol();
ManageSovietOre();
MissionUtils.CapOre(soviets);
BaseGuardTick();
@@ -218,13 +218,6 @@ namespace OpenRA.Mods.RA.Missions
MissionFailed("The Soviet research laboratory was not secured in time.");
}
void ManageSovietOre()
{
var res = soviets.PlayerActor.Trait<PlayerResources>();
if (res.Ore > res.OreCapacity * 0.8)
res.TakeOre(res.OreCapacity / 10);
}
void BaseGuardTick()
{
if (baseGuardTicks <= 0 || baseGuard.IsDead() || !baseGuard.IsInWorld) return;