low power slowdown
This commit is contained in:
@@ -6,6 +6,8 @@ using OpenRa.Game.Traits;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
enum PowerState { Normal, Low, Critical };
|
||||
|
||||
class Player
|
||||
{
|
||||
public int Palette;
|
||||
@@ -65,6 +67,13 @@ namespace OpenRa.Game
|
||||
return (float)Ore / GetOreCapacity();
|
||||
}
|
||||
|
||||
public PowerState GetPowerState()
|
||||
{
|
||||
if (powerProvided >= powerDrained) return PowerState.Normal;
|
||||
if (powerProvided > powerDrained / 2) return PowerState.Low;
|
||||
return PowerState.Critical;
|
||||
}
|
||||
|
||||
public int GetOreCapacity()
|
||||
{
|
||||
return Game.world.Actors
|
||||
|
||||
Reference in New Issue
Block a user