public override Yield Execute(Rumor rumor) { bool call; try { // If there is no condition, this is an else and we will always // want to call if (Condition == null) { call = true; } else { var value = Condition.Evaluate(rumor.Scope)?.AsBoolean(); call = value?.Value ?? false; } } catch (UndefinedVariableException) { call = false; } catch (VariableTypeException) { call = false; } if (call) { rumor.Call(Label); } else { Next?.Execute(rumor); } return(null); }
public override void Update(Rumor rumor, double delta) { base.Update(rumor, delta); if (Timeout.HasValue) { Finished = Elapsed >= Timeout.Value; if (Finished) { switch (moveType) { case MoveType.Jump: rumor.Jump(label); break; case MoveType.Call: rumor.Call(label); break; } rumor.State.ClearChoices(); } } }
public override Yield Execute(Rumor rumor) { rumor.Call(Label); return(null); }