(98ad00fa2) v0.9.1.0

This commit is contained in:
Joonas Rikkonen
2019-07-10 13:52:12 +03:00
parent 2a791887ed
commit afa2137bd2
104 changed files with 3041 additions and 3134 deletions
@@ -17,7 +17,8 @@ namespace Barotrauma
const float coolDown = 10.0f;
public Character Enemy { get; private set; }
public bool HoldPosition { get; set; }
private Item _weapon;
private Item Weapon
{
@@ -125,7 +126,10 @@ namespace Barotrauma
TryArm();
if (seekAmmunition == null || !subObjectives.Contains(seekAmmunition))
{
Move();
if (!HoldPosition)
{
Move();
}
if (WeaponComponent != null)
{
OperateWeapon(deltaTime);
@@ -151,6 +155,8 @@ namespace Barotrauma
private bool TryArm()
{
if (character.LockHands) { return false; }
if (Weapon != null)
{
if (!character.Inventory.Items.Contains(Weapon) || WeaponComponent == null)
@@ -160,7 +166,7 @@ namespace Barotrauma
else if (!WeaponComponent.HasRequiredContainedItems(false))
{
// Seek ammunition only if cannot find a new weapon
if (!Reload(true, () => GetWeapon(out _) == null))
if (!Reload(!HoldPosition, () => GetWeapon(out _) == null))
{
if (seekAmmunition != null && subObjectives.Contains(seekAmmunition))
{
@@ -266,7 +272,7 @@ namespace Barotrauma
private void Unequip()
{
if (character.SelectedItems.Contains(Weapon))
if (!character.LockHands && character.SelectedItems.Contains(Weapon))
{
if (!Weapon.AllowedSlots.Contains(InvSlotType.Any) || !character.Inventory.TryPutItem(Weapon, character, new List<InvSlotType>() { InvSlotType.Any }))
{
@@ -277,6 +283,7 @@ namespace Barotrauma
private bool Equip()
{
if (character.LockHands) { return false; }
if (!WeaponComponent.HasRequiredContainedItems(false))
{
Mode = CombatMode.Retreat;
@@ -322,6 +329,13 @@ namespace Barotrauma
private void Engage()
{
if (character.LockHands)
{
Mode = CombatMode.Retreat;
SteeringManager.Reset();
return;
}
retreatTarget = null;
RemoveSubObjective(ref retreatObjective);
RemoveSubObjective(ref seekAmmunition);