v0.3.3
This commit is contained in:
Binary file not shown.
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.3.2.6")]
|
[assembly: AssemblyVersion("0.3.3.0")]
|
||||||
[assembly: AssemblyFileVersion("0.3.2.6")]
|
[assembly: AssemblyFileVersion("0.3.3.0")]
|
||||||
|
|||||||
@@ -913,6 +913,13 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (selectedCharacter != null) DeselectCharacter();
|
||||||
|
selectedConstruction = null;
|
||||||
|
closestItem = null;
|
||||||
|
closestCharacter = null;
|
||||||
|
}
|
||||||
|
|
||||||
DisableControls = false;
|
DisableControls = false;
|
||||||
}
|
}
|
||||||
@@ -1393,7 +1400,7 @@ namespace Barotrauma
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
message.Write((byte)0);
|
message.Write((byte)0);
|
||||||
message.WriteRangedInteger((int)lastAttackCauseOfDeath, 0, Enum.GetValues(typeof(CauseOfDeath)).Length);
|
message.WriteRangedInteger(0, Enum.GetValues(typeof(CauseOfDeath)).Length, (int)lastAttackCauseOfDeath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AnimController.StunTimer<=0.0f && bleeding<=0.0f && oxygen>99.0f)
|
if (AnimController.StunTimer<=0.0f && bleeding<=0.0f && oxygen>99.0f)
|
||||||
|
|||||||
@@ -328,7 +328,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void Remove()
|
public void Remove()
|
||||||
{
|
{
|
||||||
if (headSprite != null) headSprite.Remove();
|
//if (headSprite != null)
|
||||||
|
//{
|
||||||
|
// headSprite.Remove();
|
||||||
|
// headSprite = null;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,11 +265,12 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
public void ReceiveCommandInput(char command)
|
public void ReceiveCommandInput(char command)
|
||||||
{
|
{
|
||||||
|
if (Text == null) Text = "";
|
||||||
|
|
||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
case '\b': //backspace
|
case '\b': //backspace
|
||||||
if (Text.Length > 0)
|
if (Text.Length > 0) Text = Text.Substring(0, Text.Length - 1);
|
||||||
Text = Text.Substring(0, Text.Length - 1);
|
|
||||||
break;
|
break;
|
||||||
//case '\r': //return
|
//case '\r': //return
|
||||||
// if (OnEnterPressed != null)
|
// if (OnEnterPressed != null)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -10,46 +12,98 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public TraitorManager(GameServer server)
|
public TraitorManager(GameServer server)
|
||||||
{
|
{
|
||||||
server.NewTraitor(out traitorCharacter, out targetCharacter);
|
Start(server);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Start(GameServer server)
|
||||||
|
{
|
||||||
|
if (server == null) return;
|
||||||
|
|
||||||
|
List<Character> characters = new List<Character>();
|
||||||
|
foreach (Client client in server.ConnectedClients)
|
||||||
|
{
|
||||||
|
if (!client.inGame || client.Character==null) continue;
|
||||||
|
characters.Add(client.Character);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (server.Character!= null) characters.Add(server.Character);
|
||||||
|
|
||||||
|
if (characters.Count < 2)
|
||||||
|
{
|
||||||
|
traitorCharacter = null;
|
||||||
|
targetCharacter = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int traitorIndex = Rand.Range(0, characters.Count);
|
||||||
|
|
||||||
|
int targetIndex = Rand.Range(0, characters.Count);
|
||||||
|
while (targetIndex == traitorIndex)
|
||||||
|
{
|
||||||
|
targetIndex = Rand.Range(0, characters.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
traitorCharacter = characters[traitorIndex];
|
||||||
|
targetCharacter = characters[targetIndex];
|
||||||
|
|
||||||
|
if (server.Character == null)
|
||||||
|
{
|
||||||
|
new GUIMessageBox("New traitor", traitorCharacter.Name + " is the traitor and the target is " + targetCharacter.Name+".");
|
||||||
|
}
|
||||||
|
else if (server.Character == traitorCharacter)
|
||||||
|
{
|
||||||
|
CreateStartPopUp(traitorCharacter.Name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
server.NewTraitor(traitorCharacter, targetCharacter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateStartPopUp(string targetName)
|
||||||
|
{
|
||||||
|
new GUIMessageBox("You are the Traitor!",
|
||||||
|
"Your secret task is to assassinate " + targetName + "! Discretion is an utmost concern; sinking the submarine and killing the entire crew "
|
||||||
|
+ "will arouse suspicion amongst the Fleet. If possible, make the death look like an accident.", 400, 350);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetEndMessage()
|
public string GetEndMessage()
|
||||||
{
|
{
|
||||||
if (GameMain.Server == null || traitorCharacter == null || targetCharacter == null) return "";
|
if (GameMain.Server == null || traitorCharacter == null || targetCharacter == null) return "";
|
||||||
|
|
||||||
if (targetCharacter.IsDead)
|
string endMessage = "";
|
||||||
|
|
||||||
|
if (targetCharacter.IsDead && !traitorCharacter.IsDead)
|
||||||
{
|
{
|
||||||
string endMessage = traitorCharacter.Name + " was a traitor! ";
|
endMessage = traitorCharacter.Name + " was a traitor! ";
|
||||||
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
||||||
endMessage += " task was to assassinate " + targetCharacter.Name + ". The task was successful.";
|
endMessage += " task was to assassinate " + targetCharacter.Name + ". The task was successful.";
|
||||||
//End(endMessage);
|
}
|
||||||
|
else if (targetCharacter.IsDead && traitorCharacter.IsDead)
|
||||||
|
{
|
||||||
|
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, but luckily the bastard didn't make it out alive either.";
|
||||||
}
|
}
|
||||||
else if (traitorCharacter.IsDead)
|
else if (traitorCharacter.IsDead)
|
||||||
{
|
{
|
||||||
string endMessage = traitorCharacter.Name + " was a traitor! ";
|
endMessage = traitorCharacter.Name + " was a traitor! ";
|
||||||
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
||||||
endMessage += " task was to assassinate " + targetCharacter.Name + ", but ";
|
endMessage += " task was to assassinate " + targetCharacter.Name + ", but ";
|
||||||
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "he" : "she";
|
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "he" : "she";
|
||||||
endMessage += " got " + ((traitorCharacter.Info.Gender == Gender.Male) ? "himself" : "herself");
|
endMessage += " got " + ((traitorCharacter.Info.Gender == Gender.Male) ? "himself" : "herself");
|
||||||
endMessage += " killed before completing it.";
|
endMessage += " killed before completing it.";
|
||||||
|
|
||||||
return endMessage;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string endMessage = traitorCharacter.Name + " was a traitor! ";
|
endMessage = traitorCharacter.Name + " was a traitor! ";
|
||||||
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
||||||
endMessage += " task was to assassinate " + targetCharacter.Name + ". ";
|
endMessage += " task was to assassinate " + targetCharacter.Name + ". ";
|
||||||
endMessage += (Submarine.Loaded.AtEndPosition) ?
|
endMessage += (Submarine.Loaded.AtEndPosition) ?
|
||||||
"The task was unsuccessful - the has submarine reached its destination." :
|
"The task was unsuccessful - the has submarine reached its destination." :
|
||||||
"The task was unsuccessful.";
|
"The task was unsuccessful.";
|
||||||
|
|
||||||
return endMessage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return endMessage;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void CharacterLeft(Character character)
|
//public void CharacterLeft(Character character)
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
||||||
{
|
{
|
||||||
message.WriteRangedInteger(-10,10,(int)(flowPercentage/10.0f));
|
message.WriteRangedInteger(-10, 10, (int)(flowPercentage / 10.0f));
|
||||||
message.Write(IsActive);
|
message.Write(IsActive);
|
||||||
message.WritePadBits();
|
message.WritePadBits();
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
panelTexture = Sprite.LoadTexture("Content/Items/connectionpanel.png");
|
panelTexture = Sprite.LoadTexture("Content/Items/connectionpanel.png");
|
||||||
|
|
||||||
connector = new Sprite(panelTexture, new Rectangle(448, 80, 64, 64), new Vector2(-32.0f, -32.0f), 0.0f);
|
connector = new Sprite(panelTexture, new Rectangle(448, 80, 64, 64), Vector2.Zero, 0.0f);
|
||||||
|
connector.Origin = new Vector2(32.0f, 32.0f);
|
||||||
wireCorner = new Sprite(panelTexture, new Rectangle(448, 0, 64, 64), new Vector2(-32.0f, -32.0f), 0.0f);
|
wireCorner = new Sprite(panelTexture, new Rectangle(448, 0, 64, 64), new Vector2(-32.0f, -32.0f), 0.0f);
|
||||||
wireVertical = new Sprite(panelTexture, new Rectangle(480, 64, 16, 16), new Vector2(-8.0f, -8.0f), 0.0f);
|
wireVertical = new Sprite(panelTexture, new Rectangle(480, 64, 16, 16), new Vector2(-8.0f, -8.0f), 0.0f);
|
||||||
wireHorizontal = new Sprite(panelTexture, new Rectangle(496, 64, 16, 16), new Vector2(-8.0f, -8.0f), 0.0f);
|
wireHorizontal = new Sprite(panelTexture, new Rectangle(496, 64, 16, 16), new Vector2(-8.0f, -8.0f), 0.0f);
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ namespace Barotrauma
|
|||||||
float[] leftDelta;
|
float[] leftDelta;
|
||||||
float[] rightDelta;
|
float[] rightDelta;
|
||||||
|
|
||||||
float lastSentVolume;
|
private float lastSentVolume;
|
||||||
|
private float lastNetworkUpdate;
|
||||||
|
|
||||||
public List<Gap> ConnectedGaps;
|
public List<Gap> ConnectedGaps;
|
||||||
|
|
||||||
@@ -705,7 +706,7 @@ namespace Barotrauma
|
|||||||
message.WriteRangedSingle(MathHelper.Clamp(volume/FullVolume, 0.0f, 1.5f), 0.0f, 1.5f, 6);
|
message.WriteRangedSingle(MathHelper.Clamp(volume/FullVolume, 0.0f, 1.5f), 0.0f, 1.5f, 6);
|
||||||
|
|
||||||
message.Write((byte)fireSources.Count, 4);
|
message.Write((byte)fireSources.Count, 4);
|
||||||
for (int i = 0; i < Math.Min(fireSources.Count, 16) ;i++ )
|
for (int i = 0; i < Math.Min(fireSources.Count, 16); i++)
|
||||||
{
|
{
|
||||||
var fireSource = fireSources[i];
|
var fireSource = fireSources[i];
|
||||||
|
|
||||||
@@ -725,6 +726,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
data = null;
|
data = null;
|
||||||
|
|
||||||
|
if (sendingTime < lastNetworkUpdate) return;
|
||||||
|
|
||||||
float newVolume = this.volume;
|
float newVolume = this.volume;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -785,6 +788,8 @@ namespace Barotrauma
|
|||||||
toBeRemoved[i].Remove(true);
|
toBeRemoved[i].Remove(true);
|
||||||
}
|
}
|
||||||
fireSources = newFireSources;
|
fireSources = newFireSources;
|
||||||
|
|
||||||
|
lastNetworkUpdate = sendingTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -711,6 +711,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector2 center = (topLeft + bottomRight) / 2.0f;
|
Vector2 center = (topLeft + bottomRight) / 2.0f;
|
||||||
|
center.X -= center.X % GridSize.X;
|
||||||
|
center.Y -= center.Y % GridSize.Y;
|
||||||
|
|
||||||
foreach (Item item in Item.ItemList)
|
foreach (Item item in Item.ItemList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ namespace Barotrauma.Networking
|
|||||||
case (byte)PacketTypes.Traitor:
|
case (byte)PacketTypes.Traitor:
|
||||||
string targetName = inc.ReadString();
|
string targetName = inc.ReadString();
|
||||||
|
|
||||||
new GUIMessageBox("You are the Traitor!", "Your secret task is to assassinate " + targetName + "!");
|
TraitorManager.CreateStartPopUp(targetName);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case (byte)PacketTypes.ResendRequest:
|
case (byte)PacketTypes.ResendRequest:
|
||||||
|
|||||||
@@ -873,7 +873,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
UpdateCrewFrame();
|
UpdateCrewFrame();
|
||||||
|
|
||||||
if (TraitorsEnabled == YesNoMaybe.Yes || (TraitorsEnabled == YesNoMaybe.Maybe && Rand.Range(0.0f, 1.0f)<0.5f))
|
if (TraitorsEnabled == YesNoMaybe.Yes || (TraitorsEnabled == YesNoMaybe.Maybe && Rand.Range(0.0f, 1.0f) < 0.5f))
|
||||||
{
|
{
|
||||||
TraitorManager = new TraitorManager(this);
|
TraitorManager = new TraitorManager(this);
|
||||||
}
|
}
|
||||||
@@ -1022,15 +1022,6 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
if (gameStarted && client.Character != null)
|
if (gameStarted && client.Character != null)
|
||||||
{
|
{
|
||||||
if (GameMain.GameSession!=null && GameMain.GameSession.gameMode!=null)
|
|
||||||
{
|
|
||||||
//TraitorMode traitorMode = GameMain.GameSession.gameMode as TraitorMode;
|
|
||||||
//if (traitorMode!=null)
|
|
||||||
//{
|
|
||||||
// traitorMode.CharacterLeft(client.Character);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
client.Character.ClearInputs();
|
client.Character.ClearInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1106,45 +1097,9 @@ namespace Barotrauma.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NewTraitor(out Character traitor, out Character target)
|
public void NewTraitor(Character traitor, Character target)
|
||||||
{
|
{
|
||||||
List<Character> characters = new List<Character>();
|
Log(traitor.Name + " is the traitor and the target is " + target.Name, Color.Cyan);
|
||||||
foreach (Client client in ConnectedClients)
|
|
||||||
{
|
|
||||||
if (!client.inGame || client.Character==null) continue;
|
|
||||||
characters.Add(client.Character);
|
|
||||||
}
|
|
||||||
if (myCharacter!= null) characters.Add(myCharacter);
|
|
||||||
|
|
||||||
if (characters.Count < 2)
|
|
||||||
{
|
|
||||||
traitor = null;
|
|
||||||
target = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int traitorIndex = Rand.Range(0, characters.Count);
|
|
||||||
|
|
||||||
int targetIndex = Rand.Range(0, characters.Count);
|
|
||||||
while (targetIndex == traitorIndex)
|
|
||||||
{
|
|
||||||
targetIndex = Rand.Range(0, characters.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
traitor = characters[traitorIndex];
|
|
||||||
target = characters[targetIndex];
|
|
||||||
|
|
||||||
if (myCharacter==null)
|
|
||||||
{
|
|
||||||
new GUIMessageBox("New traitor", traitor.Info.Name + " is the traitor and the target is " + target.Info.Name+".");
|
|
||||||
}
|
|
||||||
else if (myCharacter == traitor)
|
|
||||||
{
|
|
||||||
new GUIMessageBox("You are the traitor!", "Your task is to assassinate " + target.Info.Name+".");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log(traitor.Info.Name + " is the traitor and the target is " + target.Info.Name, Color.Cyan);
|
|
||||||
|
|
||||||
Client traitorClient = null;
|
Client traitorClient = null;
|
||||||
foreach (Client c in ConnectedClients)
|
foreach (Client c in ConnectedClients)
|
||||||
|
|||||||
@@ -144,10 +144,10 @@ namespace Barotrauma.Networking
|
|||||||
if (!e.FillNetworkData(eventType, message, data)) return false;
|
if (!e.FillNetworkData(eventType, message, data)) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
DebugConsole.ThrowError("Failed to write network message for entity "+e.ToString());
|
DebugConsole.ThrowError("Failed to write network message for entity "+e.ToString(), exception);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -103,17 +103,17 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
if (Submarine.SavedSubmarines.Count > 0) mapList.Select(Submarine.SavedSubmarines[0]);
|
if (Submarine.SavedSubmarines.Count > 0) mapList.Select(Submarine.SavedSubmarines[0]);
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle((int)(mapList.Rect.Width + 30), 0, 100, 20),
|
new GUITextBlock(new Rectangle((int)(mapList.Rect.Width + 20), 0, 100, 20),
|
||||||
"Save name: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
"Save name: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||||
|
|
||||||
saveNameBox = new GUITextBox(new Rectangle((int)(mapList.Rect.Width + 20), 30, 180, 20),
|
saveNameBox = new GUITextBox(new Rectangle((int)(mapList.Rect.Width + 30), 30, 180, 20),
|
||||||
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||||
saveNameBox.Text = SaveUtil.CreateSavePath();
|
saveNameBox.Text = SaveUtil.CreateSavePath();
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle((int)(mapList.Rect.Width + 30), 60, 100, 20),
|
new GUITextBlock(new Rectangle((int)(mapList.Rect.Width + 20), 60, 100, 20),
|
||||||
"Map Seed: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
"Map Seed: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||||
|
|
||||||
seedBox = new GUITextBox(new Rectangle((int)(mapList.Rect.Width + 20), 90, 180, 20),
|
seedBox = new GUITextBox(new Rectangle((int)(mapList.Rect.Width + 30), 90, 180, 20),
|
||||||
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
Alignment.TopLeft, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||||
seedBox.Text = ToolBox.RandomSeed(8);
|
seedBox.Text = ToolBox.RandomSeed(8);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,6 +12,8 @@ far away from the coordinates (0,0)
|
|||||||
- character/inventory syncing bugfixes
|
- character/inventory syncing bugfixes
|
||||||
- fixed spectators not seeing their own chat messages
|
- fixed spectators not seeing their own chat messages
|
||||||
- scrollable list of clients in the network statistics view
|
- scrollable list of clients in the network statistics view
|
||||||
|
- small changes to the vanilla subs
|
||||||
|
- fixed the water brightness in Linux version
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
v0.3.2.6
|
v0.3.2.6
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user