More hard-coded text removal, fixed StatusHUD displaying husk infection state incorrectly

This commit is contained in:
Joonas Rikkonen
2018-01-12 13:17:22 +02:00
parent 6edbe5de1f
commit 03bff643f8
4 changed files with 84 additions and 32 deletions

View File

@@ -178,7 +178,7 @@ namespace Barotrauma
{
if (GameMain.NetworkMember != null && Character.controlled == this)
{
string chatMessage = TextManager.Get("Self_CauseOfDeath." + causeOfDeath.ToString());
string chatMessage = TextManager.Get("Self_CauseOfDeathDescription." + causeOfDeath.ToString());
if (GameMain.Client != null) chatMessage += " Your chat messages will only be visible to other dead players.";
GameMain.NetworkMember.AddChatMessage(chatMessage, ChatMessageType.Dead);

View File

@@ -88,7 +88,7 @@ namespace Barotrauma
Character character = characterInfo.Character;
if (character == null || character.IsDead)
{
statusText = TextManager.Get("CauseOfDeath." + characterInfo.CauseOfDeath.ToString());
statusText = TextManager.Get("CauseOfDeathDescription." + characterInfo.CauseOfDeath.ToString());
statusColor = Color.DarkRed;
}
else

View File

@@ -8,11 +8,30 @@ namespace Barotrauma.Items.Components
{
partial class StatusHUD : ItemComponent
{
private static readonly string[] BleedingTexts = { "Minor bleeding", "Bleeding", "Bleeding heavily", "Catastrophic Bleeding" };
private static readonly string[] BleedingTexts =
{
TextManager.Get("MinorBleeding"),
TextManager.Get("Bleeding"),
TextManager.Get("HeavyBleeding"),
TextManager.Get("CatastrophicBleeding")
};
private static readonly string[] HealthTexts = { "No visible injuries", "Minor injuries", "Injured", "Major injuries", "Critically injured" };
private static readonly string[] HealthTexts =
{
TextManager.Get("NoInjuries"),
TextManager.Get("MinorInjuries"),
TextManager.Get("Injuries"),
TextManager.Get("MajorInjuries"),
TextManager.Get("CriticalInjuries")
};
private static readonly string[] OxygenTexts = { "Oxygen level normal", "Gasping for air", "Signs of oxygen deprivation", "Not breathing" };
private static readonly string[] OxygenTexts =
{
TextManager.Get("OxygenNormal"),
TextManager.Get("OxygenReduced"),
TextManager.Get("OxygenLow"),
TextManager.Get("NotBreathing")
};
[Serialize(500.0f, false)]
public float Range
@@ -126,20 +145,20 @@ namespace Barotrauma.Items.Components
if (target.IsDead)
{
texts.Add("Deceased");
texts.Add("Cause of Death: " + target.CauseOfDeath.ToString());
texts.Add(TextManager.Get("Deceased"));
texts.Add(TextManager.Get("CauseOfDeath") + ": " + TextManager.Get("CauseOfDeath." + target.CauseOfDeath.ToString()));
}
else
{
if (target.IsUnconscious) texts.Add("Unconscious");
if (target.Stun > 0.01f) texts.Add("Stunned");
if (target.IsUnconscious) texts.Add(TextManager.Get("Unconscious"));
if (target.Stun > 0.01f) texts.Add(TextManager.Get("Stunned"));
int healthTextIndex = target.Health > 95.0f ? 0 :
MathHelper.Clamp((int)Math.Ceiling((1.0f - (target.Health / 200.0f + 0.5f)) * HealthTexts.Length), 0, HealthTexts.Length - 1);
texts.Add(HealthTexts[healthTextIndex]);
int oxygenTextIndex = MathHelper.Clamp((int)Math.Floor((1.0f - (target.Oxygen / 200.0f + 0.5f)) * OxygenTexts.Length), 0, OxygenTexts.Length - 1);
int oxygenTextIndex = MathHelper.Clamp((int)Math.Floor((1.0f - (target.Oxygen / 100.0f)) * OxygenTexts.Length), 0, OxygenTexts.Length - 1);
texts.Add(OxygenTexts[oxygenTextIndex]);
if (target.Bleeding > 0.0f)
@@ -150,13 +169,13 @@ namespace Barotrauma.Items.Components
if (target.huskInfection != null)
{
if (target.huskInfection.State != HuskInfection.InfectionState.Transition)
if (target.huskInfection.State == HuskInfection.InfectionState.Transition)
{
texts.Add("Velonaceps calyx infection");
texts.Add(TextManager.Get("HuskInfectionTransition"));
}
else if (target.huskInfection.State != HuskInfection.InfectionState.Active)
else if (target.huskInfection.State == HuskInfection.InfectionState.Active)
{
texts.Add("Advanced Velonaceps calyx infection");
texts.Add(TextManager.Get("HuskInfectionActive"));
}
}
}

View File

@@ -52,8 +52,7 @@
<OxygenBarInfo>Running out of oxygen!</OxygenBarInfo>
<PressureInfo>Water pressure increasing!</PressureInfo>
<Grabbing>Grabbing</Grabbing>
<Stun>Stun</Stun>
<Stun>Stun</Stun>
<!-- Status -->
<StatusOK>OK</StatusOK>
@@ -135,6 +134,7 @@
<Crew>Crew</Crew>
<Store>Store</Store>
<Hire>Hire</Hire>
<HireButton>Hire</HireButton>
<Location>Location</Location>
<HireUnavailable>No-one available for hire.</HireUnavailable>
<Mission>Mission</Mission>
@@ -280,28 +280,61 @@
<TraitorEndMessageFailureTraitorDetained>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task failed - [genderpronoun] was successfully detained.</TraitorEndMessageFailureTraitorDetained>
<!-- Causes of death -->
<CauseOfDeath.Damage>Succumbed to their injuries</CauseOfDeath.Damage>
<CauseOfDeath.Bloodloss>Bled out</CauseOfDeath.Bloodloss>
<CauseOfDeath.Drowning>Drowned</CauseOfDeath.Drowning>
<CauseOfDeath.Suffocation>Suffocated</CauseOfDeath.Suffocation>
<CauseOfDeath.Pressure>Crushed by water pressure</CauseOfDeath.Pressure>
<CauseOfDeath.Burn>Burned to death</CauseOfDeath.Burn>
<CauseOfDeath.Husk>Taken over by a parasite</CauseOfDeath.Husk>
<CauseOfDeath.Disconnected>Disconnected</CauseOfDeath.Disconnected>
<CauseOfDeath>Cause of death</CauseOfDeath>
<CauseOfDeath.Damage>Damage</CauseOfDeath.Damage>
<CauseOfDeath.Bloodloss>Bloodloss</CauseOfDeath.Bloodloss>
<CauseOfDeath.Drowning>Drowning</CauseOfDeath.Drowning>
<CauseOfDeath.Suffocation>Suffocation</CauseOfDeath.Suffocation>
<CauseOfDeath.Pressure>Pressure</CauseOfDeath.Pressure>
<CauseOfDeath.Burn>Burn</CauseOfDeath.Burn>
<CauseOfDeath.Husk>Husk infection</CauseOfDeath.Husk>
<CauseOfDeath.Disconnected>Braindead</CauseOfDeath.Disconnected>
<CauseOfDeathDescription.Damage>Succumbed to their injuries</CauseOfDeathDescription.Damage>
<CauseOfDeathDescription.Bloodloss>Bled out</CauseOfDeathDescription.Bloodloss>
<CauseOfDeathDescription.Drowning>Drowned</CauseOfDeathDescription.Drowning>
<CauseOfDeathDescription.Suffocation>Suffocated</CauseOfDeathDescription.Suffocation>
<CauseOfDeathDescription.Pressure>Crushed by water pressure</CauseOfDeathDescription.Pressure>
<CauseOfDeathDescription.Burn>Burned to death</CauseOfDeathDescription.Burn>
<CauseOfDeathDescription.Husk>Taken over by a parasite</CauseOfDeathDescription.Husk>
<CauseOfDeathDescription.Disconnected>Disconnected</CauseOfDeathDescription.Disconnected>
<Self_CauseOfDeath.Damage>You have succumbed to your injuries.</Self_CauseOfDeath.Damage>
<Self_CauseOfDeath.Bloodloss>You have bled out.</Self_CauseOfDeath.Bloodloss>
<Self_CauseOfDeath.Drowning>You have drowned.</Self_CauseOfDeath.Drowning>
<Self_CauseOfDeath.Suffocation>You have suffocated.</Self_CauseOfDeath.Suffocation>
<Self_CauseOfDeath.Pressure>You have been crushed by water pressure.</Self_CauseOfDeath.Pressure>
<Self_CauseOfDeath.Burn>You have burned to death.</Self_CauseOfDeath.Burn>
<Self_CauseOfDeath.Husk>The parasite has taken over your body.</Self_CauseOfDeath.Husk>
<Self_CauseOfDeath.Disconnected>You were disconnected from the server.</Self_CauseOfDeath.Disconnected>
<Self_CauseOfDeathDescription.Damage>You have succumbed to your injuries.</Self_CauseOfDeathDescription.Damage>
<Self_CauseOfDeathDescription.Bloodloss>You have bled out.</Self_CauseOfDeathDescription.Bloodloss>
<Self_CauseOfDeathDescription.Drowning>You have drowned.</Self_CauseOfDeathDescription.Drowning>
<Self_CauseOfDeathDescription.Suffocation>You have suffocated.</Self_CauseOfDeathDescription.Suffocation>
<Self_CauseOfDeathDescription.Pressure>You have been crushed by water pressure.</Self_CauseOfDeathDescription.Pressure>
<Self_CauseOfDeathDescription.Burn>You have burned to death.</Self_CauseOfDeathDescription.Burn>
<Self_CauseOfDeathDescription.Husk>The parasite has taken over your body.</Self_CauseOfDeathDescription.Husk>
<Self_CauseOfDeathDescription.Disconnected>You were disconnected from the server.</Self_CauseOfDeathDescription.Disconnected>
<GiveInButton>Give in</GiveInButton>
<GiveInHelpMultiplayer>Let go of your character and enter spectator mode (other players will no longer be able to revive you)</GiveInHelpMultiplayer>
<GiveInHelpSingleplayer>"The character can no longer be revived if you give in."</GiveInHelpSingleplayer>
<!-- Status -->
<Deceased>Deceased</Deceased>
<Unconscious>Unconscious</Unconscious>
<Stunned>Stunned</Stunned>
<HuskInfectionTransition>Velonaceps calyx infection</HuskInfectionTransition>
<HuskInfectionActive>Advanced Velonaceps calyx infection</HuskInfectionActive>
<MinorBleeding>Minor bleeding</MinorBleeding>
<Bleeding>Bleeding</Bleeding>
<HeavyBleeding>Heavy bleeding</HeavyBleeding>
<CatastrophicBleeding>Catastrophic bleeding</CatastrophicBleeding>
<NoInjuries>No visible injuries</NoInjuries>
<MinorInjuries>Minor injuries</MinorInjuries>
<Injuries>Injured</Injuries>
<MajorInjuries>Major injuries</MajorInjuries>
<CriticalInjuries>Critically injured</CriticalInjuries>
<OxygenNormal>Oxygen level normal</OxygenNormal>
<OxygenReduced>Gasping for air</OxygenReduced>
<OxygenLow>Signs of oxygen deprivation</OxygenLow>
<NotBreathing>Not breathing</NotBreathing>
<!-- Huskification -->
<HuskDormant>Your throat feels sore</HuskDormant>
<HuskDormant>Your feel feverish</HuskDormant>