diff --git a/CrashReporter/CrashReporter.csproj b/CrashReporter/CrashReporter.csproj index 525989800..eb2db32ee 100644 --- a/CrashReporter/CrashReporter.csproj +++ b/CrashReporter/CrashReporter.csproj @@ -56,9 +56,9 @@ - + {008c0f83-e914-4966-9135-ea885059edd8} - Subsurface + Barotrauma diff --git a/CrashReporter/ReporterMain.cs b/CrashReporter/ReporterMain.cs index a28497c0f..6a019b775 100644 --- a/CrashReporter/ReporterMain.cs +++ b/CrashReporter/ReporterMain.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface; +using Barotrauma; using System.IO; namespace CrashReporter diff --git a/Farseer Physics Engine 3.5/Collision/Shapes/PolygonShape.cs b/Farseer Physics Engine 3.5/Collision/Shapes/PolygonShape.cs index 5d0a4b37d..2480555a2 100644 --- a/Farseer Physics Engine 3.5/Collision/Shapes/PolygonShape.cs +++ b/Farseer Physics Engine 3.5/Collision/Shapes/PolygonShape.cs @@ -196,11 +196,6 @@ namespace FarseerPhysics.Collision.Shapes I += (0.25f * k_inv3 * D) * (intx2 + inty2); } - if (area <= Settings.Epsilon) - { - int alsmfkldsmfdkasf = 1; - } - //The area is too small for the engine to handle. Debug.Assert(area > Settings.Epsilon); diff --git a/Launcher/Form1.cs b/Launcher/Form1.cs index dcd6df2a7..dc6e37492 100644 --- a/Launcher/Form1.cs +++ b/Launcher/Form1.cs @@ -1,5 +1,5 @@ using RestSharp; -using Subsurface; +using Barotrauma; using System; using System.Collections.Generic; using System.ComponentModel; @@ -23,7 +23,7 @@ namespace Launcher string version = AssemblyName.GetAssemblyName("Barotrauma.exe").Version.ToString(); private const string configPath = "config.xml"; - private Subsurface.GameSettings settings; + private Barotrauma.GameSettings settings; private string latestVersionFileList, latestVersionFolder; diff --git a/Launcher/Launcher.csproj b/Launcher/Launcher.csproj index a19de67a6..cef546adf 100644 --- a/Launcher/Launcher.csproj +++ b/Launcher/Launcher.csproj @@ -100,9 +100,9 @@ - + {008c0f83-e914-4966-9135-ea885059edd8} - Subsurface + Barotrauma diff --git a/Launcher/PackageManager.cs b/Launcher/PackageManager.cs index 420b1fdd6..42e077d8b 100644 --- a/Launcher/PackageManager.cs +++ b/Launcher/PackageManager.cs @@ -1,4 +1,4 @@ -using Subsurface; +using Barotrauma; using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/Launcher2/Launcher2.csproj b/Launcher2/Launcher2.csproj index 67af45212..6624dcfad 100644 --- a/Launcher2/Launcher2.csproj +++ b/Launcher2/Launcher2.csproj @@ -62,9 +62,9 @@ - + {008c0f83-e914-4966-9135-ea885059edd8} - Subsurface + Barotrauma diff --git a/Launcher2/LauncherMain.cs b/Launcher2/LauncherMain.cs index e8002e933..cc822c818 100644 --- a/Launcher2/LauncherMain.cs +++ b/Launcher2/LauncherMain.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface; +using Barotrauma; using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; @@ -25,7 +25,7 @@ namespace Launcher2 string version = AssemblyName.GetAssemblyName("Barotrauma.exe").Version.ToString(); private const string configPath = "config.xml"; - private Subsurface.GameSettings settings; + private Barotrauma.GameSettings settings; private string latestVersionFileList, latestVersionFolder; diff --git a/Subsurface/Subsurface.csproj b/Subsurface/Barotrauma.csproj similarity index 98% rename from Subsurface/Subsurface.csproj rename to Subsurface/Barotrauma.csproj index 0373a9e8e..477c5b791 100644 --- a/Subsurface/Subsurface.csproj +++ b/Subsurface/Barotrauma.csproj @@ -8,7 +8,7 @@ {008C0F83-E914-4966-9135-EA885059EDD8} WinExe Properties - Subsurface + Barotrauma Barotrauma 512 false @@ -383,6 +383,9 @@ PreserveNewest Designer + + PreserveNewest + PreserveNewest Designer @@ -845,6 +848,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -875,6 +884,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Subsurface/Subsurface.csproj.user b/Subsurface/Barotrauma.csproj.user similarity index 89% rename from Subsurface/Subsurface.csproj.user rename to Subsurface/Barotrauma.csproj.user index d8060d791..1782abafa 100644 --- a/Subsurface/Subsurface.csproj.user +++ b/Subsurface/Barotrauma.csproj.user @@ -1,18 +1,18 @@ - - - - publish\ - - - - - - en-US - false - ProjectFiles - - - - - + + + + publish\ + + + + + + en-US + false + ShowAllFiles + + + + + \ No newline at end of file diff --git a/Subsurface/Content/Items/Clothes/clothes.xml b/Subsurface/Content/Items/Clothes/clothes.xml index e52fef947..a0d4c251e 100644 --- a/Subsurface/Content/Items/Clothes/clothes.xml +++ b/Subsurface/Content/Items/Clothes/clothes.xml @@ -62,7 +62,7 @@ - + @@ -78,7 +78,7 @@ - + diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml index 7e4394ebb..7f58f6b74 100644 --- a/Subsurface/Content/Items/Electricity/poweritems.xml +++ b/Subsurface/Content/Items/Electricity/poweritems.xml @@ -41,7 +41,8 @@ - + + @@ -50,7 +51,11 @@ - + + + + + - + @@ -26,7 +26,7 @@ - + diff --git a/Subsurface/Content/Items/Medical/syringe.ogg b/Subsurface/Content/Items/Medical/syringe.ogg new file mode 100644 index 000000000..d0a0cf547 Binary files /dev/null and b/Subsurface/Content/Items/Medical/syringe.ogg differ diff --git a/Subsurface/Content/Items/Pump/pump.xml b/Subsurface/Content/Items/Pump/pump.xml index 04a3b4d25..782671806 100644 --- a/Subsurface/Content/Items/Pump/pump.xml +++ b/Subsurface/Content/Items/Pump/pump.xml @@ -3,7 +3,7 @@ linkable="true" pickdistance="200"> - + diff --git a/Subsurface/Content/Items/Weapons/stunbaton.ogg b/Subsurface/Content/Items/Weapons/stunbaton.ogg new file mode 100644 index 000000000..0efb8d0d6 Binary files /dev/null and b/Subsurface/Content/Items/Weapons/stunbaton.ogg differ diff --git a/Subsurface/Content/Items/Weapons/stunbaton.png b/Subsurface/Content/Items/Weapons/stunbaton.png new file mode 100644 index 000000000..2ea699413 Binary files /dev/null and b/Subsurface/Content/Items/Weapons/stunbaton.png differ diff --git a/Subsurface/Content/Items/Weapons/weapons.xml b/Subsurface/Content/Items/Weapons/weapons.xml index 22e44c66d..052a9ed4f 100644 --- a/Subsurface/Content/Items/Weapons/weapons.xml +++ b/Subsurface/Content/Items/Weapons/weapons.xml @@ -49,7 +49,7 @@ - + @@ -62,16 +62,34 @@ pickdistance="150" price="100"> - + - - - + + + + + + + + + + + + + + + + + + diff --git a/Subsurface/Content/Jobs.xml b/Subsurface/Content/Jobs.xml index a9dc5be55..7e5e6b6d0 100644 --- a/Subsurface/Content/Jobs.xml +++ b/Subsurface/Content/Jobs.xml @@ -8,8 +8,8 @@ - - + + @@ -24,7 +24,7 @@ - + @@ -35,18 +35,18 @@ - + - - - + + + - - - + + + - + diff --git a/Subsurface/Content/Map/TutorialSub.sub b/Subsurface/Content/Map/TutorialSub.sub new file mode 100644 index 000000000..e251a3bcb Binary files /dev/null and b/Subsurface/Content/Map/TutorialSub.sub differ diff --git a/Subsurface/Data/ContentPackages/Vanilla 0.1.3.xml b/Subsurface/Data/ContentPackages/Vanilla 0.1.3.xml index f16534828..0f5a07d60 100644 --- a/Subsurface/Data/ContentPackages/Vanilla 0.1.3.xml +++ b/Subsurface/Data/ContentPackages/Vanilla 0.1.3.xml @@ -1,5 +1,5 @@  - + @@ -32,5 +32,5 @@ - + \ No newline at end of file diff --git a/Subsurface/Data/SavedSubs/Aegir Mark II.gz b/Subsurface/Data/SavedSubs/Aegir Mark II.sub similarity index 100% rename from Subsurface/Data/SavedSubs/Aegir Mark II.gz rename to Subsurface/Data/SavedSubs/Aegir Mark II.sub diff --git a/Subsurface/Data/SavedSubs/TutorialSub.gz b/Subsurface/Data/SavedSubs/TutorialSub.gz deleted file mode 100644 index 96f8aa1b3..000000000 Binary files a/Subsurface/Data/SavedSubs/TutorialSub.gz and /dev/null differ diff --git a/Subsurface/Data/SavedSubs/TutorialSub.sub b/Subsurface/Data/SavedSubs/TutorialSub.sub new file mode 100644 index 000000000..4383dcf0a Binary files /dev/null and b/Subsurface/Data/SavedSubs/TutorialSub.sub differ diff --git a/Subsurface/Data/SavedSubs/Vellamo.gz b/Subsurface/Data/SavedSubs/Vellamo.gz deleted file mode 100644 index c7013624d..000000000 Binary files a/Subsurface/Data/SavedSubs/Vellamo.gz and /dev/null differ diff --git a/Subsurface/Data/SavedSubs/Vellamo.sub b/Subsurface/Data/SavedSubs/Vellamo.sub new file mode 100644 index 000000000..d9345ee24 Binary files /dev/null and b/Subsurface/Data/SavedSubs/Vellamo.sub differ diff --git a/Subsurface/Source/Camera.cs b/Subsurface/Source/Camera.cs index 71c5a45a4..a037506bf 100644 --- a/Subsurface/Source/Camera.cs +++ b/Subsurface/Source/Camera.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { public class Camera { diff --git a/Subsurface/Source/Characters/AI/AIController.cs b/Subsurface/Source/Characters/AI/AIController.cs index 6694614d4..e3fc2e544 100644 --- a/Subsurface/Source/Characters/AI/AIController.cs +++ b/Subsurface/Source/Characters/AI/AIController.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { class AIController : ISteerable { diff --git a/Subsurface/Source/Characters/AI/AITarget.cs b/Subsurface/Source/Characters/AI/AITarget.cs index 3a0670f2a..46e006afa 100644 --- a/Subsurface/Source/Characters/AI/AITarget.cs +++ b/Subsurface/Source/Characters/AI/AITarget.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { class AITarget { diff --git a/Subsurface/Source/Characters/AI/EnemyAIController.cs b/Subsurface/Source/Characters/AI/EnemyAIController.cs index ce17b51d2..cdf6666bc 100644 --- a/Subsurface/Source/Characters/AI/EnemyAIController.cs +++ b/Subsurface/Source/Characters/AI/EnemyAIController.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { class EnemyAIController : AIController diff --git a/Subsurface/Source/Characters/AI/ISteerable.cs b/Subsurface/Source/Characters/AI/ISteerable.cs index 3a4ec5379..efafca9d9 100644 --- a/Subsurface/Source/Characters/AI/ISteerable.cs +++ b/Subsurface/Source/Characters/AI/ISteerable.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { interface ISteerable { diff --git a/Subsurface/Source/Characters/AI/PathFinder.cs b/Subsurface/Source/Characters/AI/PathFinder.cs index 0e4c8dfd4..3172407ab 100644 --- a/Subsurface/Source/Characters/AI/PathFinder.cs +++ b/Subsurface/Source/Characters/AI/PathFinder.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace Subsurface +namespace Barotrauma { class PathNode { diff --git a/Subsurface/Source/Characters/AI/SteeringManager.cs b/Subsurface/Source/Characters/AI/SteeringManager.cs index 7ac461f44..9352195fa 100644 --- a/Subsurface/Source/Characters/AI/SteeringManager.cs +++ b/Subsurface/Source/Characters/AI/SteeringManager.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using FarseerPhysics.Dynamics; -namespace Subsurface +namespace Barotrauma { class SteeringManager { diff --git a/Subsurface/Source/Characters/AI/SteeringPath.cs b/Subsurface/Source/Characters/AI/SteeringPath.cs index 125fff3e9..bfe4b0b35 100644 --- a/Subsurface/Source/Characters/AI/SteeringPath.cs +++ b/Subsurface/Source/Characters/AI/SteeringPath.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { class SteeringPath { diff --git a/Subsurface/Source/Characters/AICharacter.cs b/Subsurface/Source/Characters/AICharacter.cs index 874120463..10b5fd345 100644 --- a/Subsurface/Source/Characters/AICharacter.cs +++ b/Subsurface/Source/Characters/AICharacter.cs @@ -1,12 +1,12 @@ using Lidgren.Network; using Microsoft.Xna.Framework; -using Subsurface.Networking; +using Barotrauma.Networking; using System; using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class AICharacter : Character { @@ -14,6 +14,11 @@ namespace Subsurface private AIController aiController; + public override AIController AIController + { + get { return aiController; } + } + public AICharacter(string file) : this(file, Vector2.Zero, null) { } @@ -37,7 +42,10 @@ namespace Subsurface public AICharacter(string file, Vector2 position, CharacterInfo characterInfo = null, bool isNetworkPlayer = false) : base(file, position, characterInfo, isNetworkPlayer) { - aiController = new EnemyAIController(this, file); + aiController = new EnemyAIController(this, file); + + + if (GameMain.Client != null && GameMain.Server == null) Enabled = false; } public override void Update(Camera cam, float deltaTime) diff --git a/Subsurface/Source/Characters/AnimController.cs b/Subsurface/Source/Characters/AnimController.cs index ef64d4aab..326321440 100644 --- a/Subsurface/Source/Characters/AnimController.cs +++ b/Subsurface/Source/Characters/AnimController.cs @@ -2,7 +2,7 @@ using FarseerPhysics; using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { class AnimController : Ragdoll { diff --git a/Subsurface/Source/Characters/Attack.cs b/Subsurface/Source/Characters/Attack.cs index bdc49ba78..68e217394 100644 --- a/Subsurface/Source/Characters/Attack.cs +++ b/Subsurface/Source/Characters/Attack.cs @@ -1,10 +1,10 @@ using Microsoft.Xna.Framework; -using Subsurface.Particles; +using Barotrauma.Particles; using System; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public enum DamageType { None, Blunt, Slash } diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSprite.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSprite.cs index 9a80cc56e..00859d6a7 100644 --- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSprite.cs +++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSprite.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class BackgroundSprite : ISteerable diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs index ea9e77c32..0f6dbe27b 100644 --- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs +++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class BackgroundSpriteManager { diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs index 1326ce05c..de4b56c92 100644 --- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs +++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class BackgroundSpritePrefab { diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 2d868a6f8..1115ae2ad 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -5,15 +5,15 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface.Networking; -using Subsurface.Particles; +using Barotrauma.Networking; +using Barotrauma.Particles; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class Character : Entity, IDamageable, IPropertyObject @@ -33,6 +33,12 @@ namespace Subsurface set { controlled = value; } } + public bool Enabled + { + get; + set; + } + public readonly bool IsNetworkPlayer; private CharacterInventory inventory; @@ -411,6 +417,8 @@ namespace Subsurface AnimController.FindHull(); CharacterList.Add(this); + + Enabled = true; } private static string humanConfigFile; @@ -498,7 +506,7 @@ namespace Subsurface public void Control(float deltaTime, Camera cam) { - if (isDead) return; + if (isDead || AnimController.StunTimer>0.0f) return; Vector2 targetMovement = Vector2.Zero; if (GetInputState(InputType.Left)) targetMovement.X -= 1.0f; @@ -741,17 +749,17 @@ namespace Subsurface { foreach (Character c in CharacterList) { - if (c.isDead) continue; + if (c.isDead || !c.Enabled) continue; c.AnimController.UpdateAnim(deltaTime); } } public static void UpdateAll(Camera cam, float deltaTime) { - if (NewCharacterQueue.Count>0) - { - new Character(NewCharacterQueue.Dequeue(), Vector2.Zero); - } + //if (NewCharacterQueue.Count>0) + //{ + // new Character(NewCharacterQueue.Dequeue(), Vector2.Zero); + //} foreach (Character c in CharacterList) { @@ -761,6 +769,8 @@ namespace Subsurface public virtual void Update(Camera cam, float deltaTime) { + if (!Enabled) return; + AnimController.SimplePhysicsEnabled = (Character.controlled!=this && Vector2.Distance(cam.WorldViewCenter, Position)>5000.0f); if (isDead) return; @@ -828,6 +838,8 @@ namespace Subsurface public void Draw(SpriteBatch spriteBatch) { + if (!Enabled) return; + AnimController.Draw(spriteBatch); //GUI.DrawLine(spriteBatch, ConvertUnits.ToDisplayUnits(animController.limbs[0].SimPosition.X, animController.limbs[0].SimPosition.Y), @@ -842,6 +854,8 @@ namespace Subsurface public virtual void DrawFront(SpriteBatch spriteBatch) { + if (!Enabled) return; + Vector2 pos = ConvertUnits.ToDisplayUnits(AnimController.Limbs[0].SimPosition); pos.Y = -pos.Y; @@ -869,9 +883,6 @@ namespace Subsurface GUI.DrawRectangle(spriteBatch, new Rectangle((int)healthBarPos.X, (int)healthBarPos.Y, (int)(100.0f * (health / maxHealth)), 15), Color.Red, true); } - - - public void PlaySound(AIController.AiState state) { if (sounds == null || !sounds.Any()) return; @@ -931,6 +942,7 @@ namespace Subsurface { if (stunTimer <= 0.0f) return; + AnimController.ResetPullJoints(); AnimController.StunTimer = Math.Max(AnimController.StunTimer, stunTimer); selectedConstruction = null; @@ -1138,6 +1150,8 @@ namespace Subsurface public override void ReadNetworkData(NetworkEventType type, NetIncomingMessage message) { + Enabled = true; + if (type == NetworkEventType.PickItem) { System.Diagnostics.Debug.WriteLine("**************** PickItem networkevent received"); diff --git a/Subsurface/Source/Characters/CharacterHUD.cs b/Subsurface/Source/Characters/CharacterHUD.cs index 576641154..b718da8cb 100644 --- a/Subsurface/Source/Characters/CharacterHUD.cs +++ b/Subsurface/Source/Characters/CharacterHUD.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class CharacterHUD { diff --git a/Subsurface/Source/Characters/CharacterInfo.cs b/Subsurface/Source/Characters/CharacterInfo.cs index f0ecaafad..e44b25d2a 100644 --- a/Subsurface/Source/Characters/CharacterInfo.cs +++ b/Subsurface/Source/Characters/CharacterInfo.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public enum Gender { None, Male, Female }; diff --git a/Subsurface/Source/Characters/DelayedEffect.cs b/Subsurface/Source/Characters/DelayedEffect.cs index cec94dc09..b0935fd78 100644 --- a/Subsurface/Source/Characters/DelayedEffect.cs +++ b/Subsurface/Source/Characters/DelayedEffect.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class DelayedEffect : StatusEffect { diff --git a/Subsurface/Source/Characters/FishAnimController.cs b/Subsurface/Source/Characters/FishAnimController.cs index a0bfc27b8..e67fb4c0b 100644 --- a/Subsurface/Source/Characters/FishAnimController.cs +++ b/Subsurface/Source/Characters/FishAnimController.cs @@ -6,7 +6,7 @@ using FarseerPhysics.Dynamics.Joints; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { class FishAnimController : AnimController { diff --git a/Subsurface/Source/Characters/HumanoidAnimController.cs b/Subsurface/Source/Characters/HumanoidAnimController.cs index 0b633fe01..23b3e9c09 100644 --- a/Subsurface/Source/Characters/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/HumanoidAnimController.cs @@ -3,9 +3,9 @@ using System.Linq; using System.Xml.Linq; using FarseerPhysics; using Microsoft.Xna.Framework; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; -namespace Subsurface +namespace Barotrauma { class HumanoidAnimController : AnimController { @@ -120,23 +120,24 @@ namespace Subsurface { onFloorTimer -= deltaTime; } - - - IgnorePlatforms = (TargetMovement.Y < 0.0f); - + //stun (= disable the animations) if the ragdoll receives a large enough impact if (strongestImpact > 0.0f) { character.StartStun(MathHelper.Min(strongestImpact * 0.5f, 5.0f)); } strongestImpact = 0.0f; - + if (stunTimer > 0) { stunTimer -= deltaTime; return; } + IgnorePlatforms = (TargetMovement.Y < 0.0f); + + + if (Anim != Animation.UsingConstruction) ResetPullJoints(); if (TargetDir != dir) Flip(); @@ -228,30 +229,35 @@ namespace Subsurface this.stepSize.Y * walkPosY * runningModifier * runningModifier); float footMid = waist.SimPosition.X;// (leftFoot.SimPosition.X + rightFoot.SimPosition.X) / 2.0f; - - int limbsInWater = 0; - foreach (Limb limb in Limbs) + + if (Math.Abs(TargetMovement.X)>1.0f) { - if (limb.inWater) limbsInWater++; - } + int limbsInWater = 0; + foreach (Limb limb in Limbs) + { + if (limb.inWater) limbsInWater++; + } - TargetMovement *= (1.0f - 0.5f * ((float)limbsInWater / (float)Limbs.Count())); + float slowdownFactor = (float)limbsInWater / (float)Limbs.Count(); + + TargetMovement = Vector2.Normalize(TargetMovement) * Math.Max(TargetMovement.Length() - slowdownFactor, 1.0f); + } movement = MathUtils.SmoothStep(movement, TargetMovement, movementLerp); movement.Y = 0.0f; + bool legsUp = false; for (int i = 0; i < 2; i++) { Limb leg = GetLimb((i == 0) ? LimbType.LeftThigh : LimbType.RightThigh);// : leftLeg; if (leg.SimPosition.Y < torso.SimPosition.Y) continue; - leg.body.ApplyTorque(-Dir * leg.Mass * 10.0f); + leg.body.ApplyTorque(Dir * leg.Mass * 10.0f); + legsUp = true; } - //place the anchors of the head and the torso to make the ragdoll stand - - if (LowestLimb == null) return; + if (legsUp || LowestLimb == null) return; if (!onGround || (LowestLimb.SimPosition.Y - floorY > 0.5f && stairs == null)) return; diff --git a/Subsurface/Source/Characters/Jobs/Job.cs b/Subsurface/Source/Characters/Jobs/Job.cs index 616db3808..14b238896 100644 --- a/Subsurface/Source/Characters/Jobs/Job.cs +++ b/Subsurface/Source/Characters/Jobs/Job.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class Job { diff --git a/Subsurface/Source/Characters/Jobs/JobPrefab.cs b/Subsurface/Source/Characters/Jobs/JobPrefab.cs index 004bdb8d3..01a4c8600 100644 --- a/Subsurface/Source/Characters/Jobs/JobPrefab.cs +++ b/Subsurface/Source/Characters/Jobs/JobPrefab.cs @@ -4,7 +4,7 @@ using System.Globalization; using System.Xml.Linq; using System.Linq; -namespace Subsurface +namespace Barotrauma { class JobPrefab { @@ -20,13 +20,15 @@ namespace Subsurface //(i.e. if one captain is required, one captain is chosen even if all the players have set captain to lowest preference) private int minNumber; + private float commonness; + //if set to true, a client that has chosen this as their preferred job will get it no matter what public bool AllowAlways { get; private set; } - + //names of the items the character spawns with public List ItemNames; public List EquipItem; @@ -53,6 +55,11 @@ namespace Subsurface get { return minNumber; } } + public float Commonness + { + get { return commonness; } + } + public JobPrefab(XElement element) { name = ToolBox.GetAttributeString(element, "name", "name not found"); @@ -62,6 +69,8 @@ namespace Subsurface minNumber = ToolBox.GetAttributeInt(element, "minnumber", 0); maxNumber = ToolBox.GetAttributeInt(element, "maxnumber", 10); + commonness = ToolBox.GetAttributeInt(element, "commonness", 10); + AllowAlways = ToolBox.GetAttributeBool(element, "allowalways", false); ItemNames = new List(); diff --git a/Subsurface/Source/Characters/Jobs/Skill.cs b/Subsurface/Source/Characters/Jobs/Skill.cs index 5ae509916..c0dd3b117 100644 --- a/Subsurface/Source/Characters/Jobs/Skill.cs +++ b/Subsurface/Source/Characters/Jobs/Skill.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class Skill { diff --git a/Subsurface/Source/Characters/Jobs/SkillPrefab.cs b/Subsurface/Source/Characters/Jobs/SkillPrefab.cs index 82737a87f..b89ba9583 100644 --- a/Subsurface/Source/Characters/Jobs/SkillPrefab.cs +++ b/Subsurface/Source/Characters/Jobs/SkillPrefab.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class SkillPrefab { diff --git a/Subsurface/Source/Characters/Limb.cs b/Subsurface/Source/Characters/Limb.cs index be0580bb6..4ba5871d4 100644 --- a/Subsurface/Source/Characters/Limb.cs +++ b/Subsurface/Source/Characters/Limb.cs @@ -5,9 +5,9 @@ using FarseerPhysics.Dynamics; using FarseerPhysics.Dynamics.Joints; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; -namespace Subsurface +namespace Barotrauma { public enum LimbType { diff --git a/Subsurface/Source/Characters/Ragdoll.cs b/Subsurface/Source/Characters/Ragdoll.cs index b2ee4c5ed..4379206bd 100644 --- a/Subsurface/Source/Characters/Ragdoll.cs +++ b/Subsurface/Source/Characters/Ragdoll.cs @@ -8,9 +8,9 @@ using FarseerPhysics.Dynamics.Contacts; using FarseerPhysics.Dynamics.Joints; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; -namespace Subsurface +namespace Barotrauma { class Ragdoll { @@ -491,8 +491,7 @@ namespace Subsurface { for (int i = 0; i < Limbs.Count(); i++) { - if (Limbs[i] == null) continue; - if (Limbs[i].pullJoint == null) continue; + if (Limbs[i] == null || Limbs[i].pullJoint == null) continue; Limbs[i].pullJoint.Enabled = false; } } @@ -526,7 +525,7 @@ namespace Subsurface Category collisionCategory = (ignorePlatforms) ? wall | Physics.CollisionProjectile | Physics.CollisionStairs - : wall | Physics.CollisionPlatform | Physics.CollisionStairs; + : wall | Physics.CollisionProjectile | Physics.CollisionPlatform | Physics.CollisionStairs; foreach (Limb limb in Limbs) { @@ -538,6 +537,8 @@ namespace Subsurface public void Update(Camera cam, float deltaTime) { + if (!character.Enabled) return; + UpdateNetplayerPosition(); Vector2 flowForce = Vector2.Zero; @@ -605,7 +606,7 @@ namespace Subsurface { //create a splash particle - Subsurface.Particles.Particle splash = GameMain.ParticleManager.CreateParticle("watersplash", + Barotrauma.Particles.Particle splash = GameMain.ParticleManager.CreateParticle("watersplash", new Vector2(limb.Position.X, limbHull.Surface), new Vector2(0.0f, Math.Abs(-limb.LinearVelocity.Y * 10.0f)), 0.0f); diff --git a/Subsurface/Source/Characters/StatusEffect.cs b/Subsurface/Source/Characters/StatusEffect.cs index 60fd2f13d..5efa952b9 100644 --- a/Subsurface/Source/Characters/StatusEffect.cs +++ b/Subsurface/Source/Characters/StatusEffect.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class StatusEffect { @@ -182,7 +182,8 @@ namespace Subsurface ObjectProperty property; foreach (IPropertyObject target in targets) { - if (targetNames!=null && !targetNames.Contains(target.Name)) continue; + //if (targetNames!=null && !targetNames.Contains(target.Name)) continue; + if (!target.ObjectProperties.TryGetValue(propertyNames[i], out property)) continue; ApplyToProperty(property, propertyEffects[i], deltaTime); diff --git a/Subsurface/Source/ContentPackage.cs b/Subsurface/Source/ContentPackage.cs index aaf32d591..61283bedd 100644 --- a/Subsurface/Source/ContentPackage.cs +++ b/Subsurface/Source/ContentPackage.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public enum ContentType { diff --git a/Subsurface/Source/CoroutineManager.cs b/Subsurface/Source/CoroutineManager.cs index d1ffb1f09..95b7a933b 100644 --- a/Subsurface/Source/CoroutineManager.cs +++ b/Subsurface/Source/CoroutineManager.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { enum CoroutineStatus { diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 5677314ff..134c4d8d9 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -4,9 +4,9 @@ using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface.Networking; +using Barotrauma.Networking; -namespace Subsurface +namespace Barotrauma { struct ColoredText { @@ -289,7 +289,7 @@ namespace Subsurface DebugConsole.ThrowError("Illegal symbols in filename (../)"); return; } - Submarine.SaveCurrent(fileName +".gz"); + Submarine.SaveCurrent(fileName +".sub"); NewMessage("map saved", Color.Green); break; case "loadmap": diff --git a/Subsurface/Source/Events/MonsterEvent.cs b/Subsurface/Source/Events/MonsterEvent.cs index feb097ed9..609bdc736 100644 --- a/Subsurface/Source/Events/MonsterEvent.cs +++ b/Subsurface/Source/Events/MonsterEvent.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using System; -namespace Subsurface +namespace Barotrauma { class MonsterEvent : ScriptedEvent { diff --git a/Subsurface/Source/Events/PropertyTask.cs b/Subsurface/Source/Events/PropertyTask.cs index 33220132c..0f30ced22 100644 --- a/Subsurface/Source/Events/PropertyTask.cs +++ b/Subsurface/Source/Events/PropertyTask.cs @@ -1,4 +1,4 @@ -namespace Subsurface +namespace Barotrauma { class PropertyTask : Task { diff --git a/Subsurface/Source/Events/Quests/MonsterQuest.cs b/Subsurface/Source/Events/Quests/MonsterQuest.cs index 686ae94ac..7a62dd2d4 100644 --- a/Subsurface/Source/Events/Quests/MonsterQuest.cs +++ b/Subsurface/Source/Events/Quests/MonsterQuest.cs @@ -6,12 +6,10 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class MonsterQuest : Quest { - //string monsterName; - string monsterFile; Character monster; @@ -33,7 +31,7 @@ namespace Subsurface monster = new AICharacter(monsterFile, ConvertUnits.ToSimUnits(position+level.Position)); } - + public override void End() { if (!monster.IsDead) diff --git a/Subsurface/Source/Events/Quests/Quest.cs b/Subsurface/Source/Events/Quests/Quest.cs index 2f321fe1e..ad261e06b 100644 --- a/Subsurface/Source/Events/Quests/Quest.cs +++ b/Subsurface/Source/Events/Quests/Quest.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class Quest { @@ -104,7 +104,7 @@ namespace Subsurface try { - t = Type.GetType("Subsurface." + type, true, true); + t = Type.GetType("Barotrauma." + type, true, true); if (t == null) { DebugConsole.ThrowError("Error in " + configFile + "! Could not find a quest class of the type ''" + type + "''."); diff --git a/Subsurface/Source/Events/Quests/SalvageQuest.cs b/Subsurface/Source/Events/Quests/SalvageQuest.cs index 7dfa65f52..440fcc643 100644 --- a/Subsurface/Source/Events/Quests/SalvageQuest.cs +++ b/Subsurface/Source/Events/Quests/SalvageQuest.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class SalvageQuest : Quest { diff --git a/Subsurface/Source/Events/RepairTask.cs b/Subsurface/Source/Events/RepairTask.cs index 9e132bfae..ef8472de6 100644 --- a/Subsurface/Source/Events/RepairTask.cs +++ b/Subsurface/Source/Events/RepairTask.cs @@ -1,4 +1,4 @@ -namespace Subsurface +namespace Barotrauma { class RepairTask : Task { diff --git a/Subsurface/Source/Events/ScriptedEvent.cs b/Subsurface/Source/Events/ScriptedEvent.cs index a216ce276..73a6e75d5 100644 --- a/Subsurface/Source/Events/ScriptedEvent.cs +++ b/Subsurface/Source/Events/ScriptedEvent.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Reflection; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class ScriptedEvent { @@ -137,7 +137,7 @@ namespace Subsurface try { - t = Type.GetType("Subsurface." + type, true, true); + t = Type.GetType("Barotrauma." + type, true, true); if (t == null) { DebugConsole.ThrowError("Error in " + configFile + "! Could not find an event class of the type ''" + type + "''."); diff --git a/Subsurface/Source/Events/ScriptedTask.cs b/Subsurface/Source/Events/ScriptedTask.cs index 2fb257261..1f98d53c5 100644 --- a/Subsurface/Source/Events/ScriptedTask.cs +++ b/Subsurface/Source/Events/ScriptedTask.cs @@ -1,4 +1,4 @@ -namespace Subsurface +namespace Barotrauma { class ScriptedTask : Task { diff --git a/Subsurface/Source/Events/Task.cs b/Subsurface/Source/Events/Task.cs index 283eff24c..acea30f10 100644 --- a/Subsurface/Source/Events/Task.cs +++ b/Subsurface/Source/Events/Task.cs @@ -1,5 +1,5 @@  -namespace Subsurface +namespace Barotrauma { class Task { diff --git a/Subsurface/Source/Events/TaskManager.cs b/Subsurface/Source/Events/TaskManager.cs index 6600683d1..2f37db9fe 100644 --- a/Subsurface/Source/Events/TaskManager.cs +++ b/Subsurface/Source/Events/TaskManager.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -namespace Subsurface +namespace Barotrauma { class TaskManager { diff --git a/Subsurface/Source/FrameCounter.cs b/Subsurface/Source/FrameCounter.cs index 56440e095..11b400a5b 100644 --- a/Subsurface/Source/FrameCounter.cs +++ b/Subsurface/Source/FrameCounter.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace Subsurface +namespace Barotrauma { public class FrameCounter { diff --git a/Subsurface/Source/GUI/ComponentStyle.cs b/Subsurface/Source/GUI/ComponentStyle.cs index 443e79558..ed3c94f29 100644 --- a/Subsurface/Source/GUI/ComponentStyle.cs +++ b/Subsurface/Source/GUI/ComponentStyle.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public class GUIComponentStyle { diff --git a/Subsurface/Source/GUI/GUI.cs b/Subsurface/Source/GUI/GUI.cs index 0ef39592d..6f0154088 100644 --- a/Subsurface/Source/GUI/GUI.cs +++ b/Subsurface/Source/GUI/GUI.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { [Flags] public enum Alignment diff --git a/Subsurface/Source/GUI/GUIButton.cs b/Subsurface/Source/GUI/GUIButton.cs index 7cff05c70..bb22f51fe 100644 --- a/Subsurface/Source/GUI/GUIButton.cs +++ b/Subsurface/Source/GUI/GUIButton.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { public class GUIButton : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs index eb6e5d1bb..0e749962f 100644 --- a/Subsurface/Source/GUI/GUIComponent.cs +++ b/Subsurface/Source/GUI/GUIComponent.cs @@ -5,7 +5,7 @@ using EventInput; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public abstract class GUIComponent { diff --git a/Subsurface/Source/GUI/GUIDropDown.cs b/Subsurface/Source/GUI/GUIDropDown.cs index 89aa7091d..73c1bcd02 100644 --- a/Subsurface/Source/GUI/GUIDropDown.cs +++ b/Subsurface/Source/GUI/GUIDropDown.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { public class GUIDropDown : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIFrame.cs b/Subsurface/Source/GUI/GUIFrame.cs index e7b4b575d..73fbb72dd 100644 --- a/Subsurface/Source/GUI/GUIFrame.cs +++ b/Subsurface/Source/GUI/GUIFrame.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using System; -namespace Subsurface +namespace Barotrauma { public class GUIFrame : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIImage.cs b/Subsurface/Source/GUI/GUIImage.cs index 379595291..abddcb103 100644 --- a/Subsurface/Source/GUI/GUIImage.cs +++ b/Subsurface/Source/GUI/GUIImage.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public class GUIImage : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIListBox.cs b/Subsurface/Source/GUI/GUIListBox.cs index 3182c8f86..ea5cb8e11 100644 --- a/Subsurface/Source/GUI/GUIListBox.cs +++ b/Subsurface/Source/GUI/GUIListBox.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public class GUIListBox : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIMessage.cs b/Subsurface/Source/GUI/GUIMessage.cs index 6d3274988..a07fa6cb2 100644 --- a/Subsurface/Source/GUI/GUIMessage.cs +++ b/Subsurface/Source/GUI/GUIMessage.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class GUIMessage { diff --git a/Subsurface/Source/GUI/GUIMessageBox.cs b/Subsurface/Source/GUI/GUIMessageBox.cs index c7143dff7..6768ca6be 100644 --- a/Subsurface/Source/GUI/GUIMessageBox.cs +++ b/Subsurface/Source/GUI/GUIMessageBox.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { public class GUIMessageBox : GUIFrame { diff --git a/Subsurface/Source/GUI/GUIProgressBar.cs b/Subsurface/Source/GUI/GUIProgressBar.cs index 13b866a7b..53e33d6e4 100644 --- a/Subsurface/Source/GUI/GUIProgressBar.cs +++ b/Subsurface/Source/GUI/GUIProgressBar.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public class GUIProgressBar : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIScrollBar.cs b/Subsurface/Source/GUI/GUIScrollBar.cs index ae857dee6..ec750e54c 100644 --- a/Subsurface/Source/GUI/GUIScrollBar.cs +++ b/Subsurface/Source/GUI/GUIScrollBar.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public class GUIScrollBar : GUIComponent { diff --git a/Subsurface/Source/GUI/GUIStyle.cs b/Subsurface/Source/GUI/GUIStyle.cs index 75e3f2008..f66c9c22b 100644 --- a/Subsurface/Source/GUI/GUIStyle.cs +++ b/Subsurface/Source/GUI/GUIStyle.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { public class GUIStyle { diff --git a/Subsurface/Source/GUI/GUITextBlock.cs b/Subsurface/Source/GUI/GUITextBlock.cs index 7ea96e934..3bb302dcc 100644 --- a/Subsurface/Source/GUI/GUITextBlock.cs +++ b/Subsurface/Source/GUI/GUITextBlock.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { public class GUITextBlock : GUIComponent { diff --git a/Subsurface/Source/GUI/GUITextBox.cs b/Subsurface/Source/GUI/GUITextBox.cs index d1c1f2b25..9187a8f37 100644 --- a/Subsurface/Source/GUI/GUITextBox.cs +++ b/Subsurface/Source/GUI/GUITextBox.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { delegate void TextBoxEvent(GUITextBox sender); diff --git a/Subsurface/Source/GUI/GUITickBox.cs b/Subsurface/Source/GUI/GUITickBox.cs index 6caa9a870..f63ffcf10 100644 --- a/Subsurface/Source/GUI/GUITickBox.cs +++ b/Subsurface/Source/GUI/GUITickBox.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { public class GUITickBox : GUIComponent { diff --git a/Subsurface/Source/GUI/TitleScreen.cs b/Subsurface/Source/GUI/TitleScreen.cs index 1086fc4b3..a79b05e78 100644 --- a/Subsurface/Source/GUI/TitleScreen.cs +++ b/Subsurface/Source/GUI/TitleScreen.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class LoadingScreen { diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index b2cad1462..f54ffe3a8 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -5,14 +5,14 @@ using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; -using Subsurface.Particles; +using Barotrauma.Networking; +using Barotrauma.Particles; using System.Collections; using System.Collections.Generic; using Microsoft.Xna.Framework.Input; using System.Xml; -namespace Subsurface +namespace Barotrauma { class GameMain : Game { diff --git a/Subsurface/Source/GameSession/CargoManager.cs b/Subsurface/Source/GameSession/CargoManager.cs index ddb928db7..9167814ed 100644 --- a/Subsurface/Source/GameSession/CargoManager.cs +++ b/Subsurface/Source/GameSession/CargoManager.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class CargoManager { diff --git a/Subsurface/Source/GameSession/CrewManager.cs b/Subsurface/Source/GameSession/CrewManager.cs index 254535a93..67cd1b81f 100644 --- a/Subsurface/Source/GameSession/CrewManager.cs +++ b/Subsurface/Source/GameSession/CrewManager.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class CrewManager { diff --git a/Subsurface/Source/GameSession/GameModes/GameMode.cs b/Subsurface/Source/GameSession/GameModes/GameMode.cs index dba60f5c0..d9165b4a9 100644 --- a/Subsurface/Source/GameSession/GameModes/GameMode.cs +++ b/Subsurface/Source/GameSession/GameModes/GameMode.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Reflection; -namespace Subsurface +namespace Barotrauma { class GameMode { diff --git a/Subsurface/Source/GameSession/GameModes/GameModePreset.cs b/Subsurface/Source/GameSession/GameModes/GameModePreset.cs index a00a22270..a0efba237 100644 --- a/Subsurface/Source/GameSession/GameModes/GameModePreset.cs +++ b/Subsurface/Source/GameSession/GameModes/GameModePreset.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Reflection; using System.Text; -namespace Subsurface +namespace Barotrauma { class GameModePreset { diff --git a/Subsurface/Source/GameSession/GameModes/QuestMode.cs b/Subsurface/Source/GameSession/GameModes/QuestMode.cs index 18c768387..0c0f3304d 100644 --- a/Subsurface/Source/GameSession/GameModes/QuestMode.cs +++ b/Subsurface/Source/GameSession/GameModes/QuestMode.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class QuestMode : GameMode { diff --git a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs index 028481886..1e925e4c6 100644 --- a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs +++ b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class SinglePlayerMode : GameMode { diff --git a/Subsurface/Source/GameSession/GameModes/TraitorMode.cs b/Subsurface/Source/GameSession/GameModes/TraitorMode.cs index 32c83220c..b9264e960 100644 --- a/Subsurface/Source/GameSession/GameModes/TraitorMode.cs +++ b/Subsurface/Source/GameSession/GameModes/TraitorMode.cs @@ -1,8 +1,8 @@ using System; using System.Linq; -using Subsurface.Networking; +using Barotrauma.Networking; -namespace Subsurface +namespace Barotrauma { class TraitorMode : GameMode { diff --git a/Subsurface/Source/GameSession/GameModes/TutorialMode.cs b/Subsurface/Source/GameSession/GameModes/TutorialMode.cs index 228f2b02f..2b46b1c66 100644 --- a/Subsurface/Source/GameSession/GameModes/TutorialMode.cs +++ b/Subsurface/Source/GameSession/GameModes/TutorialMode.cs @@ -1,13 +1,13 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; using System; using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class TutorialMode : GameMode { @@ -17,7 +17,7 @@ namespace Subsurface public static void Start() { - Submarine.Load("Content/Map/TutorialSub.gz", ""); + Submarine.Load("Content/Map/TutorialSub.sub", ""); GameMain.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLower()=="tutorial")); @@ -86,12 +86,15 @@ namespace Subsurface private IEnumerable UpdateState() { + Submarine.Loaded.SetPosition(new Vector2(Submarine.Loaded.Position.X, 38500.0f)); - GameMain.GameScreen.BackgroundSpriteManager.SpawnSprites(1, Submarine.Loaded.Position + Character.Controlled.Position); + //spawn some fish next to the player + GameMain.GameScreen.BackgroundSpriteManager.SpawnSprites(2, + Submarine.Loaded.Position + Character.Controlled.Position); yield return new WaitForSeconds(4.0f); - infoBox = CreateInfoFrame("Use WASD to move and mouse to look around"); + infoBox = CreateInfoFrame("Use WASD to move and the mouse to look around"); yield return new WaitForSeconds(5.0f); @@ -110,9 +113,19 @@ namespace Subsurface //----------------------------------- - infoBox = CreateInfoFrame("Now it's time to power up the submarine. Go to the upper left corner of the submarine, where you'll find a nuclear reactor."); + infoBox = CreateInfoFrame("Hold W or S to walk up or down stairs. Use shift to run.", true); + + while (infoBox!=null) + { + yield return CoroutineStatus.Running; + } + + //----------------------------------- + + infoBox = CreateInfoFrame("At the moment the submarine has no power, which means that crucial systems such as the oxygen generator or the engine aren't running. Let's fix this: go to the upper left corner of the submarine, where you'll find a nuclear reactor."); Reactor reactor = Item.itemList.Find(i => i.HasTag("tutorialreactor")).GetComponent(); + reactor.MeltDownTemp = 20000.0f; while (Vector2.Distance(Character.Controlled.Position, reactor.Item.Position)>200.0f) { @@ -135,28 +148,39 @@ namespace Subsurface } yield return new WaitForSeconds(0.5f); - infoBox = CreateInfoFrame("The reactor core has started generating heat, which in turn generates power for the submarine. It won't generate much power at the moment, " - +" because the shutdown temperature is set to 500. When the temperature of the reactor raises higher than the shutdown temperature, the reactor will automatically start to cool itself down." - + " You should increase it to somewhere around 5000."); + infoBox = CreateInfoFrame("The reactor core has started generating heat, which in turn generates power for the submarine. The power generation is very low at the moment," + +" because the reactor is set to shut itself down when the temperature rises above 500 degrees Celsius. You can adjust the temperature limit by changing the ''Shutdown Temperature'' in the control panel.", true); - while (Math.Abs(reactor.ShutDownTemp-5000.0f) > 400.0f) + while (infoBox!=null) { + reactor.ShutDownTemp = Math.Min(reactor.ShutDownTemp, 5000.0f); yield return CoroutineStatus.Running; } yield return new WaitForSeconds(0.5f); infoBox = CreateInfoFrame("The amount of power generated by the reactor should be kept close to the amount of power consumed by the devices in the submarine. " - +"If there's not enough power, devices won't function properly, and if there's too much power, some devices may be damaged. Turn on ''Automatic temperature control'' to " - +"make the reactor automatically adjust the temperature to a suitable level."); + +"If there isn't enough power, devices won't function properly (or at all), and if there's too much power, some devices may be damaged." + +" Try to raise the temperature of the reactor close to 3000 degrees by adjusting the fission and cooling rates."); + + while (Math.Abs(reactor.Temperature-3000.0f) > 100.0f) + { + reactor.ShutDownTemp = Math.Min(reactor.ShutDownTemp, 5000.0f); + yield return CoroutineStatus.Running; + } + yield return new WaitForSeconds(0.5f); + infoBox = CreateInfoFrame("Looks like we're up and running! Now you should turn on the ''Automatic temperature control'', which will make the reactor " + +"automatically adjust the temperature to a suitable level. Even though it's an easy way to keep the reactor up and running most of the time, " + +"you should keep in mind that it changes the temperature very slowly and carefully, which may cause issues if there are sudden changes in grid load."); + while (!reactor.AutoTemp) { yield return CoroutineStatus.Running; } yield return new WaitForSeconds(0.5f); - infoBox = CreateInfoFrame("That's the basics you need to know to power up the reactor! Now that there's power available for the engines, let's try steering the sub. " - +"Deselect the reactor by pressing E and head to the command room at the left edge of the vessel."); + infoBox = CreateInfoFrame("That's the basics of operating the reactor! Now that there's power available for the engines, it's time to get the submarine moving. " + +"Deselect the reactor by pressing E and head to the command room at the right edge of the vessel."); Steering steering = Item.itemList.Find(i => i.HasTag("tutorialsteering")).GetComponent(); Radar radar = steering.Item.GetComponent(); @@ -165,6 +189,8 @@ namespace Subsurface { yield return CoroutineStatus.Running; } + + CoroutineManager.StartCoroutine(KeepReactorRunning(reactor)); infoBox = CreateInfoFrame("Select the navigation terminal by walking next to it and pressing E."); @@ -183,7 +209,7 @@ namespace Subsurface { yield return CoroutineStatus.Running; } - yield return new WaitForSeconds(1.0f); + yield return new WaitForSeconds(5.0f); infoBox = CreateInfoFrame("You need a screwdriver to check the wiring of the terminal." + " Equip a screwdriver by pulling it to either of the slots with a hand symbol, and then select the terminal again by pressing E."); @@ -272,14 +298,21 @@ namespace Subsurface yield return new WaitForSeconds(0.5f); infoBox = CreateInfoFrame("The white box in the middle is the submarine, and the white lines outside it are the walls of an underwater cavern. " - + "Try moving the submarine by clicking somewhere inside the rectangle and draggind the pointer to the direction you want to go to."); + + "Try moving the submarine by clicking somewhere on the monitor and dragging the pointer to the direction you want to go to."); while (steering.CurrTargetVelocity == Vector2.Zero && steering.CurrTargetVelocity.Length() < 50.0f) { yield return CoroutineStatus.Running; } yield return new WaitForSeconds(4.0f); - + + infoBox = CreateInfoFrame("The submarine moves up and down by pumping water in and out of the two ballast tanks at the bottom of the submarine. " + +"The engine at the back of the sub moves it forwards and backwards.", true); + + while (infoBox!=null) + { + yield return CoroutineStatus.Running; + } infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern."); @@ -287,10 +320,7 @@ namespace Subsurface { yield return CoroutineStatus.Running; } - yield return new WaitForSeconds(8.0f); - - infoBox = CreateInfoFrame("The submarine moves up and down by pumping water in and out of the two ballast tanks at the bottom of the submarine. " - +"The engine at the back of the sub moves it forwards and backwards."); + yield return new WaitForSeconds(1.0f); var moloch = new AICharacter("Content/Characters/Moloch/moloch.xml", steering.Item.SimPosition + Vector2.UnitX * 25.0f); moloch.PlaySound(AIController.AiState.Attack); @@ -318,7 +348,7 @@ namespace Subsurface foreach (Limb limb in moloch.AnimController.Limbs) { - limb.body.LinearVelocity = new Vector2(limb.LinearVelocity.X, limb.LinearVelocity.Y + steeringDir.Y*10.0f); + limb.body.LinearVelocity = new Vector2(limb.LinearVelocity.X*2.0f, limb.LinearVelocity.Y + steeringDir.Y*10.0f); } moloch.AIController.Steering = steeringDir; @@ -338,17 +368,15 @@ namespace Subsurface yield return new WaitForSeconds(1.0f); } while (!broken); - yield return new WaitForSeconds(1.0f); + yield return new WaitForSeconds(0.5f); var capacitor1 = Item.itemList.Find(i => i.HasTag("capacitor1")).GetComponent(); var capacitor2 = Item.itemList.Find(i => i.HasTag("capacitor1")).GetComponent(); CoroutineManager.StartCoroutine(KeepEnemyAway(moloch, new PowerContainer[] { capacitor1, capacitor2 })); - - + infoBox = CreateInfoFrame("The hull has been breached! Close all the doors to the command room to stop the water from flooding the entire sub!"); - - + Door commandDoor1 = Item.itemList.Find(i => i.HasTag("commanddoor1")).GetComponent(); Door commandDoor2 = Item.itemList.Find(i => i.HasTag("commanddoor2")).GetComponent(); Door commandDoor3 = Item.itemList.Find(i => i.HasTag("commanddoor3")).GetComponent(); @@ -358,7 +386,7 @@ namespace Subsurface yield return CoroutineStatus.Running; } - infoBox = CreateInfoFrame("You should find yourself an diving mask or a diving suit, in case the creature causes more damage. "+ + infoBox = CreateInfoFrame("You should quickly find yourself a diving mask or a diving suit. "+ "There are some in the room next to the airlock."); while (!HasItem("Diving Mask") && !HasItem("Diving Suit")) @@ -386,7 +414,7 @@ namespace Subsurface yield return new WaitForSeconds(5.0f); - infoBox = CreateInfoFrame("Now it's time to stop the creature attacking the submarine. Head to the railgun room at the upper right corner of the sub."); + infoBox = CreateInfoFrame("Now you should stop the creature attacking the submarine before it does any more damage. Head to the railgun room at the upper right corner of the sub."); var railGun = Item.itemList.Find(i => i.GetComponent()!=null); @@ -515,6 +543,7 @@ namespace Subsurface Character.Controlled = null; GameMain.GameScreen.Cam.TargetPos = Vector2.Zero; + GameMain.LightManager.LosEnabled = false; do { @@ -590,6 +619,19 @@ namespace Subsurface yield return CoroutineStatus.Success; } + private IEnumerable KeepReactorRunning(Reactor reactor) + { + do + { + reactor.AutoTemp = true; + reactor.ShutDownTemp = 5000.0f; + + yield return CoroutineStatus.Running; + } while (Item.itemList.Contains(reactor.Item)); + + yield return CoroutineStatus.Success; + } + public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); @@ -598,10 +640,17 @@ namespace Subsurface if (infoBox != null) infoBox.Draw(spriteBatch); } - private GUIComponent CreateInfoFrame(string text) + private bool CloseInfoFrame(GUIButton button, object userData) + { + infoBox = null; + + return true; + } + + private GUIComponent CreateInfoFrame(string text, bool hasButton = false) { int width = 300; - int height = 80; + int height = hasButton ? 110 : 80; string wrappedText = ToolBox.WrapText(text, width, GUI.Font); @@ -612,7 +661,13 @@ namespace Subsurface infoBlock.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f); infoBlock.Flash(Color.Green); - new GUITextBlock(new Rectangle(10, 10, width - 40, height), text, GUI.Style, infoBlock, true); + var textBlock = new GUITextBlock(new Rectangle(10, 10, width - 40, height), text, GUI.Style, infoBlock, true); + + if (hasButton) + { + var okButton = new GUIButton(new Rectangle(0,-40,80,25), "OK", Alignment.BottomCenter, GUI.Style, textBlock); + okButton.OnClicked = CloseInfoFrame; + } GUI.PlayMessageSound(); diff --git a/Subsurface/Source/GameSession/GameSession.cs b/Subsurface/Source/GameSession/GameSession.cs index 7e9df144b..86fde58ea 100644 --- a/Subsurface/Source/GameSession/GameSession.cs +++ b/Subsurface/Source/GameSession/GameSession.cs @@ -8,7 +8,7 @@ using System.Text; using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class GameSession { diff --git a/Subsurface/Source/GameSession/HireManager.cs b/Subsurface/Source/GameSession/HireManager.cs index 1e5b52f36..ce3aa1608 100644 --- a/Subsurface/Source/GameSession/HireManager.cs +++ b/Subsurface/Source/GameSession/HireManager.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { class HireManager { diff --git a/Subsurface/Source/GameSettings.cs b/Subsurface/Source/GameSettings.cs index cdf8df2ba..97290cad9 100644 --- a/Subsurface/Source/GameSettings.cs +++ b/Subsurface/Source/GameSettings.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public class GameSettings { diff --git a/Subsurface/Source/IPropertyObject.cs b/Subsurface/Source/IPropertyObject.cs index be8de376d..287b28f66 100644 --- a/Subsurface/Source/IPropertyObject.cs +++ b/Subsurface/Source/IPropertyObject.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { interface IPropertyObject { diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs index 93e2cc9f4..56fab4692 100644 --- a/Subsurface/Source/Items/CharacterInventory.cs +++ b/Subsurface/Source/Items/CharacterInventory.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { [Flags] public enum LimbSlot @@ -279,7 +279,7 @@ namespace Subsurface { DropItem(draggingItem); - new Networking.NetworkEvent(Subsurface.Networking.NetworkEventType.DropItem, draggingItem.ID, true); + new Networking.NetworkEvent(Barotrauma.Networking.NetworkEventType.DropItem, draggingItem.ID, true); //draggingItem = null; } } diff --git a/Subsurface/Source/Items/Components/Door.cs b/Subsurface/Source/Items/Components/Door.cs index 10f5ec551..6a681bc28 100644 --- a/Subsurface/Source/Items/Components/Door.cs +++ b/Subsurface/Source/Items/Components/Door.cs @@ -6,9 +6,9 @@ using FarseerPhysics.Dynamics; using FarseerPhysics.Factories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Lights; +using Barotrauma.Lights; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Door : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Holdable/Holdable.cs b/Subsurface/Source/Items/Components/Holdable/Holdable.cs index 0f834c0b5..fe6cf0672 100644 --- a/Subsurface/Source/Items/Components/Holdable/Holdable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Holdable.cs @@ -3,7 +3,7 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Holdable : Pickable { diff --git a/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs b/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs index dd10991e0..5dc68a12f 100644 --- a/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs +++ b/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs @@ -4,7 +4,7 @@ using FarseerPhysics.Dynamics.Contacts; using Microsoft.Xna.Framework; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class MeleeWeapon : Holdable { @@ -74,7 +74,7 @@ namespace Subsurface.Items.Components hitting = true; IsActive = true; - return true; + return false; } public override void Drop(Character dropper) @@ -187,6 +187,8 @@ namespace Subsurface.Items.Components RestoreCollision(); hitting = false; + ApplyStatusEffects(ActionType.OnUse, 1.0f, picker); + return true; } } diff --git a/Subsurface/Source/Items/Components/Holdable/Pickable.cs b/Subsurface/Source/Items/Components/Holdable/Pickable.cs index 634d8f07a..972b687a1 100644 --- a/Subsurface/Source/Items/Components/Holdable/Pickable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Pickable.cs @@ -1,7 +1,7 @@ using System; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Pickable : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs b/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs index d05a882f3..587b9ba94 100644 --- a/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs +++ b/Subsurface/Source/Items/Components/Holdable/RangedWeapon.cs @@ -6,7 +6,7 @@ using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class RangedWeapon : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs index b6b55e8db..3568932b6 100644 --- a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs +++ b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs @@ -5,9 +5,9 @@ using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Particles; +using Barotrauma.Particles; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class RepairTool : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Holdable/Throwable.cs b/Subsurface/Source/Items/Components/Holdable/Throwable.cs index 8293a205e..3f5e17178 100644 --- a/Subsurface/Source/Items/Components/Holdable/Throwable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Throwable.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Throwable : Holdable { diff --git a/Subsurface/Source/Items/Components/ItemComponent.cs b/Subsurface/Source/Items/Components/ItemComponent.cs index 94d299c96..6fab1cba3 100644 --- a/Subsurface/Source/Items/Components/ItemComponent.cs +++ b/Subsurface/Source/Items/Components/ItemComponent.cs @@ -6,11 +6,11 @@ using System.Xml.Linq; using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; using System.IO; using System.Globalization; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class ItemSound { @@ -644,7 +644,7 @@ namespace Subsurface.Items.Components try { // Get the type of a specified class. - t = Type.GetType("Subsurface.Items.Components." + type + "", false, true); + t = Type.GetType("Barotrauma.Items.Components." + type + "", false, true); if (t == null) { if (errorMessages) DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")"); diff --git a/Subsurface/Source/Items/Components/ItemContainer.cs b/Subsurface/Source/Items/Components/ItemContainer.cs index d795cca74..4abc5e8b5 100644 --- a/Subsurface/Source/Items/Components/ItemContainer.cs +++ b/Subsurface/Source/Items/Components/ItemContainer.cs @@ -5,7 +5,7 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class ItemContainer : ItemComponent { diff --git a/Subsurface/Source/Items/Components/ItemLabel.cs b/Subsurface/Source/Items/Components/ItemLabel.cs index 0b9ff1323..e8887d474 100644 --- a/Subsurface/Source/Items/Components/ItemLabel.cs +++ b/Subsurface/Source/Items/Components/ItemLabel.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class ItemLabel : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Ladder.cs b/Subsurface/Source/Items/Components/Ladder.cs index 9323bf328..3cbf1a47b 100644 --- a/Subsurface/Source/Items/Components/Ladder.cs +++ b/Subsurface/Source/Items/Components/Ladder.cs @@ -1,6 +1,6 @@ using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Ladder : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Machines/Controller.cs b/Subsurface/Source/Items/Components/Machines/Controller.cs index 8817ce664..45305b3cd 100644 --- a/Subsurface/Source/Items/Components/Machines/Controller.cs +++ b/Subsurface/Source/Items/Components/Machines/Controller.cs @@ -5,7 +5,7 @@ using FarseerPhysics; using FarseerPhysics.Dynamics.Joints; using Microsoft.Xna.Framework; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { struct LimbPos { @@ -163,15 +163,6 @@ namespace Subsurface.Items.Components break; } } - - //foreach (MapEntity e in item.linkedTo) - //{ - // Item linkedItem = e as Item; - // if (linkedItem == null) continue; - // linkedItem.SecondaryUse(deltaTime, character); - //} - - } public override bool Pick(Character picker) diff --git a/Subsurface/Source/Items/Components/Machines/Engine.cs b/Subsurface/Source/Items/Components/Machines/Engine.cs index 6713f43ef..f26735544 100644 --- a/Subsurface/Source/Items/Components/Machines/Engine.cs +++ b/Subsurface/Source/Items/Components/Machines/Engine.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Engine : Powered { diff --git a/Subsurface/Source/Items/Components/Machines/Fabricator.cs b/Subsurface/Source/Items/Components/Machines/Fabricator.cs index 63f4dc89d..5918a41a9 100644 --- a/Subsurface/Source/Items/Components/Machines/Fabricator.cs +++ b/Subsurface/Source/Items/Components/Machines/Fabricator.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class FabricableItem { diff --git a/Subsurface/Source/Items/Components/Machines/MiniMap.cs b/Subsurface/Source/Items/Components/Machines/MiniMap.cs index f0813d3ef..7f03e33f3 100644 --- a/Subsurface/Source/Items/Components/Machines/MiniMap.cs +++ b/Subsurface/Source/Items/Components/Machines/MiniMap.cs @@ -3,7 +3,7 @@ using System.Xml.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class MiniMap : Powered { diff --git a/Subsurface/Source/Items/Components/Machines/OxygenGenerator.cs b/Subsurface/Source/Items/Components/Machines/OxygenGenerator.cs index c50e2b1d6..f69703b60 100644 --- a/Subsurface/Source/Items/Components/Machines/OxygenGenerator.cs +++ b/Subsurface/Source/Items/Components/Machines/OxygenGenerator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class OxygenGenerator : Powered { @@ -60,6 +60,8 @@ namespace Subsurface.Items.Components powerDownTimer = 0.0f; } + ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + running = true; CurrFlow = Math.Min(voltage, 1.0f) * 50000.0f; diff --git a/Subsurface/Source/Items/Components/Machines/Pump.cs b/Subsurface/Source/Items/Components/Machines/Pump.cs index 8b9e5c31c..16b6b2e14 100644 --- a/Subsurface/Source/Items/Components/Machines/Pump.cs +++ b/Subsurface/Source/Items/Components/Machines/Pump.cs @@ -5,7 +5,7 @@ using System.Collections.Specialized; using System.Globalization; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Pump : Powered { @@ -78,6 +78,8 @@ namespace Subsurface.Items.Components if (voltage < minVoltage) return; + ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + if (hull2 == null && hull1 == null) return; float powerFactor = (currPowerConsumption==0.0f) ? 1.0f : voltage; diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs index 4c40a4ce7..5f1ceb455 100644 --- a/Subsurface/Source/Items/Components/Machines/Radar.cs +++ b/Subsurface/Source/Items/Components/Machines/Radar.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Radar : Powered { diff --git a/Subsurface/Source/Items/Components/Machines/Reactor.cs b/Subsurface/Source/Items/Components/Machines/Reactor.cs index 45b2c3a14..d6d03a6bb 100644 --- a/Subsurface/Source/Items/Components/Machines/Reactor.cs +++ b/Subsurface/Source/Items/Components/Machines/Reactor.cs @@ -4,9 +4,9 @@ using System.Xml.Linq; using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Reactor : Powered { @@ -106,6 +106,7 @@ namespace Subsurface.Items.Components public bool AutoTemp { get { return autoTemp; } + set { autoTemp = value; } } public float ExtraCooling { get; set; } @@ -115,7 +116,7 @@ namespace Subsurface.Items.Components public float ShutDownTemp { get { return shutDownTemp; } - private set { shutDownTemp = MathHelper.Clamp(value, 0.0f, 10000.0f); } + set { shutDownTemp = MathHelper.Clamp(value, 0.0f, 10000.0f); } } public Reactor(Item item, XElement element) @@ -137,7 +138,7 @@ namespace Subsurface.Items.Components public override void Update(float deltaTime, Camera cam) { - //ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + ApplyStatusEffects(ActionType.OnActive, deltaTime, null); fissionRate = Math.Min(fissionRate, AvailableFuel); diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs index 80b870d68..4fc27995a 100644 --- a/Subsurface/Source/Items/Components/Machines/Steering.cs +++ b/Subsurface/Source/Items/Components/Machines/Steering.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Steering : Powered { diff --git a/Subsurface/Source/Items/Components/Machines/Vent.cs b/Subsurface/Source/Items/Components/Machines/Vent.cs index 07191494d..5e8a5e10c 100644 --- a/Subsurface/Source/Items/Components/Machines/Vent.cs +++ b/Subsurface/Source/Items/Components/Machines/Vent.cs @@ -1,7 +1,7 @@ using System; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Vent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Power/PowerContainer.cs b/Subsurface/Source/Items/Components/Power/PowerContainer.cs index 1e1fb6d4e..170ca3e8c 100644 --- a/Subsurface/Source/Items/Components/Power/PowerContainer.cs +++ b/Subsurface/Source/Items/Components/Power/PowerContainer.cs @@ -3,7 +3,7 @@ using System.Xml.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class PowerContainer : Powered { @@ -92,9 +92,6 @@ namespace Subsurface.Items.Components //if (item.linkedTo.Count == 0) return; - ApplyStatusEffects(ActionType.OnActive, deltaTime, null); - - foreach (Connection c in item.Connections) { foreach (Connection c2 in c.Recipients) @@ -106,23 +103,14 @@ namespace Subsurface.Items.Components } } - //foreach (MapEntity e in item.linkedTo) - //{ - // Item it = e as Item; - // if (it == null) continue; - - // PowerTransfer pt = it.GetComponent(); - // if (pt==null) continue; - // //gridPower -= pt.PowerConsumption; - // gridLoad += pt.PowerLoad; - - // //gridPower = -jb.PowerConsumption; - // //gridLoad = jb.load; - // break; - //} float gridRate = voltage; + if (gridRate>minVoltage) + { + ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + } + //recharge if (gridRate >= chargeRate) { diff --git a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs index ccb6c0afa..9c3ac914b 100644 --- a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs +++ b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Globalization; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class PowerTransfer : Powered { diff --git a/Subsurface/Source/Items/Components/Power/Powered.cs b/Subsurface/Source/Items/Components/Power/Powered.cs index 999480755..f571f7c6b 100644 --- a/Subsurface/Source/Items/Components/Power/Powered.cs +++ b/Subsurface/Source/Items/Components/Power/Powered.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.IO; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Powered : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Projectile.cs b/Subsurface/Source/Items/Components/Projectile.cs index f1e2b5f17..fc258b19e 100644 --- a/Subsurface/Source/Items/Components/Projectile.cs +++ b/Subsurface/Source/Items/Components/Projectile.cs @@ -8,7 +8,7 @@ using FarseerPhysics.Dynamics.Contacts; using FarseerPhysics.Dynamics.Joints; using Microsoft.Xna.Framework; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Projectile : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Rope.cs b/Subsurface/Source/Items/Components/Rope.cs index 391042ced..8ea0a5328 100644 --- a/Subsurface/Source/Items/Components/Rope.cs +++ b/Subsurface/Source/Items/Components/Rope.cs @@ -11,7 +11,7 @@ using FarseerPhysics.Factories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Rope : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/AndComponent.cs b/Subsurface/Source/Items/Components/Signal/AndComponent.cs index 7d4e0ca01..eba73b42b 100644 --- a/Subsurface/Source/Items/Components/Signal/AndComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/AndComponent.cs @@ -1,7 +1,7 @@ using System; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class AndComponent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/Connection.cs b/Subsurface/Source/Items/Components/Signal/Connection.cs index c0b47827c..191defac1 100644 --- a/Subsurface/Source/Items/Components/Signal/Connection.cs +++ b/Subsurface/Source/Items/Components/Signal/Connection.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Connection diff --git a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs index e67e320b6..26174d8fe 100644 --- a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs +++ b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class ConnectionPanel : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/LightComponent.cs b/Subsurface/Source/Items/Components/Signal/LightComponent.cs index 46ac7e32d..8f84865f7 100644 --- a/Subsurface/Source/Items/Components/Signal/LightComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/LightComponent.cs @@ -1,12 +1,12 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Lights; +using Barotrauma.Lights; using System; using System.IO; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class LightComponent : Powered { diff --git a/Subsurface/Source/Items/Components/Signal/NotComponent.cs b/Subsurface/Source/Items/Components/Signal/NotComponent.cs index 7515f78e9..076a496c9 100644 --- a/Subsurface/Source/Items/Components/Signal/NotComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/NotComponent.cs @@ -1,6 +1,6 @@ using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class NotComponent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/OrComponent.cs b/Subsurface/Source/Items/Components/Signal/OrComponent.cs index 335096ff5..5515635d3 100644 --- a/Subsurface/Source/Items/Components/Signal/OrComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/OrComponent.cs @@ -1,6 +1,6 @@ using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class OrComponent : AndComponent { diff --git a/Subsurface/Source/Items/Components/Signal/OxygenDetector.cs b/Subsurface/Source/Items/Components/Signal/OxygenDetector.cs index f52764f97..918d64241 100644 --- a/Subsurface/Source/Items/Components/Signal/OxygenDetector.cs +++ b/Subsurface/Source/Items/Components/Signal/OxygenDetector.cs @@ -1,6 +1,6 @@ using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class OxygenDetector : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/RegExFindComponent.cs b/Subsurface/Source/Items/Components/Signal/RegExFindComponent.cs index 5b294b0f1..c5eb192aa 100644 --- a/Subsurface/Source/Items/Components/Signal/RegExFindComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/RegExFindComponent.cs @@ -1,7 +1,7 @@ using System.Xml.Linq; using System.Text.RegularExpressions; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class RegExFindComponent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/SignalCheckComponent.cs b/Subsurface/Source/Items/Components/Signal/SignalCheckComponent.cs index 0f282106a..617846d07 100644 --- a/Subsurface/Source/Items/Components/Signal/SignalCheckComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/SignalCheckComponent.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class SignalCheckComponent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/WifiComponent.cs b/Subsurface/Source/Items/Components/Signal/WifiComponent.cs index d1486eca7..870f3ddb3 100644 --- a/Subsurface/Source/Items/Components/Signal/WifiComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/WifiComponent.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class WifiComponent : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Signal/Wire.cs b/Subsurface/Source/Items/Components/Signal/Wire.cs index 7e62b0a16..7c6b3871b 100644 --- a/Subsurface/Source/Items/Components/Signal/Wire.cs +++ b/Subsurface/Source/Items/Components/Signal/Wire.cs @@ -6,7 +6,7 @@ using System.Globalization; using System.Linq; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Wire : ItemComponent { diff --git a/Subsurface/Source/Items/Components/Turret.cs b/Subsurface/Source/Items/Components/Turret.cs index 47d9f0406..62a2ce1f3 100644 --- a/Subsurface/Source/Items/Components/Turret.cs +++ b/Subsurface/Source/Items/Components/Turret.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using FarseerPhysics; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class Turret : Powered { diff --git a/Subsurface/Source/Items/Components/Wearable.cs b/Subsurface/Source/Items/Components/Wearable.cs index bc3232869..f052172f1 100644 --- a/Subsurface/Source/Items/Components/Wearable.cs +++ b/Subsurface/Source/Items/Components/Wearable.cs @@ -4,7 +4,7 @@ using System.IO; using System.Linq; using System.Xml.Linq; -namespace Subsurface.Items.Components +namespace Barotrauma.Items.Components { class WearableSprite { diff --git a/Subsurface/Source/Items/FixRequirement.cs b/Subsurface/Source/Items/FixRequirement.cs index 4545d71d5..e60892550 100644 --- a/Subsurface/Source/Items/FixRequirement.cs +++ b/Subsurface/Source/Items/FixRequirement.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class FixRequirement { diff --git a/Subsurface/Source/Items/Inventory.cs b/Subsurface/Source/Items/Inventory.cs index 17057458b..64ca1c3ee 100644 --- a/Subsurface/Source/Items/Inventory.cs +++ b/Subsurface/Source/Items/Inventory.cs @@ -3,10 +3,10 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface.Networking; +using Barotrauma.Networking; using System; -namespace Subsurface +namespace Barotrauma { class Inventory : Entity { diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 6145af8b5..88de703e5 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -6,14 +6,14 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface.Networking; +using Barotrauma.Networking; using System; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; using System.ComponentModel; using System.Collections.ObjectModel; using FarseerPhysics.Dynamics; -namespace Subsurface +namespace Barotrauma { public enum ActionType @@ -429,7 +429,17 @@ namespace Subsurface foreach (Item containedItem in containedItems) { if (containedItem == null) continue; - if (effect.TargetNames != null && !effect.TargetNames.Contains(containedItem.Name)) continue; + if (effect.TargetNames != null && !effect.TargetNames.Contains(containedItem.Name)) + { + bool tagFound = false; + foreach (string targetName in effect.TargetNames) + { + if (!containedItem.HasTag(targetName)) continue; + tagFound = true; + break; + } + if (!tagFound) continue; + } hasTargets = true; targets.Add(containedItem); @@ -440,30 +450,30 @@ namespace Subsurface } - if (hasTargets) + if (!hasTargets) return; + + if (effect.Targets.HasFlag(StatusEffect.TargetType.This)) { - if (effect.Targets.HasFlag(StatusEffect.TargetType.This)) + foreach (var pobject in AllPropertyObjects) { - foreach (var pobject in AllPropertyObjects) - { - targets.Add(pobject); - } + targets.Add(pobject); } - //effect.Apply(type, deltaTime, this); - //ApplyStatusEffect(effect, type, deltaTime, this); + } + //effect.Apply(type, deltaTime, this); + //ApplyStatusEffect(effect, type, deltaTime, this); - if (effect.Targets.HasFlag(StatusEffect.TargetType.Character)) targets.Add(character); - //effect.Apply(type, deltaTime, null, character); - //ApplyStatusEffect(effect, type, deltaTime, null, character, limb); + if (effect.Targets.HasFlag(StatusEffect.TargetType.Character)) targets.Add(character); + //effect.Apply(type, deltaTime, null, character); + //ApplyStatusEffect(effect, type, deltaTime, null, character, limb); - if (container != null && effect.Targets.HasFlag(StatusEffect.TargetType.Parent)) targets.Add(container); - //{ - // effect.Apply(type, deltaTime, container); - // //container.ApplyStatusEffect(effect, type, deltaTime, container); - //} + if (container != null && effect.Targets.HasFlag(StatusEffect.TargetType.Parent)) targets.Add(container); + //{ + // effect.Apply(type, deltaTime, container); + // //container.ApplyStatusEffect(effect, type, deltaTime, container); + //} - effect.Apply(type, deltaTime, this, targets); - } + effect.Apply(type, deltaTime, this, targets); + } @@ -497,7 +507,7 @@ namespace Subsurface ic.Update(deltaTime, cam); ic.PlaySound(ActionType.OnActive, Position); - ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + //ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null); } else { diff --git a/Subsurface/Source/Items/ItemInventory.cs b/Subsurface/Source/Items/ItemInventory.cs index b3f2ed9fb..af904fcf0 100644 --- a/Subsurface/Source/Items/ItemInventory.cs +++ b/Subsurface/Source/Items/ItemInventory.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; -namespace Subsurface +namespace Barotrauma { class ItemInventory : Inventory { diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs index b7021d576..5ecdd28d1 100644 --- a/Subsurface/Source/Items/ItemPrefab.cs +++ b/Subsurface/Source/Items/ItemPrefab.cs @@ -7,7 +7,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { class ItemPrefab : MapEntityPrefab { diff --git a/Subsurface/Source/Items/RelatedItem.cs b/Subsurface/Source/Items/RelatedItem.cs index bdbbf339d..dbc4ce005 100644 --- a/Subsurface/Source/Items/RelatedItem.cs +++ b/Subsurface/Source/Items/RelatedItem.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class RelatedItem { diff --git a/Subsurface/Source/Map/Entity.cs b/Subsurface/Source/Map/Entity.cs index 375f796fd..48d868ce2 100644 --- a/Subsurface/Source/Map/Entity.cs +++ b/Subsurface/Source/Map/Entity.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using Lidgren.Network; using Microsoft.Xna.Framework; -using Subsurface.Networking; +using Barotrauma.Networking; -namespace Subsurface +namespace Barotrauma { class Entity { diff --git a/Subsurface/Source/Map/Explosion.cs b/Subsurface/Source/Map/Explosion.cs index d35d0d4ba..be8fb4fcd 100644 --- a/Subsurface/Source/Map/Explosion.cs +++ b/Subsurface/Source/Map/Explosion.cs @@ -1,11 +1,11 @@ using FarseerPhysics; using Microsoft.Xna.Framework; -using Subsurface.Lights; +using Barotrauma.Lights; using System; using System.Collections.Generic; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class Explosion { @@ -21,17 +21,6 @@ namespace Subsurface private bool sparks, shockwave, flames; - //public Explosion(Vector2 position, float range, float damage, float structureDamage, float stun = 0.0f, float force = 0.0f) - //{ - // this.position = position; - - // attack = new Attack(,); - - // this.force = force; - - - //} - public Explosion(XElement element) { attack = new Attack(element); @@ -42,7 +31,7 @@ namespace Subsurface shockwave = ToolBox.GetAttributeBool(element, "shockwave", true); flames = ToolBox.GetAttributeBool(element, "flames", true); - CameraShake = attack.Range*10.0f; + CameraShake = ToolBox.GetAttributeFloat(element, "camerashake", attack.Range*10.0f); } public void Explode() diff --git a/Subsurface/Source/Map/Gap.cs b/Subsurface/Source/Map/Gap.cs index 7f929f0a8..e7490e2b3 100644 --- a/Subsurface/Source/Map/Gap.cs +++ b/Subsurface/Source/Map/Gap.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.ObjectModel; -namespace Subsurface +namespace Barotrauma { class Gap : MapEntity { diff --git a/Subsurface/Source/Map/Hull.cs b/Subsurface/Source/Map/Hull.cs index c2d9d0d58..36142d8a3 100644 --- a/Subsurface/Source/Map/Hull.cs +++ b/Subsurface/Source/Map/Hull.cs @@ -7,7 +7,7 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { class Hull : MapEntity diff --git a/Subsurface/Source/Map/IDamageable.cs b/Subsurface/Source/Map/IDamageable.cs index 9771c0f00..995c3121f 100644 --- a/Subsurface/Source/Map/IDamageable.cs +++ b/Subsurface/Source/Map/IDamageable.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { interface IDamageable { diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index 03ce14e27..5ca6f7971 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Diagnostics; using Voronoi2; -namespace Subsurface +namespace Barotrauma { class Level { diff --git a/Subsurface/Source/Map/Levels/VoronoiElements.cs b/Subsurface/Source/Map/Levels/VoronoiElements.cs index 746788917..5b96a33fe 100644 --- a/Subsurface/Source/Map/Levels/VoronoiElements.cs +++ b/Subsurface/Source/Map/Levels/VoronoiElements.cs @@ -52,7 +52,7 @@ using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; -using Subsurface; +using Barotrauma; using System; using System.Collections.Generic; diff --git a/Subsurface/Source/Map/Lights/ConvexHull.cs b/Subsurface/Source/Map/Lights/ConvexHull.cs index 901f95490..b3f6a486f 100644 --- a/Subsurface/Source/Map/Lights/ConvexHull.cs +++ b/Subsurface/Source/Map/Lights/ConvexHull.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using System.Linq; -namespace Subsurface.Lights +namespace Barotrauma.Lights { class CachedShadow { diff --git a/Subsurface/Source/Map/Lights/LightManager.cs b/Subsurface/Source/Map/Lights/LightManager.cs index ec7d06687..b5799e9a8 100644 --- a/Subsurface/Source/Map/Lights/LightManager.cs +++ b/Subsurface/Source/Map/Lights/LightManager.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using System.Diagnostics; -namespace Subsurface.Lights +namespace Barotrauma.Lights { class LightManager { @@ -124,18 +124,18 @@ namespace Subsurface.Lights spriteBatch.End(); } - //ClearAlphaToOne(graphics, spriteBatch); - //spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.MultiplyWithAlpha, null, null, null, null, cam.Transform); + ClearAlphaToOne(graphics, spriteBatch); + spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.MultiplyWithAlpha, null, null, null, null, cam.Transform); - //foreach (LightSource light in lights) - //{ - // if (light.hullsInRange.Count > 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue; - // if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue; + foreach (LightSource light in lights) + { + if (light.hullsInRange.Count > 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue; + if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue; - // light.Draw(spriteBatch); - //} + light.Draw(spriteBatch); + } - //spriteBatch.End(); + spriteBatch.End(); //clear alpha, to avoid messing stuff up later ClearAlphaToOne(graphics, spriteBatch); diff --git a/Subsurface/Source/Map/Lights/LightSource.cs b/Subsurface/Source/Map/Lights/LightSource.cs index 0ed505b0f..6dd94e1ad 100644 --- a/Subsurface/Source/Map/Lights/LightSource.cs +++ b/Subsurface/Source/Map/Lights/LightSource.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface.Lights +namespace Barotrauma.Lights { class LightSource { diff --git a/Subsurface/Source/Map/Location.cs b/Subsurface/Source/Map/Location.cs index 92d2cfb1a..7e5e067b6 100644 --- a/Subsurface/Source/Map/Location.cs +++ b/Subsurface/Source/Map/Location.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class Location diff --git a/Subsurface/Source/Map/LocationType.cs b/Subsurface/Source/Map/LocationType.cs index 31e267e9d..9ac05b1ab 100644 --- a/Subsurface/Source/Map/LocationType.cs +++ b/Subsurface/Source/Map/LocationType.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class LocationType { diff --git a/Subsurface/Source/Map/Map.cs b/Subsurface/Source/Map/Map.cs index 03a75b777..f23ab45c2 100644 --- a/Subsurface/Source/Map/Map.cs +++ b/Subsurface/Source/Map/Map.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using Voronoi2; -namespace Subsurface +namespace Barotrauma { class Map { diff --git a/Subsurface/Source/Map/MapEntity.cs b/Subsurface/Source/Map/MapEntity.cs index 9c8fad1ba..1cc9cbc74 100644 --- a/Subsurface/Source/Map/MapEntity.cs +++ b/Subsurface/Source/Map/MapEntity.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System.Collections.ObjectModel; -namespace Subsurface +namespace Barotrauma { class MapEntity : Entity { diff --git a/Subsurface/Source/Map/MapEntityPrefab.cs b/Subsurface/Source/Map/MapEntityPrefab.cs index 946ec34b4..f553214ff 100644 --- a/Subsurface/Source/Map/MapEntityPrefab.cs +++ b/Subsurface/Source/Map/MapEntityPrefab.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { class MapEntityPrefab { diff --git a/Subsurface/Source/Map/Md5Hash.cs b/Subsurface/Source/Map/Md5Hash.cs index c91579662..ff01bac91 100644 --- a/Subsurface/Source/Map/Md5Hash.cs +++ b/Subsurface/Source/Map/Md5Hash.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public class Md5Hash { diff --git a/Subsurface/Source/Map/Structure.cs b/Subsurface/Source/Map/Structure.cs index cbff2b873..601872dbf 100644 --- a/Subsurface/Source/Map/Structure.cs +++ b/Subsurface/Source/Map/Structure.cs @@ -10,10 +10,10 @@ using FarseerPhysics.Factories; using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; -using Subsurface.Lights; +using Barotrauma.Networking; +using Barotrauma.Lights; -namespace Subsurface +namespace Barotrauma { class WallSection { diff --git a/Subsurface/Source/Map/StructurePrefab.cs b/Subsurface/Source/Map/StructurePrefab.cs index 978801100..fb6cd0848 100644 --- a/Subsurface/Source/Map/StructurePrefab.cs +++ b/Subsurface/Source/Map/StructurePrefab.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { class StructurePrefab : MapEntityPrefab { diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 1b6da89a9..063f7014e 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -5,7 +5,7 @@ using FarseerPhysics.Dynamics; using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Items.Components; +using Barotrauma.Items.Components; using System; using System.Collections.Generic; using System.IO; @@ -13,7 +13,7 @@ using System.Linq; using System.Reflection; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public enum Direction : byte { @@ -516,11 +516,17 @@ namespace Subsurface } catch { - DebugConsole.ThrowError("Couldn't load submarine ''" + file + "! (Unrecognized file extension)"); - return null; + //no file extension specified: try using the default one + file += ".sub"; } - if (extension == ".gz") + if (string.IsNullOrWhiteSpace(extension)) + { + extension = ".sub"; + file += ".sub"; + } + + if (extension == ".sub") { Stream stream = SaveUtil.DecompressFiletoStream(file); if (stream == null) @@ -580,8 +586,7 @@ namespace Subsurface Type t; try { - // Get the type of a specified class. - t = Type.GetType("Subsurface." + typeName, true, true); + t = Type.GetType("Barotrauma." + typeName, true, true); if (t == null) { DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type ''" + typeName + "''."); diff --git a/Subsurface/Source/Map/SubmarineHull.cs b/Subsurface/Source/Map/SubmarineHull.cs index b313f4068..9beddb331 100644 --- a/Subsurface/Source/Map/SubmarineHull.cs +++ b/Subsurface/Source/Map/SubmarineHull.cs @@ -12,7 +12,7 @@ using System.Linq; using System.Text; using Voronoi2; -namespace Subsurface +namespace Barotrauma { class SubmarineBody { diff --git a/Subsurface/Source/Map/WaterRenderer.cs b/Subsurface/Source/Map/WaterRenderer.cs index 27718c5ed..94b5ed0e7 100644 --- a/Subsurface/Source/Map/WaterRenderer.cs +++ b/Subsurface/Source/Map/WaterRenderer.cs @@ -3,7 +3,7 @@ using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { class WaterRenderer : IDisposable { diff --git a/Subsurface/Source/Map/WayPoint.cs b/Subsurface/Source/Map/WayPoint.cs index 416acebd8..25442fdc5 100644 --- a/Subsurface/Source/Map/WayPoint.cs +++ b/Subsurface/Source/Map/WayPoint.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System.Collections.ObjectModel; -namespace Subsurface +namespace Barotrauma { public enum SpawnType { None, Human, Enemy, Cargo }; class WayPoint : MapEntity diff --git a/Subsurface/Source/Networking/GameClient.cs b/Subsurface/Source/Networking/GameClient.cs index e03f4b567..a048500e0 100644 --- a/Subsurface/Source/Networking/GameClient.cs +++ b/Subsurface/Source/Networking/GameClient.cs @@ -4,7 +4,7 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Subsurface.Networking +namespace Barotrauma.Networking { class GameClient : NetworkMember { diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index b611b4d6b..3f9ba9755 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -6,7 +6,7 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using RestSharp; -namespace Subsurface.Networking +namespace Barotrauma.Networking { class GameServer : NetworkMember { @@ -1002,6 +1002,15 @@ namespace Subsurface.Networking } } + //share the rest of the jobs according to the ''commonness'' of the job + float totalCommonness = 0.0f; + for (int i = 0; i < JobPrefab.List.Count; i++) + { + if (JobPrefab.List[i].AllowAlways || JobPrefab.List[i].MaxNumber == 0) continue; + + totalCommonness += JobPrefab.List[i].Commonness; + } + for (int preferenceIndex = 0; preferenceIndex < 3; preferenceIndex++) { for (int i = unassigned.Count - 1; i >= 0; i--) @@ -1018,7 +1027,7 @@ namespace Subsurface.Networking } } - //UpdateNetLobby(null); + UpdateNetLobby(null); } diff --git a/Subsurface/Source/Networking/NetConfig.cs b/Subsurface/Source/Networking/NetConfig.cs index 7034986d6..c9eb500a0 100644 --- a/Subsurface/Source/Networking/NetConfig.cs +++ b/Subsurface/Source/Networking/NetConfig.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface.Networking +namespace Barotrauma.Networking { static class NetConfig { diff --git a/Subsurface/Source/Networking/NetworkEvent.cs b/Subsurface/Source/Networking/NetworkEvent.cs index 6cc1420f5..8e1595605 100644 --- a/Subsurface/Source/Networking/NetworkEvent.cs +++ b/Subsurface/Source/Networking/NetworkEvent.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Lidgren.Network; -namespace Subsurface.Networking +namespace Barotrauma.Networking { enum NetworkEventType { diff --git a/Subsurface/Source/Networking/NetworkMember.cs b/Subsurface/Source/Networking/NetworkMember.cs index dfaac9fb6..a283e3e40 100644 --- a/Subsurface/Source/Networking/NetworkMember.cs +++ b/Subsurface/Source/Networking/NetworkMember.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System.Collections.Generic; -namespace Subsurface.Networking +namespace Barotrauma.Networking { enum PacketTypes { diff --git a/Subsurface/Source/Particles/Particle.cs b/Subsurface/Source/Particles/Particle.cs index 643fefdbf..75ea43ef8 100644 --- a/Subsurface/Source/Particles/Particle.cs +++ b/Subsurface/Source/Particles/Particle.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -namespace Subsurface.Particles +namespace Barotrauma.Particles { class Particle { diff --git a/Subsurface/Source/Particles/ParticleEmitter.cs b/Subsurface/Source/Particles/ParticleEmitter.cs index d2e3cea6b..99b97ab0b 100644 --- a/Subsurface/Source/Particles/ParticleEmitter.cs +++ b/Subsurface/Source/Particles/ParticleEmitter.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework; using FarseerPhysics; using System; -namespace Subsurface.Particles +namespace Barotrauma.Particles { class ParticleEmitterPrefab { diff --git a/Subsurface/Source/Particles/ParticleManager.cs b/Subsurface/Source/Particles/ParticleManager.cs index 08291162b..750ccfdf1 100644 --- a/Subsurface/Source/Particles/ParticleManager.cs +++ b/Subsurface/Source/Particles/ParticleManager.cs @@ -5,7 +5,7 @@ using FarseerPhysics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace Subsurface.Particles +namespace Barotrauma.Particles { class ParticleManager { diff --git a/Subsurface/Source/Particles/ParticlePrefab.cs b/Subsurface/Source/Particles/ParticlePrefab.cs index 40abed125..d505b3131 100644 --- a/Subsurface/Source/Particles/ParticlePrefab.cs +++ b/Subsurface/Source/Particles/ParticlePrefab.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework; using FarseerPhysics; -namespace Subsurface.Particles +namespace Barotrauma.Particles { class ParticlePrefab { diff --git a/Subsurface/Source/Physics/Physics.cs b/Subsurface/Source/Physics/Physics.cs index 472f80e5f..90e44be4e 100644 --- a/Subsurface/Source/Physics/Physics.cs +++ b/Subsurface/Source/Physics/Physics.cs @@ -2,7 +2,7 @@ using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { static class Physics { diff --git a/Subsurface/Source/Physics/PhysicsBody.cs b/Subsurface/Source/Physics/PhysicsBody.cs index f97ee93b6..05a916536 100644 --- a/Subsurface/Source/Physics/PhysicsBody.cs +++ b/Subsurface/Source/Physics/PhysicsBody.cs @@ -5,11 +5,11 @@ using FarseerPhysics.Factories; using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; using System.Collections.Generic; using System; -namespace Subsurface +namespace Barotrauma { class PhysicsBody { diff --git a/Subsurface/Source/PlayerInput.cs b/Subsurface/Source/PlayerInput.cs index 0eca9b249..abd1fcdf1 100644 --- a/Subsurface/Source/PlayerInput.cs +++ b/Subsurface/Source/PlayerInput.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; -namespace Subsurface +namespace Barotrauma { public enum InputType diff --git a/Subsurface/Source/Program.cs b/Subsurface/Source/Program.cs index dca120a86..42e2511b7 100644 --- a/Subsurface/Source/Program.cs +++ b/Subsurface/Source/Program.cs @@ -12,7 +12,7 @@ using System.Windows.Forms; #endregion -namespace Subsurface +namespace Barotrauma { #if WINDOWS || LINUX /// diff --git a/Subsurface/Source/Properties.cs b/Subsurface/Source/Properties.cs index c6aed3039..21503aa68 100644 --- a/Subsurface/Source/Properties.cs +++ b/Subsurface/Source/Properties.cs @@ -8,7 +8,7 @@ using System.Xml.Linq; using System.ComponentModel; -namespace Subsurface +namespace Barotrauma { [AttributeUsage(AttributeTargets.Property)] public class Editable : System.Attribute diff --git a/Subsurface/Source/Screens/EditCharacterScreen.cs b/Subsurface/Source/Screens/EditCharacterScreen.cs index faffba83e..f2bc7b006 100644 --- a/Subsurface/Source/Screens/EditCharacterScreen.cs +++ b/Subsurface/Source/Screens/EditCharacterScreen.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { class EditCharacterScreen : Screen { diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index ef124abe9..57611e69e 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; -namespace Subsurface +namespace Barotrauma { class EditMapScreen : Screen { diff --git a/Subsurface/Source/Screens/GameScreen.cs b/Subsurface/Source/Screens/GameScreen.cs index 1069506b6..04da3ef86 100644 --- a/Subsurface/Source/Screens/GameScreen.cs +++ b/Subsurface/Source/Screens/GameScreen.cs @@ -2,10 +2,10 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using Subsurface.Lights; +using Barotrauma.Lights; using System.Diagnostics; -namespace Subsurface +namespace Barotrauma { class GameScreen : Screen { @@ -288,7 +288,7 @@ namespace Subsurface Submarine.DrawFront(spriteBatch); - GameMain.GameSession?.Level?.Draw(spriteBatch); + if (Level.Loaded!=null) Level.Loaded.Draw(spriteBatch); spriteBatch.End(); diff --git a/Subsurface/Source/Screens/LobbyScreen.cs b/Subsurface/Source/Screens/LobbyScreen.cs index 0ca926800..4241a7ee2 100644 --- a/Subsurface/Source/Screens/LobbyScreen.cs +++ b/Subsurface/Source/Screens/LobbyScreen.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { class LobbyScreen : Screen { diff --git a/Subsurface/Source/Screens/MainMenuScreen.cs b/Subsurface/Source/Screens/MainMenuScreen.cs index ed7e51ae3..09ce8d636 100644 --- a/Subsurface/Source/Screens/MainMenuScreen.cs +++ b/Subsurface/Source/Screens/MainMenuScreen.cs @@ -1,10 +1,10 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { class MainMenuScreen : Screen { diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index 625464bf3..fc4e7a22e 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -2,14 +2,14 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; using FarseerPhysics; using FarseerPhysics.Factories; using FarseerPhysics.Dynamics; using System.IO; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { class NetLobbyScreen : Screen { diff --git a/Subsurface/Source/Screens/Screen.cs b/Subsurface/Source/Screens/Screen.cs index e0a8268ab..be828a21a 100644 --- a/Subsurface/Source/Screens/Screen.cs +++ b/Subsurface/Source/Screens/Screen.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework.Graphics; -namespace Subsurface +namespace Barotrauma { class Screen { diff --git a/Subsurface/Source/Screens/ServerListScreen.cs b/Subsurface/Source/Screens/ServerListScreen.cs index d1a691daa..92a30889d 100644 --- a/Subsurface/Source/Screens/ServerListScreen.cs +++ b/Subsurface/Source/Screens/ServerListScreen.cs @@ -2,7 +2,7 @@ using Lidgren.Network; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Subsurface.Networking; +using Barotrauma.Networking; using FarseerPhysics; using FarseerPhysics.Factories; using FarseerPhysics.Dynamics; @@ -10,7 +10,7 @@ using System.IO; using System.Collections.Generic; using RestSharp; -namespace Subsurface +namespace Barotrauma { class ServerListScreen : Screen { diff --git a/Subsurface/Source/Screens/SettingsScreen.cs b/Subsurface/Source/Screens/SettingsScreen.cs index f11ec0174..f905e8e17 100644 --- a/Subsurface/Source/Screens/SettingsScreen.cs +++ b/Subsurface/Source/Screens/SettingsScreen.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { class SettingsScreen : Screen { diff --git a/Subsurface/Source/Sounds/AmbientSoundManager.cs b/Subsurface/Source/Sounds/AmbientSoundManager.cs index b563b86e6..f633735ea 100644 --- a/Subsurface/Source/Sounds/AmbientSoundManager.cs +++ b/Subsurface/Source/Sounds/AmbientSoundManager.cs @@ -5,10 +5,10 @@ using System.Xml.Linq; using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; -using Subsurface.Sounds; +using Barotrauma.Sounds; using System.Collections.Generic; -namespace Subsurface +namespace Barotrauma { public enum DamageSoundType { None, diff --git a/Subsurface/Source/Sounds/OggSound.cs b/Subsurface/Source/Sounds/OggSound.cs index 775a6aa8b..b06d320b8 100644 --- a/Subsurface/Source/Sounds/OggSound.cs +++ b/Subsurface/Source/Sounds/OggSound.cs @@ -2,7 +2,7 @@ using NVorbis; using OpenTK.Audio.OpenAL; -namespace Subsurface.Sounds +namespace Barotrauma.Sounds { class OggSound : IDisposable { diff --git a/Subsurface/Source/Sounds/OggStream.cs b/Subsurface/Source/Sounds/OggStream.cs index ae4be34ae..efcdd56a6 100644 --- a/Subsurface/Source/Sounds/OggStream.cs +++ b/Subsurface/Source/Sounds/OggStream.cs @@ -7,7 +7,7 @@ using System.Threading; using NVorbis; using OpenTK.Audio.OpenAL; -namespace Subsurface.Sounds +namespace Barotrauma.Sounds { internal static class ALHelper { diff --git a/Subsurface/Source/Sounds/Sound.cs b/Subsurface/Source/Sounds/Sound.cs index 80da381f0..cf7fdccd6 100644 --- a/Subsurface/Source/Sounds/Sound.cs +++ b/Subsurface/Source/Sounds/Sound.cs @@ -4,9 +4,9 @@ using System.IO; using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; -using Subsurface.Sounds; +using Barotrauma.Sounds; -namespace Subsurface +namespace Barotrauma { public class Sound { diff --git a/Subsurface/Source/Sounds/SoundManager.cs b/Subsurface/Source/Sounds/SoundManager.cs index 8fcd7c96e..7943c820a 100644 --- a/Subsurface/Source/Sounds/SoundManager.cs +++ b/Subsurface/Source/Sounds/SoundManager.cs @@ -6,7 +6,7 @@ using OpenTK.Audio; using System; -namespace Subsurface.Sounds +namespace Barotrauma.Sounds { static class SoundManager { diff --git a/Subsurface/Source/Sprite.cs b/Subsurface/Source/Sprite.cs index 9ab714479..ceb73925d 100644 --- a/Subsurface/Source/Sprite.cs +++ b/Subsurface/Source/Sprite.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public class Sprite { diff --git a/Subsurface/Source/Utils/MathUtils.cs b/Subsurface/Source/Utils/MathUtils.cs index 50c993542..9c355344f 100644 --- a/Subsurface/Source/Utils/MathUtils.cs +++ b/Subsurface/Source/Utils/MathUtils.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { static class MathUtils { diff --git a/Subsurface/Source/Utils/Rand.cs b/Subsurface/Source/Utils/Rand.cs index a564feb9f..e62bcd7cf 100644 --- a/Subsurface/Source/Utils/Rand.cs +++ b/Subsurface/Source/Utils/Rand.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Subsurface +namespace Barotrauma { static class Rand { diff --git a/Subsurface/Source/Utils/SaveUtil.cs b/Subsurface/Source/Utils/SaveUtil.cs index c73ea070c..d1a0a7e92 100644 --- a/Subsurface/Source/Utils/SaveUtil.cs +++ b/Subsurface/Source/Utils/SaveUtil.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public class SaveUtil { @@ -32,11 +32,11 @@ namespace Subsurface { if (Submarine.Loaded!=null) { - Submarine.Loaded.SaveAs(Path.Combine(tempPath, "map.gz")); + Submarine.Loaded.SaveAs(Path.Combine(tempPath, "map.sub")); } else { - File.Copy(GameMain.GameSession.Submarine.FilePath, Path.Combine(tempPath, "map.gz")); + File.Copy(GameMain.GameSession.Submarine.FilePath, Path.Combine(tempPath, "map.sub")); } } catch (Exception e) @@ -72,7 +72,7 @@ namespace Subsurface DecompressToDirectory(filePath, tempPath, null); - Submarine selectedMap = new Submarine(Path.Combine(tempPath, "map.gz"), "");// Submarine.Load(); + Submarine selectedMap = new Submarine(Path.Combine(tempPath, "map.sub"), "");// Submarine.Load(); GameMain.GameSession = new GameSession(selectedMap, fileName, Path.Combine(tempPath, "gamesession.xml")); //Directory.Delete(tempPath, true); diff --git a/Subsurface/Source/Utils/TextureLoader.cs b/Subsurface/Source/Utils/TextureLoader.cs index 63cddbe7d..79b0f17a7 100644 --- a/Subsurface/Source/Utils/TextureLoader.cs +++ b/Subsurface/Source/Utils/TextureLoader.cs @@ -6,7 +6,7 @@ using Color = Microsoft.Xna.Framework.Color; using System; using Microsoft.Xna.Framework; -namespace Subsurface +namespace Barotrauma { /// /// Based on http://jakepoz.com/jake_poznanski__background_load_xna.html diff --git a/Subsurface/Source/Utils/ToolBox.cs b/Subsurface/Source/Utils/ToolBox.cs index dd36e51b4..bf8abcf2c 100644 --- a/Subsurface/Source/Utils/ToolBox.cs +++ b/Subsurface/Source/Utils/ToolBox.cs @@ -8,7 +8,7 @@ using System.Text; using System.Xml; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public static class ToolBox { diff --git a/Subsurface/Source/Utils/UpdaterUtil.cs b/Subsurface/Source/Utils/UpdaterUtil.cs index 0c6fabbcc..97f11f4e0 100644 --- a/Subsurface/Source/Utils/UpdaterUtil.cs +++ b/Subsurface/Source/Utils/UpdaterUtil.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography; using System.Text; using System.Xml.Linq; -namespace Subsurface +namespace Barotrauma { public static class UpdaterUtil { diff --git a/Subsurface_Solution.sln b/Subsurface_Solution.sln index d1bf602ec..bacafb288 100644 --- a/Subsurface_Solution.sln +++ b/Subsurface_Solution.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Subsurface", "Subsurface\Subsurface.csproj", "{008C0F83-E914-4966-9135-EA885059EDD8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barotrauma", "Subsurface\Barotrauma.csproj", "{008C0F83-E914-4966-9135-EA885059EDD8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Subsurface_contentContent", "Subsurface_content\Subsurface_contentContent\Subsurface_contentContent.contentproj", "{8C1D2051-F0F3-457B-AAAE-4E155FC7C75C}" EndProject diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index e0e3c5377..a716f1b7d 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ