Unstable 1.2.4.0

This commit is contained in:
Markus Isberg
2023-11-30 13:53:00 +02:00
parent 8a2e2ea0ae
commit fb5ea537bf
210 changed files with 4201 additions and 1283 deletions
@@ -5,17 +5,31 @@ namespace Barotrauma
[Serialize("", IsPropertySaveable.Yes)]
public string Name { get; set; }
[Serialize(-1, IsPropertySaveable.Yes)]
public int MaxTimes { get; set; }
private int counter;
public GoTo(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
public override bool IsFinished(ref string goTo)
{
goTo = Name;
if (counter < MaxTimes || MaxTimes <= 0)
{
goTo = Name;
counter++;
}
return true;
}
public override string ToDebugString()
{
return $"[-] Go to label \"{Name}\"";
string msg = $"[-] Go to label \"{Name}\"";
if (MaxTimes > 0)
{
msg += $" ({counter}/{MaxTimes})";
}
return msg;
}
public override void Reset() { }