Ejemplo n.º 1
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;
            }
        }
Ejemplo n.º 2
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();
            }
        }
Ejemplo n.º 3
0
 private void ChangeSlide()
 {
     whichSlide = nextSlide;
     if (whichSlide >= 0)
     {
         BoardGameScene updatedScene = scenario.Scenes[whichSlide];
         if (updatedScene.NewMusic != null)
         {
             Game1.changeMusicTrack(scenario.Scenes[whichSlide].NewMusic);
         }
         if (updatedScene.ShakeTimer > 0)
         {
             timers.SetTimer(TimerType.SHAKE_TIMER, updatedScene.ShakeTimer);
         }
     }
     else
     {
         this.grade = scenario.GetGrade(scoreCount);
         timers.SetTimer(TimerType.END_TIMER, 6000);
     }
 }