Files
LuaCsForBarotraumaEP/Subsurface/Source/GameSession/GameModes/TraitorMode.cs
Regalis c78784068c -fixed a typo in fabricableItem requirement & added checking for said typos
- fixed being able to set battery recharge sped over the limits
- fixed vents being added to OxygenGenerator.ventlist multiple times
- fixed item.Submarine not being set if pulling an item from a fabricator
- some tutorial fixes
- fixed TraitorMode endmessage not being shown if the sub isn't at the end and neither character is dead
- SalvageQuest fails if the item has been destroyed
-
2016-01-21 20:59:26 +02:00

72 lines
2.7 KiB
C#

using System;
using System.Linq;
using Barotrauma.Networking;
namespace Barotrauma
{
class TraitorManager
{
private Character traitorCharacter, targetCharacter;
public TraitorManager(GameServer server)
{
server.NewTraitor(out traitorCharacter, out targetCharacter);
}
public string GetEndMessage()
{
if (GameMain.Server == null || traitorCharacter == null || targetCharacter == null) return "";
if (targetCharacter.IsDead)
{
string endMessage = traitorCharacter.Name + " was a traitor! ";
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
endMessage += " task was to assassinate " + targetCharacter.Name + ". The task was successful.";
//End(endMessage);
}
else if (traitorCharacter.IsDead)
{
string endMessage = traitorCharacter.Name + " was a traitor! ";
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
endMessage += " task was to assassinate " + targetCharacter.Name + ", but ";
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "he" : "she";
endMessage += " got " + ((traitorCharacter.Info.Gender == Gender.Male) ? "himself" : "herself");
endMessage += " killed before completing it.";
return endMessage;
}
else
{
string endMessage = traitorCharacter.Name + " was a traitor! ";
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
endMessage += " task was to assassinate " + targetCharacter.Name + ". ";
endMessage += (Submarine.Loaded.AtEndPosition) ?
"The task was unsuccessful - the has submarine reached its destination." :
"The task was unsuccessful.";
return endMessage;
}
return "";
}
//public void CharacterLeft(Character character)
//{
// if (character != traitorCharacter && character != targetCharacter) return;
// if (character == traitorCharacter)
// {
// string endMessage = "The traitor has disconnected from the server.";
// End(endMessage);
// }
// else if (character == targetCharacter)
// {
// string endMessage = "The traitor's target has disconnected from the server.";
// End(endMessage);
// }
//}
}
}