added HasSight for hax cases where we wouldnt normally do sight for a unit [plane,heli]

This commit is contained in:
Chris Forbes
2010-04-19 19:09:19 +12:00
parent be75cabe1e
commit 95ede55179
4 changed files with 46 additions and 7 deletions

View File

@@ -82,6 +82,7 @@
<Compile Include="Orders\GenericSelectTarget.cs" />
<Compile Include="Traits\AI\EmitInfantryOnSell.cs" />
<Compile Include="Traits\AI\ReturnOnIdle.cs" />
<Compile Include="Traits\HasSight.cs" />
<Compile Include="Traits\Player\VictoryConditions.cs" />
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
<Compile Include="Traits\Render\RenderFlare.cs" />

View File

@@ -26,10 +26,8 @@ using OpenRA.GameRules;
/*
* Crates left to implement:
Cloak=0,STEALTH2 ; enable cloaking on nearby objects
Darkness=1,EMPULSE ; cloak entire radar map
HealBase=1,INVUN ; all buildings to full strength
ICBM=1,MISSILE2 ; nuke missile one time shot
ParaBomb=3,PARABOX ; para-bomb raid one time shot
Reveal=1,EARTH ; reveal entire radar map
Sonar=3,SONARBOX ; one time sonar pulse
Squad=20,NONE ; squad of random infantry

View File

@@ -0,0 +1,35 @@
#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
namespace OpenRA.Traits
{
class HasSightInfo : TraitInfo<HasSight> { }
// for random non-mobile movers
class HasSight : ITick
{
public void Tick(Actor self)
{
if (!self.IsIdle)
self.World.WorldActor.traits.Get<Shroud>().UpdateActor(self);
}
}
}

View File

@@ -548,7 +548,7 @@ MIG:
Armor: light
InitialFacing: 192
ROT: 5
Sight: 0
Sight: 6
Speed: 20
AttackPlane:
PrimaryWeapon: Maverick
@@ -560,6 +560,7 @@ MIG:
Ammo: 3
IronCurtainable:
ReturnOnIdle:
HasSight:
YAK:
Inherits: ^Plane
@@ -577,7 +578,7 @@ YAK:
Crewed: yes
InitialFacing: 192
ROT: 5
Sight: 0
Sight: 4
Speed: 16
AttackPlane:
PrimaryWeapon: ChainGun
@@ -589,6 +590,7 @@ YAK:
Ammo: 15
IronCurtainable:
ReturnOnIdle:
HasSight:
TRAN:
Inherits: ^Plane
@@ -605,7 +607,7 @@ TRAN:
Armor: light
InitialFacing: 20
ROT: 5
Sight: 0
Sight: 4
Speed: 12
Helicopter:
RenderUnitRotor:
@@ -616,6 +618,7 @@ TRAN:
PassengerTypes: Foot
Passengers: 5
IronCurtainable:
HasSight:
HELI:
Inherits: ^Plane
@@ -633,7 +636,7 @@ HELI:
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 0
Sight: 6
Speed: 16
AttackHeli:
PrimaryWeapon: Hellfire
@@ -647,6 +650,7 @@ HELI:
LimitedAmmo:
Ammo: 6
IronCurtainable:
HasSight:
HIND:
Inherits: ^Plane
@@ -664,7 +668,7 @@ HIND:
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 0
Sight: 6
Speed: 12
AttackHeli:
PrimaryWeapon: ChainGun
@@ -676,6 +680,7 @@ HIND:
LimitedAmmo:
Ammo: 12
IronCurtainable:
HasSight:
U2:
Inherits: ^Plane