Kill Crewed and move WaterBound onto building

This commit is contained in:
Paul Chote
2010-07-28 20:48:50 +12:00
parent 5ca7218eb6
commit 6854d9853b
11 changed files with 24 additions and 91 deletions

View File

@@ -22,16 +22,15 @@ namespace OpenRA.Traits
{
public readonly int HP = 0;
public readonly ArmorType Armor = ArmorType.none;
public readonly bool Crewed = false; // replace with trait?
public readonly int Sight = 0;
public readonly bool WaterBound = false;
public readonly string TargetType = "Ground";
public readonly string[] TargetType = {"Ground"};
}
public class BuildingInfo : OwnedActorInfo, ITraitInfo
{
public readonly int Power = 0;
public readonly bool BaseNormal = true;
public readonly bool WaterBound = false;
public readonly int Adjacent = 2;
public readonly bool Capturable = false;
public readonly bool Repairable = true;

View File

@@ -163,19 +163,20 @@ namespace OpenRA.Mods.RA
{
// todo: fix this properly.
if (!target.IsValid) return false;
if (!target.IsActor) return weapon.ValidTargets.Contains("Ground"); // hack!
if (!target.IsActor) return weapon.ValidTargets.Contains("Ground") // hack!
|| (weapon.ValidTargets.Contains("Water") &&
Game.world.GetTerrainType(Util.CellContaining(target.CenterLocation)) == "Water"); // even bigger hack!
var ownedInfo = target.Actor.Info.Traits.GetOrDefault<OwnedActorInfo>();
if (!weapon.ValidTargets.Contains(ownedInfo.TargetType))
if (!weapon.ValidTargets.Intersect(ownedInfo.TargetType).Any())
return false;
if (weapon.Warheads.All( w => w.EffectivenessAgainst(ownedInfo.Armor) <= 0))
return false;
if (weapon.Underwater && !ownedInfo.WaterBound)
return false;
return true;
}

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
public override int2? CreationLocation(Actor self, ActorInfo producee)
{
return FindAdjacentTile(self, producee.Traits.Get<OwnedActorInfo>().WaterBound);
return FindAdjacentTile(self, self.Info.Traits.Get<BuildingInfo>().WaterBound);
}
public override int CreationFacing(Actor self, Actor newUnit)

View File

@@ -130,7 +130,6 @@
BuildSounds: hvydoor1.aud
Capturable: false
BaseNormal: no
Crewed: no
Sight: 0
DamagedSound: xplos.aud
DestroyedSound: xplobig4.aud
@@ -191,6 +190,7 @@
Bounds: 96,96
BelowUnits:
Building:
TargetType: Ground, Water
DamagedSound: xplos.aud
DestroyedSound: xplobig4.aud
Footprint: ______ ______ ______ ______

View File

@@ -10,7 +10,6 @@ FACT:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
Production:
@@ -33,7 +32,6 @@ NUKE:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 4
Bib:
@@ -54,7 +52,6 @@ PROC.proxy:
Capturable: true
HP: 900
Armor: wood
Crewed: yes
Sight: 6
ReplaceWithActor:
Actor: proc
@@ -72,7 +69,6 @@ PROC:
Capturable: true
HP: 900
Armor: wood
Crewed: yes
Sight: 6
Bib:
OreRefinery:
@@ -121,6 +117,7 @@ SILO:
PipColor: Green
Capacity: 1000
-RenderBuilding:
-EmitInfantryOnSell:
PYLE:
Inherits: ^Building
@@ -140,7 +137,6 @@ PYLE:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
RallyPoint:
@@ -165,7 +161,6 @@ HAND:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
RallyPoint:
@@ -190,7 +185,6 @@ AFLD:
Capturable: true
HP: 1000
Armor: heavy
Crewed: yes
Sight: 7
Bib:
RallyPoint:
@@ -216,7 +210,6 @@ WEAP:
Capturable: true
HP: 400
Armor: light
Crewed: yes
Sight: 4
Bib:
RenderWarFactory:
@@ -243,7 +236,6 @@ HQ:
Capturable: true
HP: 1000
Armor: wood
Crewed: yes
Sight: 10
Bib:
ProvidesRadar:
@@ -267,7 +259,6 @@ NUK2:
Capturable: true
HP: 600
Armor: wood
Crewed: yes
Sight: 4
Bib:
@@ -288,7 +279,6 @@ FIX:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
BelowUnits:
Reservable:
@@ -312,7 +302,6 @@ HPAD:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
Production:
@@ -343,7 +332,6 @@ EYE:
Capturable: true
HP: 1000
Armor: wood
Crewed: yes
Sight: 10
Bib:
ProvidesRadar:
@@ -369,7 +357,6 @@ TMPL:
Capturable: false
HP: 2000
Armor: light
Crewed: yes
Sight: 6
Bib:
NukeSilo:
@@ -393,7 +380,6 @@ OBLI:
Dimensions: 1,2
HP: 400
Armor: light
Crewed: no
Sight: 8
RenderBuildingCharge:
ChargeAudio: obelpowr.aud
@@ -404,6 +390,7 @@ OBLI:
AutoTarget:
-RenderBuilding:
RenderRangeCircle:
-EmitInfantryOnSell:
CYCL:
Category: Defense
@@ -471,7 +458,6 @@ GUN:
Power: -20
HP: 400
Armor: heavy
Crewed: yes
Sight: 7
Turreted:
ROT: 12
@@ -500,7 +486,6 @@ SAM:
Dimensions: 2,1
HP: 400
Armor: heavy
Crewed: yes
Sight: 5
Turreted:
ROT: 30
@@ -527,7 +512,6 @@ GTWR:
Power: -10
HP: 400
Armor: wood
Crewed: yes
Sight: 6
AttackOmni:
PrimaryWeapon: HighV
@@ -551,7 +535,6 @@ ATWR:
Power: -20
HP: 600
Armor: light
Crewed: yes
Sight: 8
AttackOmni:
PrimaryWeapon: Tomahawk

View File

@@ -13,7 +13,6 @@ MCV:
Unit:
HP: 600
Armor: light
Crewed: yes
Sight: 4
Speed: 6
TransformsOnDeploy:
@@ -45,7 +44,6 @@ HARV:
Unit:
HP: 600
Armor: light
Crewed: yes
Sight: 4
Speed: 6
RenderUnit:
@@ -91,7 +89,6 @@ ARTY:
Unit:
HP: 75
Armor: light
Crewed: yes
ROT: 2
Sight: 6
Speed: 6
@@ -114,7 +111,6 @@ FTNK:
Unit:
HP: 300
Armor: heavy
Crewed: yes
ROT: 5
Sight: 4
Speed: 9
@@ -138,7 +134,6 @@ BGGY:
Unit:
HP: 140
Armor: light
Crewed: yes
ROT: 10
Sight: 5
Speed: 18
@@ -165,7 +160,6 @@ BIKE:
HP: 160
Armor: none
ROT: 10
Crewed: yes
Sight: 7
Speed: 20
AttackBase:
@@ -191,7 +185,6 @@ JEEP:
Unit:
HP: 150
Armor: light
Crewed: yes
ROT: 10
Sight: 7
Speed: 15
@@ -217,7 +210,6 @@ LTNK:
Unit:
HP: 300
Armor: Heavy
Crewed: yes
Sight: 4
Speed: 9
Turreted:
@@ -246,7 +238,6 @@ MTNK:
Unit:
HP: 400
Armor: heavy
Crewed: yes
Sight: 5
Speed: 9
Turreted:
@@ -275,7 +266,6 @@ HTNK:
Unit:
HP: 600
Armor: heavy
Crewed: yes
Sight: 6
Speed: 3
Turreted:
@@ -310,7 +300,6 @@ MSAM:
Unit:
HP: 120
Armor: light
Crewed: yes
Sight: 6
Speed: 6
Turreted:
@@ -338,7 +327,6 @@ MLRS:
Unit:
HP: 120
Armor: light
Crewed: yes
Sight: 10
Speed: 6
Turreted:
@@ -362,7 +350,6 @@ STNK:
Unit:
HP: 110
Armor: light
Crewed: yes
Sight: 4
Speed: 15
Cloak:
@@ -415,7 +402,6 @@ HELI:
Unit:
HP: 125
Armor: heavy
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 8
@@ -443,7 +429,6 @@ ORCA:
Unit:
HP: 125
Armor: heavy
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 8

View File

@@ -7,7 +7,6 @@ FCOM:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 10
Bib:

View File

@@ -59,6 +59,7 @@
^Ship:
Category: Ship
Unit:
TargetType: Ground, Water
Mobile:
TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River
TerrainSpeeds: 0%, 0%, 0%, 0%, 100%, 0%, 0%, 0%, 0%, 0%
@@ -103,7 +104,6 @@
BuildSounds: placbldg.aud
Capturable: false
BaseNormal: no
Crewed: no
Sight: 0
DamagedSound: sandbag2.aud
DestroyedSound: sandbag2.aud
@@ -169,6 +169,7 @@
# Bounds: 96,48
BelowUnits:
Building:
TargetType: Ground, Water
Footprint: ____ ____
Dimensions: 4,2
HP: 1000

View File

@@ -17,7 +17,6 @@ MSLO:
Dimensions: 2,1
HP: 400
Armor: heavy
Crewed: yes
Sight: 5
IronCurtainable:
@@ -44,7 +43,6 @@ GAP:
Capturable: true
HP: 1000
Armor: wood
Crewed: yes
Sight: 10
IronCurtainable:
@@ -60,6 +58,7 @@ SPEN:
LongDesc: Produces and repairs submarines and \ntransports
Hotkey: s
Building:
TargetType: Ground, Water
Power: -30
Footprint: xxx xxx xxx
Dimensions: 3,3
@@ -88,6 +87,7 @@ SYRD:
LongDesc: Produces and repairs ships
Hotkey: s
Building:
TargetType: Ground, Water
Power: -30
Footprint: xxx xxx xxx
Dimensions: 3,3
@@ -124,7 +124,6 @@ IRON:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 10
Bib:
IronCurtainable:
@@ -150,7 +149,6 @@ PDOX:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 10
Bib:
Chronosphere:
@@ -177,7 +175,6 @@ TSLA:
Dimensions: 1,2
HP: 400
Armor: heavy
Crewed: yes
Sight: 8
RenderBuildingCharge:
AttackTesla:
@@ -207,7 +204,6 @@ AGUN:
Dimensions: 1,2
HP: 400
Armor: heavy
Crewed: yes
Sight: 6
Turreted:
ROT: 15
@@ -240,7 +236,6 @@ DOME:
Capturable: true
HP: 1000
Armor: wood
Crewed: yes
Sight: 10
Bib:
ProvidesRadar:
@@ -261,7 +256,6 @@ PBOX:
Power: -15
HP: 400
Armor: wood
Crewed: yes
Sight: 6
AttackOmni:
PrimaryWeapon: Vulcan
@@ -284,7 +278,6 @@ HBOX:
Power: -15
HP: 600
Armor: wood
Crewed: yes
Sight: 6
AttackOmni:
PrimaryWeapon: Vulcan
@@ -307,7 +300,6 @@ GUN:
Power: -40
HP: 400
Armor: heavy
Crewed: yes
Sight: 7
Turreted:
ROT: 12
@@ -335,7 +327,6 @@ FTUR:
Power: -20
HP: 400
Armor: heavy
Crewed: yes
Sight: 6
AttackOmni:
PrimaryWeapon: FireballLauncher
@@ -361,7 +352,6 @@ SAM:
Dimensions: 2,1
HP: 400
Armor: heavy
Crewed: yes
Sight: 5
Turreted:
ROT: 30
@@ -392,7 +382,6 @@ ATEK:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 10
Bib:
IronCurtainable:
@@ -415,7 +404,6 @@ WEAP:
Capturable: true
HP: 1000
Armor: light
Crewed: yes
Sight: 4
Bib:
RenderWarFactory:
@@ -433,7 +421,6 @@ FACT:
Capturable: true
HP: 1000
Armor: heavy
Crewed: yes
Sight: 5
Bib:
Production:
@@ -464,7 +451,6 @@ PROC:
Capturable: true
HP: 900
Armor: wood
Crewed: yes
Sight: 6
Bib:
OreRefinery:
@@ -503,6 +489,7 @@ SILO:
Capacity: 1500
IronCurtainable:
-RenderBuilding:
-EmitInfantryOnSell:
HPAD:
Inherits: ^Building
@@ -521,7 +508,6 @@ HPAD:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
Production:
@@ -548,7 +534,6 @@ AFLD:
Capturable: true
HP: 1000
Armor: heavy
Crewed: yes
Sight: 7
Production:
Produces: Plane
@@ -573,7 +558,6 @@ POWR:
Capturable: true
HP: 400
Armor: wood
Crewed: yes
Sight: 4
Bib:
IronCurtainable:
@@ -596,7 +580,6 @@ APWR:
Capturable: true
HP: 700
Armor: wood
Crewed: yes
Sight: 4
Bib:
IronCurtainable:
@@ -619,7 +602,6 @@ STEK:
Capturable: true
HP: 600
Armor: wood
Crewed: yes
Sight: 4
Bib:
IronCurtainable:
@@ -642,7 +624,6 @@ BARR:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
RallyPoint:
@@ -668,7 +649,6 @@ TENT:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
Bib:
RallyPoint:
@@ -695,6 +675,7 @@ KENN:
Production:
Produces: Infantry
IronCurtainable:
-EmitInfantryOnSell:
FIX:
Inherits: ^Building
@@ -713,7 +694,6 @@ FIX:
Capturable: true
HP: 800
Armor: wood
Crewed: yes
Sight: 5
BelowUnits:
Reservable:
@@ -743,6 +723,7 @@ FACF:
Image: FACT
Fake:
IronCurtainable:
-EmitInfantryOnSell:
WEAF:
Inherits: ^Building
@@ -768,6 +749,7 @@ WEAF:
Image: WEAP
Fake:
IronCurtainable:
-EmitInfantryOnSell:
SYRF:
Inherits: ^Building
@@ -783,6 +765,7 @@ SYRF:
# LongDesc: Looks like a Shipyard
# Hotkey: z
Building:
TargetType: Ground, Water
Power: -2
Footprint: xxx xxx xxx
Dimensions: 3,3
@@ -800,6 +783,7 @@ SYRF:
SPEF:
Inherits: ^Building
Building:
TargetType: Ground, Water
Power: -2
Footprint: xxx xxx xxx
Dimensions: 3,3
@@ -839,6 +823,7 @@ DOMF:
RenderBuilding:
Image: DOME
Fake:
-EmitInfantryOnSell:
SBAG:
Category: Defense

View File

@@ -50,7 +50,6 @@ V2RL:
Unit:
HP: 150
Armor: light
Crewed: yes
Sight: 5
Speed: 7
AttackBase:
@@ -73,7 +72,6 @@ V2RL:
Unit:
HP: 300
Armor: heavy
Crewed: yes
Sight: 4
Speed: 9
Turreted:
@@ -101,7 +99,6 @@ V2RL:
Unit:
HP: 400
Armor: heavy
Crewed: yes
Sight: 5
Speed: 8
Turreted:
@@ -129,7 +126,6 @@ V2RL:
Unit:
HP: 550
Armor: heavy
Crewed: yes
Sight: 5
Speed: 6
Turreted:
@@ -157,7 +153,6 @@ V2RL:
Unit:
HP: 750
Armor: heavy
Crewed: yes
Sight: 6
Speed: 3
Turreted:
@@ -192,7 +187,6 @@ ARTY:
Unit:
HP: 75
Armor: light
Crewed: yes
ROT: 2
Sight: 5
Speed: 6
@@ -219,7 +213,6 @@ HARV:
Unit:
HP: 600
Armor: heavy
Crewed: yes
Sight: 4
Speed: 6
RenderUnit:
@@ -238,7 +231,6 @@ MCV:
Unit:
HP: 600
Armor: light
Crewed: yes
Sight: 4
Speed: 6
TransformsOnDeploy:
@@ -263,7 +255,6 @@ JEEP:
Unit:
HP: 150
Armor: light
Crewed: yes
ROT: 10
Sight: 8
Speed: 12
@@ -315,7 +306,6 @@ MNLY.AP:
Unit:
HP: 100
Armor: heavy
Crewed: yes
Sight: 5
Speed: 9
RenderUnit:
@@ -339,7 +329,6 @@ MNLY.AT:
Unit:
HP: 100
Armor: heavy
Crewed: yes
Sight: 5
Speed: 9
RenderUnit:
@@ -375,7 +364,6 @@ SS:
ROT: 4
Sight: 6
Speed: 5
WaterBound: yes
RenderUnit:
Cloak:
InitialDelay: .4
@@ -406,7 +394,6 @@ MSUB:
ROT: 3
Sight: 6
Speed: 3
WaterBound: yes
RenderUnit:
Cloak:
InitialDelay: .4
@@ -436,7 +423,6 @@ DD:
ROT: 7
Sight: 6
Speed: 6
WaterBound: yes
Turreted:
ROT: 7
AttackTurreted:
@@ -465,7 +451,6 @@ CA:
ROT: 2
Sight: 7
Speed: 2
WaterBound: yes
Turreted:
ROT: 3
AttackTurreted:
@@ -496,7 +481,6 @@ LST:
ROT: 10
Sight: 6
Speed: 14
WaterBound: yes
RenderUnit:
Cargo:
PassengerTypes: Foot,Wheel,Track
@@ -520,7 +504,6 @@ PT:
ROT: 7
Sight: 7
Speed: 9
WaterBound: yes
Turreted:
ROT: 7
AttackTurreted:
@@ -577,7 +560,6 @@ YAK:
Unit:
HP: 60
Armor: light
Crewed: yes
InitialFacing: 192
ROT: 5
Sight: 10
@@ -636,7 +618,6 @@ HELI:
Unit:
HP: 120
Armor: light
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 12
@@ -668,7 +649,6 @@ HIND:
Unit:
HP: 120
Armor: light
Crewed: yes
InitialFacing: 20
ROT: 4
Sight: 12

View File

@@ -560,7 +560,7 @@ TorpTube:
ROF: 100
Range: 9
Report: TORPEDO1
ValidTargets: Ground
ValidTargets: Water
Underwater: yes
Burst: 2
BurstDelay: 1