From b332785d2eb92b01f279b25ceeabb02250807e46 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 8 Jan 2010 19:35:43 +1300 Subject: [PATCH] Initial GpsSatellite support --- OpenRa.Game/OpenRa.Game.csproj | 1 + OpenRa.Game/Shroud.cs | 14 ++++++++++++++ OpenRa.Game/Traits/GpsSatellite.cs | 22 ++++++++++++++++++++++ units.ini | 2 +- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 OpenRa.Game/Traits/GpsSatellite.cs diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index 80e5bc199f..c9317d181a 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -216,6 +216,7 @@ + diff --git a/OpenRa.Game/Shroud.cs b/OpenRa.Game/Shroud.cs index 56cc9efb59..400075390a 100644 --- a/OpenRa.Game/Shroud.cs +++ b/OpenRa.Game/Shroud.cs @@ -26,6 +26,20 @@ namespace OpenRa.Game dirty = true; } + + public void RevealAll() + { + for (int x = 0; x < 128; x++) + for (int y = 0; y < 128; y++) + explored[x, y] = true; + } + + public void HideAll() + { + for (int x = 0; x < 128; x++) + for (int y = 0; y < 128; y++) + explored[x, y] = false; + } Sprite ChooseShroud(int i, int j) { diff --git a/OpenRa.Game/Traits/GpsSatellite.cs b/OpenRa.Game/Traits/GpsSatellite.cs new file mode 100644 index 0000000000..4cb62d968f --- /dev/null +++ b/OpenRa.Game/Traits/GpsSatellite.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OpenRa.Game.Traits +{ + class GpsSatellite + { + public GpsSatellite(Actor self) + { + // TODO: connect this to a special power that calls Activate(); + Activate(self); + } + + public void Activate(Actor self) + { + // TODO: Launch satellite + self.Owner.Shroud.RevealAll(); + } + } +} diff --git a/units.ini b/units.ini index 6ed539a5f0..3b156254a1 100644 --- a/units.ini +++ b/units.ini @@ -345,7 +345,7 @@ MINV ; `Produces` is a category of objects that this building can produce. [ATEK] Description=Allied Tech Center -Traits=Building, RenderBuilding, IronCurtainable +Traits=Building, RenderBuilding, IronCurtainable, GpsSatellite Dimensions=2,2 Footprint=xx xx SelectionPriority=3