Refactored ticks to delay per issue #9810

This commit is contained in:
Jonathan Ling
2016-02-06 23:18:08 -05:00
committed by colonelpopcorn
parent 689f05c3ca
commit 2d4c3f715f
11 changed files with 58 additions and 31 deletions

View File

@@ -22,8 +22,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Allows King of the Hill (KotH) style gameplay.")]
public class StrategicVictoryConditionsInfo : ITraitInfo, Requires<MissionObjectivesInfo>
{
[Desc("Amount of time (in game ticks) that the player has to hold all the strategic points.", "Defaults to 5 minutes.")]
public readonly int TicksToHold = 25 * 60 * 5;
[Desc("Amount of time (in game ticks) that the player has to hold all the strategic points.", "Defaults to 7500 ticks (5 minutes at default speed).")]
public readonly int HoldDuration = 7500;
[Desc("Should the timer reset when the player loses hold of a strategic point.")]
public readonly bool ResetOnHoldLost = true;
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
public StrategicVictoryConditions(Actor self, StrategicVictoryConditionsInfo svcInfo)
{
info = svcInfo;
TicksLeft = info.TicksToHold;
TicksLeft = info.HoldDuration;
player = self.Owner;
mo = self.Trait<MissionObjectives>();
}
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits
}
else if (TicksLeft != 0)
if (info.ResetOnHoldLost)
TicksLeft = info.TicksToHold; // Reset the time hold
TicksLeft = info.HoldDuration; // Reset the time hold
}
}