Пример #1
0
        private void CreateQuestionWindow()
        {
            BoardGameScene currentScene = scenario.Scenes[whichSlide];

            if (currentScene.Answers != null)
            {
                List <Response> responses       = new List <Response>();
                int             responseCounter = -1;
                foreach (DialogueResponse currentResponse in currentScene.Answers)
                {
                    ++responseCounter;
                    if (currentResponse.DisplayConditions != null)
                    {
                        if (!DoVariablesContainConditions(currentResponse.DisplayConditions))
                        {
                            continue;
                        }
                    }
                    string   responseKey   = responseCounter.ToString();
                    Response addedResponse = new Response(responseKey, currentResponse.ResponseText);
                    responses.Add(addedResponse);
                }
                Game1.currentLocation.createQuestionDialogue(currentScene.Question, responses.ToArray(), new GameLocation.afterQuestionBehavior(this.BehaviorOnResponse), (NPC)null);
            }
            else
            {
                nextSlide        = currentScene.DefaultNext;
                this.nextDisplay = NextBoardGameDisplayType.DELAY_SETUP;
                ChangeSlide();
            }
        }
Пример #2
0
        private void BehaviorOnResponse(Farmer who, string responseKey)
        {
            int responseIndex;

            Int32.TryParse(responseKey, out responseIndex);
            BoardGameScene   currentScene    = scenario.Scenes[whichSlide];
            DialogueResponse currentResponse = currentScene.Answers[responseIndex];

            int newSceneIndex = currentResponse.ChangeScene;

            nextSlide = newSceneIndex;

            if (currentResponse.SetFlags != null)
            {
                foreach (string addedFlag in currentResponse.SetFlags)
                {
                    scenarioVariables.Add(addedFlag);
                }
            }

            scoreCount += currentResponse.AddScore;
            woundCount += currentResponse.AddWound;

            if (currentResponse.ResponseReaction == null)
            {
                this.nextDisplay = NextBoardGameDisplayType.DELAY_SETUP;
                ChangeSlide();
            }
            else
            {
                currentlyDisplayedDialogue = currentResponse.ResponseReaction;
                this.nextDisplay           = NextBoardGameDisplayType.POST_QUESTION_DISPLAY;
            }
        }
Пример #3
0
        private void UpdateTextBoxDisplay()
        {
            if (nextDisplay == NextBoardGameDisplayType.DELAY_SETUP)
            {
                nextDisplay = NextBoardGameDisplayType.DELAY_TIMER;
            }

            if (timers.GetTimer(TimerType.APPEAR_TIMER) <= 0 && nextDisplay == NextBoardGameDisplayType.DELAY_TIMER)
            {
                nextDisplay = NextBoardGameDisplayType.DIALOGUE_DISPLAY;
            }

            if (nextDisplay == NextBoardGameDisplayType.DIALOGUE_DISPLAY)
            {
                currentlyDisplayedDialogue = scenario.Scenes[whichSlide].Dialogue;
                if (currentlyDisplayedDialogue == null || whichDialogue >= currentlyDisplayedDialogue.Count)
                {
                    whichDialogue = 0;
                    nextDisplay   = NextBoardGameDisplayType.QUESTION_DISPLAY;
                }
            }

            if (nextDisplay == NextBoardGameDisplayType.POST_QUESTION_DISPLAY)
            {
                if (currentlyDisplayedDialogue == null || whichDialogue >= currentlyDisplayedDialogue.Count)
                {
                    whichDialogue = 0;
                    nextDisplay   = NextBoardGameDisplayType.DELAY_SETUP;
                    ChangeSlide();
                }
            }

            if (nextDisplay == NextBoardGameDisplayType.DIALOGUE_DISPLAY || nextDisplay == NextBoardGameDisplayType.POST_QUESTION_DISPLAY)
            {
                if (whichDialogue < currentlyDisplayedDialogue.Count)
                {
                    CreateDialogueWindow();
                    whichDialogue++;
                }
            }


            if (nextDisplay == NextBoardGameDisplayType.QUESTION_DISPLAY)
            {
                CreateQuestionWindow();
            }
        }