Restore ra proc behavior
This commit is contained in:
@@ -29,6 +29,7 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
class OreRefineryInfo : ITraitInfo
|
class OreRefineryInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
|
public readonly bool LocalStorage = false;
|
||||||
public readonly int PipCount = 0;
|
public readonly int PipCount = 0;
|
||||||
public readonly PipType PipColor = PipType.Red;
|
public readonly PipType PipColor = PipType.Red;
|
||||||
public readonly int2 DockOffset = new int2 (1, 2);
|
public readonly int2 DockOffset = new int2 (1, 2);
|
||||||
@@ -75,19 +76,28 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void GiveOre (int amount)
|
public void GiveOre (int amount)
|
||||||
{
|
{
|
||||||
Ore += amount;
|
if (!Info.LocalStorage)
|
||||||
if (Ore > Info.Capacity)
|
Player.GiveOre(amount);
|
||||||
Ore = Info.Capacity;
|
else
|
||||||
|
{
|
||||||
|
Ore += amount;
|
||||||
|
if (Ore > Info.Capacity)
|
||||||
|
Ore = Info.Capacity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick (Actor self)
|
public void Tick (Actor self)
|
||||||
{
|
{
|
||||||
|
if (!Info.LocalStorage)
|
||||||
|
return;
|
||||||
|
|
||||||
if (--nextProcessTime <= 0) {
|
if (--nextProcessTime <= 0) {
|
||||||
// Convert resources to cash
|
// Convert resources to cash
|
||||||
int amount = Math.Min (Ore, Info.ProcessAmount);
|
int amount = Math.Min (Ore, Info.ProcessAmount);
|
||||||
amount = Math.Min (amount, Player.OreCapacity - Player.Ore);
|
amount = Math.Min (amount, Player.OreCapacity - Player.Ore);
|
||||||
|
|
||||||
if (amount > 0) {
|
if (amount > 0)
|
||||||
|
{
|
||||||
Ore -= amount;
|
Ore -= amount;
|
||||||
Player.GiveOre (amount);
|
Player.GiveOre (amount);
|
||||||
}
|
}
|
||||||
@@ -132,6 +142,9 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public IEnumerable<PipType> GetPips (Actor self)
|
public IEnumerable<PipType> 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);
|
return Graphics.Util.MakeArray (Info.PipCount, i => (Ore * 1f / Info.Capacity > i * 1f / Info.PipCount) ? Info.PipColor : PipType.Transparent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ PROC.proxy:
|
|||||||
Owner: gdi,nod
|
Owner: gdi,nod
|
||||||
Cost: 2300
|
Cost: 2300
|
||||||
Description: Tiberium Refinery
|
Description: Tiberium Refinery
|
||||||
LongDesc: Processes Tiberium into useable resources
|
LongDesc: Processes raw Tiberium into useable resources
|
||||||
Building:
|
Building:
|
||||||
Power: -50
|
Power: -50
|
||||||
Footprint: ___xx xxxxx xxx__ xxx__
|
Footprint: ___xx xxxxx xxx__ xxx__
|
||||||
@@ -64,7 +64,7 @@ PROC:
|
|||||||
Valued:
|
Valued:
|
||||||
Cost: 2000
|
Cost: 2000
|
||||||
Description: Tiberium Refinery
|
Description: Tiberium Refinery
|
||||||
LongDesc: Processes Tiberium into useable resources
|
LongDesc: Processes raw Tiberium into useable resources
|
||||||
Building:
|
Building:
|
||||||
Power: -30
|
Power: -30
|
||||||
Footprint: ___ xxx ===
|
Footprint: ___ xxx ===
|
||||||
@@ -76,6 +76,7 @@ PROC:
|
|||||||
Sight: 6
|
Sight: 6
|
||||||
Bib:
|
Bib:
|
||||||
OreRefinery:
|
OreRefinery:
|
||||||
|
LocalStorage: yes
|
||||||
PipCount: 15
|
PipCount: 15
|
||||||
PipColor: Red
|
PipColor: Red
|
||||||
DockOffset: 0,2
|
DockOffset: 0,2
|
||||||
|
|||||||
@@ -468,10 +468,6 @@ PROC:
|
|||||||
Sight: 6
|
Sight: 6
|
||||||
Bib:
|
Bib:
|
||||||
OreRefinery:
|
OreRefinery:
|
||||||
PipCount: 17
|
|
||||||
Capacity: 1000
|
|
||||||
ProcessTick: 25
|
|
||||||
ProcessAmount: 50
|
|
||||||
OreRefineryDockAction:
|
OreRefineryDockAction:
|
||||||
StoresOre:
|
StoresOre:
|
||||||
PipCount: 17
|
PipCount: 17
|
||||||
|
|||||||
Reference in New Issue
Block a user