Merged branch master into new-netcode
This commit is contained in:
@@ -38,11 +38,8 @@ namespace Barotrauma
|
|||||||
get { return zoom; }
|
get { return zoom; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
zoom = value;
|
zoom = Math.Max(value, GameMain.DebugDraw ? 0.01f : 0.1f);
|
||||||
if (zoom < 0.1f) zoom = 0.1f;
|
|
||||||
|
|
||||||
//if (prevZoom == zoom) return;
|
|
||||||
|
|
||||||
Vector2 center = WorldViewCenter;
|
Vector2 center = WorldViewCenter;
|
||||||
float newWidth = resolution.X / zoom;
|
float newWidth = resolution.X / zoom;
|
||||||
float newHeight = resolution.Y / zoom;
|
float newHeight = resolution.Y / zoom;
|
||||||
@@ -137,7 +134,6 @@ namespace Barotrauma
|
|||||||
worldView.X = (int)(interpolatedPosition.X - worldView.Width / 2.0);
|
worldView.X = (int)(interpolatedPosition.X - worldView.Width / 2.0);
|
||||||
worldView.Y = (int)(interpolatedPosition.Y + worldView.Height / 2.0);
|
worldView.Y = (int)(interpolatedPosition.Y + worldView.Height / 2.0);
|
||||||
|
|
||||||
|
|
||||||
if (Level.Loaded != null && clampPos)
|
if (Level.Loaded != null && clampPos)
|
||||||
{
|
{
|
||||||
position.Y -= Math.Max(worldView.Y - Level.Loaded.Size.Y, 0.0f);
|
position.Y -= Math.Max(worldView.Y - Level.Loaded.Size.Y, 0.0f);
|
||||||
@@ -199,7 +195,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
moveCam = moveCam * deltaTime * 60.0f;
|
moveCam = moveCam * deltaTime * 60.0f;
|
||||||
|
|
||||||
Zoom = MathHelper.Clamp(zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f) * zoom, 0.1f, 2.0f);
|
Zoom = MathHelper.Clamp(zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f) * zoom, GameMain.DebugDraw ? 0.01f : 0.1f, 2.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
@@ -27,11 +28,21 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void Start(Level level)
|
public override void Start(Level level)
|
||||||
{
|
{
|
||||||
Vector2 position = level.GetRandomInterestingPosition(true, Level.PositionType.MainPath);
|
float minDist = Math.Max(Submarine.MainSub.Borders.Width, Submarine.MainSub.Borders.Height);
|
||||||
|
|
||||||
monster = Character.Create(monsterFile, position, null, GameMain.Client != null);
|
//find a random spawnpos that isn't too close to the main sub
|
||||||
|
int tries = 0;
|
||||||
|
Vector2 spawnPos = Vector2.Zero;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
spawnPos = Level.Loaded.GetRandomInterestingPosition(true, Level.PositionType.MainPath);
|
||||||
|
tries++;
|
||||||
|
} while (tries < 50 && Vector2.Distance(spawnPos, Submarine.MainSub.WorldPosition) < minDist);
|
||||||
|
|
||||||
|
|
||||||
|
monster = Character.Create(monsterFile, spawnPos, null, GameMain.Client != null);
|
||||||
monster.Enabled = false;
|
monster.Enabled = false;
|
||||||
radarPosition = monster.Position;
|
radarPosition = spawnPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float deltaTime)
|
public override void Update(float deltaTime)
|
||||||
|
|||||||
@@ -47,9 +47,17 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private void SpawnMonsters()
|
private void SpawnMonsters()
|
||||||
{
|
{
|
||||||
//WayPoint randomWayPoint = WayPoint.GetRandom(SpawnType.Enemy);
|
float minDist = Math.Max(Submarine.MainSub.Borders.Width, Submarine.MainSub.Borders.Height);
|
||||||
|
|
||||||
|
//find a random spawnpos that isn't too close to the main sub
|
||||||
|
int tries = 0;
|
||||||
|
Vector2 spawnPos = Vector2.Zero;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
spawnPos = Level.Loaded.GetRandomInterestingPosition(true, spawnPosType);
|
||||||
|
tries++;
|
||||||
|
} while (tries < 50 && Vector2.Distance(spawnPos, Submarine.MainSub.WorldPosition) < minDist);
|
||||||
|
|
||||||
Vector2 spawnPos = Level.Loaded.GetRandomInterestingPosition(true, spawnPosType);
|
|
||||||
|
|
||||||
int amount = Rand.Range(minAmount, maxAmount, false);
|
int amount = Rand.Range(minAmount, maxAmount, false);
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
if (item.CurrentHull == null) return;
|
if (item.CurrentHull == null) return;
|
||||||
|
|
||||||
|
if (item.InWater) return;
|
||||||
|
|
||||||
item.CurrentHull.Oxygen += oxygenFlow * deltaTime;
|
item.CurrentHull.Oxygen += oxygenFlow * deltaTime;
|
||||||
OxygenFlow -= deltaTime * 1000.0f;
|
OxygenFlow -= deltaTime * 1000.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user