- fixed level generation algorithm placing waypoints at unreachable positions
- changes to drowning/suffocation logic (oxygen-value drops/rises at a fixed rate depending on whether there's enough oxygen available, instead of effects "stacking")
This commit is contained in:
@@ -81,7 +81,7 @@ namespace Barotrauma
|
||||
private Vector2 cursorPosition;
|
||||
|
||||
protected bool needsAir;
|
||||
protected float oxygen;
|
||||
protected float oxygen, oxygenAvailable;
|
||||
protected float drowningTime;
|
||||
|
||||
protected float health;
|
||||
@@ -251,6 +251,12 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public float OxygenAvailable
|
||||
{
|
||||
get { return oxygenAvailable; }
|
||||
set { oxygenAvailable = MathHelper.Clamp(value, 0.0f, 100.0f); }
|
||||
}
|
||||
|
||||
public float Stun
|
||||
{
|
||||
get { return AnimController.StunTimer; }
|
||||
@@ -416,6 +422,7 @@ namespace Barotrauma
|
||||
IsNetworkPlayer = isNetworkPlayer;
|
||||
|
||||
oxygen = 100.0f;
|
||||
oxygenAvailable = 100.0f;
|
||||
aiTarget = new AITarget(this);
|
||||
|
||||
lowPassMultiplier = 1.0f;
|
||||
@@ -1027,20 +1034,20 @@ namespace Barotrauma
|
||||
|
||||
if (needsAir)
|
||||
{
|
||||
if (AnimController.HeadInWater)
|
||||
{
|
||||
Oxygen -= deltaTime*100.0f / drowningTime;
|
||||
}
|
||||
else if (AnimController.CurrentHull != null)
|
||||
{
|
||||
float hullOxygen = AnimController.CurrentHull.OxygenPercentage;
|
||||
hullOxygen -= 30.0f;
|
||||
Oxygen += deltaTime * (oxygenAvailable < 30.0f ? -5.0f : 10.0f);
|
||||
|
||||
Oxygen += deltaTime * 100.0f * (hullOxygen / 500.0f);
|
||||
PressureProtection -= deltaTime*100.0f;
|
||||
|
||||
float hullAvailableOxygen = 0.0f;
|
||||
|
||||
if (!AnimController.HeadInWater && AnimController.CurrentHull != null)
|
||||
{
|
||||
hullAvailableOxygen = AnimController.CurrentHull.OxygenPercentage;
|
||||
|
||||
AnimController.CurrentHull.Oxygen -= Hull.OxygenConsumptionSpeed * deltaTime;
|
||||
}
|
||||
PressureProtection -= deltaTime*100.0f;
|
||||
|
||||
OxygenAvailable += Math.Sign(hullAvailableOxygen - oxygenAvailable) * deltaTime * 50.0f;
|
||||
}
|
||||
|
||||
Health -= bleeding * deltaTime;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Barotrauma
|
||||
|
||||
if (Screen.Selected == GameMain.EditMapScreen) return;
|
||||
|
||||
if (character.Oxygen < 50.0f && !character.IsDead)
|
||||
if (character.Oxygen < 80.0f && !character.IsDead)
|
||||
{
|
||||
Vector2 offset = Rand.Vector(noiseOverlay.size.X);
|
||||
offset.X = Math.Abs(offset.X);
|
||||
@@ -106,7 +106,7 @@ namespace Barotrauma
|
||||
|
||||
noiseOverlay.DrawTiled(spriteBatch, Vector2.Zero - offset, new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) + offset,
|
||||
Vector2.Zero,
|
||||
Color.White * ((50.0f - character.Oxygen) / 50.0f));
|
||||
Color.White * Math.Min((80.0f - character.Oxygen) / 50.0f, 0.8f));
|
||||
}
|
||||
|
||||
if (damageOverlayTimer>0.0f)
|
||||
|
||||
Reference in New Issue
Block a user