add infiltrate for exploration(reset) ability

This commit is contained in:
Chris Forbes
2012-04-06 17:44:40 +12:00
parent 4a76e2ad33
commit b081103866
3 changed files with 36 additions and 6 deletions

View File

@@ -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<InfiltrateForExploration> {}
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();
}
}
}

View File

@@ -38,13 +38,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq">
</Reference>
<Reference Include="System.Data.DataSetExtensions">
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="ICSharpCode.SharpZipLib">
@@ -361,6 +358,7 @@
<Compile Include="World\PlayMusicOnMapLoad.cs" />
<Compile Include="World\SmudgeLayer.cs" />
<Compile Include="Player\BaseAttackNotifier.cs" />
<Compile Include="InfiltrateForExploration.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -356,6 +356,7 @@ DOME:
Bib:
ProvidesRadar:
IronCurtainable:
InfiltrateForExploration:
PBOX:
Inherits: ^Building