Replace seconds by ticks

This commit is contained in:
abcdefg30
2015-08-16 22:40:25 +02:00
parent 7fd3ae7db9
commit 277f9acb89

View File

@@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Maximum number of crates.")]
public readonly int Maximum = 255;
[Desc("Average time (seconds) between crate spawn.")]
public readonly int SpawnInterval = 180;
[Desc("Average time (ticks) between crate spawn.")]
public readonly int SpawnInterval = 180 * 25;
[Desc("Delay (in seconds) before the first crate spawns.")]
public readonly int InitialSpawnDelay = 300;
[Desc("Delay (in ticks) before the first crate spawns.")]
public readonly int InitialSpawnDelay = 300 * 25;
[Desc("Which terrain types can we drop on?")]
public readonly HashSet<string> ValidGround = new HashSet<string> { "Clear", "Rough", "Road", "Ore", "Beach" };
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits
this.info = info;
this.self = self;
ticks = info.InitialSpawnDelay * 25;
ticks = info.InitialSpawnDelay;
}
public void Tick(Actor self)
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits
if (--ticks <= 0)
{
ticks = info.SpawnInterval * 25;
ticks = info.SpawnInterval;
var toSpawn = Math.Max(0, info.Minimum - crates)
+ (crates < info.Maximum ? 1 : 0);