low power notif
This commit is contained in:
@@ -41,6 +41,9 @@ namespace OpenRa.Game
|
|||||||
powerProvided += dPower;
|
powerProvided += dPower;
|
||||||
if (dPower < 0)
|
if (dPower < 0)
|
||||||
powerDrained -= dPower;
|
powerDrained -= dPower;
|
||||||
|
|
||||||
|
if (powerDrained > powerProvided)
|
||||||
|
GiveAdvice("lopower1.aud");
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetSiloFullness()
|
public float GetSiloFullness()
|
||||||
@@ -57,6 +60,13 @@ namespace OpenRa.Game
|
|||||||
.Sum(b => b.Storage);
|
.Sum(b => b.Storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GiveAdvice(string advice)
|
||||||
|
{
|
||||||
|
// todo: store the condition or something.
|
||||||
|
// repeat after Rules.General.SpeakDelay, as long as the condition holds.
|
||||||
|
Sound.Play(advice);
|
||||||
|
}
|
||||||
|
|
||||||
public void GiveCash( int num ) { Cash += num; }
|
public void GiveCash( int num ) { Cash += num; }
|
||||||
public void GiveOre(int num)
|
public void GiveOre(int num)
|
||||||
{
|
{
|
||||||
@@ -67,7 +77,7 @@ namespace OpenRa.Game
|
|||||||
Ore = capacity; // trim off the overflow.
|
Ore = capacity; // trim off the overflow.
|
||||||
|
|
||||||
if (Ore > .8 * capacity)
|
if (Ore > .8 * capacity)
|
||||||
Sound.Play("silond1.aud");
|
GiveAdvice("silond1.aud"); // silos needed
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TakeCash( int num )
|
public bool TakeCash( int num )
|
||||||
|
|||||||
Reference in New Issue
Block a user