// get all the values that previously added private void FinalForm_Load(object sender, EventArgs e) { STR_textBox.Text = AbilityForm.getSTR().ToString(); DEX_textBox.Text = AbilityForm.getDEX().ToString(); END_textBox.Text = AbilityForm.getEND().ToString(); INT_textBox.Text = AbilityForm.getINT().ToString(); PER_textBox.Text = AbilityForm.getPER().ToString(); CHA_textBox.Text = AbilityForm.getCHA().ToString(); job_textBox.Text = JobForm.getJob(); race_textBox.Text = RaceForm.getRace(); health_textBox.Text = JobForm.getHealthPoints().ToString(); if (race_textBox.Text.Equals("Human")) { race_pictureBox.Image = human; } else if (race_textBox.Text.Equals("Dwarf")) { race_pictureBox.Image = dwarf; } else if (race_textBox.Text.Equals("Elf")) { race_pictureBox.Image = elf; } else { race_pictureBox.Image = halfling; } }
// when the elf radio button is clicked private void elf_radioButton_CheckedChanged(object sender, EventArgs e) { setRace("Elf"); racialBonus_textBox.Text = " DEX and CHA increased by 15 pts."; race_pictureBox.Image = elf; AbilityForm.setDEX(AbilityForm.getDEX() + 15); AbilityForm.setCHA(AbilityForm.getCHA() + 15); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AbilityForm af = new AbilityForm(); Application.Run(af); //Application.Run(new AbilityForm()); }
// when the human radio button is clicked private void human_radioButton_CheckedChanged(object sender, EventArgs e) { setRace("Human"); racialBonus_textBox.Text = "All of your abilities will be increased by 5 pts."; race_pictureBox.Image = human; AbilityForm.setSTR(AbilityForm.getSTR() + 5); AbilityForm.setDEX(AbilityForm.getDEX() + 5); AbilityForm.setEND(AbilityForm.getEND() + 5); AbilityForm.setINT(AbilityForm.getINT() + 5); AbilityForm.setPER(AbilityForm.getPER() + 5); AbilityForm.setCHA(AbilityForm.getCHA() + 5); }
// when the halfling radio button is clicked private void halfling_radioButton_CheckedChanged(object sender, EventArgs e) { setRace("Halfling"); racialBonus_textBox.Text = " DEX and INT increased by 20 pts,STR decreased by 10 pts"; race_pictureBox.Image = halfling; AbilityForm.setDEX(AbilityForm.getDEX() + 20); AbilityForm.setINT(AbilityForm.getINT() + 20); if (AbilityForm.getSTR() >= 13) { AbilityForm.setSTR(AbilityForm.getSTR() - 10); } else { AbilityForm.setSTR(3); } }
// when the dwarf radio button is clicked private void dwarf_radioButton_CheckedChanged(object sender, EventArgs e) { setRace("Dwarf"); racialBonus_textBox.Text = "STR and PER increased by 20 pts, CHA decreased by 10 pts."; race_pictureBox.Image = dwarf; AbilityForm.setSTR(AbilityForm.getSTR() + 20); AbilityForm.setPER(AbilityForm.getPER() + 20); if (AbilityForm.getCHA() >= 13) { AbilityForm.setCHA(AbilityForm.getCHA() - 10); } else { AbilityForm.setCHA(3); } }
// when the cultist radio button is clicked private void cultist_radioButton_CheckedChanged(object sender, EventArgs e) { health_label.Text = "Health Points: " + (24 + AbilityForm.getCHA()); setHealthPoints(24 + AbilityForm.getCHA()); setJob("Cultist"); }
// when the magicker radio button is clicked private void magicker_radioButton_CheckedChanged(object sender, EventArgs e) { health_label.Text = "Health Points: " + (15 + AbilityForm.getINT()); setHealthPoints(15 + AbilityForm.getINT()); setJob("Magicker"); }
// when the rogue radio button is clicked private void rogue_radioButton_CheckedChanged(object sender, EventArgs e) { health_label.Text = "Health Points: " + (28 + AbilityForm.getDEX()); setHealthPoints(28 + AbilityForm.getDEX()); setJob("Rogue"); }
// when the soldier radio button is clicked private void soldier_radioButton_CheckedChanged(object sender, EventArgs e) { health_label.Text = "Health Points: " + (30 + AbilityForm.getEND()); setHealthPoints(30 + AbilityForm.getEND()); setJob("Soldier"); }