Example #1
0
        protected override void OnInternalGameEvent(OfficeWorld world, AObject lObject, AObject lObjectTo, string details)
        {
            if (details.Equals("endDialogue"))
            {
                DialogueObject dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject;

                if (dialogue == lObject)
                {
                    AObject patient = world.GetObjectFromId("patient main");
                    if (this.isSuccess)
                    {
                        patient.SetAnimationIndex(8);
                    }
                    else
                    {
                        patient.SetAnimationIndex(7);
                    }

                    this.timeElapsed = Time.Zero;
                    this.periodPhase = Time.FromSeconds(2);
                    this.moment      = ExposePhaseMoment.END_DIALOGUE;
                }
            }
            else if (details.Equals("speedUpDialogue"))
            {
                DialogueObject dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject;

                dialogue.SpeedFactor = 10;
            }
        }
Example #2
0
        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;
                }
            }
        }
Example #3
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

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

            this.isSuccess = dialogue.IsSuccess;

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

            toubib.SetAnimationIndex(3);

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

            bubble.SetAnimationIndex(1);

            this.periodPhase = Time.FromSeconds(1.2f);
            this.timeElapsed = Time.Zero;
        }
Example #4
0
        protected override void OnInternalGameEvent(OfficeWorld world, AObject lObject, AObject lObjectTo, string details)
        {
            if (details.Equals("endDialogue"))
            {
                DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject;

                if (dialogue == lObject)
                {
                    this.timeElapsed = Time.Zero;
                    this.periodPhase = Time.FromSeconds(3);
                    this.moment      = StartPhaseMoment.TEXT_APPEARED;
                }
            }
            else if (details.Equals("speedUpDialogue"))
            {
                DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject;

                dialogue.SpeedFactor = 10;
            }
        }
Example #5
0
        protected override void OnInternalGameEvent(OfficeWorld world, AObject lObject, AObject lObjectTo, string details)
        {
            DialogueObject dialogue = world.GetObjectFromId("dialogue coming") as DialogueObject;

            if (dialogue == lObject)
            {
                this.timeElapsed = Time.Zero;
                this.periodPhase = Time.FromSeconds(1);
                this.moment      = PrePhaseMoment.TEXT_APPEARED;
            }
        }
Example #6
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            world.NbPatient++;

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

            //AObject test = world.GetObjectFromId("test");

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

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

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

            this.periodPhase = Time.FromSeconds(3);
            this.timeElapsed = Time.Zero;
        }
Example #7
0
        protected override void OnInternalGameEvent(OfficeWorld world, AObject lObject, AObject lObjectTo, string details)
        {
            if (details.Equals("endDialogue"))
            {
                DialogueObject dialogue;
                AObject patient = world.GetObjectFromId("patient main");

                if (this.isSuccess)
                {
                    dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject;
                }
                else
                {
                    dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject;
                }

                if (dialogue == lObject)
                {
                    this.timeElapsed = Time.Zero;
                    this.periodPhase = Time.FromSeconds(3);
                    this.moment = ResolvePhaseMoment.END_DIALOGUE;
                }
            }
            else if (details.Equals("speedUpDialogue"))
            {
                DialogueObject dialogue;
                if (this.isSuccess)
                {
                    dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject;
                }
                else
                {
                    dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject;
                }

                dialogue.SpeedFactor = 10;
            }
        }
Example #8
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(2);
            toubib.SetAnimationIndex(1);

            bubble.SetAnimationIndex(1);

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

            dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f));

            this.periodPhase = Time.FromSeconds(1.2f);
            this.timeElapsed = Time.Zero;
        }
Example #9
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;
        }
Example #10
0
        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;
        }
Example #11
0
        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;
                }
            }
        }
Example #12
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;
        }
Example #13
0
        public override void UpdateLogic(OfficeWorld world, Time timeElapsed)
        {
            this.timeElapsed += timeElapsed;

            if (this.timeElapsed > periodPhase)
            {
                switch (this.moment)
                {
                case ThinkPhaseMoment.START:
                    DialogueObject dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject;
                    dialogue.LaunchDialogue(6);

                    AObject queueDream = world.GetObjectFromId("queueDream main");
                    queueDream.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      = ThinkPhaseMoment.BUBBLE_APPEARED;
                    break;

                case ThinkPhaseMoment.BUBBLE_APPEARED:

                    DialogueObject dialogueAnswer = world.GetObjectFromId("dialogue answer") as DialogueObject;
                    dialogueAnswer.SetKinematicParameters(new Vector2f(-550f, 200f), new Vector2f(0f, 0f));
                    dialogueAnswer.LaunchDialogue(6);

                    this.timeElapsed = Time.Zero;
                    this.periodPhase = Time.FromSeconds(world.CurrentLevel.Data.Timer);

                    AObject timer = world.GetObjectFromId("timer main");
                    timer.SetAnimationIndex(2);

                    this.moment = ThinkPhaseMoment.START_TIMER;
                    break;

                case ThinkPhaseMoment.START_TIMER:

                    this.EndTimerAction(world);
                    break;

                case ThinkPhaseMoment.END:
                    dialogue = world.GetObjectFromId("dialogue toubib") as DialogueObject;
                    dialogue.ValidateDialogue(world);

                    timer = world.GetObjectFromId("timer main");
                    timer.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0f, 0f));

                    this.NodeState = NodeState.NOT_ACTIVE;
                    break;
                }
            }

            if (this.moment == ThinkPhaseMoment.START_TIMER)
            {
                AToken timerToken = world.GetObjectFromId("timerToken main") as AToken;
                timerToken.DisplayText = ((int)(world.CurrentLevel.Data.Timer - this.timeElapsed.AsSeconds())).ToString();
            }
        }
Example #14
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;
                }
            }
        }