Unstable 1.2.4.0
This commit is contained in:
@@ -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() { }
|
||||
|
||||
Reference in New Issue
Block a user