public void PressChoice(int choice) { WoodFireStoryLine storyLine = story[textIndex]; int deadScouts = (choice == 1 ? storyLine.scoutsDeadChoice1 : storyLine.scoutsDeadChoice2); int savedScouts = (choice == 1 ? storyLine.scoutsSavedChoice1 : storyLine.scoutsSavedChoice2); bool scaryAtmosphere = (choice == 1 ? storyLine.scaryAtmosphereChoice1 : storyLine.scaryAtmosphereChoice2); bool boringAtmosphere = (choice == 1 ? storyLine.boringAtmosphereChoice1 : storyLine.boringAtmosphereChoice2); if (scaryAtmosphere) { LaunchScaryAtmosphere(); } if (deadScouts > 0) { ScoutsDie(deadScouts, 2); } if (boringAtmosphere) { LaunchBoringAtmosphere(); } if (savedScouts > 0) { ScoutsGoToBed(savedScouts, 2); } IncrementStoryText(); UpdateUI(deadScouts + savedScouts); }
private void IncrementStoryText() { textIndex++; if (textIndex < story.Count) { WoodFireStoryLine storyLine = story[textIndex]; while (storyLine.minimumNumberOfScoutsToReadLine > totalScouts) { textIndex++; if (textIndex >= story.Count) { break; } storyLine = story[textIndex]; } } }