(eba811de) Unstable 0.9.703.0

This commit is contained in:
Juan Pablo Arce
2020-02-04 11:54:57 -03:00
parent 15499cb704
commit 08ab6185c4
100 changed files with 2162 additions and 1520 deletions
@@ -107,19 +107,16 @@ namespace Barotrauma
: this (rectangle, Submarine.MainSub)
{ }
public Gap(Rectangle newRect, Submarine submarine)
: this(newRect, newRect.Width < newRect.Height, submarine)
public Gap(Rectangle rect, Submarine submarine)
: this(rect, rect.Width < rect.Height, submarine)
{ }
public Gap(Rectangle newRect, bool isHorizontal, Submarine submarine)
public Gap(Rectangle rect, bool isHorizontal, Submarine submarine)
: base(MapEntityPrefab.Find(null, "gap"), submarine)
{
rect = newRect;
this.rect = rect;
flowForce = Vector2.Zero;
this.IsHorizontal = isHorizontal;
IsHorizontal = isHorizontal;
open = 1.0f;
FindHulls();
@@ -131,6 +128,7 @@ namespace Barotrauma
outsideCollisionBlocker.CollisionCategories = Physics.CollisionWall;
outsideCollisionBlocker.CollidesWith = Physics.CollisionCharacter;
outsideCollisionBlocker.Enabled = false;
Resized += newRect => IsHorizontal = newRect.Width < newRect.Height;
DebugConsole.Log("Created gap (" + ID + ")");
}
@@ -36,6 +36,8 @@ namespace Barotrauma
//is the mouse inside the rect
private bool isHighlighted;
public event Action<Rectangle> Resized;
public bool IsHighlighted
{
get { return isHighlighted || ExternalHighlight; }
@@ -578,6 +580,7 @@ namespace Barotrauma
if (!float.IsNaN(value))
{
_spriteOverrideDepth = MathHelper.Clamp(value, 0.001f, 0.999f);
if (this is Item) { _spriteOverrideDepth = Math.Min(_spriteOverrideDepth, 0.9f); }
SpriteDepthOverrideIsSet = true;
}
}
@@ -42,9 +42,6 @@ namespace Barotrauma
public const int WallSectionSize = 96;
public static List<Structure> WallList = new List<Structure>();
//how much mechanic skill increases per damage removed from the wall by welding
public const float SkillIncreaseMultiplier = 0.005f;
const float LeakThreshold = 0.1f;
#if CLIENT
@@ -1008,7 +1005,7 @@ namespace Barotrauma
if (damageDiff < 0.0f)
{
attacker.Info.IncreaseSkillLevel("mechanical",
-damageDiff * SkillIncreaseMultiplier / Math.Max(attacker.GetSkillLevel("mechanical"), 1.0f),
-damageDiff * SkillSettings.Current.SkillIncreasePerRepairedStructureDamage / Math.Max(attacker.GetSkillLevel("mechanical"), 1.0f),
SectionPosition(sectionIndex, true));
}
}
@@ -949,6 +949,7 @@ namespace Barotrauma
&& !fixture.CollisionCategories.HasFlag(Physics.CollisionWall)
&& !fixture.CollisionCategories.HasFlag(Physics.CollisionRepair)) { return -1; }
if (ignoreSubs && fixture.Body.UserData is Submarine) { return -1; }
if (fixture.Body.UserData as string == "ruinroom") { return -1; }
if (fixture.Body.UserData is Structure structure)
{
if (structure.IsPlatform || structure.StairDirection != Direction.None) { return -1; }