HasSight -> RevealsShroud and used everywhere

This commit is contained in:
Chris Forbes
2010-04-19 20:49:32 +12:00
parent 95ede55179
commit 595dd57b6f
8 changed files with 22 additions and 15 deletions

View File

@@ -82,7 +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\RevealsShroud.cs" />
<Compile Include="Traits\Player\VictoryConditions.cs" />
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
<Compile Include="Traits\Render\RenderFlare.cs" />

View File

@@ -53,7 +53,6 @@ namespace OpenRA.Traits
{
self.World.WorldActor.traits.Get<UnitInfluence>().Remove(self, this);
self.Location = value;
self.World.WorldActor.traits.Get<Shroud>().UpdateActor(self);
}
self.World.WorldActor.traits.Get<UnitInfluence>().Add(self, this);
}

View File

@@ -20,16 +20,19 @@
namespace OpenRA.Traits
{
class HasSightInfo : TraitInfo<HasSight> { }
class RevealsShroudInfo : TraitInfo<RevealsShroud> { }
// for random non-mobile movers
class HasSight : ITick
class RevealsShroud : ITick
{
int2 previousLocation;
public void Tick(Actor self)
{
if (!self.IsIdle)
if (!self.IsIdle && previousLocation != self.Location)
{
previousLocation = self.Location;
self.World.WorldActor.traits.Get<Shroud>().UpdateActor(self);
}
}
}
}

View File

@@ -87,6 +87,8 @@ namespace OpenRA.Traits
vis = GetVisOrigins(a).ToArray()
};
if (v.range == 0) return; // don't bother for things that can't see
foreach (var p in v.vis)
{
foreach (var q in FindVisibleTiles(a.World, p, v.range))

View File

@@ -11,6 +11,7 @@
Passenger:
IronCurtainable:
HiddenUnderFog:
RevealsShroud:
^Infantry:
Category: Infantry
@@ -26,6 +27,7 @@
Passenger:
HiddenUnderFog:
PoisonedByTiberium:
RevealsShroud:
^Ship:
Category: Ship
@@ -34,12 +36,14 @@
MovementType: Float
Selectable:
HiddenUnderFog:
RevealsShroud:
^Plane:
Category: Plane
Unit:
Selectable:
HiddenUnderFog:
RevealsShroud:
^Building:
Category: Building

View File

@@ -379,7 +379,7 @@ TRAN:
Armor: light
InitialFacing: 20
ROT: 5
Sight: 0
Sight: 4
Speed: 15
Helicopter:
RenderUnitRotor:
@@ -407,7 +407,7 @@ HELI:
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 0
Sight: 6
Speed: 20
AttackHeli:
PrimaryWeapon: HighV
@@ -438,7 +438,7 @@ ORCA:
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 0
Sight: 6
Speed: 20
AttackHeli:
PrimaryWeapon: Rockets

View File

@@ -11,6 +11,7 @@
Passenger:
IronCurtainable:
HiddenUnderFog:
RevealsShroud:
^Infantry:
Category: Infantry
@@ -25,6 +26,7 @@
AutoTarget:
Passenger:
HiddenUnderFog:
RevealsShroud:
^Ship:
Category: Ship
@@ -33,6 +35,7 @@
MovementType: Float
Selectable:
HiddenUnderFog:
RevealsShroud:
^Plane:
Category: Plane
@@ -40,6 +43,7 @@
TargetType: Air
Selectable:
HiddenUnderFog:
RevealsShroud:
^Building:
Category: Building

View File

@@ -560,7 +560,6 @@ MIG:
Ammo: 3
IronCurtainable:
ReturnOnIdle:
HasSight:
YAK:
Inherits: ^Plane
@@ -590,7 +589,6 @@ YAK:
Ammo: 15
IronCurtainable:
ReturnOnIdle:
HasSight:
TRAN:
Inherits: ^Plane
@@ -618,7 +616,6 @@ TRAN:
PassengerTypes: Foot
Passengers: 5
IronCurtainable:
HasSight:
HELI:
Inherits: ^Plane
@@ -650,7 +647,6 @@ HELI:
LimitedAmmo:
Ammo: 6
IronCurtainable:
HasSight:
HIND:
Inherits: ^Plane
@@ -680,7 +676,6 @@ HIND:
LimitedAmmo:
Ammo: 12
IronCurtainable:
HasSight:
U2:
Inherits: ^Plane