Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -25,6 +25,9 @@ namespace Barotrauma
[Serialize("", IsPropertySaveable.Yes, description: "A tag to apply to the hull the target is currently in when the check succeeds.")]
public Identifier ApplyTagToHull { get; set; }
[Serialize("", IsPropertySaveable.Yes, description: "Tag to apply to the target (or all targets if there's multiple) when the check succeeds.")]
public Identifier ApplyTagToTarget { get; set; }
public CheckConditionalAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element)
{
@@ -45,7 +48,6 @@ namespace Barotrauma
foreach (ContentXElement subElement in conditionalElements)
{
conditionalList.AddRange(PropertyConditional.FromXElement(subElement));
break;
}
Conditionals = conditionalList.ToImmutableArray();
}
@@ -85,7 +87,7 @@ namespace Barotrauma
{
foreach (var target in targets)
{
ApplyTagsToHulls(target as Entity, ApplyTagToHull, ApplyTagToLinkedHulls);
ApplyTagsToTarget(target);
}
return true;
}
@@ -96,12 +98,21 @@ namespace Barotrauma
{
if (ConditionalsMatch(target))
{
ApplyTagsToTarget(target);
success = true;
ApplyTagsToHulls(target as Entity, ApplyTagToHull, ApplyTagToLinkedHulls);
}
}
return success;
}
void ApplyTagsToTarget(ISerializableEntity target)
{
if (!ApplyTagToTarget.IsEmpty)
{
ParentEvent.AddTarget(ApplyTagToTarget, target as Entity);
}
ApplyTagsToHulls(target as Entity, ApplyTagToHull, ApplyTagToLinkedHulls);
}
}
private bool ConditionalsMatch(ISerializableEntity target)