diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index 0fb8587a2..68a2ac24e 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -769,6 +769,9 @@ PreserveNewest Designer + + PreserveNewest + PreserveNewest diff --git a/Subsurface/Content/Characters/Human/ffirstnames.txt b/Subsurface/Content/Characters/Human/ffirstnames.txt index c8f23b820..b0168740d 100644 --- a/Subsurface/Content/Characters/Human/ffirstnames.txt +++ b/Subsurface/Content/Characters/Human/ffirstnames.txt @@ -1,19 +1,25 @@ Albertine +Alexia Alfredia +Alice Alita Alla Alta Althea Alyce Amee +Amira Annette Ara Arcelia Arie Armanda +Aryanna +Ashley Ashly Astrid Avril +Azul Barbra Beaulah Bell @@ -22,13 +28,17 @@ Bettyann Beverley Bridgett Candace +Cara Carie Carla +Carmen Cathleen +Cathy Cecille Christiana Christine Cinda +Claire Cleopatra Codi Corinne @@ -46,19 +56,26 @@ Doria Dorthy Eleanor Elinor +Eliza +Elliana Emerald +Emilee +Erica Erline Ethel Eugenia Fanny Fernanda +Fiona Glenda +Gloria Hortensia Ilene Ina Inga Iris Jacquline +Jaida Janee Janessa Janie @@ -75,30 +92,37 @@ Karyn Katerina Katherina Kathy +Katrina Kellie +Kenna Keri Kizzie Kristeen Kristie Larissa Larita +Lauren Laurie Laurinda Lavinia Leanne Leila Lelah +Lena Leola +Lily Lindy Liza Lola Lora Lorriane Lorrie +Macey Mafalda Maira Majorie Marcy +Margaret Margeret Mariela Marin @@ -110,19 +134,25 @@ Masako Maudie Maybell Mechelle +Megan Melany Melba Michele +Mikaela Mila Miranda Muoi Natalia Natashia +Nicole Nola Noriko Page +Pamela Paula Peggie +Phoenix +Priscilla Randi Reatha Renata @@ -146,9 +176,13 @@ Sherita Sherry Shin Shirlee +Siena Socorro +Sophie Stefany +Stella Stephane +Summer Susy Synthia Tania @@ -168,4 +202,5 @@ Vanessa Velma Yahaira Zandra -Zoe \ No newline at end of file +Zoe +Zoey \ No newline at end of file diff --git a/Subsurface/Content/Characters/Human/firstnames.txt b/Subsurface/Content/Characters/Human/firstnames.txt index ccb1d0f35..19534b715 100644 --- a/Subsurface/Content/Characters/Human/firstnames.txt +++ b/Subsurface/Content/Characters/Human/firstnames.txt @@ -1,17 +1,20 @@ Abe Adam Adan +Ahmed Alan Aldo Allan Alonso Alton Alvaro +Alvin Andres Anton Antony Arkadi Arron +Arthur Arturo Austin Avery @@ -22,6 +25,7 @@ Ben Bennie Bertram Bill +Bo Boyce Boyd Brady @@ -41,14 +45,15 @@ Christoper Chuck Claude Coleman +Cuck Dan Darius Darrin Darwin David Delbert -Devin Dewey +Devin Dewitt Dimitry Dominick @@ -61,6 +66,7 @@ Elmer Erich Erik Ernie +Esteban Everette Ezequiel Filiberto @@ -70,6 +76,8 @@ Freeman Fritz Garrett Gerard +Glenn +Gregor Hal Harlan Harris @@ -77,6 +85,7 @@ Harry Hector Herman Hobert +Igor Irwin Ivan Jackie @@ -94,12 +103,15 @@ Jerrell Jerrod Jess Joe +Joel John +Johny Jonathan Josef Joseph Joshua Jude +Julius Keith Kendall Keneth @@ -114,7 +126,9 @@ Lanny Lee Len Lenny +Leo Lionel +Lucas Lynn Lynwood Malcom @@ -131,6 +145,7 @@ Mauricio Mckinley Mechislav Merrill +Messiah Micheal Milton Minh @@ -143,11 +158,14 @@ Mose Murray Neal Neil +Nick Nolan Norman +Omari Orval Oscar Owen +Pedro Pete Peter Quincy @@ -165,6 +183,7 @@ Rob Roderick Roland Romeo +Ronnie Rosendo Roy Rupert @@ -176,14 +195,17 @@ Sergei Seth Shelby Sidney +Simon Son Sonny Steve Stevie Sylvester Tad +Tate Terrance Terrell +The Timur Tod Todd @@ -193,14 +215,16 @@ Travis Tyler Tyson Ulof -Virgil -Virgilio Waldo Walker Warner +Vasili Wilford Will Williams +Willie Willy Winston +Virgil +Virgilio Zachary \ No newline at end of file diff --git a/Subsurface/Content/Characters/Human/lastnames.txt b/Subsurface/Content/Characters/Human/lastnames.txt index 8e4e8874b..3ce9f6134 100644 --- a/Subsurface/Content/Characters/Human/lastnames.txt +++ b/Subsurface/Content/Characters/Human/lastnames.txt @@ -1,9 +1,15 @@ +Aguilar Aker Angles +Ashley Atterbury +Avery +Bailey +Banks Bartolomeo Basnett Baumgardner +Beltran Bergman Berlin Berner @@ -13,121 +19,207 @@ Boman Bonham Books Box +Bradley +Brady Breeki +Buckley +Burke Bushman Callahan -Callanan Carey +Carroll +Case +Castillo +Castro Celina Ryder Chandler Chaney +Chaney Chapman Chiu +Clements Clothier +Cluck Cobble +Collins Colpitts Combs Connors Cork Cortese +Craig +Cuevas Danko Day +Day Delange Deloney Deras Dews Dimauro Dollinger +Donovan Dorado Dudley Duplantier +Dyer Eastman +Elliott +Ellison +Escobar Feinberg Feinman Fesler Fleig Flowers Fonte +Freeman Frye Gadberry Gallagher Gallardo +Gay Gears Geist +Gomez Gonzales Goodin +Gordon +Gould +Graves +Graves +Green +Gregory Gumbs Hajek Hallett +Hampton Hardy Harp Hebert Hedrick Hefner +Hernandez Heuer +Higgins Hillard Hines +Hinton Hocker +Hoffman Holter House +Huber +Huber +Hurley +Hutchinson +Huynh Jack +James Jones Keller +Kidd Kinney Klein Knowles Krall +Kramer Lane +Larsen +Larsen Lavey +Lawrence +Lawson +Lee Leonard Lester Linares +Little Lowe +Lozano +Lucas +Lyons Malone Mansfield Marchi +Marquez Mason +Maxwell Maynard Maynes +Mcclure +Mcdowell McLeroy McNeal +Mcneil Mead Meals Meisner Mell Mendel +Mendez +Meza +Molina +Monroe +Mooney +Moran +Moses +Moses +Mosley Mulford Mungo Navarro Newton Nicolosi +Nunez Ordway Ouellette Palmieri Parchman Parker Parks +Patel +Pearson Petersen +Phillips Phoenix Pickett Planck +Pollard Pool Poole +Preston Price +Proctor +Quinn Radebaugh Radice Ram +Ramos +Rangel +Reeves +Reynolds Rhymer Riddle Riles +Rios +Rivera Robertson Rolfe +Roman Rosewood +Rowe Sacks Santillan Santistevan +Saunders Sawyer +Schmitt +Serrano Severance +Sexton +Shah +Simpson Smith Southworth Sparks @@ -135,6 +227,8 @@ Stalvey Stanley Stein Stogner +Suarez +Summers Summitt Sunderland Swanger @@ -142,16 +236,21 @@ Swanson Sykes Tamashiro Tate +Terry Thompkins Tootle Tseng Tyson Ulrich +Walls Vaughn +Vazquez Veach +Weaver Velazquez Welden Wheeling Whitely Wiley -Williams \ No newline at end of file +Williams +Zhang \ No newline at end of file diff --git a/Subsurface/Content/Items/Electricity/signalitems.xml b/Subsurface/Content/Items/Electricity/signalitems.xml index a559427d4..11880451e 100644 --- a/Subsurface/Content/Items/Electricity/signalitems.xml +++ b/Subsurface/Content/Items/Electricity/signalitems.xml @@ -220,7 +220,9 @@ - + + + diff --git a/Subsurface/Content/Items/Medical/medical.xml b/Subsurface/Content/Items/Medical/medical.xml index 4ad18cc4c..44b7570a9 100644 --- a/Subsurface/Content/Items/Medical/medical.xml +++ b/Subsurface/Content/Items/Medical/medical.xml @@ -148,7 +148,7 @@ - + diff --git a/Subsurface/Content/Items/Weapons/weapons.xml b/Subsurface/Content/Items/Weapons/weapons.xml index 0c47b7b24..72e39f49b 100644 --- a/Subsurface/Content/Items/Weapons/weapons.xml +++ b/Subsurface/Content/Items/Weapons/weapons.xml @@ -49,7 +49,7 @@ - + diff --git a/Subsurface/Content/Map/StructurePrefabs.xml b/Subsurface/Content/Map/StructurePrefabs.xml index edeb72c34..711353e8f 100644 --- a/Subsurface/Content/Map/StructurePrefabs.xml +++ b/Subsurface/Content/Map/StructurePrefabs.xml @@ -119,7 +119,12 @@ - + + + + diff --git a/Subsurface/Content/Map/structures2.png b/Subsurface/Content/Map/structures2.png new file mode 100644 index 000000000..14866b4e6 Binary files /dev/null and b/Subsurface/Content/Map/structures2.png differ diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index c5657d643..f99f140e4 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.1.3")] -[assembly: AssemblyFileVersion("0.4.1.3")] +[assembly: AssemblyVersion("0.4.1.6")] +[assembly: AssemblyFileVersion("0.4.1.6")] diff --git a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs index fecb7bacd..ca39e4aee 100644 --- a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs @@ -156,6 +156,13 @@ namespace Barotrauma } strongestImpact = 0.0f; + + if (stunTimer > 0) + { + stunTimer -= deltaTime; + return; + } + if (character.LockHands) { var leftHand = GetLimb(LimbType.LeftHand); @@ -185,15 +192,13 @@ namespace Barotrauma //rightHand.pullJoint.Enabled = true; //rightHand.pullJoint.WorldAnchorB = midPos; } - - if (stunTimer > 0) + else { - stunTimer -= deltaTime; - return; - } - - if (Anim != Animation.UsingConstruction) ResetPullJoints(); + if (Anim != Animation.UsingConstruction) ResetPullJoints(); + + } + if (SimplePhysicsEnabled) { UpdateStandingSimple(); @@ -287,7 +292,7 @@ namespace Barotrauma float slowdownFactor = (float)limbsInWater / (float)Limbs.Count(); float maxSpeed = Math.Max(TargetMovement.Length() - slowdownFactor, 1.0f); - if (character.SelectedCharacter!=null) maxSpeed = Math.Min(maxSpeed, 1.0f); + // if (character.SelectedCharacter!=null) maxSpeed = Math.Min(maxSpeed, 1.0f); TargetMovement = Vector2.Normalize(TargetMovement) * maxSpeed; } @@ -933,10 +938,11 @@ namespace Barotrauma { pullLimb.pullJoint.Enabled = true; pullLimb.pullJoint.WorldAnchorB = targetLimb.SimPosition; - pullLimb.pullJoint.MaxForce = 100.0f; + pullLimb.pullJoint.MaxForce = 10000.0f; targetLimb.pullJoint.Enabled = true; targetLimb.pullJoint.WorldAnchorB = pullLimb.SimPosition; + targetLimb.pullJoint.MaxForce = 10000.0f; } } diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index bdbb31842..2450b52c7 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1030,6 +1030,12 @@ namespace Barotrauma PressureTimer = 0.0f; } } + + if (controlled == this) + { + Lights.LightManager.ViewTarget = this; + CharacterHUD.Update(deltaTime, this); + } if (IsUnconscious) { @@ -1039,8 +1045,6 @@ namespace Barotrauma if (controlled == this) { - Lights.LightManager.ViewTarget = this; - CharacterHUD.Update(deltaTime,this); ControlLocalPlayer(deltaTime, cam); } diff --git a/Subsurface/Source/Characters/CharacterHUD.cs b/Subsurface/Source/Characters/CharacterHUD.cs index 153a75154..2f4f5fe5b 100644 --- a/Subsurface/Source/Characters/CharacterHUD.cs +++ b/Subsurface/Source/Characters/CharacterHUD.cs @@ -82,7 +82,7 @@ namespace Barotrauma DrawStatusIcons(spriteBatch, character); - if (!character.IsUnconscious) + if (!character.IsUnconscious && character.Stun <= 0.0f) { if (character.Inventory != null && !character.LockHands && character.Stun >= -0.1f) character.Inventory.DrawOwn(spriteBatch, Vector2.Zero); @@ -193,7 +193,10 @@ namespace Barotrauma suicideButton.OnClicked = (button, userData) => { - character.Kill(character.CauseOfDeath); + if (Character.Controlled != null) + { + Character.Controlled.Kill(Character.Controlled.CauseOfDeath); + } return true; }; } diff --git a/Subsurface/Source/GUI/GUI.cs b/Subsurface/Source/GUI/GUI.cs index a8f4c269d..eed1cbe28 100644 --- a/Subsurface/Source/GUI/GUI.cs +++ b/Subsurface/Source/GUI/GUI.cs @@ -398,27 +398,27 @@ namespace Barotrauma if (GameMain.DebugDraw) { - spriteBatch.DrawString(Font, + spriteBatch.DrawString(SmallFont, "FPS: " + (int)GameMain.FrameCounter.AverageFramesPerSecond, new Vector2(10, 10), Color.White); - spriteBatch.DrawString(Font, + spriteBatch.DrawString(SmallFont, "Physics: " + GameMain.World.UpdateTime, + new Vector2(10, 20), Color.White); + + spriteBatch.DrawString(SmallFont, + "Bodies: " + GameMain.World.BodyList.Count + " (" + GameMain.World.BodyList.FindAll(b => b.Awake && b.Enabled).Count + " awake)", new Vector2(10, 30), Color.White); - spriteBatch.DrawString(Font, - "Bodies: " + GameMain.World.BodyList.Count + " (" + GameMain.World.BodyList.FindAll(b => b.Awake && b.Enabled).Count + " awake)", - new Vector2(10, 50), Color.White); - - spriteBatch.DrawString(Font, - "Camera pos: " + GameMain.GameScreen.Cam.Position, - new Vector2(10, 70), Color.White); + spriteBatch.DrawString(SmallFont, + "Camera pos: " + GameMain.GameScreen.Cam.Position.ToPoint(), + new Vector2(10, 40), Color.White); if (Submarine.MainSub != null) { - spriteBatch.DrawString(Font, - "Sub pos: " + Submarine.MainSub.Position, - new Vector2(10, 90), Color.White); + spriteBatch.DrawString(SmallFont, + "Sub pos: " + Submarine.MainSub.Position.ToPoint(), + new Vector2(10, 50), Color.White); } } diff --git a/Subsurface/Source/Items/Components/Power/PowerContainer.cs b/Subsurface/Source/Items/Components/Power/PowerContainer.cs index 003381b5e..f6400c72e 100644 --- a/Subsurface/Source/Items/Components/Power/PowerContainer.cs +++ b/Subsurface/Source/Items/Components/Power/PowerContainer.cs @@ -36,6 +36,13 @@ namespace Barotrauma.Items.Components get { return maxOutput; } } + [HasDefaultValue(10.0f, true), Editable] + public float Capacity + { + get { return capacity; } + set { capacity = Math.Max(value, 1.0f); } + } + [Editable, HasDefaultValue(0.0f, true)] public float Charge { @@ -47,13 +54,6 @@ namespace Barotrauma.Items.Components } } - [HasDefaultValue(10.0f, true), Editable] - public float Capacity - { - get { return capacity; } - set { capacity = Math.Max(value, 1.0f); } - } - [HasDefaultValue(10.0f, true), Editable] public float RechargeSpeed { diff --git a/Subsurface/Source/Items/Components/Turret.cs b/Subsurface/Source/Items/Components/Turret.cs index 9bab38897..e017c9b99 100644 --- a/Subsurface/Source/Items/Components/Turret.cs +++ b/Subsurface/Source/Items/Components/Turret.cs @@ -67,6 +67,8 @@ namespace Barotrauma.Items.Components Vector2 vector = ToolBox.ParseToVector2(value); minRotation = MathHelper.ToRadians(vector.X); maxRotation = MathHelper.ToRadians(vector.Y); + + rotation = (minRotation + maxRotation) / 2; } } diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 511a0f707..884d23797 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -813,6 +813,9 @@ namespace Barotrauma if (prefab.sprite != null) { + float depth = Sprite.Depth; + depth += (ID % 255) * 0.000001f; + if (body == null) { if (prefab.ResizeHorizontal || prefab.ResizeVertical) @@ -821,7 +824,7 @@ namespace Barotrauma } else { - prefab.sprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y), color); + prefab.sprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y), color, 0.0f, 1.0f, SpriteEffects.None, depth); } } @@ -830,7 +833,6 @@ namespace Barotrauma var holdable = GetComponent(); if (holdable!=null && holdable.Picker !=null) { - float depth = Sprite.Depth; if (holdable.Picker.SelectedItems[0]==this) { depth = holdable.Picker.AnimController.GetLimb(LimbType.RightHand).sprite.Depth + 0.000001f; @@ -844,7 +846,7 @@ namespace Barotrauma } else { - body.Draw(spriteBatch, prefab.sprite, color); + body.Draw(spriteBatch, prefab.sprite, color, depth); } } } diff --git a/Subsurface/Source/Map/EntityGrid.cs b/Subsurface/Source/Map/EntityGrid.cs index c0aef6943..b5b5b9d90 100644 --- a/Subsurface/Source/Map/EntityGrid.cs +++ b/Subsurface/Source/Map/EntityGrid.cs @@ -40,9 +40,9 @@ namespace Barotrauma return; } - for (int x = Math.Max(indices.X, 0); x <= Math.Min(indices.Width, entities.GetLength(0)); x++) + for (int x = Math.Max(indices.X, 0); x <= Math.Min(indices.Width, entities.GetLength(0)-1); x++) { - for (int y = Math.Max(indices.Y,0); y <= Math.Min(indices.Height, entities.GetLength(1)); y++) + for (int y = Math.Max(indices.Y,0); y <= Math.Min(indices.Height, entities.GetLength(1)-1); y++) { entities[x, y].Add(entity); } diff --git a/Subsurface/Source/Map/Explosion.cs b/Subsurface/Source/Map/Explosion.cs index ddd913e3b..e252a6d5f 100644 --- a/Subsurface/Source/Map/Explosion.cs +++ b/Subsurface/Source/Map/Explosion.cs @@ -128,7 +128,7 @@ namespace Barotrauma if (limb.WorldPosition == worldPosition) continue; - c.AddDamage(limb.SimPosition, DamageType.None, + c.AddDamage(limb.WorldPosition, DamageType.None, damage / c.AnimController.Limbs.Length * distFactor, 0.0f, stun * distFactor, false); if (force > 0.0f) { diff --git a/Subsurface/Source/Map/Hull.cs b/Subsurface/Source/Map/Hull.cs index 4f3f4f7ea..813119bf8 100644 --- a/Subsurface/Source/Map/Hull.cs +++ b/Subsurface/Source/Map/Hull.cs @@ -522,9 +522,13 @@ namespace Barotrauma new Rectangle(drawRect.X, -drawRect.Y, rect.Width, rect.Height), Color.Red*((100.0f-OxygenPercentage)/400.0f), true); - spriteBatch.DrawString(GUI.Font, "Pressure: " + ((int)pressure - rect.Y).ToString() + - " - Oxygen: " + ((int)OxygenPercentage), new Vector2(drawRect.X + 10, -drawRect.Y + 10), Color.Black); - spriteBatch.DrawString(GUI.Font, volume + " / " + FullVolume, new Vector2(drawRect.X + 10, -drawRect.Y + 30), Color.Black); + if (GameMain.DebugDraw) + { + spriteBatch.DrawString(GUI.SmallFont, "Pressure: " + ((int)pressure - rect.Y).ToString() + + " - Oxygen: " + ((int)OxygenPercentage), new Vector2(drawRect.X + 5, -drawRect.Y + 5), Color.White); + spriteBatch.DrawString(GUI.SmallFont, volume + " / " + FullVolume, new Vector2(drawRect.X + 5, -drawRect.Y + 20), Color.White); + + } if ((isSelected || isHighlighted) && editing) { diff --git a/Subsurface/Source/Networking/GameClient.cs b/Subsurface/Source/Networking/GameClient.cs index 26166fe75..0cc704603 100644 --- a/Subsurface/Source/Networking/GameClient.cs +++ b/Subsurface/Source/Networking/GameClient.cs @@ -834,7 +834,7 @@ namespace Barotrauma.Networking Character character = obj as Character; if (character == null) return false; - if (character != myCharacter) + if (character != myCharacter && Voting.AllowVoteKick) { var client = GameMain.NetworkMember.ConnectedClients.Find(c => c.Character == character); if (client != null) diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 429846431..f15001b48 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -1725,8 +1725,9 @@ namespace Barotrauma.Networking Client preferredClient = null; foreach (Client c in clients) { - int index = c.jobPreferences.FindIndex(jp => jp == job); - if (index == 0) index = 1000; + int index = c.jobPreferences.IndexOf(job); + if (index == -1) index = 1000; + if (preferredClient == null || index < bestPreference) { bestPreference = index; diff --git a/Subsurface/Source/Networking/GameServerSettings.cs b/Subsurface/Source/Networking/GameServerSettings.cs index 769e96a63..6f6f17926 100644 --- a/Subsurface/Source/Networking/GameServerSettings.cs +++ b/Subsurface/Source/Networking/GameServerSettings.cs @@ -93,6 +93,12 @@ namespace Barotrauma.Networking get { return allowSpectating; } } + public bool AllowVoteKick + { + get; + private set; + } + public float EndVoteRequiredRatio = 0.5f; public float KickVoteRequiredRatio = 0.5f; @@ -159,10 +165,9 @@ namespace Barotrauma.Networking private void CreateSettingsFrame() { - settingsFrame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.5f); - + settingsFrame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.5f); - GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 400), null, Alignment.Center, GUI.Style, settingsFrame); + GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 420), null, Alignment.Center, GUI.Style, settingsFrame); innerFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f); new GUITextBlock(new Rectangle(0, -5, 0, 20), "Server settings", GUI.Style, innerFrame, GUI.LargeFont); @@ -175,6 +180,7 @@ namespace Barotrauma.Networking y += 30; + var endVoteBox = new GUITickBox(new Rectangle(0, y, 20, 20), "End round by voting", Alignment.Left, innerFrame); endVoteBox.Selected = Voting.AllowEndVoting; endVoteBox.OnSelected = (GUITickBox) => @@ -199,6 +205,33 @@ namespace Barotrauma.Networking return true; }; votesRequiredSlider.OnMoved(votesRequiredSlider, votesRequiredSlider.BarScroll); + + y += 40; + + var voteKickBox = new GUITickBox(new Rectangle(0, y, 20, 20), "Allow vote kicking", Alignment.Left, innerFrame); + voteKickBox.Selected = Voting.AllowVoteKick; + voteKickBox.OnSelected = (GUITickBox) => + { + Voting.AllowVoteKick = !Voting.AllowVoteKick; + GameMain.Server.UpdateVoteStatus(); + return true; + }; + + var kickVotesRequiredText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Votes required: 50 %", GUI.Style, innerFrame, GUI.SmallFont); + + var kickVoteSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), GUI.Style, 0.1f, innerFrame); + kickVoteSlider.UserData = kickVotesRequiredText; + kickVoteSlider.Step = 0.2f; + kickVoteSlider.BarScroll = (KickVoteRequiredRatio - 0.5f) * 2.0f; + kickVoteSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) => + { + GUITextBlock voteText = scrollBar.UserData as GUITextBlock; + + KickVoteRequiredRatio = barScroll / 2.0f + 0.5f; + voteText.Text = "Votes required: " + (int)MathUtils.Round(KickVoteRequiredRatio * 100.0f, 10.0f) + " %"; + return true; + }; + kickVoteSlider.OnMoved(kickVoteSlider, kickVoteSlider.BarScroll); y += 40; diff --git a/Subsurface/Source/Networking/NetworkMember.cs b/Subsurface/Source/Networking/NetworkMember.cs index 4fb0b83f2..7a167d71f 100644 --- a/Subsurface/Source/Networking/NetworkMember.cs +++ b/Subsurface/Source/Networking/NetworkMember.cs @@ -306,8 +306,8 @@ namespace Barotrauma.Networking { if (gameStarted && Screen.Selected == GameMain.GameScreen) { - //chatBox.Visible = Character.Controlled == null || !Character.Controlled.IsUnconscious; - chatMsgBox.Visible = Character.Controlled == null || !Character.Controlled.IsUnconscious; + chatMsgBox.Visible = Character.Controlled == null || + (!Character.Controlled.IsUnconscious && Character.Controlled.Stun >= 0.0f); inGameHUD.Update(deltaTime); diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index a9d31afd8..dd5f3f382 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -354,6 +354,7 @@ namespace Barotrauma if (IsServer && GameMain.Server != null) { + int prevSelected = subList.SelectedIndex; UpdateSubList(Submarine.SavedSubmarines); modeList.OnSelected = VotableClicked; @@ -377,8 +378,11 @@ namespace Barotrauma var banListButton = new GUIButton(new Rectangle(0, 30, 100, 20), "Banned IPs", Alignment.BottomRight, GUI.Style, playerList.Parent); banListButton.OnClicked = GameMain.Server.BanList.ToggleBanFrame; banListButton.UserData = "banListButton"; - - if (subList.CountChildren > 0 && subList.Selected == null) subList.Select(0); + + if (subList.CountChildren > 0 && subList.Selected == null) + { + subList.Select(Math.Max(0, prevSelected)); + } if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(0); if (myPlayerFrame.children.Find(c => c.UserData as string == "playyourself") == null) diff --git a/Subsurface/Source/Screens/NetLobbyVoting.cs b/Subsurface/Source/Screens/NetLobbyVoting.cs index 714aeeadb..5f8d3daef 100644 --- a/Subsurface/Source/Screens/NetLobbyVoting.cs +++ b/Subsurface/Source/Screens/NetLobbyVoting.cs @@ -12,6 +12,8 @@ namespace Barotrauma { private bool allowSubVoting, allowModeVoting; + public bool AllowVoteKick = true; + public bool AllowEndVoting = true; public bool AllowSubVoting @@ -243,8 +245,9 @@ namespace Barotrauma { msg.Write((byte)voters.Count(v => v.GetVote(VoteType.EndRound))); msg.Write((byte)voters.Count); - } - + } + + msg.Write(AllowVoteKick); } public void ReadData(NetIncomingMessage msg) @@ -286,6 +289,8 @@ namespace Barotrauma GameMain.NetworkMember.EndVoteCount = msg.ReadByte(); GameMain.NetworkMember.EndVoteMax = msg.ReadByte(); } + + AllowVoteKick = msg.ReadBoolean(); } } } diff --git a/Subsurface/Source/Sounds/SoundPlayer.cs b/Subsurface/Source/Sounds/SoundPlayer.cs index 07f4da930..6663693a2 100644 --- a/Subsurface/Source/Sounds/SoundPlayer.cs +++ b/Subsurface/Source/Sounds/SoundPlayer.cs @@ -7,6 +7,7 @@ using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; using Barotrauma.Sounds; using System.Collections.Generic; +using System.IO; namespace Barotrauma { @@ -249,7 +250,16 @@ namespace Barotrauma if (currMusicVolume < 0.01f) { Sound.StopStream(); - if (targetMusic != null) Sound.StartStream(targetMusic.file, currMusicVolume); + + try + { + if (targetMusic != null) Sound.StartStream(targetMusic.file, currMusicVolume); + } + catch (FileNotFoundException e) + { + DebugConsole.ThrowError("Music clip " + targetMusic.file + " not found!"); + } + currentMusic = targetMusic; } } diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 3153e4582..ab3f17f0b 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,41 @@ +--------------------------------------------------------------------------------------------------------- +v0.4.1.6 +--------------------------------------------------------------------------------------------------------- + +- vote kicking +- fixed reverting back to the first sub on the list after each round when using manual submarine selection +- fixed lights "bleeding" through walls +- fixed crashing if the submarine contains hulls far away from the rest of the submarine +- corricodone is slightly more effective +- battery charge can be set higher than the default capacity of 2000 (assuming the capacity is set higher) +- job assignment bugfixes +- head sprites can be given tags (e.g. customhead[tag].png) which will make the game select body sprites +with a matching tag (e.g. customtorso[tag].png) for the character +- some new head sprites +- pathfinding errors (which may be caused by missing or incorrectly placed waypoints in custom subs) +don't cause the debug console to pop up +- added missing music clips to the Linux build + +--------------------------------------------------------------------------------------------------------- +v0.4.1.5 +--------------------------------------------------------------------------------------------------------- + +- fixed oxygen distribution through vents not being calculated correctly +- fixed another bug that caused ''object reference not set to an instance of object'' error messages +when starting a new round +- fulgurium batteries can be put in flashlights and sonars +- more powerful oxygen generators in vanilla subs (small rooms aren't deathtraps anymore) + +Linux version: +- fixed ''unable to load coelanth.png'' error messages +- fixed non-matching content packages between the Linux and Windows versions + +--------------------------------------------------------------------------------------------------------- +v0.4.1.4 +--------------------------------------------------------------------------------------------------------- + +- fixed clients failing to select submarines in their "Submarines/Downloaded" folder + --------------------------------------------------------------------------------------------------------- v0.4.1.3 ---------------------------------------------------------------------------------------------------------