hide-map crate
This commit is contained in:
@@ -98,7 +98,12 @@ namespace OpenRA
|
|||||||
|
|
||||||
return IsExplored(x,y);
|
return IsExplored(x,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetExplored()
|
||||||
|
{
|
||||||
|
explored = new bool[map.MapSize, map.MapSize];
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle MakeRect(int2 center, int range)
|
Rectangle MakeRect(int2 center, int range)
|
||||||
{
|
{
|
||||||
return new Rectangle(center.X - range, center.Y - range, 2 * range + 1, 2 * range + 1);
|
return new Rectangle(center.X - range, center.Y - range, 2 * range + 1, 2 * range + 1);
|
||||||
|
|||||||
41
OpenRA.Mods.RA/Crates/ResetRadarCrateAction.cs
Normal file
41
OpenRA.Mods.RA/Crates/ResetRadarCrateAction.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
|
||||||
|
* This file is part of OpenRA.
|
||||||
|
*
|
||||||
|
* OpenRA is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* OpenRA is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.RA
|
||||||
|
{
|
||||||
|
class HideMapCrateActionInfo : CrateActionInfo
|
||||||
|
{
|
||||||
|
public override object Create(Actor self) { return new HideMapCrateAction(self, this); }
|
||||||
|
}
|
||||||
|
|
||||||
|
class HideMapCrateAction : CrateAction
|
||||||
|
{
|
||||||
|
public HideMapCrateAction(Actor self, HideMapCrateActionInfo info)
|
||||||
|
: base(self, info) {}
|
||||||
|
|
||||||
|
public override void Activate(Actor collector)
|
||||||
|
{
|
||||||
|
collector.Owner.Shroud.ResetExplored();
|
||||||
|
base.Activate(collector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -78,6 +78,7 @@
|
|||||||
<Compile Include="Spy.cs" />
|
<Compile Include="Spy.cs" />
|
||||||
<Compile Include="SpyPlanePower.cs" />
|
<Compile Include="SpyPlanePower.cs" />
|
||||||
<Compile Include="Thief.cs" />
|
<Compile Include="Thief.cs" />
|
||||||
|
<Compile Include="Crates\ResetRadarCrateAction.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
@@ -659,6 +659,9 @@ CRATE:
|
|||||||
ExplodeCrateAction@boom:
|
ExplodeCrateAction@boom:
|
||||||
Weapon: CrateExplosion
|
Weapon: CrateExplosion
|
||||||
SelectionShares: 5
|
SelectionShares: 5
|
||||||
|
HideMapCrateAction:
|
||||||
|
SelectionShares: 10
|
||||||
|
Effect: hide-map
|
||||||
Unit:
|
Unit:
|
||||||
HP: 1
|
HP: 1
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
|
|||||||
Reference in New Issue
Block a user