From 91b612fa4790aa927da83f800298c90d53c2236e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 9 Jul 2014 06:17:49 +0200 Subject: [PATCH 1/4] ITeleportable does not exist anymore --- OpenRA.Mods.RA/Crate.cs | 1 - OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index ef8cb228e3..f6081bbb36 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA public object Create(ActorInitializer init) { return new Crate(init, this); } } - // ITeleportable is required for paradrop class Crate : ITick, IPositionable, ICrushable, ISync, INotifyParachuteLanded, INotifyAddedToWorld, INotifyRemovedFromWorld { readonly Actor self; diff --git a/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs b/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs index c6440a6900..07c644bd7b 100644 --- a/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Crates public SupportPowerCrateAction(Actor self, SupportPowerCrateActionInfo info) : base(self, info) { Info = info; } - // The free unit crate requires same race, and the actor to be at least ITeleportable. + // The free unit crate requires same race and the actor needs to be mobile. // We want neither of these properties for crate power proxies. public override void Activate(Actor collector) { From aa8ce199c27480c528ab3fbb63a1275c2f9788ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Aug 2014 16:06:10 +0200 Subject: [PATCH 2/4] self-document CrushClass of crates --- OpenRA.Mods.RA/Crate.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index f6081bbb36..f7df5848c6 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -22,8 +22,12 @@ namespace OpenRA.Mods.RA [Desc("Seconds")] public readonly int Lifetime = 5; + [Desc("Allowed to land on.")] public readonly string[] TerrainTypes = { }; + [Desc("Define actors that can collect crates by setting this into the Crushes field from the Mobile trait.")] + public readonly string CrushClass = "crate"; + public object Create(ActorInitializer init) { return new Crate(init, this); } } @@ -127,7 +131,7 @@ namespace OpenRA.Mods.RA public bool CrushableBy(string[] crushClasses, Player owner) { - return crushClasses.Contains("crate"); + return crushClasses.Contains(info.CrushClass); } public void AddedToWorld(Actor self) From 57463f249cf26060c258fba37707b8a1c1a2238b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Aug 2014 16:18:49 +0200 Subject: [PATCH 3/4] let supply trucks spawn money crates upon destruction --- mods/ra/rules/misc.yaml | 22 ++++++++++++++++++++++ mods/ra/rules/vehicles.yaml | 2 ++ mods/ra/sequences/misc.yaml | 5 +++++ 3 files changed, 29 insertions(+) diff --git a/mods/ra/rules/misc.yaml b/mods/ra/rules/misc.yaml index 2e471b0e0f..ce7aaec68c 100644 --- a/mods/ra/rules/misc.yaml +++ b/mods/ra/rules/misc.yaml @@ -160,6 +160,28 @@ CRATE: Passenger: BodyOrientation: +MONEYCRATE: + Tooltip: + Name: Money Crate + Crate: + Lifetime: 180 + TerrainTypes: Clear, Rough, Road, Ore, Beach + GiveCashCrateAction: + Amount: 500 + SelectionShares: 1 + UseCashTick: true + RenderSprites: + Palette: effect + WithCrateBody: + Images: wcrate + XmasImages: xcratea, xcrateb, xcratec, xcrated + Selectable: + Selectable: false + Bounds: 15,15,-1,-1 + ProximityCaptor: + Types: Crate + BodyOrientation: + CAMERA: Immobile: OccupiesSpace: false diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index 62d890aea0..75f02327bb 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -480,6 +480,8 @@ TRUK: Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall + LeavesHusk: + HuskActor: moneycrate MGG: Inherits: ^Vehicle diff --git a/mods/ra/sequences/misc.yaml b/mods/ra/sequences/misc.yaml index f282d06027..3d7d9eb031 100644 --- a/mods/ra/sequences/misc.yaml +++ b/mods/ra/sequences/misc.yaml @@ -268,6 +268,11 @@ scrate: Tick: 500 ZOffset: -511 +wcrate: + idle: + Start: 0 + ZOffset: -511 + xcratea: idle: Start: 0 From 98106e2ff78e5029f228e5d0aff863ec96ed62f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Aug 2014 16:22:20 +0200 Subject: [PATCH 4/4] ContainsCrate is redundant to LeavesHusk --- OpenRA.Mods.RA/ContainsCrate.cs | 30 ---------------------------- OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 - OpenRA.Utility/UpgradeRules.cs | 10 ++++++++++ 3 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 OpenRA.Mods.RA/ContainsCrate.cs diff --git a/OpenRA.Mods.RA/ContainsCrate.cs b/OpenRA.Mods.RA/ContainsCrate.cs deleted file mode 100644 index 52d9346315..0000000000 --- a/OpenRA.Mods.RA/ContainsCrate.cs +++ /dev/null @@ -1,30 +0,0 @@ -#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 OpenRA.Primitives; -using OpenRA.Traits; - -namespace OpenRA.Mods.RA -{ - [Desc("Leave a \"crate\" actor after destruction.")] - public class ContainsCrateInfo : TraitInfo { } - - public class ContainsCrate : INotifyKilled - { - public void Killed(Actor self, AttackInfo e) - { - self.World.AddFrameEndTask(w => w.CreateActor("crate", new TypeDictionary - { - new LocationInit(self.Location), - new OwnerInit(self.World.WorldActor.Owner), - })); - } - } -} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 1148e35b16..0a1adbc83e 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -191,7 +191,6 @@ - diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index afed5bc493..344fb1e16d 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -354,6 +354,16 @@ namespace OpenRA.Utility } } + if (engineVersion < 20140803) + { + // ContainsCrate was removed (use LeavesHusk instead) + if (depth == 1 && node.Key == "ContainsCrate") + { + node.Key = "LeavesHusk"; + node.Value.Nodes.Add(new MiniYamlNode("HuskActor", new MiniYaml("crate"))); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }