Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FormCharacterCreation
- {
- private int UpdateValues()
- {
- StrenghtValue.Text = PlayerStrenght;
- DexterityValue.Text = PlayerDexterity;
- ConstitutionValue.Text = PlayerConstitution;
- IntelligenceValue.Text = PlayerIntelligence;
- WisdomValue.Text = PlayerWisdom;
- CharismaValue.Text = PlayerCharisma;
- StatPointsValue.Text = PlayerStatPoints;
- }
- private int DistributePoints(string Type, string Amount)
- {
- if ((Amount == "Decrease"))
- {
- if ((Type == "Strenght"))
- {
- if ((PlayerStrenght >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerStrenght = PlayerStrenght - 1;
- UpdateValues();
- }
- }
- else if ((Type == "Dexterity"))
- {
- if ((PlayerDexterity >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerDexterity = PlayerDexterity - 1;
- UpdateValues();
- }
- }
- else if ((Type == "Constitution"))
- {
- if ((PlayerConstitution >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerConstitution = PlayerConstitution - 1;
- UpdateValues();
- }
- }
- else if ((Type == "Intelligence"))
- {
- if ((PlayerIntelligence >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerIntelligence = PlayerIntelligence - 1;
- UpdateValues();
- }
- }
- else if ((Type == "Wisdom"))
- {
- if ((PlayerWisdom >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerWisdom = PlayerWisdom - 1;
- UpdateValues();
- }
- }
- else if ((Type == "Charisma"))
- {
- if ((PlayerCharisma >= 9))
- {
- PlayerStatPoints = PlayerStatPoints + 1;
- PlayerCharisma = PlayerCharisma - 1;
- UpdateValues();
- }
- }
- }
- else if ((Amount == "Increase"))
- {
- if ((Type == "Strenght"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerStrenght < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerStrenght = PlayerStrenght + 1;
- UpdateValues();
- }
- }
- else if ((Type == "Dexterity"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerDexterity < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerDexterity = PlayerDexterity + 1;
- UpdateValues();
- }
- }
- else if ((Type == "Constitution"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerConstitution < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerConstitution = PlayerConstitution + 1;
- UpdateValues();
- }
- }
- else if ((Type == "Intelligence"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerIntelligence < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerIntelligence = PlayerIntelligence + 1;
- UpdateValues();
- }
- }
- else if ((Type == "Wisdom"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerWisdom < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerWisdom = PlayerWisdom + 1;
- UpdateValues();
- }
- }
- else if ((Type == "Charisma"))
- {
- if ((PlayerStatPoints >= 1) & (PlayerCharisma < 18))
- {
- PlayerStatPoints = PlayerStatPoints - 1;
- PlayerCharisma = PlayerCharisma + 1;
- UpdateValues();
- }
- }
- }
- }
- private void ButtonConfirmName_Click(System.Object sender, System.EventArgs e)
- {
- PlayerName = BoxInsertName.Text;
- LabelName.Text = PlayerName;
- BoxInsertName.Visible = false;
- ButtonConfirmName.Visible = false;
- }
- private void ButtonDecreaseStrenght_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Strenght", "Decrease");
- }
- private void ButtonIncreaseStrenght_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Strenght", "Increase");
- }
- private void ButtonDecreaseDexterity_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Dexterity", "Decrease");
- }
- private void ButtonIncreaseDexterity_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Dexterity", "Increase");
- }
- private void ButtonDecreaseConstitution_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Constitution", "Decrease");
- }
- private void ButtonIncreaseConstitution_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Constitution", "Increase");
- }
- private void ButtonDecreaseIntelligence_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Intelligence", "Decrease");
- }
- private void ButtonIncreaseIntelligence_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Intelligence", "Increase");
- }
- private void ButtonDecreaseWisdom_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Wisdom", "Decrease");
- }
- private void ButtonIncreaseWisdom_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Wisdom", "Increase");
- }
- private void ButtonDecreaseCharisma_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Charisma", "Decrease");
- }
- private void ButtonIncreaseCharisma_Click(System.Object sender, System.EventArgs e)
- {
- DistributePoints("Charisma", "Increase");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement