Example #1
0
 private void bt_HD_Click(object sender, EventArgs e)
 {
     if (nud_CurrHD.Value > 0)
     {
         nud_CurrHD.Value = nud_CurrHD.Value - 1;
         DataAccess db   = new DataAccess();
         int        dice = db.GDice(cb_charclass.SelectedItem.ToString());
         nud_HPCURR.Value += Pocitani.MyRandom(1, dice + 1) + Convert.ToInt32(lb_modif_con.Text);
         return;
     }
     else
     {
         MessageBox.Show("Nedostatek Hit dice!", "Chyba", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         return;
     }
 }
Example #2
0
 private void bt_DS_Click(object sender, EventArgs e)
 {
     if (nud_HPCURR.Value == 0)      //Jen kdyz hp sou down
     {
         if (Pocitani.Roll20() < 10) // DS fail
         {
             if (chb_fail1.Checked == false)
             {
                 chb_fail1.Checked = true;
                 return;
             }
             if (chb_fail1.Checked == true && chb_fail2.Checked == false)
             {
                 chb_fail2.Checked = true;
                 return;
             }
             if (chb_fail1.Checked == true && chb_fail2.Checked == true && chb_fail3.Checked == false)
             {
                 chb_fail3.Checked = true;
                 return;
             }
         }
         if (Pocitani.Roll20() > 10 && Pocitani.Roll20() < 20) //DS succ
         {
             if (chb_succ1.Checked == false)
             {
                 chb_succ1.Checked = true;
                 return;
             }
             if (chb_succ1.Checked == true && chb_succ2.Checked == false)
             {
                 chb_succ2.Checked = true;
                 return;
             }
             if (chb_succ1.Checked == true && chb_succ2.Checked == true && chb_succ3.Checked == false)
             {
                 chb_succ3.Checked = true;
                 return;
             }
         }
         if (Pocitani.Roll20() == 20) //DS s NAT 20
         {
             nud_HPCURR.Value = 1;
         }
     }
 }
Example #3
0
 private void b_lvlup_Click(object sender, EventArgs e)
 {
     try
     {
         if (nud_lvl.Value != 20)
         {
             int dice = ClassDice();
             nud_MAXHP.Value += Pocitani.MyRandom(1, dice + 1) + Convert.ToInt32(lb_modif_con.Text);
             nud_lvl.Value++;
         }
         else
         {
             throw new Exception("Již dosáhnut MAX level!");
         }
     }
     catch
     {
         MessageBox.Show("Vyber class nez budes davat LEVEL", "Neni Class");
     }
 }
Example #4
0
 private void b_CHAR_Click(object sender, EventArgs e)
 {
     tb_final.Text = (Pocitani.Roll20() + Convert.ToInt32(lb_modif_cha.Text)).ToString();
 }
Example #5
0
 private void b_INT_Click(object sender, EventArgs e)
 {
     tb_final.Text = (Convert.ToInt32(lb_modif_wis.Text) + Pocitani.Roll20()).ToString();
 }