Kill Unit trait; Radar signature tweaks

This commit is contained in:
Paul Chote
2010-08-01 01:26:59 +12:00
parent d416f0be5c
commit bd979f65b8
13 changed files with 41 additions and 113 deletions

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -176,7 +176,6 @@
<Compile Include="Traits\Render\RenderSimple.cs" />
<Compile Include="Traits\TraitsInterfaces.cs" />
<Compile Include="Traits\Turreted.cs" />
<Compile Include="Traits\Unit.cs" />
<Compile Include="Traits\World\UnitInfluence.cs" />
<Compile Include="Network\UnitOrders.cs" />
<Compile Include="Traits\Util.cs" />
@@ -258,4 +257,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<Folder Include="Traits\" />
</ItemGroup>
</Project>

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Traits
public object Create(ActorInitializer init) { return new Building(init); }
}
public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace, IRadarSignature
public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace
{
readonly Actor self;
public readonly BuildingInfo Info;
@@ -113,19 +113,5 @@ namespace OpenRA.Traits
{
return Footprint.UnpathableTiles( self.Info.Name, Info, TopLeft );
}
public IEnumerable<int2> RadarSignatureCells(Actor self)
{
return Footprint.Tiles(self);
}
public Color RadarSignatureColor(Actor self)
{
var mod = self.traits.WithInterface<IRadarColorModifier>().FirstOrDefault();
if (mod != null)
return mod.RadarColorOverride(self);
return self.Owner.Color;
}
}
}

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits.Activities;
namespace OpenRA.Traits
{
public class MobileInfo : ITraitInfo, ITraitPrerequisite<UnitInfo>
public class MobileInfo : ITraitInfo
{
public readonly string[] TerrainTypes;
public readonly float[] TerrainSpeeds;

View File

@@ -11,19 +11,20 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
public class UnitInfo : ITraitInfo
{
public object Create( ActorInitializer init ) { return new Unit(); }
}
public class AppearsOnRadarInfo : TraitInfo<AppearsOnRadar> {}
public class AppearsOnRadar : IRadarSignature
{
IOccupySpace Space;
public class Unit : IRadarSignature
{
public IEnumerable<int2> RadarSignatureCells(Actor self)
{
yield return self.Location;
{
if (Space == null)
Space = self.traits.Get<IOccupySpace>();
return Space.OccupiedCells();
}
public Color RadarSignatureColor(Actor self)
@@ -35,4 +36,4 @@ namespace OpenRA.Traits
return self.Owner.Color;
}
}
}
}

View File

@@ -233,6 +233,7 @@
<Compile Include="Transforms.cs" />
<Compile Include="Activities\Transform.cs" />
<Compile Include="ActorLostNotification.cs" />
<Compile Include="AppearsOnRadar.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
@@ -244,9 +245,6 @@
<Name>OpenRA.Game</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Chrome\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1,6 +1,6 @@
^Vehicle:
Category: Vehicle
Unit:
AppearsOnRadar:
Mobile:
Crushes: crate
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
@@ -23,7 +23,7 @@
^Tank:
Category: Vehicle
Unit:
AppearsOnRadar:
Mobile:
Crushes: wall, crate
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
@@ -46,7 +46,7 @@
^Helicopter:
Category: Plane
Unit:
AppearsOnRadar:
Targetable:
TargetTypes: Air
Selectable:
@@ -63,7 +63,7 @@
^Infantry:
Category: Infantry
Unit:
AppearsOnRadar:
Health:
Armor: none
RevealsShroud:
@@ -90,13 +90,13 @@
^CivInfantry:
Inherits: ^Infantry
AppearsOnRadar:
Selectable:
Voice: CivilianMaleVoice
Bounds: 12,17,0,-9
Valued:
Cost: 70
Description: Civilian
Unit:
Mobile:
Speed: 4
Health:
@@ -111,7 +111,7 @@
^Plane:
Category: Plane
Unit:
AppearsOnRadar:
Selectable:
Voice: GenericVoice
Targetable:
@@ -125,6 +125,7 @@
^Building:
Category: Building
AppearsOnRadar:
Selectable:
Priority: 3
Targetable:
@@ -177,6 +178,7 @@
^Wall:
Category: Building
AppearsOnRadar:
Building:
Dimensions: 1,1
Footprint: x
@@ -208,6 +210,7 @@
Building:
Footprint: __ x_
Dimensions: 2,2
AppearsOnRadar:
RadarColorFromTerrain:
Terrain: Tree
^Rock:
@@ -219,12 +222,12 @@
Building:
Footprint: __ x_
Dimensions: 2,2
AppearsOnRadar:
RadarColorFromTerrain:
Terrain: Tree
^Husk:
Category: Vehicle
Unit:
Mobile:
ROT: 0
Speed: 0
@@ -235,6 +238,7 @@
Selectable:
Priority: -1
HiddenUnderFog:
AppearsOnRadar:
Burns:
^Bridge:
@@ -250,6 +254,4 @@
DamagedSound: xplos.aud
DestroyedSound: xplobig4.aud
Footprint: ______ ______ ______ ______
Dimensions: 6,4
RadarColorFromTerrain:
Terrain: Road
Dimensions: 6,4

View File

@@ -9,7 +9,6 @@ E1:
Icon: e1icnh
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 4
Health:
@@ -30,7 +29,6 @@ E2:
Icon: e2icnh
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 4
Health:
@@ -52,7 +50,6 @@ E3:
Icon: e3icnh
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 3
Health:
@@ -75,7 +72,6 @@ E4:
Icon: e4icnh
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 4
Health:
@@ -101,7 +97,6 @@ E5:
Prerequisites: tmpl
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 4
Health:
@@ -127,7 +122,6 @@ E6:
Icon: e6icnh
Selectable:
Bounds: 12,17,0,-6
Unit:
Mobile:
Speed: 4
Health:
@@ -152,7 +146,6 @@ RMBO:
Selectable:
Bounds: 12,17,0,-6
Voice: CommandoVoice
Unit:
Mobile:
Speed: 5
Health:

View File

@@ -158,6 +158,5 @@ CRATE:
Effect: hide-map
CloakCrateAction:
SelectionShares: 1000
Unit:
RenderUnit:
BelowUnits:

View File

@@ -10,7 +10,6 @@ MCV:
LongDesc: Deploys into another Construction Yard.\n Unarmed
Selectable:
Priority: 3
Unit:
Mobile:
Speed: 6
Health:
@@ -44,7 +43,6 @@ HARV:
PipCount: 5
PipColor: Green
Capacity: 28
Unit:
Mobile:
Speed: 6
Health:
@@ -64,7 +62,6 @@ APC:
Cost: 700
Description: Armored Personnel Carrier
LongDesc: Tough infantry transport.\n Strong vs Infantry, Light Vehicles\n Weak vs Tanks, Aircraft
Unit:
Mobile:
ROT: 5
Speed: 15
@@ -95,7 +92,6 @@ ARTY:
Cost: 600
Description: Artillery
LongDesc: Long-range artillery.\n Strong vs Infantry, Buildings\n Weak vs Tanks, Aircraft
Unit:
Mobile:
ROT: 2
Speed: 6
@@ -120,7 +116,6 @@ FTNK:
Cost: 800
Description: Flame Tank
LongDesc: Heavily armored flame-throwing vehicle.\n Strong vs Infantry, Buildings\n Weak vs Aircraft
Unit:
Mobile:
ROT: 5
Speed: 9
@@ -146,7 +141,6 @@ BGGY:
Cost: 600
Description: Nod Buggy
LongDesc: Fast scout & anti-infantry vehicle.\n Strong vs Infantry\n Weak vs Tanks, Aircraft
Unit:
Mobile:
ROT: 10
Speed: 18
@@ -174,7 +168,6 @@ BIKE:
Cost: 500
Description: Recon Bike
LongDesc: Fast scout vehicle, armed with \nrockets.\n Strong vs Vehicles, Aircraft\n Weak vs Infantry
Unit:
Mobile:
ROT: 10
Speed: 20
@@ -203,7 +196,6 @@ JEEP:
Cost: 400
Description: Hum-Vee
LongDesc: Fast scout & anti-infantry vehicle.\n Strong vs Infantry\n Weak vs Tanks, Aircraft
Unit:
Mobile:
ROT: 10
Speed: 15
@@ -231,7 +223,6 @@ LTNK:
Cost: 600
Description: Light Tank
LongDesc: Light Tank, good for scouting.\n Strong vs Light Vehicles\n Weak vs Tanks, Aircraft
Unit:
Mobile:
Speed: 9
Health:
@@ -262,7 +253,6 @@ MTNK:
Cost: 800
Description: Medium Tank
LongDesc: General-Purpose GDI Tank.\n Strong vs Tanks, Light Vehicles\n Weak vs Infantry, Aircraft
Unit:
Mobile:
Speed: 9
Health:
@@ -293,7 +283,6 @@ HTNK:
Cost: 1500
Description: Mammoth Tank
LongDesc: Heavily armored GDI Tank.\n Strong vs Everything
Unit:
Mobile:
Crushes: wall, heavywall
Speed: 3
@@ -329,7 +318,6 @@ MSAM:
Cost: 800
Description: Rocket Launcher
LongDesc: Long range artillery.\n Strong vs Infantry, Buildings\n Weak vs Tanks, Aircraft
Unit:
Mobile:
Speed: 6
Health:
@@ -359,7 +347,6 @@ MLRS:
Cost: 750
Description: SSM Launcher
LongDesc: Long range artillery.\n Strong vs Infantry, Aircraft\n Weak vs Tanks, Aircraft
Unit:
Mobile:
Speed: 6
Health:
@@ -385,7 +372,6 @@ STNK:
Cost: 900
Description: Stealth Tank
LongDesc: Missile tank that can bend light around \nitself to become invisible\n Strong vs Infantry, Aircraft\n Weak vs Tanks
Unit:
Mobile:
Speed: 15
Health:
@@ -414,7 +400,6 @@ TRAN:
Cost: 1500
Description: Chinook Transport
LongDesc: Fast Infantry Transport Helicopter.\n Unarmed
Unit:
MobileAir:
InitialFacing: 20
ROT: 5
@@ -443,7 +428,6 @@ HELI:
Cost: 1200
Description: Apache Longbow
LongDesc: Helicopter Gunship with AG Missiles.\n Strong vs Buildings, Tanks\n Weak vs Infantry
Unit:
MobileAir:
InitialFacing: 20
ROT: 4
@@ -473,7 +457,6 @@ ORCA:
Cost: 1200
Description: Orca
LongDesc: Helicopter Gunship with AG Missiles.\n Strong vs Buildings, Tanks\n Weak vs Infantry
Unit:
MobileAir:
InitialFacing: 20
ROT: 4
@@ -495,7 +478,6 @@ C17:
ParaDrop:
LZRange: 1
Inherits: ^Plane
Unit:
Plane:
ROT: 5
Speed: 25
@@ -513,7 +495,6 @@ C17:
A10:
Inherits: ^Plane
Unit:
Plane:
ROT: 4
Speed: 25

View File

@@ -1,6 +1,6 @@
^Vehicle:
Category: Vehicle
Unit:
AppearsOnRadar:
Mobile:
Crushes: atmine, crate
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
@@ -23,7 +23,7 @@
^Tank:
Category: Vehicle
Unit:
AppearsOnRadar:
Mobile:
Crushes: wall, atmine, crate
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
@@ -46,7 +46,7 @@
^Infantry:
Category: Infantry
Unit:
AppearsOnRadar:
Health:
Armor: none
RevealsShroud:
@@ -72,7 +72,7 @@
^Ship:
Category: Ship
Unit:
AppearsOnRadar:
Mobile:
Crushes: crate
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
@@ -90,7 +90,7 @@
^Plane:
Category: Plane
Unit:
AppearsOnRadar:
Selectable:
Voice: GenericVoice
Targetable:
@@ -104,6 +104,7 @@
^Building:
Category: Building
AppearsOnRadar:
Selectable:
Priority: 3
Targetable:
@@ -123,6 +124,7 @@
^Wall:
Category: Building
AppearsOnRadar:
Building:
Dimensions: 1,1
Footprint: x
@@ -169,12 +171,12 @@
Building:
Footprint: x
Dimensions: 1,1
AppearsOnRadar:
RadarColorFromTerrain:
Terrain: Tree
^Husk:
Category: Vehicle
Unit:
Health:
HP: 140
Armor: Heavy
@@ -182,6 +184,7 @@
Selectable:
Priority: -1
HiddenUnderFog:
AppearsOnRadar:
Burns:
^Bridge:
@@ -195,6 +198,4 @@
Footprint: ____ ____
Dimensions: 4,2
Health:
HP: 1000
RadarColorFromTerrain:
Terrain: Road
HP: 1000

View File

@@ -257,7 +257,6 @@ SHOK:
Bounds: 12,17,0,-9
Health:
HP: 80
Unit:
Mobile:
Speed: 3
RevealsShroud:

View File

@@ -182,7 +182,6 @@ MINP:
Weapon: APMine
CrushClasses: apmine
AvoidFriendly: yes
Unit:
Health:
HP: 1
RenderUnit:
@@ -195,7 +194,6 @@ MINV:
Weapon: ATMine
CrushClasses: atmine
AvoidFriendly: yes
Unit:
Health:
HP: 1
RenderUnit:
@@ -253,14 +251,11 @@ CRATE:
GiveUnitCrateAction@4tnk:
SelectionShares: 3
Unit: 4tnk
Unit:
RenderUnit:
BelowUnits:
CAMERA:
Aircraft:
Unit:
Health:
HP:1000
RevealsShroud:
@@ -268,7 +263,6 @@ CAMERA:
FLARE:
Aircraft:
Unit:
Health:
HP:1000
RevealsShroud:

View File

@@ -5,7 +5,6 @@ BADR:
Health:
HP: 60
Armor: light
Unit:
Plane:
ROT: 5
Speed: 16
@@ -25,7 +24,6 @@ BADR.bomber:
Health:
HP: 60
Armor: light
Unit:
Plane:
ROT: 5
Speed: 16
@@ -50,7 +48,6 @@ V2RL:
Health:
HP: 150
Armor: light
Unit:
Mobile:
Speed: 7
RevealsShroud:
@@ -75,7 +72,6 @@ V2RL:
Health:
HP: 300
Armor: heavy
Unit:
Mobile:
Speed: 9
RevealsShroud:
@@ -105,7 +101,6 @@ V2RL:
Health:
HP: 400
Armor: heavy
Unit:
Mobile:
Speed: 7
RevealsShroud:
@@ -135,7 +130,6 @@ V2RL:
Health:
HP: 550
Armor: heavy
Unit:
Mobile:
Speed: 5
RevealsShroud:
@@ -165,7 +159,6 @@ V2RL:
Health:
HP: 750
Armor: heavy
Unit:
Mobile:
Speed: 3
RevealsShroud:
@@ -202,7 +195,6 @@ ARTY:
Health:
HP: 75
Armor: light
Unit:
Mobile:
ROT: 2
Speed: 6
@@ -231,7 +223,6 @@ HARV:
Health:
HP: 600
Armor: heavy
Unit:
Mobile:
Speed: 6
RevealsShroud:
@@ -252,7 +243,6 @@ MCV:
Health:
HP: 600
Armor: light
Unit:
Mobile:
Speed: 6
RevealsShroud:
@@ -279,7 +269,6 @@ JEEP:
Health:
HP: 150
Armor: light
Unit:
Mobile:
ROT: 10
Speed: 12
@@ -306,7 +295,6 @@ APC:
Health:
HP: 200
Armor: heavy
Unit:
Mobile:
Speed: 10
RevealsShroud:
@@ -336,7 +324,6 @@ MNLY.AP:
Health:
HP: 100
Armor: heavy
Unit:
Mobile:
Speed: 9
RevealsShroud:
@@ -362,7 +349,6 @@ MNLY.AT:
Health:
HP: 100
Armor: heavy
Unit:
Mobile:
Speed: 9
RevealsShroud:
@@ -380,7 +366,6 @@ TRUK:
Health:
HP: 110
Armor: light
Unit:
Mobile:
Speed: 10
RevealsShroud:
@@ -400,7 +385,6 @@ SS:
Health:
HP: 120
Armor: light
Unit:
Mobile:
ROT: 4
Speed: 5
@@ -433,7 +417,6 @@ MSUB:
Health:
HP: 200
Armor: light
Unit:
Mobile:
ROT: 3
Speed: 3
@@ -465,7 +448,6 @@ DD:
Health:
HP: 400
Armor: heavy
Unit:
Mobile:
ROT: 7
Speed: 6
@@ -496,7 +478,6 @@ CA:
Health:
HP: 800
Armor: heavy
Unit:
Mobile:
ROT: 2
Speed: 2
@@ -529,7 +510,6 @@ LST:
Health:
HP: 350
Armor: heavy
Unit:
Mobile:
ROT: 10
Speed: 14
@@ -555,7 +535,6 @@ PT:
Health:
HP: 200
Armor: heavy
Unit:
Mobile:
ROT: 7
Speed: 9
@@ -586,7 +565,6 @@ MIG:
Health:
HP: 70
Armor: light
Unit:
RevealsShroud:
Range: 12
AttackPlane:
@@ -619,7 +597,6 @@ YAK:
Health:
HP: 60
Armor: light
Unit:
RevealsShroud:
Range: 10
AttackPlane:
@@ -651,7 +628,6 @@ TRAN:
Health:
HP: 90
Armor: light
Unit:
RevealsShroud:
Range: 12
Helicopter:
@@ -681,7 +657,6 @@ HELI:
Health:
HP: 120
Armor: light
Unit:
RevealsShroud:
Range: 12
AttackHeli:
@@ -714,7 +689,6 @@ HIND:
Health:
HP: 120
Armor: light
Unit:
RevealsShroud:
Range: 12
AttackHeli:
@@ -737,7 +711,6 @@ U2:
Health:
HP: 2000
Armor: heavy
Unit:
Mobile:
ROT: 7
Speed: 40
@@ -807,7 +780,6 @@ TTNK:
Health:
HP: 110
Armor: light
Unit:
Mobile:
Speed: 8
RevealsShroud:
@@ -816,4 +788,4 @@ TTNK:
PrimaryWeapon: TTankZap
RenderUnitSpinner:
Selectable:
Bounds: 28,28,0,0
Bounds: 28,28,0,0