Skip to content

Commit

Permalink
v0.4.0.1: radio messages visible to spectators, handheld sonars in va…
Browse files Browse the repository at this point in the history
…nilla subs, nerfed water damage to junction boxes, moved junction boxes inside Nehalennias ballast tanks to a drier location
  • Loading branch information
Regalis committed Apr 24, 2016
1 parent 5d635f5 commit d4816c3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Subsurface/Content/Items/Electricity/poweritems.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</fixrequirement>

<PowerTransfer canbeselected = "true">
<StatusEffect type="InWater" target="This" condition="-1.0"/>
<StatusEffect type="InWater" target="This" condition="-0.5"/>
<GuiFrame rect="0,0,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
</PowerTransfer>

Expand Down
23 changes: 10 additions & 13 deletions Subsurface/Source/Networking/NetworkMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,7 @@ public GUIFrame InGameHUD
{
get { return inGameHUD; }
}

public GUIListBox ChatBox
{
get { return chatBox; }
}


public NetworkMember()
{
inGameHUD = new GUIFrame(new Rectangle(0,0,0,0), null, null);
Expand Down Expand Up @@ -204,7 +199,7 @@ public bool CanUseRadio(Character sender)
{
if (sender == null) return false;

var radio = sender.Inventory.Items.First(i => i != null && i.GetComponent<WifiComponent>() != null);
var radio = sender.Inventory.Items.FirstOrDefault(i => i != null && i.GetComponent<WifiComponent>() != null);
if (radio == null || !sender.HasEquippedItem(radio)) return false;

var radioComponent = radio.GetComponent<WifiComponent>();
Expand All @@ -231,7 +226,9 @@ public void AddChatMessage(string message, ChatMessageType type, string senderNa

public void AddChatMessage(ChatMessage message)
{
if (message.Type == ChatMessageType.Radio && message.Sender != null && message.Sender != myCharacter)
if (message.Type == ChatMessageType.Radio &&
Character.Controlled != null &&
message.Sender != null && message.Sender != myCharacter)
{
var radio = message.Sender.Inventory.Items.First(i => i != null && i.GetComponent<WifiComponent>() != null);
if (radio == null) return;
Expand All @@ -247,9 +244,9 @@ public void AddChatMessage(ChatMessage message)

if (message.Sender != null)
{
if (message.Type == ChatMessageType.Default && myCharacter != null)
if (message.Type == ChatMessageType.Default && Character.Controlled != null)
{
displayedText = message.ApplyDistanceEffect(myCharacter);
displayedText = message.ApplyDistanceEffect(Character.Controlled);
if (string.IsNullOrWhiteSpace(displayedText)) return;
}

Expand Down Expand Up @@ -303,8 +300,8 @@ public virtual void Update(float deltaTime)
{
if (gameStarted && Screen.Selected == GameMain.GameScreen)
{
chatBox.Visible = Character.Controlled == null || !Character.Controlled.IsUnconscious;
chatMsgBox.Visible = chatBox.Visible;
//chatBox.Visible = Character.Controlled == null || !Character.Controlled.IsUnconscious;
chatMsgBox.Visible = Character.Controlled == null || !Character.Controlled.IsUnconscious;

inGameHUD.Update(deltaTime);

Expand All @@ -319,7 +316,7 @@ public virtual void Update(float deltaTime)
}
}

if (PlayerInput.KeyHit(InputType.Chat))
if (PlayerInput.KeyHit(InputType.Chat) && chatMsgBox.Visible)
{
if (chatMsgBox.Selected)
{
Expand Down
Binary file modified Subsurface/Submarines/Aegir Mark II.sub
Binary file not shown.
Binary file modified Subsurface/Submarines/Nehalennia.sub
Binary file not shown.
Binary file modified Subsurface/Submarines/Vellamo.sub
Binary file not shown.
9 changes: 9 additions & 0 deletions Subsurface/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---------------------------------------------------------------------------------------------------------
v0.4.0.1
---------------------------------------------------------------------------------------------------------

- radio messages are visible to spectators
- added a bunch of handheld sonars to the vanilla subs
- junction boxes take more time to break in water
- moved the junction boxes inside Nehalennia's ballast tanks to a drier location

---------------------------------------------------------------------------------------------------------
v0.4.0.0
---------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit d4816c3

Please sign in to comment.