Merge https://github.com/Regalis11/Barotrauma into develop
This commit is contained in:
@@ -1068,7 +1068,7 @@ namespace Barotrauma
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelectedItem == null || (SelectedItem.GetComponent<Controller>()?.AllowAiming ?? false);
|
||||
return (SelectedItem == null || SelectedItem.GetComponent<Controller>() is { AllowAiming: true }) && !IsIncapacitated && !IsRagdolled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1131,6 +1131,7 @@ namespace Barotrauma
|
||||
public HashSet<Identifier> MarkedAsLooted = new();
|
||||
|
||||
public bool IsInFriendlySub => Submarine != null && Submarine.TeamID == TeamID;
|
||||
public bool IsInPlayerSub => Submarine != null && Submarine.Info.IsPlayer;
|
||||
|
||||
public float AITurretPriority
|
||||
{
|
||||
@@ -2710,27 +2711,6 @@ namespace Barotrauma
|
||||
CustomInteractHUDText = hudText;
|
||||
}
|
||||
|
||||
private void TransformCursorPos()
|
||||
{
|
||||
if (Submarine == null)
|
||||
{
|
||||
//character is outside but cursor position inside
|
||||
if (cursorPosition.Y > Level.Loaded.Size.Y)
|
||||
{
|
||||
var sub = Submarine.FindContaining(cursorPosition);
|
||||
if (sub != null) cursorPosition += sub.Position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//character is inside but cursor position is outside
|
||||
if (cursorPosition.Y < Level.Loaded.Size.Y)
|
||||
{
|
||||
cursorPosition -= Submarine.Position;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectCharacter(Character character)
|
||||
{
|
||||
if (character == null || character == this) { return; }
|
||||
@@ -4335,7 +4315,7 @@ namespace Barotrauma
|
||||
if (statusEffect.type == ActionType.OnDamaged)
|
||||
{
|
||||
if (!statusEffect.HasRequiredAfflictions(LastDamage)) { continue; }
|
||||
if (statusEffect.OnlyPlayerTriggered)
|
||||
if (statusEffect.OnlyWhenDamagedByPlayer)
|
||||
{
|
||||
if (LastAttacker == null || !LastAttacker.IsPlayer)
|
||||
{
|
||||
@@ -4393,6 +4373,10 @@ namespace Barotrauma
|
||||
{
|
||||
statusEffect.Apply(actionType, deltaTime, this, this);
|
||||
}
|
||||
if (statusEffect.HasTargetType(StatusEffect.TargetType.Hull) && CurrentHull != null)
|
||||
{
|
||||
statusEffect.Apply(actionType, deltaTime, this, CurrentHull);
|
||||
}
|
||||
}
|
||||
if (actionType != ActionType.OnDamaged && actionType != ActionType.OnSevered)
|
||||
{
|
||||
@@ -4670,6 +4654,13 @@ namespace Barotrauma
|
||||
|
||||
CharacterList.Remove(this);
|
||||
|
||||
foreach (var attachedProjectile in AttachedProjectiles.ToList())
|
||||
{
|
||||
attachedProjectile.Unstick();
|
||||
}
|
||||
Latchers.ForEachMod(l => l?.DeattachFromBody(reset: true));
|
||||
Latchers.Clear();
|
||||
|
||||
if (Inventory != null)
|
||||
{
|
||||
foreach (Item item in Inventory.AllItems)
|
||||
@@ -4756,6 +4747,8 @@ namespace Barotrauma
|
||||
}
|
||||
#if SERVER
|
||||
newItem.GetComponent<Terminal>()?.SyncHistory();
|
||||
if (newItem.GetComponent<WifiComponent>() is WifiComponent wifiComponent) { newItem.CreateServerEvent(wifiComponent); }
|
||||
if (newItem.GetComponent<GeneticMaterial>() is GeneticMaterial geneticMaterial) { newItem.CreateServerEvent(geneticMaterial); }
|
||||
#endif
|
||||
int[] slotIndices = itemElement.GetAttributeIntArray("i", new int[] { 0 });
|
||||
if (!slotIndices.Any())
|
||||
|
||||
Reference in New Issue
Block a user