v1.2.6.0 (Winter Update)

This commit is contained in:
Regalis11
2023-12-14 16:11:27 +02:00
parent af8cc89fce
commit b91e85559d
375 changed files with 7771 additions and 2874 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() { }