diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index 84d443da4c..7b798e15f2 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -45,7 +45,8 @@ namespace OpenRA.Mods.RA public object Create(ActorInitializer init) { return new Crate(init); } } - class Crate : ITick, IOccupySpace + // IMove is required for paradrop + class Crate : ITick, IOccupySpace, IMove { readonly Actor self; [Sync] @@ -98,5 +99,15 @@ namespace OpenRA.Mods.RA public int2 TopLeft {get { return Location; }} int2[] noCells = new int2[] { }; public IEnumerable OccupiedCells() { return noCells; } + + public bool CanEnterCell(int2 location) { return true; } + public float MovementCostForCell(Actor self, int2 cell) { return 0; } + public float MovementSpeedForCell(Actor self, int2 cell) { return 1; } + public IEnumerable GetCurrentPath(Actor self) { return new float2[] {}; } + public void SetPosition(Actor self, int2 cell) + { + Location = cell; + self.CenterLocation = Util.CenterOfCell(cell); + } } } diff --git a/OpenRA.Mods.RA/ParaDrop.cs b/OpenRA.Mods.RA/ParaDrop.cs index c92e9df6be..02af31ec1d 100644 --- a/OpenRA.Mods.RA/ParaDrop.cs +++ b/OpenRA.Mods.RA/ParaDrop.cs @@ -19,6 +19,7 @@ #endregion using System.Collections.Generic; +using System.Linq; using OpenRA.GameRules; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Effects; @@ -30,6 +31,7 @@ namespace OpenRA.Mods.RA public class ParaDropInfo : TraitInfo { public readonly int LZRange = 4; + public readonly string ChuteSound = "chute1.aud"; } public class ParaDrop : ITick @@ -47,7 +49,8 @@ namespace OpenRA.Mods.RA public void Tick(Actor self) { - var r = self.Info.Traits.Get().LZRange; + var info = self.Info.Traits.Get(); + var r = info.LZRange; if ((self.Location - lz).LengthSquared <= r * r && !droppedAt.Contains(self.Location)) { @@ -70,14 +73,14 @@ namespace OpenRA.Mods.RA Util.CenterOfCell(Util.CellContaining(self.CenterLocation)), self.traits.Get().Altitude, a))); - Sound.Play("chute1.aud", self.CenterLocation); + Sound.Play(info.ChuteSound, self.CenterLocation); } } } bool IsSuitableCell(Actor self, int2 p) { - return self.traits.Get().CanEnterCell(p); + return self.traits.WithInterface().FirstOrDefault().CanEnterCell(p); } void FinishedDropping(Actor self) diff --git a/mods/ra/defaults.yaml b/mods/ra/defaults.yaml index 8b2c06c129..ee21e3debc 100644 --- a/mods/ra/defaults.yaml +++ b/mods/ra/defaults.yaml @@ -3,7 +3,28 @@ Unit: ROT: 5 Mobile: - MovementType: Wheel + Crushes: atmine + TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River, Special + TerrainSpeeds: 60%, 40%, 100%, 0%, 0%, 0%, 0%, 90%, 40%, 0%, 100% + Selectable: + Voice: VehicleVoice + Repairable: + Chronoshiftable: + Passenger: + IronCurtainable: + HiddenUnderFog: + RevealsShroud: + GainsExperience: + GivesExperience: + +^Tank: + Category: Vehicle + Unit: + ROT: 5 + Mobile: + Crushes: wall, atmine + TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River, Special + TerrainSpeeds: 80%, 70%, 100%, 0%, 0%, 0%, 0%, 90%, 70%, 0%, 100% Selectable: Voice: VehicleVoice Repairable: @@ -21,7 +42,9 @@ Armor: none Sight: 4 Mobile: - MovementType: Foot + Crushes: apmine + TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River, Special + TerrainSpeeds: 90%, 80%, 100%, 0%, 0%, 0%, 0%, 100%, 80%, 0%, 100% Selectable: RenderInfantry: AutoTarget: @@ -36,7 +59,8 @@ Category: Ship Unit: Mobile: - MovementType: Float + TerrainTypes: Clear, Rough, Road, Tree, Water, Rock, Wall, Ore, Beach, River, Special + TerrainSpeeds: 0%, 0%, 0%, 0%, 100%, 0%, 0%, 0%, 0%, 0%, 100% Selectable: HiddenUnderFog: RevealsShroud: @@ -71,7 +95,7 @@ Category: Building Building: Dimensions: 1,1 - Footprint: y + Footprint: x BuildSounds: placbldg.aud Capturable: false BaseNormal: no @@ -81,6 +105,7 @@ DestroyedSound: sandbag2.aud Adjacent: 4 Wall: + CrushClasses: wall LineBuild: Selectable: Priority: 1 diff --git a/mods/ra/structures.yaml b/mods/ra/structures.yaml index 137bbabde8..d6b9fb686b 100644 --- a/mods/ra/structures.yaml +++ b/mods/ra/structures.yaml @@ -854,8 +854,6 @@ SBAG: Building: HP: 100 Armor: none - Wall: - CrushableBy: Wheel, Track FENC: Category: Defense @@ -871,8 +869,6 @@ FENC: Building: HP: 100 Armor: none - Wall: - CrushableBy: Track BRIK: Category: Defense @@ -892,7 +888,8 @@ BRIK: DestroyedSound: kaboom30.aud RenderBuildingWall: DamageStates: 4 - + Wall: + CrushClasses: heavywall CYCL: Inherits: ^Wall Building: @@ -900,21 +897,15 @@ CYCL: Armor: none RenderBuildingWall: DamageStates: 3 - Wall: - CrushableBy: Track BARB: Inherits: ^Wall Building: HP: 100 Armor: none - Wall: - CrushableBy: Track WOOD: Inherits: ^Wall Building: HP: 100 Armor: none - Wall: - CrushableBy: Track diff --git a/mods/ra/system.yaml b/mods/ra/system.yaml index b075758125..2bf0407d9e 100644 --- a/mods/ra/system.yaml +++ b/mods/ra/system.yaml @@ -227,14 +227,12 @@ World: ResourceLayer: ResourceType@ore: ResourceType: 1 - MovementTerrainType: Ore Palette: terrain SpriteNames: gold01,gold02,gold03,gold04 ValuePerUnit: 25 Name: Ore ResourceType@gem: ResourceType: 2 - MovementTerrainType: Ore Palette: terrain SpriteNames: gem01,gem02,gem03,gem04 ValuePerUnit: 50 @@ -278,7 +276,7 @@ World: MINP: Mine: Weapon: APMine - TriggeredBy: Foot, Wheel, Track + CrushClasses: apmine AvoidFriendly: yes Unit: HP: 1 @@ -291,7 +289,7 @@ MINP: MINV: Mine: Weapon: ATMine - TriggeredBy: Wheel, Track + CrushClasses: atmine AvoidFriendly: yes Unit: HP: 1 diff --git a/mods/ra/terrain.yaml b/mods/ra/terrain.yaml index c5706fe1d1..50f3a8e23f 100644 --- a/mods/ra/terrain.yaml +++ b/mods/ra/terrain.yaml @@ -1,82 +1,38 @@ Clear: - Foot: 90% - Track: 80% - Wheel: 60% - Float: 0% Buildable: yes Rough: - Foot: 80% - Track: 70% - Wheel: 40% - Float: 0% Buildable: no Road: - Foot: 100% - Track: 100% - Wheel: 100% - Float: 0% Buildable: yes Tree: - Foot: 0% - Track: 0% - Wheel: 0% - Float: 0% Buildable: no AcceptSmudge: no Water: - Foot: 0% - Track: 0% - Wheel: 0% - Float: 100% Buildable: no AcceptSmudge: no Rock: - Foot: 0% - Track: 0% - Wheel: 0% - Float: 0% Buildable: no AcceptSmudge: no Wall: - Foot: 0% - Track: 0% - Wheel: 0% - Float: 0% + Buildable: no + +Ore: Buildable: no Beach: - Foot: 80% - Track: 70% - Wheel: 40% - Float: 0% Buildable: no AcceptSmudge: no River: - Foot: 0% - Track: 0% - Wheel: 0% - Float: 0% Buildable: no AcceptSmudge: no -Ore: - Foot: 100% - Track: 90% - Wheel: 90% - Float: 0% - Buildable: no - Special: - Foot: 100% - Track: 100% - Wheel: 100% - Float: 100% Buildable: no AcceptSmudge: no \ No newline at end of file diff --git a/mods/ra/vehicles.yaml b/mods/ra/vehicles.yaml index 1ffb4cea3d..a83a030561 100644 --- a/mods/ra/vehicles.yaml +++ b/mods/ra/vehicles.yaml @@ -53,8 +53,6 @@ V2RL: Crewed: yes Sight: 5 Speed: 7 - Mobile: - MovementType: Track AttackBase: PrimaryWeapon: SCUD RenderUnitReload: @@ -64,7 +62,7 @@ V2RL: EmptyWeapon: 1TNK: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 40 Prerequisites: weap @@ -78,8 +76,6 @@ V2RL: Crewed: yes Sight: 4 Speed: 9 - Mobile: - MovementType: Track Turreted: ROT: 5 AttackTurreted: @@ -94,7 +90,7 @@ V2RL: HuskActor: 1TNK.Husk 2TNK: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 60 Prerequisites: weap @@ -108,8 +104,6 @@ V2RL: Crewed: yes Sight: 5 Speed: 8 - Mobile: - MovementType: Track Turreted: ROT: 5 AttackTurreted: @@ -124,7 +118,7 @@ V2RL: HuskActor: 2TNK.Husk 3TNK: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 40 Prerequisites: weap,atek @@ -138,8 +132,6 @@ V2RL: Crewed: yes Sight: 5 Speed: 6 - Mobile: - MovementType: Track Turreted: ROT: 5 AttackTurreted: @@ -154,7 +146,7 @@ V2RL: HuskActor: 3TNK.Husk 4TNK: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 100 Prerequisites: weap,stek @@ -168,8 +160,6 @@ V2RL: Crewed: yes Sight: 6 Speed: 3 - Mobile: - MovementType: Track Turreted: ROT: 2 AttackTurreted: @@ -191,7 +181,7 @@ V2RL: HealIfBelow: 50% ARTY: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 80 Prerequisites: weap @@ -206,8 +196,6 @@ ARTY: ROT: 2 Sight: 5 Speed: 6 - Mobile: - MovementType: Track AttackBase: PrimaryWeapon: 155mm RenderUnit: @@ -234,8 +222,6 @@ HARV: Crewed: yes Sight: 4 Speed: 6 - Mobile: - MovementType: Track RenderUnit: MCV: @@ -291,7 +277,7 @@ JEEP: AutoTarget: APC: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 50 Prerequisites: weap,tent @@ -304,8 +290,6 @@ APC: Armor: heavy Sight: 5 Speed: 10 - Mobile: - MovementType: Track AttackBase: PrimaryWeapon: M60mg PrimaryOffset: 0,0,0,-4 @@ -319,7 +303,7 @@ APC: UnloadFacing: 220 MNLY.AP: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 30 Prerequisites: weap,fix @@ -334,8 +318,6 @@ MNLY.AP: Crewed: yes Sight: 5 Speed: 9 - Mobile: - MovementType: Track RenderUnit: Image: MNLY Minelayer: @@ -345,7 +327,7 @@ MNLY.AP: Ammo: 5 MNLY.AT: - Inherits: ^Vehicle + Inherits: ^Tank Buildable: BuildPaletteOrder: 30 Prerequisites: weap,fix @@ -360,8 +342,6 @@ MNLY.AT: Crewed: yes Sight: 5 Speed: 9 - Mobile: - MovementType: Track RenderUnit: Image: MNLY Minelayer: