(42b18ccca) Allow to return to the initial combat mode after retreating. Implement reloading (disabled because only reloads one ammunition) -> TODO: only load ammunition when found in the inventory. Implement a generic method for removing subobjectives and resetting the reference. Refuel the repair tool.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:58:15 +03:00
parent 18b6775457
commit 257889b9cc
39 changed files with 505 additions and 639 deletions
@@ -20,8 +20,6 @@ namespace Barotrauma
public float Rotation;
private int spriteIndex;
public LevelObjectPrefab ActivePrefab;
public PhysicsBody PhysicsBody
@@ -42,15 +40,6 @@ namespace Barotrauma
set { Triggers.ForEach(t => t.NeedsNetworkSyncing = false); }
}
public Sprite Sprite
{
get { return spriteIndex < 0 || Prefab.Sprites.Count == 0 ? null : Prefab.Sprites[spriteIndex % Prefab.Sprites.Count]; }
}
public Sprite SpecularSprite
{
get { return spriteIndex < 0 || Prefab.SpecularSprites.Count == 0 ? null : Prefab.SpecularSprites[spriteIndex % Prefab.SpecularSprites.Count]; }
}
public LevelObject(LevelObjectPrefab prefab, Vector3 position, float scale, float rotation = 0.0f)
{
Triggers = new List<LevelTrigger>();
@@ -60,8 +49,6 @@ namespace Barotrauma
Scale = scale;
Rotation = rotation;
spriteIndex = ActivePrefab.Sprites.Any() ? Rand.Int(ActivePrefab.Sprites.Count, Rand.RandSync.Server) : -1;
if (prefab.PhysicsBodyElement != null)
{
PhysicsBody = new PhysicsBody(prefab.PhysicsBodyElement, ConvertUnits.ToSimUnits(new Vector2(position.X, position.Y)), Scale);