Changelog update, stuff
This commit is contained in:
@@ -178,14 +178,14 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
GUI.DrawString(spriteBatch,
|
GUI.DrawString(spriteBatch,
|
||||||
new Vector2(x+10, y+height-40),
|
new Vector2(x + 10, y + height - 60),
|
||||||
oxygenAmount == null ? "Air quality data not available" : "Air quality: "+(int)oxygenAmount+" %",
|
oxygenAmount == null ? "Air quality data not available" : "Air quality: " + (int)oxygenAmount + " %",
|
||||||
oxygenAmount == null ? Color.Red : Color.Lerp(Color.Red, Color.LightGreen, (float)oxygenAmount / 100.0f),
|
oxygenAmount == null ? Color.Red : Color.Lerp(Color.Red, Color.LightGreen, (float)oxygenAmount / 100.0f),
|
||||||
Color.Black * 0.5f, 2, GUI.SmallFont);
|
Color.Black * 0.5f, 2, GUI.SmallFont);
|
||||||
|
|
||||||
GUI.DrawString(spriteBatch,
|
GUI.DrawString(spriteBatch,
|
||||||
new Vector2(x + 10, y + height - 20),
|
new Vector2(x + 10, y + height - 40),
|
||||||
waterAmount == null ? "Water level data not available" : "Water level: " + (int)(waterAmount*100.0f) + " %",
|
waterAmount == null ? "Water level data not available" : "Water level: " + (int)(waterAmount * 100.0f) + " %",
|
||||||
waterAmount == null ? Color.Red : Color.Lerp(Color.LightGreen, Color.Red, (float)waterAmount),
|
waterAmount == null ? Color.Red : Color.Lerp(Color.LightGreen, Color.Red, (float)waterAmount),
|
||||||
Color.Black * 0.5f, 2, GUI.SmallFont);
|
Color.Black * 0.5f, 2, GUI.SmallFont);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,91 +180,87 @@ namespace Barotrauma.Particles
|
|||||||
animFrame = (int)Math.Min(Math.Floor(animState / prefab.AnimDuration * frameCount), frameCount - 1);
|
animFrame = (int)Math.Min(Math.Floor(animState / prefab.AnimDuration * frameCount), frameCount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefab.DeleteOnCollision || prefab.CollidesWithWalls)
|
lifeTime -= deltaTime;
|
||||||
|
if (lifeTime <= 0.0f || alpha <= 0.0f || size.X <= 0.0f || size.Y <= 0.0f) return false;
|
||||||
|
|
||||||
|
if (!prefab.DeleteOnCollision && !prefab.CollidesWithWalls) return true;
|
||||||
|
|
||||||
|
if (currentHull == null)
|
||||||
{
|
{
|
||||||
//Vector2 edgePos = position + prefab.CollisionRadius * Vector2.Normalize(velocity) * size.X;
|
Hull collidedHull = Hull.FindHull(position);
|
||||||
|
if (collidedHull != null)
|
||||||
if (currentHull == null)
|
|
||||||
{
|
{
|
||||||
Hull collidedHull = Hull.FindHull(position);
|
if (prefab.DeleteOnCollision) return false;
|
||||||
if (collidedHull != null)
|
OnWallCollisionOutside(collidedHull);
|
||||||
{
|
|
||||||
if (prefab.DeleteOnCollision) return false;
|
|
||||||
OnWallCollisionOutside(collidedHull);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Vector2 collisionNormal = Vector2.Zero;
|
||||||
|
if (velocity.Y < 0.0f && position.Y - prefab.CollisionRadius * size.Y < currentHull.WorldRect.Y - currentHull.WorldRect.Height)
|
||||||
{
|
{
|
||||||
Vector2 collisionNormal = Vector2.Zero;
|
if (prefab.DeleteOnCollision) return false;
|
||||||
if (velocity.Y < 0.0f && position.Y - prefab.CollisionRadius * size.Y < currentHull.WorldRect.Y - currentHull.WorldRect.Height)
|
collisionNormal = new Vector2(0.0f, 1.0f);
|
||||||
{
|
}
|
||||||
if (prefab.DeleteOnCollision) return false;
|
else if (velocity.Y > 0.0f && position.Y + prefab.CollisionRadius * size.Y > currentHull.WorldRect.Y)
|
||||||
collisionNormal = new Vector2(0.0f, 1.0f);
|
{
|
||||||
}
|
if (prefab.DeleteOnCollision) return false;
|
||||||
else if (velocity.Y > 0.0f && position.Y + prefab.CollisionRadius * size.Y > currentHull.WorldRect.Y)
|
collisionNormal = new Vector2(0.0f, -1.0f);
|
||||||
{
|
}
|
||||||
if (prefab.DeleteOnCollision) return false;
|
else if (velocity.X < 0.0f && position.X - prefab.CollisionRadius * size.X < currentHull.WorldRect.X)
|
||||||
collisionNormal = new Vector2(0.0f, -1.0f);
|
{
|
||||||
}
|
if (prefab.DeleteOnCollision) return false;
|
||||||
else if (velocity.X < 0.0f && position.X - prefab.CollisionRadius * size.X < currentHull.WorldRect.X)
|
collisionNormal = new Vector2(1.0f, 0.0f);
|
||||||
{
|
}
|
||||||
if (prefab.DeleteOnCollision) return false;
|
else if (velocity.X > 0.0f && position.X + prefab.CollisionRadius * size.X > currentHull.WorldRect.Right)
|
||||||
collisionNormal = new Vector2(1.0f, 0.0f);
|
{
|
||||||
}
|
if (prefab.DeleteOnCollision) return false;
|
||||||
else if (velocity.X > 0.0f && position.X + prefab.CollisionRadius * size.X > currentHull.WorldRect.Right)
|
collisionNormal = new Vector2(-1.0f, 0.0f);
|
||||||
{
|
}
|
||||||
if (prefab.DeleteOnCollision) return false;
|
|
||||||
collisionNormal = new Vector2(-1.0f, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (collisionNormal != Vector2.Zero)
|
if (collisionNormal != Vector2.Zero)
|
||||||
|
{
|
||||||
|
bool gapFound = false;
|
||||||
|
foreach (Gap gap in hullGaps)
|
||||||
{
|
{
|
||||||
bool gapFound = false;
|
if (gap.isHorizontal != (collisionNormal.X != 0.0f)) continue;
|
||||||
foreach (Gap gap in hullGaps)
|
|
||||||
|
if (gap.isHorizontal)
|
||||||
{
|
{
|
||||||
if (gap.isHorizontal != (collisionNormal.X != 0.0f)) continue;
|
if (gap.WorldRect.Y < position.Y || gap.WorldRect.Y - gap.WorldRect.Height > position.Y) continue;
|
||||||
|
int gapDir = Math.Sign(gap.WorldRect.Center.X - currentHull.WorldRect.Center.X);
|
||||||
if (gap.isHorizontal)
|
if (Math.Sign(velocity.X) != gapDir || Math.Sign(position.X - currentHull.WorldRect.Center.X) != gapDir) continue;
|
||||||
{
|
|
||||||
if (gap.WorldRect.Y < position.Y || gap.WorldRect.Y - gap.WorldRect.Height > position.Y) continue;
|
|
||||||
int gapDir = Math.Sign(gap.WorldRect.Center.X - currentHull.WorldRect.Center.X);
|
|
||||||
if (Math.Sign(velocity.X) != gapDir || Math.Sign(position.X - currentHull.WorldRect.Center.X) != gapDir) continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (gap.WorldRect.X > position.X || gap.WorldRect.Right < position.X) continue;
|
|
||||||
float hullCenterY = currentHull.WorldRect.Y - currentHull.WorldRect.Height / 2;
|
|
||||||
int gapDir = Math.Sign(gap.WorldRect.Y - hullCenterY);
|
|
||||||
if (Math.Sign(velocity.Y) != gapDir || Math.Sign(position.Y - hullCenterY) != gapDir) continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
gapFound = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gapFound)
|
|
||||||
{
|
|
||||||
OnWallCollisionInside(currentHull, collisionNormal);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Hull newHull = Hull.FindHull(position);
|
if (gap.WorldRect.X > position.X || gap.WorldRect.Right < position.X) continue;
|
||||||
if (newHull != currentHull)
|
float hullCenterY = currentHull.WorldRect.Y - currentHull.WorldRect.Height / 2;
|
||||||
{
|
int gapDir = Math.Sign(gap.WorldRect.Y - hullCenterY);
|
||||||
currentHull = newHull;
|
if (Math.Sign(velocity.Y) != gapDir || Math.Sign(position.Y - hullCenterY) != gapDir) continue;
|
||||||
hullGaps = currentHull == null ? new List<Gap>() : currentHull.ConnectedGaps;
|
}
|
||||||
OnChangeHull?.Invoke(position, currentHull);
|
|
||||||
}
|
gapFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gapFound)
|
||||||
|
{
|
||||||
|
OnWallCollisionInside(currentHull, collisionNormal);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Hull newHull = Hull.FindHull(position);
|
||||||
|
if (newHull != currentHull)
|
||||||
|
{
|
||||||
|
currentHull = newHull;
|
||||||
|
hullGaps = currentHull == null ? new List<Gap>() : currentHull.ConnectedGaps;
|
||||||
|
OnChangeHull?.Invoke(position, currentHull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lifeTime -= deltaTime;
|
|
||||||
|
|
||||||
if (lifeTime <= 0.0f || alpha <= 0.0f || size.X <= 0.0f || size.Y <= 0.0f) return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
|
||||||
using Barotrauma.Lights;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using Microsoft.Xna.Framework.Content;
|
using Microsoft.Xna.Framework.Content;
|
||||||
using System.Collections.Generic;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
class GameScreen : Screen
|
class GameScreen : Screen
|
||||||
{
|
{
|
||||||
Camera cam;
|
private Camera cam;
|
||||||
|
|
||||||
Color waterColor = new Color(0.75f, 0.8f, 0.9f, 1.0f);
|
private Color waterColor = new Color(0.75f, 0.8f, 0.9f, 1.0f);
|
||||||
|
|
||||||
readonly RenderTarget2D renderTargetBackground;
|
readonly RenderTarget2D renderTargetBackground;
|
||||||
readonly RenderTarget2D renderTarget;
|
readonly RenderTarget2D renderTarget;
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
foreach (Submarine sub in Submarine.Loaded)
|
foreach (Submarine sub in Submarine.Loaded)
|
||||||
{
|
{
|
||||||
float movementFactor = (sub.Velocity == Vector2.Zero) ? 0.0f : sub.Velocity.Length() / 5.0f;
|
float movementFactor = (sub.Velocity == Vector2.Zero) ? 0.0f : sub.Velocity.Length() / 10.0f;
|
||||||
movementFactor = MathHelper.Clamp(movementFactor, 0.0f, 1.0f);
|
movementFactor = MathHelper.Clamp(movementFactor, 0.0f, 1.0f);
|
||||||
|
|
||||||
if (Character.Controlled==null || Character.Controlled.Submarine != sub)
|
if (Character.Controlled==null || Character.Controlled.Submarine != sub)
|
||||||
|
|||||||
+10
-17
@@ -38,23 +38,16 @@ Submarine editor:
|
|||||||
- open menus are closed when opening another one (e.g. the save dialog box is automatically closed if
|
- open menus are closed when opening another one (e.g. the save dialog box is automatically closed if
|
||||||
the item selection menu is opened)
|
the item selection menu is opened)
|
||||||
|
|
||||||
|
Misc:
|
||||||
- background ice formations with a parallax effect
|
- background ice formations with a parallax effect
|
||||||
|
- the level generation algorithm doesn't place walls behind alien ruins
|
||||||
- swimming animation fix: characters don't swim with their legs extended up over their shoulders after a
|
- improved fire & smoke particles
|
||||||
sharp turn
|
- water puts out fires more slowly
|
||||||
|
- explosion damage is reduced if there are walls or other solid obstacles between and explosion and a character
|
||||||
- the level generation algorithm doesn't place walls behind alien ruins
|
- heal and revive commands can also be used on other characters than the controlled one
|
||||||
|
- fixed fires occasionally causing incorrect sound clips to loop continuously
|
||||||
- improved fire & smoke particles
|
- swimming animation fix: characters don't swim with their legs extended up over their shoulders
|
||||||
|
after a sharp turn
|
||||||
- water puts out fires more slowly
|
|
||||||
|
|
||||||
- explosion damage is reduced if there are walls or other solid obstacles between and explosion and a character
|
|
||||||
|
|
||||||
- heal and revive commands can also be used on other characters than the controlled one
|
|
||||||
|
|
||||||
- fixed fires occasionally causing incorrect sound clips to loop continuously
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user