Have the countdown timer flash in the last 10 seconds, and increase the money amount when reinforcements arrive

This commit is contained in:
Scott_NZ
2012-09-30 17:30:07 +13:00
parent 37479b3cfd
commit 762db8b304
2 changed files with 6 additions and 6 deletions

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA.Missions
const int ReinforcementsTicks = 1500 * 12; const int ReinforcementsTicks = 1500 * 12;
static readonly string[] Reinforcements = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "jeep", "e1", "e1", "e1", "e1", "e3", "e3", "mcv" }; static readonly string[] Reinforcements = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "jeep", "e1", "e1", "e1", "e1", "e3", "e3", "mcv" };
const int ReinforcementsCash = 2000; const int ReinforcementsCash = 5000;
const int ParatroopersTicks = 1500 * 8; const int ParatroopersTicks = 1500 * 8;
static readonly string[] Badger1Passengers = { "e1", "e1", "e1", "e2", "3tnk" }; static readonly string[] Badger1Passengers = { "e1", "e1", "e1", "e2", "3tnk" };

View File

@@ -68,13 +68,13 @@ namespace OpenRA.Mods.RA.Missions
public class CountdownTimerWidget : Widget public class CountdownTimerWidget : Widget
{ {
public CountdownTimer CountdownTimer { get; set; } public CountdownTimer Timer { get; set; }
public string Header { get; set; } public string Header { get; set; }
public float2 Position { get; set; } public float2 Position { get; set; }
public CountdownTimerWidget(CountdownTimer countdownTimer, string header, float2 position) public CountdownTimerWidget(CountdownTimer timer, string header, float2 position)
{ {
CountdownTimer = countdownTimer; Timer = timer;
Header = header; Header = header;
Position = position; Position = position;
} }
@@ -86,8 +86,8 @@ namespace OpenRA.Mods.RA.Missions
return; return;
} }
var font = Game.Renderer.Fonts["Bold"]; var font = Game.Renderer.Fonts["Bold"];
var text = "{0}: {1}".F(Header, WidgetUtils.FormatTime(CountdownTimer.TicksLeft)); var text = "{0}: {1}".F(Header, WidgetUtils.FormatTime(Timer.TicksLeft));
font.DrawTextWithContrast(text, Position, CountdownTimer.TicksLeft == 0 && Game.LocalTick % 60 >= 30 ? Color.Red : Color.White, Color.Black, 1); font.DrawTextWithContrast(text, Position, Timer.TicksLeft <= 25 * 10 && Game.LocalTick % 60 <= 30 ? Color.Red : Color.White, Color.Black, 1);
} }
} }
} }