From ad7f188bf51ca6284f0880e3961b772a02b8c6a9 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 8 Jan 2010 22:15:42 +1300 Subject: [PATCH] Steal half the ore a building holds --- OpenRa.Game/Traits/StoresOre.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRa.Game/Traits/StoresOre.cs b/OpenRa.Game/Traits/StoresOre.cs index 9068839e60..bdabfca5d2 100644 --- a/OpenRa.Game/Traits/StoresOre.cs +++ b/OpenRa.Game/Traits/StoresOre.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System; +using OpenRa.Game.GameRules; namespace OpenRa.Game.Traits { class StoresOre : IPips, IAcceptThief @@ -15,9 +16,10 @@ namespace OpenRa.Game.Traits public void OnSteal(Actor self, Actor thief) { - var cashStolen = Math.Min(MaxStealAmount, self.Owner.Cash); - self.Owner.TakeCash(cashStolen); - thief.Owner.GiveCash(cashStolen); + // Steal half the ore the building holds + var toSteal = (self.Info as BuildingInfo).Storage/2; + self.Owner.TakeCash(toSteal); + thief.Owner.GiveCash(toSteal); if (Game.LocalPlayer == thief.Owner) Sound.Play("credit1.aud");