diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index dfcc3ae61..09acc2f87 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -436,6 +436,15 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -1031,6 +1040,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Subsurface/Content/Items/Clothes/clothes.xml b/Subsurface/Content/Items/Clothes/clothes.xml index 8e6a536b8..b80bb4193 100644 --- a/Subsurface/Content/Items/Clothes/clothes.xml +++ b/Subsurface/Content/Items/Clothes/clothes.xml @@ -150,5 +150,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Subsurface/Content/Items/Clothes/clownmask.png b/Subsurface/Content/Items/Clothes/clownmask.png new file mode 100644 index 000000000..ba952593f Binary files /dev/null and b/Subsurface/Content/Items/Clothes/clownmask.png differ diff --git a/Subsurface/Content/Items/Clothes/clownpants.png b/Subsurface/Content/Items/Clothes/clownpants.png new file mode 100644 index 000000000..41b68324a Binary files /dev/null and b/Subsurface/Content/Items/Clothes/clownpants.png differ diff --git a/Subsurface/Content/Items/Clothes/clownshirt.png b/Subsurface/Content/Items/Clothes/clownshirt.png new file mode 100644 index 000000000..f0c970d83 Binary files /dev/null and b/Subsurface/Content/Items/Clothes/clownshirt.png differ diff --git a/Subsurface/Content/Items/Weapons/honk.ogg b/Subsurface/Content/Items/Weapons/honk.ogg new file mode 100644 index 000000000..fb95bd2bb Binary files /dev/null and b/Subsurface/Content/Items/Weapons/honk.ogg differ diff --git a/Subsurface/Content/Items/Weapons/weapons.xml b/Subsurface/Content/Items/Weapons/weapons.xml index 6a2794628..e0dbb95e0 100644 --- a/Subsurface/Content/Items/Weapons/weapons.xml +++ b/Subsurface/Content/Items/Weapons/weapons.xml @@ -164,7 +164,27 @@ - + + + + + + + + + + + + + + + diff --git a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs index 1ef01de41..3658d5854 100644 --- a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs +++ b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs @@ -143,6 +143,8 @@ namespace Barotrauma CrewManager.Draw(spriteBatch); + if (Submarine.Loaded == null) return; + if (Submarine.Loaded.AtEndPosition) { endShiftButton.Text = "Enter " + Map.SelectedLocation.Name; diff --git a/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs b/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs index c6d50831d..bbe19d9d5 100644 --- a/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs +++ b/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs @@ -10,7 +10,7 @@ namespace Barotrauma.Items.Components { class RangedWeapon : ItemComponent { - private float reload; + private float reload, reloadTimer; private Vector2 barrelPos; @@ -21,6 +21,13 @@ namespace Barotrauma.Items.Components set { barrelPos = ConvertUnits.ToSimUnits(ToolBox.ParseToVector2(value)); } } + [HasDefaultValue(1.0f, false)] + public float Reload + { + get { return reload; } + set { reload = Math.Max(value, 0.0f); } + } + public Vector2 TransformedBarrelPos { get @@ -41,11 +48,11 @@ namespace Barotrauma.Items.Components public override void Update(float deltaTime, Camera cam) { - reload -= deltaTime; + reloadTimer -= deltaTime; - if (reload < 0.0f) + if (reloadTimer < 0.0f) { - reload = 0.0f; + reloadTimer = 0.0f; IsActive = false; } } @@ -53,9 +60,9 @@ namespace Barotrauma.Items.Components public override bool Use(float deltaTime, Character character = null) { if (character == null) return false; - if (!character.IsKeyDown(InputType.Aim) || reload > 0.0f) return false; + if (!character.IsKeyDown(InputType.Aim) || reloadTimer > 0.0f) return false; IsActive = true; - reload = 1.0f; + reloadTimer = reload; List limbBodies = new List(); foreach (Limb l in character.AnimController.Limbs) @@ -63,9 +70,6 @@ namespace Barotrauma.Items.Components limbBodies.Add(l.body.FarseerBody); } - Item[] containedItems = item.ContainedItems; - if (containedItems == null || !containedItems.Any()) return false; - float degreeOfFailure = (100.0f - DegreeOfSuccess(character))/100.0f; degreeOfFailure *= degreeOfFailure; @@ -75,41 +79,47 @@ namespace Barotrauma.Items.Components ApplyStatusEffects(ActionType.OnFailure, 1.0f, character); } - foreach (Item projectile in containedItems) + Item[] containedItems = item.ContainedItems; + if (containedItems != null) { - if (projectile == null) continue; - //find the projectile-itemcomponent of the projectile, - //and add the limbs of the shooter to the list of bodies to be ignored - //so that the player can't shoot himself - Projectile projectileComponent= projectile.GetComponent(); - if (projectileComponent == null) continue; + foreach (Item projectile in containedItems) + { + if (projectile == null) continue; + //find the projectile-itemcomponent of the projectile, + //and add the limbs of the shooter to the list of bodies to be ignored + //so that the player can't shoot himself + Projectile projectileComponent= projectile.GetComponent(); + if (projectileComponent == null) continue; - projectile.body.ResetDynamics(); - projectile.SetTransform(TransformedBarrelPos, - ((item.body.Dir == 1.0f) ? item.body.Rotation : item.body.Rotation - MathHelper.Pi) - + Rand.Range(-degreeOfFailure, degreeOfFailure)); + projectile.body.ResetDynamics(); + projectile.SetTransform(TransformedBarrelPos, + ((item.body.Dir == 1.0f) ? item.body.Rotation : item.body.Rotation - MathHelper.Pi) + + Rand.Range(-degreeOfFailure, degreeOfFailure)); - projectile.Use(deltaTime); - projectileComponent.User = character; + projectile.Use(deltaTime); + projectileComponent.User = character; - projectile.body.ApplyTorque(projectile.body.Mass * degreeOfFailure * Rand.Range(-10.0f, 10.0f)); + projectile.body.ApplyTorque(projectile.body.Mass * degreeOfFailure * Rand.Range(-10.0f, 10.0f)); - //recoil - item.body.ApplyLinearImpulse( - new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * item.body.Mass * -50.0f); + //recoil + item.body.ApplyLinearImpulse( + new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * item.body.Mass * -50.0f); - projectileComponent.ignoredBodies = limbBodies; + projectileComponent.ignoredBodies = limbBodies; - item.RemoveContained(projectile); + item.RemoveContained(projectile); - Rope rope = item.GetComponent(); - if (rope != null) rope.Attach(projectile); + Rope rope = item.GetComponent(); + if (rope != null) rope.Attach(projectile); - return true; + return true; + } } - return false; + + + return true; } } diff --git a/Subsurface/Source/Networking/ServerLog.cs b/Subsurface/Source/Networking/ServerLog.cs index 1ca3782ed..4b02144de 100644 --- a/Subsurface/Source/Networking/ServerLog.cs +++ b/Subsurface/Source/Networking/ServerLog.cs @@ -39,6 +39,8 @@ namespace Barotrauma.Networking if (LogFrame != null) { AddLine(newText); + + listBox.UpdateScrollBarSize(); } if (lines.Count >= LinesPerFile) @@ -64,6 +66,8 @@ namespace Barotrauma.Networking AddLine(line); } + listBox.UpdateScrollBarSize(); + if (listBox.BarScroll==0.0f || listBox.BarScroll==1.0f) listBox.BarScroll = 1.0f; GUIButton closeButton = new GUIButton(new Rectangle(0,0,100, 15), "Close", Alignment.BottomRight, GUI.Style, innerFrame); @@ -77,7 +81,7 @@ namespace Barotrauma.Networking private void AddLine(ColoredText line) { var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), line.Text, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, listBox, true, GUI.SmallFont); - //textBlock.Rect = new Rectangle(textBlock.Rect.X, textBlock.Rect.Y, textBlock.Rect.Width, (line.Text.Count(c => c == '\n') + 1) * 15); + textBlock.Rect = new Rectangle(textBlock.Rect.X, textBlock.Rect.Y, textBlock.Rect.Width, Math.Max(13, textBlock.Rect.Height)); textBlock.TextColor = line.Color; textBlock.CanBeFocused = false; diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 8059ac5f8..d2dc23577 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.2.3 +--------------------------------------------------------------------------------------------------------- + +- clearing the server log after saving! +- saving the log after every round (even if it isn't full) + --------------------------------------------------------------------------------------------------------- v0.3.2.2 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index c85670725..a5a712233 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ