//Event Handlers private void pictureBox_VillainDeck_Click(object sender, EventArgs e) { //Get new Villain Card Random rand = new Random(); int r = rand.Next(0, VillainDeck.Count); DefeatableCard newVillainCard = VillainDeck.ElementAt(r); VillainDeck.RemoveAt(r); //Move all cards forward and add new Card in first spot int firstNull = -1; for (int n = 0; n < 5; n++) { if (CityArray[n] == null) { firstNull = n; } } //If City is not full if (firstNull != -1) { if (firstNull < 4) { for (int i = firstNull; i >= 0; i--) { if (CityArray[i] != null) { CityArray[i + 1] = CityArray[i]; } } CityArray[0] = newVillainCard; } //First null is in the last spot else { for (int i = 3; i >= 0; i--) { if (CityArray[i] != null) { CityArray[i + 1] = CityArray[i]; } } CityArray[0] = newVillainCard; } } //If City is full, then a Villain Escapes else { EscapedVillainsList.Add(CityArray[4]); for (int i = 3; i >= 0; i--) { if (CityArray[i] != null) { CityArray[i + 1] = CityArray[i]; } } CityArray[0] = newVillainCard; //Display CardBack for pictureBox_EscapedVillains Image flipImage = Properties.Resources.CardBack; flipImage.RotateFlip(RotateFlipType.Rotate270FlipXY); pictureBox_EscapedVillains.Image = flipImage; pictureBox_EscapedVillains.Visible = true; pictureBox_EscapedVillains.SizeMode = PictureBoxSizeMode.StretchImage; } //Update City Space Images if (CityArray[0] != null) { DisplayCardImage(pictureBox_Sewers, CityArray[0].getName()); pictureBox_Sewers.Visible = true; pictureBox_Sewers.SizeMode = PictureBoxSizeMode.StretchImage; } else { pictureBox_Sewers.Visible = false; } if (CityArray[1] != null) { DisplayCardImage(pictureBox_Bank, CityArray[1].getName()); pictureBox_Bank.Visible = true; pictureBox_Bank.SizeMode = PictureBoxSizeMode.StretchImage; } else { pictureBox_Bank.Visible = false; } if (CityArray[2] != null) { DisplayCardImage(pictureBox_Rooftops, CityArray[2].getName()); pictureBox_Rooftops.Visible = true; pictureBox_Rooftops.SizeMode = PictureBoxSizeMode.StretchImage; } else { pictureBox_Rooftops.Visible = false; } if (CityArray[3] != null) { DisplayCardImage(pictureBox_Streets, CityArray[3].getName()); pictureBox_Streets.Visible = true; pictureBox_Streets.SizeMode = PictureBoxSizeMode.StretchImage; } else { pictureBox_Streets.Visible = false; } if (CityArray[4] != null) { DisplayCardImage(pictureBox_Bridge, CityArray[4].getName()); pictureBox_Bridge.Visible = true; pictureBox_Bridge.SizeMode = PictureBoxSizeMode.StretchImage; } else { pictureBox_Bridge.Visible = false; } }
private void addVillainDeck(String villainGroup1, String villainGroup2, String hench1) { //Add the Five Master Strike Cards to the VillainDeck DefeatableCard masterStrike1 = new DefeatableCard(0, 0, "MasterStrike"); VillainDeck.Add(masterStrike1); DefeatableCard masterStrike2 = new DefeatableCard(0, 0, "MasterStrike"); VillainDeck.Add(masterStrike2); DefeatableCard masterStrike3 = new DefeatableCard(0, 0, "MasterStrike"); VillainDeck.Add(masterStrike3); DefeatableCard masterStrike4 = new DefeatableCard(0, 0, "MasterStrike"); VillainDeck.Add(masterStrike4); DefeatableCard masterStrike5 = new DefeatableCard(0, 0, "MasterStrike"); VillainDeck.Add(masterStrike5); //Add 2 Bystander Cards DefeatableCard bystander1 = new DefeatableCard(1, 0, "Bystander"); VillainDeck.Add(bystander1); DefeatableCard bystander2 = new DefeatableCard(1, 0, "Bystander"); VillainDeck.Add(bystander2); //Add the Villain Group to the VillainDeck if (villainGroup1.Equals("EOA") || villainGroup2.Equals("EOA")) { DefeatableCard EOA_D1 = new DefeatableCard(5, 7, "EOA_D"); VillainDeck.Add(EOA_D1); DefeatableCard EOA_D2 = new DefeatableCard(5, 7, "EOA_D"); VillainDeck.Add(EOA_D2); DefeatableCard EOA_E1 = new DefeatableCard(4, 6, "EOA_E"); VillainDeck.Add(EOA_E1); DefeatableCard EOA_E2 = new DefeatableCard(4, 6, "EOA_E"); VillainDeck.Add(EOA_E2); DefeatableCard EOA_FG1 = new DefeatableCard(2, 4, "EOA_FG"); VillainDeck.Add(EOA_FG1); DefeatableCard EOA_FG2 = new DefeatableCard(2, 4, "EOA_FG"); VillainDeck.Add(EOA_FG2); DefeatableCard EOA_YFGK1 = new DefeatableCard(4, 6, "EOA_YFGK"); VillainDeck.Add(EOA_YFGK1); DefeatableCard EOA_YFGK2 = new DefeatableCard(4, 6, "EOA_YFGK"); VillainDeck.Add(EOA_YFGK2); } if (villainGroup1.Equals("SF") || villainGroup2.Equals("SF")) { DefeatableCard SF_DO1 = new DefeatableCard(2, 4, "SF_DO"); VillainDeck.Add(SF_DO1); DefeatableCard SF_DO2 = new DefeatableCard(2, 4, "SF_DO"); VillainDeck.Add(SF_DO2); DefeatableCard SF_GG1 = new DefeatableCard(4, 6, "SF_GG"); VillainDeck.Add(SF_GG1); DefeatableCard SF_GG2 = new DefeatableCard(4, 6, "SF_GG"); VillainDeck.Add(SF_GG2); DefeatableCard SF_TL1 = new DefeatableCard(2, 3, "SF_TL"); VillainDeck.Add(SF_TL1); DefeatableCard SF_TL2 = new DefeatableCard(2, 3, "SF_TL"); VillainDeck.Add(SF_TL2); DefeatableCard SF_V1 = new DefeatableCard(3, 5, "SF_V"); VillainDeck.Add(SF_V1); DefeatableCard SF_V2 = new DefeatableCard(3, 5, "SF_V"); VillainDeck.Add(SF_V2); } //add Henchmen Group(s) to the VillainDeck if (hench1.Equals("HN")) { DefeatableCard HN1 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN1); DefeatableCard HN2 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN2); DefeatableCard HN3 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN3); DefeatableCard HN4 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN4); DefeatableCard HN5 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN5); DefeatableCard HN6 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN6); DefeatableCard HN7 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN7); DefeatableCard HN8 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN8); DefeatableCard HN9 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN9); DefeatableCard HN10 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN10); } if (hench1.Equals("SLM")) { DefeatableCard SLM1 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM1); DefeatableCard SLM2 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM2); DefeatableCard SLM3 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM3); DefeatableCard SLM4 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM4); DefeatableCard SLM5 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM5); DefeatableCard SLM6 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM6); DefeatableCard SLM7 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM7); DefeatableCard SLM8 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM8); DefeatableCard SLM9 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM9); DefeatableCard SLM10 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM10); } if (hench1.Equals("S")) { DefeatableCard S1 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S1); DefeatableCard S2 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S2); DefeatableCard S3 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S3); DefeatableCard S4 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S4); DefeatableCard S5 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S5); DefeatableCard S6 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S6); DefeatableCard S7 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S7); DefeatableCard S8 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S8); DefeatableCard S9 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S9); DefeatableCard S10 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S10); } if (hench1.Equals("DL")) { DefeatableCard DL1 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL1); DefeatableCard DL2 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL2); DefeatableCard DL3 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL3); DefeatableCard DL4 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL4); DefeatableCard DL5 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL5); DefeatableCard DL6 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL6); DefeatableCard DL7 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL7); DefeatableCard DL8 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL8); DefeatableCard DL9 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL9); DefeatableCard DL10 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL10); } //Scheme NZPB Requires a second Henchmen Group if (scheme.getName().Equals("NZPB")) { Random rand = new Random(); int r = rand.Next(0, 3); while (r < 5) { if (r == 0 && !hench1.Equals("HN")) { DefeatableCard HN1 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN1); DefeatableCard HN2 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN2); DefeatableCard HN3 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN3); DefeatableCard HN4 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN4); DefeatableCard HN5 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN5); DefeatableCard HN6 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN6); DefeatableCard HN7 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN7); DefeatableCard HN8 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN8); DefeatableCard HN9 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN9); DefeatableCard HN10 = new DefeatableCard(1, 3, "HN"); VillainDeck.Add(HN10); r = 5; } else if (r == 1 && !hench1.Equals("SLM")) { DefeatableCard SLM1 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM1); DefeatableCard SLM2 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM2); DefeatableCard SLM3 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM3); DefeatableCard SLM4 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM4); DefeatableCard SLM5 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM5); DefeatableCard SLM6 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM6); DefeatableCard SLM7 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM7); DefeatableCard SLM8 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM8); DefeatableCard SLM9 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM9); DefeatableCard SLM10 = new DefeatableCard(1, 3, "SLM"); VillainDeck.Add(SLM10); r = 5; } else if (r == 2 && !hench1.Equals("S")) { DefeatableCard S1 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S1); DefeatableCard S2 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S2); DefeatableCard S3 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S3); DefeatableCard S4 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S4); DefeatableCard S5 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S5); DefeatableCard S6 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S6); DefeatableCard S7 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S7); DefeatableCard S8 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S8); DefeatableCard S9 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S9); DefeatableCard S10 = new DefeatableCard(1, 3, "S"); VillainDeck.Add(S10); r = 5; } else if (r == 3 && !hench1.Equals("DL")) { DefeatableCard DL1 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL1); DefeatableCard DL2 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL2); DefeatableCard DL3 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL3); DefeatableCard DL4 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL4); DefeatableCard DL5 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL5); DefeatableCard DL6 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL6); DefeatableCard DL7 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL7); DefeatableCard DL8 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL8); DefeatableCard DL9 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL9); DefeatableCard DL10 = new DefeatableCard(1, 3, "DL"); VillainDeck.Add(DL10); r = 5; } } } //Make Villain Deck Visible on Board pictureBox_VillainDeck.Visible = true; }