diff --git a/OpenRA.Mods.RA/OreRefinery.cs b/OpenRA.Mods.RA/OreRefinery.cs index 122719f4b4..5ef1830f78 100755 --- a/OpenRA.Mods.RA/OreRefinery.cs +++ b/OpenRA.Mods.RA/OreRefinery.cs @@ -29,6 +29,7 @@ namespace OpenRA.Mods.RA { class OreRefineryInfo : ITraitInfo { + public readonly bool LocalStorage = false; public readonly int PipCount = 0; public readonly PipType PipColor = PipType.Red; public readonly int2 DockOffset = new int2 (1, 2); @@ -75,19 +76,28 @@ namespace OpenRA.Mods.RA public void GiveOre (int amount) { - Ore += amount; - if (Ore > Info.Capacity) - Ore = Info.Capacity; + if (!Info.LocalStorage) + Player.GiveOre(amount); + else + { + Ore += amount; + if (Ore > Info.Capacity) + Ore = Info.Capacity; + } } public void Tick (Actor self) { + if (!Info.LocalStorage) + return; + if (--nextProcessTime <= 0) { // Convert resources to cash int amount = Math.Min (Ore, Info.ProcessAmount); amount = Math.Min (amount, Player.OreCapacity - Player.Ore); - if (amount > 0) { + if (amount > 0) + { Ore -= amount; Player.GiveOre (amount); } @@ -132,6 +142,9 @@ namespace OpenRA.Mods.RA public IEnumerable GetPips (Actor self) { + if (!Info.LocalStorage) + return new PipType[] { }; + return Graphics.Util.MakeArray (Info.PipCount, i => (Ore * 1f / Info.Capacity > i * 1f / Info.PipCount) ? Info.PipColor : PipType.Transparent); } } diff --git a/mods/cnc/structures.yaml b/mods/cnc/structures.yaml index 0948b5d4d8..96bdaba3cf 100644 --- a/mods/cnc/structures.yaml +++ b/mods/cnc/structures.yaml @@ -46,7 +46,7 @@ PROC.proxy: Owner: gdi,nod Cost: 2300 Description: Tiberium Refinery - LongDesc: Processes Tiberium into useable resources + LongDesc: Processes raw Tiberium into useable resources Building: Power: -50 Footprint: ___xx xxxxx xxx__ xxx__ @@ -64,7 +64,7 @@ PROC: Valued: Cost: 2000 Description: Tiberium Refinery - LongDesc: Processes Tiberium into useable resources + LongDesc: Processes raw Tiberium into useable resources Building: Power: -30 Footprint: ___ xxx === @@ -76,6 +76,7 @@ PROC: Sight: 6 Bib: OreRefinery: + LocalStorage: yes PipCount: 15 PipColor: Red DockOffset: 0,2 diff --git a/mods/ra/structures.yaml b/mods/ra/structures.yaml index 9c0e79d189..8580dbed29 100644 --- a/mods/ra/structures.yaml +++ b/mods/ra/structures.yaml @@ -468,10 +468,6 @@ PROC: Sight: 6 Bib: OreRefinery: - PipCount: 17 - Capacity: 1000 - ProcessTick: 25 - ProcessAmount: 50 OreRefineryDockAction: StoresOre: PipCount: 17