Warning texts when water pressure is increasing to dangerous levels and when running out of oxygen, added a method for invoking an arbitrary action after a delay to CoroutineManager
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
<return>[sub] has returned to [location].</return>
|
||||
<gameover>The ocean has claimed [sub] and its crew.</gameover>
|
||||
|
||||
<OxygenBarInfo>Running out of oxygen!</OxygenBarInfo>
|
||||
<PressureInfo>Water pressure increasing!</PressureInfo>
|
||||
|
||||
<CauseOfDeath.Damage>Succumbed to their injuries</CauseOfDeath.Damage>
|
||||
<CauseOfDeath.Bloodloss>Bled out</CauseOfDeath.Bloodloss>
|
||||
<CauseOfDeath.Drowning>Drowned</CauseOfDeath.Drowning>
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
|
||||
descriptionneutral="A Coalition vessel has been dispatched from [location1] to destroy a renegade vessel at the outskirts of [location2]."
|
||||
description1="A renegade vessel has been detected at the outskirts of [location2]. Treason against the Europa Coalition is punishable by death - eliminate the renegades and return to [location1]!"
|
||||
description2="You're a member of a renegade group opposing the Europa Coalition. According to your informants at [location1], a Coalition ship has just been dispatched on a mission to take down your vessel. Eliminate their crew and return to [location2]."
|
||||
description2="You're a member of a renegade group opposing the Europa Coalition. According to your informants at [location1], a Coalition vessel has just been dispatched on a mission to take down your boat. Eliminate their crew and return to [location2]."
|
||||
|
||||
teamname1="Coalition"
|
||||
teamname2="Renegade"
|
||||
|
||||
@@ -37,6 +37,26 @@ namespace Barotrauma
|
||||
return handle;
|
||||
}
|
||||
|
||||
public static void InvokeAfter(Action action, float delay)
|
||||
{
|
||||
StartCoroutine(DoInvokeAfter(action, delay));
|
||||
}
|
||||
|
||||
private static IEnumerable<object> DoInvokeAfter(Action action, float delay)
|
||||
{
|
||||
if (action == null)
|
||||
{
|
||||
yield return CoroutineStatus.Failure;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(delay);
|
||||
|
||||
action();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
|
||||
public static bool IsCoroutineRunning(string name)
|
||||
{
|
||||
return Coroutines.Any(c => c.Name == name);
|
||||
|
||||
Reference in New Issue
Block a user