public DressUpContest(Minigame minigame) { InitializeComponent(); this.minigame = minigame; hero = minigame.CurrentHero; Clothing[] shirts = hero.Shirts; Clothing[] pants = hero.Pants; //fill out combo boxes for every single item in the tab fillClothingSelectionBox(shirtSelectionListBox, shirts); fillClothingSelectionBox(pantsListBox, pants); fillClothingSelectionBox(faceListBox, hero.Wardrobe[(int)TYPESOFCLOTHING.FACE]); fillClothingSelectionBox(hairListBox, hero.Wardrobe[(int)TYPESOFCLOTHING.HAIR]); fillClothingSelectionBox(shoesListBox, hero.Wardrobe[(int)TYPESOFCLOTHING.SHOES]); fillClothingSelectionBox(socksListBox, hero.Wardrobe[(int)TYPESOFCLOTHING.SOCKS]); fillClothingSelectionBox(glassesListBox, hero.Wardrobe[(int)TYPESOFCLOTHING.GLASSES]); //add each clothing listbox to List item shirtSelectionListBox.SelectedIndex = 1; pantsListBox.SelectedIndex = 1; hairListBox.SelectedIndex = 1; shoesListBox.SelectedIndex = getHerosOutfitItem(TYPESOFCLOTHING.SHOES); faceListBox.SelectedIndex = 0;// I have removed }
//Progresses to the next part of text, //checks for minigames, and other tasks public string next() { int maxPosition = text.Count - 1; string output = ""; Minigame thisMinigame = Minigames[Position]; //only advance to next position in List if it exists //in case array is empty, output messages and set position to 0 for later code if (text.Count == 0) { output = ("No text loaded"); Position = 0; } //if there is a minigame loaded here that hasn't been run, play that now else if (thisMinigame != null && thisMinigame.Won == false) { //PlayLoadingScreen = true; //the outcome of the minigame will update the Won paramater. thisMinigame.start(); //PlayLoadingScreen = false; if (thisMinigame.Won == false) { //Print a message to the player they lost. Do not allow text to continue return(thisMinigame.LoserMessage); } else { //Print a message to let show the player they won. Continue with game return("You are a winner"); } } //If at max position in array, stay there else if (Position >= maxPosition) { output = (text[maxPosition]); } else { output = text[++Position]; } //add position reference to output so that I may time pictures and events properly if (timingEvents == true) { output = Position.ToString() + ": " + output; } return(output); }
public void updateImageArraySizes() { int sum = text.Count; if (HasChoices == true) { sum += 1; } Minigames = new Minigame[sum]; MiddleCharacterPicture = new Bitmap[sum]; BackgroundPicture = new Bitmap[sum]; ForegroundPicture = new Bitmap[sum]; StoryOccurances = new Occurance[sum]; TextEndPosition = sum; //Choices Array should be set to 3 locations Choices = new Choice[3]; }
//add a mini game after this position in the text public void addMinigame(int position, int minimumScore) { Minigame minigame = new Minigame(MINIGAME_GAMES.DRESSUP_CONTEST, CurrentHero, minimumScore, "You lost the tutorial contest. This does not bode well."); Minigames[position] = minigame; }