presence of the trait is enough; don't need to check a legacy flag too.

This commit is contained in:
Chris Forbes
2009-12-28 13:31:08 +13:00
parent 650a0c333a
commit c5c1ec79ab
4 changed files with 12 additions and 15 deletions

View File

@@ -68,7 +68,6 @@ namespace OpenRa.Game.GameRules
public class InfantryInfo : MobileInfo
{
public readonly bool Crushable = true; // also on VehicleInfo, but with a different default
public readonly bool C4 = false;
public readonly bool FraidyCat = false;
public readonly bool Infiltrate = false;
@@ -80,7 +79,6 @@ namespace OpenRa.Game.GameRules
public class VehicleInfo : MobileInfo
{
public readonly bool Crushable = false;
public readonly bool Tracked = false;
public VehicleInfo(string name) : base(name) { }

View File

@@ -181,7 +181,7 @@
<Compile Include="Traits\Fake.cs" />
<Compile Include="Traits\Harvester.cs" />
<Compile Include="Traits\Helicopter.cs" />
<Compile Include="Traits\Infantry.cs" />
<Compile Include="Traits\SquishByTank.cs" />
<Compile Include="Traits\Plane.cs" />
<Compile Include="Traits\ProductionQueue.cs" />
<Compile Include="Traits\ProductionSurround.cs" />

View File

@@ -5,10 +5,10 @@ using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class Infantry : ICrushable
class SquishByTank : ICrushable
{
readonly Actor self;
public Infantry(Actor self)
public SquishByTank(Actor self)
{
this.self = self;
}
@@ -26,7 +26,6 @@ namespace OpenRa.Game.Traits
public bool IsCrushableBy(UnitMovementType umt, Player player)
{
if (player == Game.LocalPlayer) return false;
if (!(self.Info as InfantryInfo).Crushable) return false;
switch (umt)
{
case UnitMovementType.Track: return true;

View File

@@ -528,48 +528,48 @@ Traits=Unit, Mobile, RenderInfantry, Infantry, AutoTarget
LongDesc=Anti-infantry unit. Not fooled by the \nSpy's disguise.\n Strong vs Infantry\n Weak vs Vehicles
[E1]
Description=Rifle Infantry
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoTarget
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoTarget
LongDesc=General-purpose infantry. Strong vs Infantry\n Weak vs Vehicles
[E2]
Description=Grenadier
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoTarget
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoTarget
FireDelay=15
PrimaryOffset=0,0,0,-13
LongDesc=Infantry armed with grenades. \n Strong vs Buildings, Infantry\n Weak vs Vehicles
[E3]
Description=Rocket Soldier
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoTarget
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoTarget
PrimaryOffset=0,0,0,-13
LongDesc=Anti-tank/Anti-aircraft infantry.\n Strong vs Tanks, Aircraft\n Weak vs Infantry
[E4]
Description=Flamethrower
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoTarget
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoTarget
FireDelay=8
LongDesc=Advanced Anti-infantry unit.\n Strong vs Infantry, Buildings\n Weak vs Vehicles
[E6]
Description=Engineer
Traits=Unit, Mobile, RenderInfantry, TakeCover, Infantry
Traits=Unit, Mobile, RenderInfantry, TakeCover, SquishByTank
Voice=EngineerVoice
LongDesc=Infiltrates and captures enemy structures.\n Strong vs Nothing\n Weak vs Everything
[SPY]
Description=Spy
Voice=SpyVoice
Traits=Unit, Mobile, RenderInfantry, TakeCover, Infantry
Traits=Unit, Mobile, RenderInfantry, TakeCover, SquishByTank
LongDesc=Infiltrates enemy structures to gather \nintelligence. Exact effect depends on the \nbuilding infiltrated.\n Strong vs Nothing\n Weak vs Everything\n Special Ability: Disguised
[THF]
Description=Thief
Voice=ThiefVoice
Traits=Unit, Mobile, RenderInfantry, TakeCover, Infantry
Traits=Unit, Mobile, RenderInfantry, TakeCover, SquishByTank
LongDesc=Infiltrates enemy refineries & \nsilos, and steals money stored there.\n Unarmed
[E7]
Description=Tanya
Voice=TanyaVoice
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoTarget
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoTarget
LongDesc=Elite commando infantry, armed with \ndual pistols and C4.\n Strong vs Infantry, Buildings\n Weak vs Vehicles\n Special Ability: Destroy Building with C4
[MEDI]
Description=Medic
Voice=MedicVoice
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, Infantry, AutoHeal
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoHeal
LongDesc=Heals nearby infantry.\n Strong vs Nothing\n Weak vs Everything