public void SetStats(OCStats stats) { characterName = stats.characterName; archetype = stats.archetype; STR = stats.STR; INT = stats.INT; CHA = stats.CHA; portrait = stats.portrait; image.sprite = portrait; nameText.text = characterName; statText.text = "S-" + STR.ToString() + " I-" + INT.ToString() + " C-" + CHA.ToString(); }
private void txtCHA_TextChanged(object sender, EventArgs e) { int CHA; if (int.TryParse(txtCHA.Text, out CHA)) { CHA = SetStatMod(CHA); if (CHA <= 0) { lblCHA.Text = CHA.ToString("0"); } else { lblCHA.Text = "+" + CHA.ToString("0"); } } }
private void SetCHA() { int CHA; if (int.TryParse(txtCHA.Text, out CHA)) { NewMonster.CHA = CHA; CHA = SetStatMod(CHA); if (CHA <= 0) { lblCHA.Text = CHA.ToString("0"); } else { lblCHA.Text = "+" + CHA.ToString("0"); } } else if (txtCHA.Text != "") { MessageBox.Show("only numbers for CHA please"); } }
private void rollAllButton_Click(object sender, EventArgs e) { HP = rng.Next(1, 21) + 10; hpValue.Text = HP.ToString(); STR = rng.Next(1, 21); strValue.Text = STR.ToString(); DEX = rng.Next(1, 21); dexValue.Text = DEX.ToString(); CON = rng.Next(1, 21); conValue.Text = CON.ToString(); INT = rng.Next(1, 21); intValue.Text = INT.ToString(); WIS = rng.Next(1, 21); wisValue.Text = WIS.ToString(); CHA = rng.Next(1, 21); chaValue.Text = CHA.ToString(); }
private void chaRollButton_Click(object sender, EventArgs e) { CHA = rng.Next(1, 21); chaValue.Text = CHA.ToString(); }