From e3dae2edd0becea35df6a501356c64e4697ef4a2 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 15 Jul 2014 10:15:35 +1200 Subject: [PATCH 1/2] Replace the obsolete race check from GiveUnitCrateAction. --- OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs index 23bdda30a9..53b1274b04 100644 --- a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs @@ -19,9 +19,15 @@ namespace OpenRA.Mods.RA.Crates class GiveUnitCrateActionInfo : CrateActionInfo { [ActorReference] + [Desc("Unit to give")] public readonly string Unit = null; + + [Desc("Override the owner of the newly spawned unit: e.g Creeps or Neutral")] public readonly string Owner = null; + [Desc("Races that are allowed to trigger this action")] + public readonly string[] Race = null; + public override object Create(ActorInitializer init) { return new GiveUnitCrateAction(init.self, this); } } @@ -34,14 +40,12 @@ namespace OpenRA.Mods.RA.Crates public bool CanGiveTo(Actor collector) { - var bi = self.World.Map.Rules.Actors[Info.Unit].Traits.GetOrDefault(); - - // this unit is not buildable by the collector's country, so - // don't give them free ones either. - if (Info.Owner == null && bi != null && !bi.Owner.Contains(collector.Owner.Country.Race)) return false; + if (Info.Race != null && !Info.Race.Contains(collector.Owner.Country.Race)) + return false; // avoid dumping tanks in the sea, and ships on dry land. - if (!GetSuitableCells(collector.Location).Any()) return false; + if (!GetSuitableCells(collector.Location).Any()) + return false; return true; } From 8f60b9b65256fea2888b81bd3a080b35407d6c57 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 13 Jul 2014 20:01:33 +0200 Subject: [PATCH 2/2] Fixed drop-zone units --- .../ra/maps/drop-zone-battle-of-tikiaki/map.yaml | 16 +++++++++++++--- mods/ra/maps/drop-zone/map.yaml | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) 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 e7f981b318..bb3e1e50b8 100644 --- a/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml +++ b/mods/ra/maps/drop-zone-battle-of-tikiaki/map.yaml @@ -321,6 +321,15 @@ Rules: GiveUnitCrateAction@dog: SelectionShares: 1 Unit: dog + ^Infantry: + GivesBounty: + Percentage: 0 + ^Tank: + GivesBounty: + Percentage: 0 + ^Vehicle: + GivesBounty: + Percentage: 0 APC: Health: HP: 1000 @@ -334,9 +343,10 @@ Rules: Description: Explodes like a damn nuke! Health: HP: 100 - Explodes: - Weapon: CrateNuke - EmptyWeapon: + Explodes: + Weapon: CrateNuke + EmptyWeapon: CrateNuke + DemoTruck: SHOK: Health: HP: 800 diff --git a/mods/ra/maps/drop-zone/map.yaml b/mods/ra/maps/drop-zone/map.yaml index f00ab9bfdc..447e6bb86e 100644 --- a/mods/ra/maps/drop-zone/map.yaml +++ b/mods/ra/maps/drop-zone/map.yaml @@ -216,6 +216,15 @@ Rules: GiveUnitCrateAction@dog: SelectionShares: 1 Unit: dog + ^Infantry: + GivesBounty: + Percentage: 0 + ^Tank: + GivesBounty: + Percentage: 0 + ^Vehicle: + GivesBounty: + Percentage: 0 APC: Health: HP: 1000 @@ -229,9 +238,10 @@ Rules: Description: Explodes like a damn nuke! Health: HP: 100 - Explodes: - Weapon: CrateNuke - EmptyWeapon: + Explodes: + Weapon: CrateNuke + EmptyWeapon: CrateNuke + DemoTruck: SHOK: Health: HP: 800