diff --git a/OpenRA.Mods.RA/Lint/CheckMapRules.cs b/OpenRA.Mods.RA/Lint/CheckMapRules.cs new file mode 100644 index 0000000000..895a2d4eaa --- /dev/null +++ b/OpenRA.Mods.RA/Lint/CheckMapRules.cs @@ -0,0 +1,31 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using OpenRA.Traits; + +namespace OpenRA.Mods.RA +{ + public class CheckMapRules : ILintPass + { + public void Run(Action emitError, Action emitWarning, Map map) + { + try + { + Game.modData.RulesetCache.LoadMapRules(map); + } + catch (Exception e) + { + emitError(e.Message); + } + } + } +} + diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index f645279052..87c417404c 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -494,6 +494,7 @@ + diff --git a/mods/cnc/maps/the-hot-box/map.yaml b/mods/cnc/maps/the-hot-box/map.yaml index 8cf19a448e..b70f9969da 100644 --- a/mods/cnc/maps/the-hot-box/map.yaml +++ b/mods/cnc/maps/the-hot-box/map.yaml @@ -203,35 +203,26 @@ Rules: CrateSpawner: Maximum: 4 SpawnInterval: 5 + CrateActors: unitcrate -SpawnMPUnits: -MPStartLocations: - CRATE: - -HealUnitsCrateAction: - -LevelUpCrateAction: - -GiveMcvCrateAction: - -RevealMapCrateAction: - -HideMapCrateAction: - -GrantUpgradeCrateAction@cloak: - -ExplodeCrateAction@nuke: - -ExplodeCrateAction@boom: - -ExplodeCrateAction@fire: - -SupportPowerCrateAction@parabombs: - -GiveCashCrateAction: + UNITCRATE: + Inherits: ^Crate GiveUnitCrateAction@stnk: SelectionShares: 4 - Unit: stnk + Units: stnk GiveUnitCrateAction@bike: SelectionShares: 6 - Unit: bike + Units: bike GiveUnitCrateAction@htnk: SelectionShares: 1 - Unit: htnk + Units: htnk GiveUnitCrateAction@e5: SelectionShares: 1 - Unit: e5 + Units: e5 GiveUnitCrateAction@e1: SelectionShares: 1 - Unit: e1 + Units: e1 APC: Health: HP: 1000 diff --git a/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml b/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml index 32e7a54354..3a8962498a 100644 --- a/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml +++ b/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml @@ -294,21 +294,11 @@ Rules: CrateSpawner: Maximum: 3 SpawnInterval: 5 + CrateActors: unitcrate -SpawnMPUnits: -MPStartLocations: - CRATE: - -LevelUpCrateAction: - -GiveMcvCrateAction: - -RevealMapCrateAction: - -HideMapCrateAction: - -ExplodeCrateAction@nuke: - -ExplodeCrateAction@boom: - -ExplodeCrateAction@fire: - -SupportPowerCrateAction@parabombs: - -GiveCashCrateAction: - -DuplicateUnitCrateAction: - -GiveUnitCrateAction@squadlight: - -GiveUnitCrateAction@squadheavysoviet: + UNITCRATE: + Inherits: ^Crate GiveUnitCrateAction@ttnk: SelectionShares: 4 Units: ttnk diff --git a/mods/ra/maps/drop-zone-w/map.yaml b/mods/ra/maps/drop-zone-w/map.yaml index 4cbefad4e4..e10654db65 100644 --- a/mods/ra/maps/drop-zone-w/map.yaml +++ b/mods/ra/maps/drop-zone-w/map.yaml @@ -208,23 +208,11 @@ Rules: Maximum: 3 SpawnInterval: 5 WaterChance: 1 + CrateActors: unitcrate -SpawnMPUnits: -MPStartLocations: - CRATE: - -LevelUpCrateAction: - -GiveMcvCrateAction: - -GiveUnitCrateAction@jeep: - -GiveUnitCrateAction@1tnk: - -RevealMapCrateAction: - -HideMapCrateAction: - -ExplodeCrateAction@nuke: - -ExplodeCrateAction@boom: - -ExplodeCrateAction@fire: - -SupportPowerCrateAction@parabombs: - -GiveCashCrateAction: - -DuplicateUnitCrateAction: - -GiveUnitCrateAction@squadlight: - -GiveUnitCrateAction@squadheavyallies: + UNITCRATE: + Inherits: ^Crate GiveUnitCrateAction@pt: SelectionShares: 7 Units: pt diff --git a/mods/ra/maps/drop-zone/map.yaml b/mods/ra/maps/drop-zone/map.yaml index 0d57ecd47c..69e0096052 100644 --- a/mods/ra/maps/drop-zone/map.yaml +++ b/mods/ra/maps/drop-zone/map.yaml @@ -189,21 +189,11 @@ Rules: CrateSpawner: Maximum: 3 SpawnInterval: 5 + CrateActors: unitcrate -SpawnMPUnits: -MPStartLocations: - CRATE: - -LevelUpCrateAction: - -GiveMcvCrateAction: - -RevealMapCrateAction: - -HideMapCrateAction: - -ExplodeCrateAction@nuke: - -ExplodeCrateAction@boom: - -ExplodeCrateAction@fire: - -SupportPowerCrateAction@parabombs: - -GiveCashCrateAction: - -DuplicateUnitCrateAction: - -GiveUnitCrateAction@squadlight: - -GiveUnitCrateAction@squadheavysoviet: + UNITCRATE: + Inherits: ^Crate GiveUnitCrateAction@ttnk: SelectionShares: 4 Units: ttnk diff --git a/mods/ra/maps/fort-lonestar/map.yaml b/mods/ra/maps/fort-lonestar/map.yaml index d6130c546c..4a6a8284aa 100644 --- a/mods/ra/maps/fort-lonestar/map.yaml +++ b/mods/ra/maps/fort-lonestar/map.yaml @@ -482,32 +482,24 @@ Rules: CrateSpawner: Maximum: 1 SpawnInterval: 100 + CrateActors: fortcrate -SpawnMPUnits: -MPStartLocations: LuaScript: Scripts: fort-lonestar.lua - CRATE: - -LevelUpCrateAction: - -GiveMcvCrateAction: - -RevealMapCrateAction: - -HideMapCrateAction: - -ExplodeCrateAction@nuke: - -ExplodeCrateAction@boom: - -ExplodeCrateAction@fire: - -GiveUnitCrateAction@jeep: - -GiveUnitCrateAction@arty: - -GiveUnitCrateAction@v2rl: - -GiveUnitCrateAction@1tnk: - -GiveUnitCrateAction@2tnk: - -GiveUnitCrateAction@3tnk: - -GiveUnitCrateAction@4tnk: + FORTCRATE: + Inherits: ^Crate SupportPowerCrateAction@parabombs: SelectionShares: 30 + Proxy: powerproxy.parabombs + Effect: parabombs HealUnitsCrateAction: SelectionShares: 30 + Notification: heal2.aud + Effect: heal GiveCashCrateAction: Amount: 400 - UseCashTick: yes + UseCashTick: true SelectionShares: 30 GiveUnitCrateAction@e7: Units: e7