public override void UpdateLogic(OfficeWorld world, Time timeElapsed) { this.timeElapsed += timeElapsed; if (this.timeElapsed > periodPhase) { switch (this.moment) { case PrePhaseMoment.START: AObject bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(1); AObject toubib = world.GetObjectFromId("toubib main"); toubib.SetAnimationIndex(3); this.moment = PrePhaseMoment.BUBBLE_APPEARED; this.periodPhase = Time.FromSeconds(1.2f); this.timeElapsed = Time.Zero; break; case PrePhaseMoment.BUBBLE_APPEARED: DialogueObject dialogue = world.GetObjectFromId("dialogue coming") as DialogueObject; dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f)); dialogue.LaunchDialogue(1); AObject queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(100f, 100f), new Vector2f(0f, 0f)); bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(2); this.moment = PrePhaseMoment.START_TALKING; break; case PrePhaseMoment.TEXT_APPEARED: dialogue = world.GetObjectFromId("dialogue coming") as DialogueObject; dialogue.ResetDialogue(); bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(3); queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0)); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(1); this.moment = PrePhaseMoment.END; break; case PrePhaseMoment.END: this.NodeState = NodeState.NOT_ACTIVE; break; } } }
public override void UpdateLogic(OfficeWorld world, Time timeElapsed) { this.timeElapsed += timeElapsed; if (this.timeElapsed > periodPhase) { switch (this.moment) { case ExposePhaseMoment.START: DialogueObject dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject; dialogue.LaunchDialogue(2); AObject queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(100f, 100f), new Vector2f(0f, 0f)); AObject bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(2); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(2); this.moment = ExposePhaseMoment.BUBBLE_APPEARED; break; case ExposePhaseMoment.END_DIALOGUE: dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject; dialogue.ResetDialogue(); bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(3); queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0)); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(2); this.moment = ExposePhaseMoment.END; break; case ExposePhaseMoment.END: this.NodeState = NodeState.NOT_ACTIVE; break; } } }
public override void VisitStart(OfficeWorld world) { base.VisitStart(world); AObject patient = world.GetObjectFromId("patient main"); AObject toubib = world.GetObjectFromId("toubib main"); patient.SetAnimationIndex(3); toubib.SetAnimationIndex(2); DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject; dialogue.ResetDialogue(); //dialogue.SetKinematicParameters(new Vector2f(-100f, -200f), new Vector2f(0f, 0f)); DialogueObject dialogueToubib = world.GetObjectFromId("dialogue toubib") as DialogueObject; dialogueToubib.SetKinematicParameters(new Vector2f(-380f, dialogueToubib.GetHeight(-150)), new Vector2f(0f, 0f)); AObject queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0f, 0f)); AObject noteblock = world.GetObjectFromId("notebook main"); (noteblock as NotebookObject).SetTransition(new Vector2f(-600, 600), new Vector2f(0, -150), Time.FromSeconds(3)); AObject bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(1); AObject timer = world.GetObjectFromId("timer main"); timer.SetAnimationIndex(1); timer.SetKinematicParameters(new Vector2f(320, 200), new Vector2f(0f, 0f)); this.periodPhase = Time.FromSeconds(1.2f); this.timeElapsed = Time.Zero; }
private void EndTimerAction(OfficeWorld world) { world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.END_TIMER, string.Empty)); DialogueObject dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject; dialogue.ResetDialogue(); DialogueObject dialogueAnswer = world.GetObjectFromId("dialogue answer") as DialogueObject; dialogueAnswer.ResetDialogue(); AObject noteblock = world.GetObjectFromId("notebook main"); (noteblock as NotebookObject).SetTransition(new Vector2f(-600, 150), new Vector2f(0, 150), Time.FromSeconds(3)); AObject bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(3); AToken timerToken = world.GetObjectFromId("timerToken main") as AToken; timerToken.DisplayText = string.Empty; AObject queueDream = world.GetObjectFromId("queueDream main"); queueDream.SetKinematicParameters(new Vector2f(1000, 1000), new Vector2f(0f, 0f)); AObject timer = world.GetObjectFromId("timer main"); timer.SetAnimationIndex(3); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(3); this.moment = ThinkPhaseMoment.END; }
public override void UpdateLogic(OfficeWorld world, Time timeElapsed) { this.timeElapsed += timeElapsed; if (this.timeElapsed > periodPhase) { DialogueObject dialogue = null; switch (this.moment) { case ResolvePhaseMoment.START: if (this.isSuccess) { dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject; } else { dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject; } dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f)); dialogue.LaunchDialogue(2); AObject queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(-200f, 120f), new Vector2f(0f, 0f)); AObject bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(2); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(2); this.moment = ResolvePhaseMoment.BUBBLE_APPEARED; break; case ResolvePhaseMoment.END_DIALOGUE: AObject patient = world.GetObjectFromId("patient main"); if (this.isSuccess) { dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject; patient.SetAnimationIndex(5); } else { dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject; patient.SetAnimationIndex(4); } dialogue.ResetDialogue(); bubble = world.GetObjectFromId("bubble main"); bubble.SetAnimationIndex(3); queueTalk = world.GetObjectFromId("queueTalk main"); queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0)); this.timeElapsed = Time.Zero; this.periodPhase = Time.FromSeconds(2); this.moment = ResolvePhaseMoment.END; break; case ResolvePhaseMoment.END: if (this.isSuccess) { world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.ENDING, "good")); } else { world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.ENDING, "bad")); } this.NodeState = NodeState.NOT_ACTIVE; break; } } }