Switch to Barotrauma & too many misc changes to remember

This commit is contained in:
Regalis
2015-10-16 18:11:58 +03:00
parent 2bb5d41836
commit 838022fcd5
203 changed files with 540 additions and 419 deletions

View File

@@ -56,9 +56,9 @@
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Subsurface\Subsurface.csproj">
<ProjectReference Include="..\Subsurface\Barotrauma.csproj">
<Project>{008c0f83-e914-4966-9135-ea885059edd8}</Project>
<Name>Subsurface</Name>
<Name>Barotrauma</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -100,9 +100,9 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Subsurface\Subsurface.csproj">
<ProjectReference Include="..\Subsurface\Barotrauma.csproj">
<Project>{008c0f83-e914-4966-9135-ea885059edd8}</Project>
<Name>Subsurface</Name>
<Name>Barotrauma</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>

View File

@@ -1,4 +1,4 @@
using Subsurface;
using Barotrauma;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@@ -62,9 +62,9 @@
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Subsurface\Subsurface.csproj">
<ProjectReference Include="..\Subsurface\Barotrauma.csproj">
<Project>{008c0f83-e914-4966-9135-ea885059edd8}</Project>
<Name>Subsurface</Name>
<Name>Barotrauma</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>

View File

@@ -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;

View File

@@ -8,7 +8,7 @@
<ProjectGuid>{008C0F83-E914-4966-9135-EA885059EDD8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Subsurface</RootNamespace>
<RootNamespace>Barotrauma</RootNamespace>
<AssemblyName>Barotrauma</AssemblyName>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
@@ -383,6 +383,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Weapons\stunbaton.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Jobs.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
@@ -845,6 +848,12 @@
<None Include="Content\Items\Engine\radarPing.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Medical\bandage.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Medical\syringe.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\OxygenGenerator\oxygengenerator.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -875,6 +884,9 @@
<None Include="Content\Items\Weapons\railgun.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\stunbaton.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\stunGrenade.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<ReferencePath>
</ReferencePath>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<ReferencePath>
</ReferencePath>
</PropertyGroup>
</Project>

View File

@@ -62,7 +62,7 @@
<Body width="52" height="17"/>
<Wearable slots="Any,Torso" armorvalue="10.0">
<sprite texture="securitygear.png" limb="Torso" sourcerect="0,0,38,58" origin="0.47,0.48"/>
<sprite texture="securitygear.png" limb="Torso" sourcerect="0,0,38,58" origin="0.52,0.48"/>
<sprite texture="securitygear.png" limb="RightArm" sourcerect="41,0,21,21" origin="0.5,1.1"/>
</Wearable>
@@ -78,7 +78,7 @@
<Body radius="12"/>
<Wearable slots="Any,Head" armorvalue="20.0">
<sprite texture="securitygear.png" limb="Head" sourcerect="39,31,29,22" origin="0.5,1.5"/>
<sprite texture="securitygear.png" limb="Head" sourcerect="39,31,29,22" origin="0.51,0.9"/>
</Wearable>
</Item>

View File

@@ -41,7 +41,8 @@
<Sprite texture ="battery.png" depth="0.8"/>
<PowerContainer capacity="2000.0" maxrechargespeed="500.0" maxoutput="1000.0" canbeselected = "true">
<GuiFrame rect="0,0,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
<GuiFrame rect="0,-100,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
</PowerContainer>
<ConnectionPanel canbeselected = "true" msg="Rewire [Screwdriver]">
@@ -50,7 +51,11 @@
</StatusEffect>
<requireditem name="Screwdriver" type="Equipped"/>
<input name="power"/>
</ConnectionPanel>
</ConnectionPanel>
<ItemContainer capacity="3" hideitems="true">
<Containable name="loadable"/>
</ItemContainer>
</Item>
<Item

Binary file not shown.

View File

@@ -11,7 +11,7 @@
<Body width="24" height="5"/>
<Holdable slots="Any,RightHand,LeftHand" RemoveOnUse="true">
<StatusEffect type="OnUse" target="This, Character" health="30.0" Condition="-100.0" disabledeltatime="true"/>
<StatusEffect type="OnUse" target="This, Character" health="30.0" Condition="-100.0" disabledeltatime="true" sound="Content/Items/Medical/syringe.ogg"/>
</Holdable>
</Item>
@@ -26,7 +26,7 @@
<Body width="9" height="15"/>
<Holdable slots="Any,RightHand,LeftHand" RemoveOnUse="true">
<StatusEffect type="OnUse" target="This, Character" bleeding="-10.0" Condition="-100.0" disabledeltatime="true"/>
<StatusEffect type="OnUse" target="This, Character" bleeding="-10.0" Condition="-100.0" disabledeltatime="true" sound="Content/Items/Medical/bandage.ogg"/>
</Holdable>
</Item>

Binary file not shown.

View File

@@ -3,7 +3,7 @@
linkable="true"
pickdistance="200">
<Sprite texture ="pump.png" depth="0.08"/>
<Sprite texture ="pump.png" depth="0.8"/>
<Pump canbeselected = "true" maxflow="500" PowerConsumption="300.0" MinVoltage="0.3">
<GuiFrame rect="0,0,330,145" alignment="Center" color="0.0,0.0,0.0,0.6"/>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -49,7 +49,7 @@
<Body width="11" height="24" density="15" friction="0.8f"/>
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="5.0" aimpos="35,-10">
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="OnUse" target="This" Condition="-100.0" delay="3.0" sound="Content/Items/Weapons/stunGrenade.ogg">
<Explosion range="500" damage="5" stun="10" force="0.1"/>
</StatusEffect>
@@ -62,16 +62,34 @@
pickdistance="150"
price="100">
<Sprite texture="harpoongun.png" depth="0.5"/>
<Sprite texture="stunbaton.png" sourcerect="0,12,77,23" depth="0.5"/>
<Body width="90" height="30" density="10"/>
<MeleeWeapon slots="Any,RightHand,LeftHand"
aimpos="50,0" handle1="-15,-6" holdangle="100">
<Attack stun="10.0" sound="Content/Items/Electricity/zap1.ogg">
<ParticleEmitter particle="spark" velocitymin="100" velocitymax="200" anglemin="0" anglemax="360" particleamount="10"/>
</Attack>
<RequiredItems name="Battery Cell" type="Contained" msg="Loaded Battery Cell required"/>
<Attack stun="10.0" sound="Content/Items/Electricity/zap1.ogg"/>
<StatusEffect type="OnUse" target="Contained" Condition="-25.0" disabledeltatime="true" sound="Content/Items/Weapons/stunbaton.ogg">
<Explosion range="100.0" force="0.1" shockwave="false" flames="false" camerashake="5.0"/>
</StatusEffect>
</MeleeWeapon>
<ItemContainer capacity="1" hideitems="true">
<Containable name="Battery Cell"/>
</ItemContainer>
</Item>
<Item
name="Battery Cell"
pickdistance="150"
tags="smallitem,loadable">
<Sprite texture ="stunbaton.png" sourcerect="0,0,20,9" depth="0.8"/>
<Body width="20" height="9" density="15"/>
<Pickable slots="Any,RightHand,LeftHand"/>
</Item>
</Items>

View File

@@ -8,8 +8,8 @@
<Skills>
<Skill name="Weapons" level="50,60"/>
<Skill name="Construction" level="10,20"/>
<Skill name="Electrical Engineering" level="10,20"/>
<Skill name="Construction" level="20,30"/>
<Skill name="Electrical Engineering" level="20,30"/>
</Skills>
</Job>
@@ -24,7 +24,7 @@
<Item name="Screwdriver"/>
</Job>
<Job name="Mechanic" description="Mechanics have high construction and mechanic skills. They can use welders and plasma cutters safely, and are usually the only ones who can fix broken mechanical devices." minnumber="1">
<Job name="Mechanic" description="Mechanics have high construction and mechanic skills. They are skilled at using tools such as plasma cutters and welders, and are usually the only ones who can fix broken mechanical devices." minnumber="1">
<Skills>
<Skill name="Weapons" level="10,30"/>
<Skill name="Construction" level="50,60"/>
@@ -35,18 +35,18 @@
<Item name="Screwdriver"/>
</Job>
<Job name="Security Officer" description="Security officers are are responsible for keeping the submarine safe from potential attackers. The creatures inhabiting the subsurface ocean aren't the only threat they need to worry about, as several of the renegade groups opposing the Europa Coalition are known to have sent infiltrators on board our vessels.">
<Job name="Security Officer" description="Security officers are are responsible for keeping the submarine safe from potential attackers. The creatures inhabiting the ocean aren't the only threat they need to worry about, as several of the renegade groups opposing the Europa Coalition are known to have sent infiltrators on board the vessels." maxnumber="2">
<Skills>
<Skill name="Weapons" level="10,30"/>
<Skill name="Construction" level="50,60"/>
<Skill name="Electrical Engineering" level="30,40"/>
<Skill name="Weapons" level="50,60"/>
<Skill name="Construction" level="10,20"/>
<Skill name="Electrical Engineering" level="10,20"/>
</Skills>
<Item name="ID Card"/>
<Item name="Wrench"/>
<Item name="Screwdriver"/>
<Item name="Stun Baton"/>
<Item name="Body Armor"/>
<Item name="Ballistic Helmet"/>
</Job>
<Job name="Assistant" description="Assistants don't have any specific responsibilities or areas of expertise. This job is a good choice for newcomers who want to get a hang of working on board a submarine without taking up tasks that they aren't qualified for." allowalways="true">
<Job name="Assistant" description="Assistants don't have any specific responsibilities or areas of expertise. This job is a good choice for newcomers who want to get a hang of working on board the submarine without taking up tasks that they aren't qualified for." allowalways="true">
<Skills>
<Skill name="Weapons" level="0,10"/>
<Skill name="Construction" level="0,10"/>

Binary file not shown.

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<contentpackage name="Vanilla 0.1.3" path="Data/ContentPackages/Vanilla 0.1.3">
<contentpackage name="Vanilla 0.2" path="Data/ContentPackages/Vanilla 0.2">
<Item file="Content\Items\idcard.xml" />
<Item file="Content\Items\itemlabel.xml" />
<Item file="Content\Items\Artifacts\artifacts.xml" />
@@ -32,5 +32,5 @@
<Character file="Content\Characters\TigerThresher\tigerthresher.xml" />
<Structure file="Content\Map\StructurePrefabs.xml" />
<Jobs file="Content\Jobs.xml" />
<Executable file="Subsurface.exe" />
<Executable file="Barotrauma.exe" />
</contentpackage>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace Subsurface
namespace Barotrauma
{
public class Camera
{

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
class AIController : ISteerable
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace Subsurface
namespace Barotrauma
{
class AITarget
{

View File

@@ -8,7 +8,7 @@ using Microsoft.Xna.Framework;
using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
class EnemyAIController : AIController

View File

@@ -1,6 +1,6 @@
using Microsoft.Xna.Framework;
namespace Subsurface
namespace Barotrauma
{
interface ISteerable
{

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
namespace Subsurface
namespace Barotrauma
{
class PathNode
{

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using FarseerPhysics.Dynamics;
namespace Subsurface
namespace Barotrauma
{
class SteeringManager
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace Subsurface
namespace Barotrauma
{
class SteeringPath
{

View File

@@ -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)

View File

@@ -2,7 +2,7 @@
using FarseerPhysics;
using Microsoft.Xna.Framework;
namespace Subsurface
namespace Barotrauma
{
class AnimController : Ragdoll
{

View File

@@ -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 }

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class BackgroundSprite : ISteerable

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class BackgroundSpriteManager
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class BackgroundSpritePrefab
{

View File

@@ -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");

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class CharacterHUD
{

View File

@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public enum Gender { None, Male, Female };

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class DelayedEffect : StatusEffect
{

View File

@@ -6,7 +6,7 @@ using FarseerPhysics.Dynamics.Joints;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace Subsurface
namespace Barotrauma
{
class FishAnimController : AnimController
{

View File

@@ -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;

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class Job
{

View File

@@ -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<string> ItemNames;
public List<bool> 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<string>();

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class Skill
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class SkillPrefab
{

View File

@@ -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
{

View File

@@ -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);

View File

@@ -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);

View File

@@ -6,7 +6,7 @@ using System.Security.Cryptography;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public enum ContentType
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
enum CoroutineStatus
{

View File

@@ -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":

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using System;
namespace Subsurface
namespace Barotrauma
{
class MonsterEvent : ScriptedEvent
{

View File

@@ -1,4 +1,4 @@
namespace Subsurface
namespace Barotrauma
{
class PropertyTask : Task
{

View File

@@ -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)

View File

@@ -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 + "''.");

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class SalvageQuest : Quest
{

View File

@@ -1,4 +1,4 @@
namespace Subsurface
namespace Barotrauma
{
class RepairTask : Task
{

View File

@@ -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 + "''.");

View File

@@ -1,4 +1,4 @@
namespace Subsurface
namespace Barotrauma
{
class ScriptedTask : Task
{

View File

@@ -1,5 +1,5 @@
namespace Subsurface
namespace Barotrauma
{
class Task
{

View File

@@ -3,7 +3,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
namespace Subsurface
namespace Barotrauma
{
class TaskManager
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
namespace Subsurface
namespace Barotrauma
{
public class FrameCounter
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public class GUIComponentStyle
{

View File

@@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
[Flags]
public enum Alignment

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace Subsurface
namespace Barotrauma
{
public class GUIButton : GUIComponent
{

View File

@@ -5,7 +5,7 @@ using EventInput;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public abstract class GUIComponent
{

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
public class GUIDropDown : GUIComponent
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using System;
namespace Subsurface
namespace Barotrauma
{
public class GUIFrame : GUIComponent
{

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public class GUIImage : GUIComponent
{

View File

@@ -3,7 +3,7 @@ using System.Diagnostics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public class GUIListBox : GUIComponent
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class GUIMessage
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
public class GUIMessageBox : GUIFrame
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public class GUIProgressBar : GUIComponent
{

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public class GUIScrollBar : GUIComponent
{

View File

@@ -3,7 +3,7 @@ using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
public class GUIStyle
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
public class GUITextBlock : GUIComponent
{

View File

@@ -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);

View File

@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace Subsurface
namespace Barotrauma
{
public class GUITickBox : GUIComponent
{

View File

@@ -7,7 +7,7 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class LoadingScreen
{

View File

@@ -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
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class CargoManager
{

View File

@@ -5,7 +5,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class CrewManager
{

View File

@@ -4,7 +4,7 @@ using System;
using System.Collections.Generic;
using System.Reflection;
namespace Subsurface
namespace Barotrauma
{
class GameMode
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Reflection;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class GameModePreset
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class QuestMode : GameMode
{

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class SinglePlayerMode : GameMode
{

View File

@@ -1,8 +1,8 @@
using System;
using System.Linq;
using Subsurface.Networking;
using Barotrauma.Networking;
namespace Subsurface
namespace Barotrauma
{
class TraitorMode : GameMode
{

View File

@@ -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<object> 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>();
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<Steering>();
Radar radar = steering.Item.GetComponent<Radar>();
@@ -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<PowerContainer>();
var capacitor2 = Item.itemList.Find(i => i.HasTag("capacitor1")).GetComponent<PowerContainer>();
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>();
Door commandDoor2 = Item.itemList.Find(i => i.HasTag("commanddoor2")).GetComponent<Door>();
Door commandDoor3 = Item.itemList.Find(i => i.HasTag("commanddoor3")).GetComponent<Door>();
@@ -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<Turret>()!=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<object> 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();

View File

@@ -8,7 +8,7 @@ using System.Text;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class GameSession
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
class HireManager
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public class GameSettings
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
interface IPropertyObject
{

View File

@@ -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;
}
}

View File

@@ -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
{

Some files were not shown because too many files have changed in this diff Show More