示例#1
0
        public override void UpdateLogic(OfficeWorld officeWorld, Time timeElapsed)
        {
            if (this.previousAnimationIndex != this.currentAnimationIndex)
            {
                if (this.previousAnimationIndex == 2)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.END_TALK, "dialogueReflexion"));
                }

                if (this.currentAnimationIndex == 2)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.START_TALK, "dialogueReflexion"));
                }

                if (this.previousAnimationIndex == 3)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.END_TALK, "dialogueToubib"));
                }

                if (this.currentAnimationIndex == 3)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.START_TALK, "dialogueToubib"));
                }
            }

            base.UpdateLogic(officeWorld, timeElapsed);
        }
示例#2
0
        public override void UpdateLogic(OfficeWorld officeWorld, Time timeElapsed)
        {
            if (this.previousAnimationIndex != this.currentAnimationIndex)
            {
                if (this.previousAnimationIndex == 4)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.END_TALK, "dialoguePatientFail"));
                }

                if (this.currentAnimationIndex == 4)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.START_TALK, "dialoguePatientFail"));
                }

                if (this.previousAnimationIndex == 5)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.END_TALK, "dialoguePatientSuccess"));
                }

                if (this.currentAnimationIndex == 5)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.START_TALK, "dialoguePatientSuccess"));
                }

                if (this.previousAnimationIndex == 2)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.END_TALK, "dialoguePatient"));
                }

                if (this.currentAnimationIndex == 2)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.START_TALK, "dialoguePatient"));
                }

                if (this.currentAnimationIndex == 1)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.DOOR_OPEN, "dialoguePatient"));
                }

                if (this.currentAnimationIndex == 6)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.DOOR_KNOCK, "dialoguePatient"));
                }

                if (this.currentAnimationIndex == 7)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.VALIDATION, "fail"));
                }

                if (this.currentAnimationIndex == 8)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.VALIDATION, "success"));
                }
            }

            base.UpdateLogic(officeWorld, timeElapsed);
        }
示例#3
0
        public override void UpdateLogic(OfficeWorld officeWorld, Time timeElapsed)
        {
            if (this.previousAnimationIndex != this.currentAnimationIndex)
            {
                if (this.currentAnimationIndex == 1)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.OPEN_BUBBLE, string.Empty));
                }
                else if (this.currentAnimationIndex == 3)
                {
                    officeWorld.NotifyGameStateChanged(officeWorld.CurrentLevel.LevelName, new GameEvent(EventType.CLOSE_BUBBLE, string.Empty));
                }
            }

            base.UpdateLogic(officeWorld, timeElapsed);
        }
示例#4
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            AObject patient = world.GetObjectFromId("patient main");
            AObject toubib  = world.GetObjectFromId("toubib main");

            AObject bubble = world.GetObjectFromId("bubble main");

            bubble.SetKinematicParameters(new Vector2f(-520f, -380f), new Vector2f(0f, 0f));

            patient.SetAnimationIndex(6);
            toubib.SetAnimationIndex(2);

            DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject;

            dialogue.SetKinematicParameters(new Vector2f(-100f, -200f), new Vector2f(0f, 0f));

            world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.START, string.Empty));

            this.periodPhase = Time.FromSeconds(2);
            this.timeElapsed = Time.Zero;
        }
示例#5
0
        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;
        }
示例#6
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.START, string.Empty));
        }
示例#7
0
        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;
                }
            }
        }