Unstable 0.1500.1.0 (BaroDev edition)

This commit is contained in:
Markus Isberg
2021-09-03 21:56:31 +09:00
parent 501e02c026
commit e7b7c1a748
143 changed files with 2928 additions and 1356 deletions
@@ -540,6 +540,12 @@ namespace Barotrauma
set => indestructible = value;
}
public bool AllowDeconstruct
{
get;
set;
}
[Editable, Serialize(false, isSaveable: true, "When enabled will prevent the item from taking damage from all sources")]
public bool InvulnerableToDamage { get; set; }
@@ -767,6 +773,8 @@ namespace Barotrauma
condition = MaxCondition;
lastSentCondition = condition;
AllowDeconstruct = itemPrefab.AllowDeconstruct;
allPropertyObjects.Add(this);
XElement element = itemPrefab.ConfigElement;
@@ -1431,7 +1439,7 @@ namespace Barotrauma
bool hasTargets = effect.TargetIdentifiers == null;
targets.Clear();
if (effect.HasTargetType(StatusEffect.TargetType.Contained))
{
foreach (Item containedItem in ContainedItems)
@@ -1443,6 +1451,11 @@ namespace Barotrauma
continue;
}
if (effect.TargetSlot > -1)
{
if (OwnInventory.FindIndex(containedItem) != effect.TargetSlot) { continue; }
}
hasTargets = true;
targets.Add(containedItem);
}
@@ -1500,8 +1513,8 @@ namespace Barotrauma
{
targets.Add(limb);
}
if (Container != null && effect.HasTargetType(StatusEffect.TargetType.Parent)) targets.Add(Container);
if (Container != null && effect.HasTargetType(StatusEffect.TargetType.Parent)) { targets.Add(Container); }
effect.Apply(type, deltaTime, this, targets, worldPosition);
}
@@ -2298,8 +2311,8 @@ namespace Barotrauma
public void ApplyTreatment(Character user, Character character, Limb targetLimb)
{
//can't apply treatment to dead characters
if (character.IsDead) return;
if (!UseInHealthInterface) return;
if (character.IsDead) { return; }
if (!UseInHealthInterface) { return; }
#if CLIENT
if (GameMain.Client != null)
@@ -2312,7 +2325,7 @@ namespace Barotrauma
bool remove = false;
foreach (ItemComponent ic in components)
{
if (!ic.HasRequiredContainedItems(user, addMessage: user == Character.Controlled)) continue;
if (!ic.HasRequiredContainedItems(user, addMessage: user == Character.Controlled)) { continue; }
bool success = Rand.Range(0.0f, 0.5f) < ic.DegreeOfSuccess(user);
ActionType actionType = success ? ActionType.OnUse : ActionType.OnFailure;
@@ -2331,7 +2344,7 @@ namespace Barotrauma
});
}
if (ic.DeleteOnUse) remove = true;
if (ic.DeleteOnUse) { remove = true; }
}
if (remove) { Spawner?.AddToRemoveQueue(this); }