From b0811038664cf0cdb15b3ca449059b74a808c85a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 6 Apr 2012 17:44:40 +1200 Subject: [PATCH] add infiltrate for exploration(reset) ability --- OpenRA.Mods.RA/InfiltrateForExploration.cs | 31 ++++++++++++++++++++++ OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 10 +++---- mods/ra/rules/structures.yaml | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 OpenRA.Mods.RA/InfiltrateForExploration.cs diff --git a/OpenRA.Mods.RA/InfiltrateForExploration.cs b/OpenRA.Mods.RA/InfiltrateForExploration.cs new file mode 100644 index 0000000000..bf153f6438 --- /dev/null +++ b/OpenRA.Mods.RA/InfiltrateForExploration.cs @@ -0,0 +1,31 @@ +#region Copyright & License Information +/* + * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System.Linq; +using OpenRA.Traits; +using OpenRA.FileFormats; + +namespace OpenRA.Mods.RA +{ + class InfiltrateForExplorationInfo : TraitInfo {} + + class InfiltrateForExploration : IAcceptSpy + { + public void OnInfiltrate(Actor self, Actor spy) + { + /* todo: changes for per-player shrouds: + * - apply this everywhere, not just on the victim's client + * - actually steal their exploration before resetting it + */ + if (self.World.LocalPlayer != null && self.World.LocalPlayer.Stances[self.Owner] == Stance.Ally) + self.Owner.Shroud.ResetExploration(); + } + } +} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 8cff11f2ac..98ed145ae1 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -38,13 +38,10 @@ - - + - - - - + + @@ -361,6 +358,7 @@ + diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index bf9ca0d575..b8d48c9acd 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -356,6 +356,7 @@ DOME: Bib: ProvidesRadar: IronCurtainable: + InfiltrateForExploration: PBOX: Inherits: ^Building