Advertisement
Guest User

Untitled

a guest
Oct 12th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class FormCharacterCreation
  2. {
  3.     private int UpdateValues()
  4.     {
  5.         StrenghtValue.Text = PlayerStrenght;
  6.         DexterityValue.Text = PlayerDexterity;
  7.         ConstitutionValue.Text = PlayerConstitution;
  8.         IntelligenceValue.Text = PlayerIntelligence;
  9.         WisdomValue.Text = PlayerWisdom;
  10.         CharismaValue.Text = PlayerCharisma;
  11.         StatPointsValue.Text = PlayerStatPoints;
  12.     }
  13.  
  14.     private int DistributePoints(string Type, string Amount)
  15.     {
  16.         if ((Amount == "Decrease"))
  17.         {
  18.             if ((Type == "Strenght"))
  19.             {
  20.                 if ((PlayerStrenght >= 9))
  21.                 {
  22.                     PlayerStatPoints = PlayerStatPoints + 1;
  23.                     PlayerStrenght = PlayerStrenght - 1;
  24.                     UpdateValues();
  25.                 }
  26.             }
  27.             else if ((Type == "Dexterity"))
  28.             {
  29.                 if ((PlayerDexterity >= 9))
  30.                 {
  31.                     PlayerStatPoints = PlayerStatPoints + 1;
  32.                     PlayerDexterity = PlayerDexterity - 1;
  33.                     UpdateValues();
  34.                 }
  35.             }
  36.             else if ((Type == "Constitution"))
  37.             {
  38.                 if ((PlayerConstitution >= 9))
  39.                 {
  40.                     PlayerStatPoints = PlayerStatPoints + 1;
  41.                     PlayerConstitution = PlayerConstitution - 1;
  42.                     UpdateValues();
  43.                 }
  44.             }
  45.             else if ((Type == "Intelligence"))
  46.             {
  47.                 if ((PlayerIntelligence >= 9))
  48.                 {
  49.                     PlayerStatPoints = PlayerStatPoints + 1;
  50.                     PlayerIntelligence = PlayerIntelligence - 1;
  51.                     UpdateValues();
  52.                 }
  53.             }
  54.             else if ((Type == "Wisdom"))
  55.             {
  56.                 if ((PlayerWisdom >= 9))
  57.                 {
  58.                     PlayerStatPoints = PlayerStatPoints + 1;
  59.                     PlayerWisdom = PlayerWisdom - 1;
  60.                     UpdateValues();
  61.                 }
  62.             }
  63.             else if ((Type == "Charisma"))
  64.             {
  65.                 if ((PlayerCharisma >= 9))
  66.                 {
  67.                     PlayerStatPoints = PlayerStatPoints + 1;
  68.                     PlayerCharisma = PlayerCharisma - 1;
  69.                     UpdateValues();
  70.                 }
  71.             }
  72.         }
  73.         else if ((Amount == "Increase"))
  74.         {
  75.             if ((Type == "Strenght"))
  76.             {
  77.                 if ((PlayerStatPoints >= 1) & (PlayerStrenght < 18))
  78.                 {
  79.                     PlayerStatPoints = PlayerStatPoints - 1;
  80.                     PlayerStrenght = PlayerStrenght + 1;
  81.                     UpdateValues();
  82.                 }
  83.             }
  84.             else if ((Type == "Dexterity"))
  85.             {
  86.                 if ((PlayerStatPoints >= 1) & (PlayerDexterity < 18))
  87.                 {
  88.                     PlayerStatPoints = PlayerStatPoints - 1;
  89.                     PlayerDexterity = PlayerDexterity + 1;
  90.                     UpdateValues();
  91.                 }
  92.             }
  93.             else if ((Type == "Constitution"))
  94.             {
  95.                 if ((PlayerStatPoints >= 1) & (PlayerConstitution < 18))
  96.                 {
  97.                     PlayerStatPoints = PlayerStatPoints - 1;
  98.                     PlayerConstitution = PlayerConstitution + 1;
  99.                     UpdateValues();
  100.                 }
  101.             }
  102.             else if ((Type == "Intelligence"))
  103.             {
  104.                 if ((PlayerStatPoints >= 1) & (PlayerIntelligence < 18))
  105.                 {
  106.                     PlayerStatPoints = PlayerStatPoints - 1;
  107.                     PlayerIntelligence = PlayerIntelligence + 1;
  108.                     UpdateValues();
  109.                 }
  110.             }
  111.             else if ((Type == "Wisdom"))
  112.             {
  113.                 if ((PlayerStatPoints >= 1) & (PlayerWisdom < 18))
  114.                 {
  115.                     PlayerStatPoints = PlayerStatPoints - 1;
  116.                     PlayerWisdom = PlayerWisdom + 1;
  117.                     UpdateValues();
  118.                 }
  119.             }
  120.             else if ((Type == "Charisma"))
  121.             {
  122.                 if ((PlayerStatPoints >= 1) & (PlayerCharisma < 18))
  123.                 {
  124.                     PlayerStatPoints = PlayerStatPoints - 1;
  125.                     PlayerCharisma = PlayerCharisma + 1;
  126.                     UpdateValues();
  127.                 }
  128.             }
  129.         }
  130.     }
  131.  
  132.     private void ButtonConfirmName_Click(System.Object sender, System.EventArgs e)
  133.     {
  134.         PlayerName = BoxInsertName.Text;
  135.         LabelName.Text = PlayerName;
  136.         BoxInsertName.Visible = false;
  137.         ButtonConfirmName.Visible = false;
  138.     }
  139.  
  140.     private void ButtonDecreaseStrenght_Click(System.Object sender, System.EventArgs e)
  141.     {
  142.         DistributePoints("Strenght", "Decrease");
  143.     }
  144.  
  145.  
  146.     private void ButtonIncreaseStrenght_Click(System.Object sender, System.EventArgs e)
  147.     {
  148.         DistributePoints("Strenght", "Increase");
  149.     }
  150.  
  151.     private void ButtonDecreaseDexterity_Click(System.Object sender, System.EventArgs e)
  152.     {
  153.         DistributePoints("Dexterity", "Decrease");
  154.     }
  155.  
  156.     private void ButtonIncreaseDexterity_Click(System.Object sender, System.EventArgs e)
  157.     {
  158.         DistributePoints("Dexterity", "Increase");
  159.     }
  160.  
  161.     private void ButtonDecreaseConstitution_Click(System.Object sender, System.EventArgs e)
  162.     {
  163.         DistributePoints("Constitution", "Decrease");
  164.     }
  165.  
  166.     private void ButtonIncreaseConstitution_Click(System.Object sender, System.EventArgs e)
  167.     {
  168.         DistributePoints("Constitution", "Increase");
  169.     }
  170.  
  171.     private void ButtonDecreaseIntelligence_Click(System.Object sender, System.EventArgs e)
  172.     {
  173.         DistributePoints("Intelligence", "Decrease");
  174.     }
  175.  
  176.     private void ButtonIncreaseIntelligence_Click(System.Object sender, System.EventArgs e)
  177.     {
  178.         DistributePoints("Intelligence", "Increase");
  179.     }
  180.  
  181.     private void ButtonDecreaseWisdom_Click(System.Object sender, System.EventArgs e)
  182.     {
  183.         DistributePoints("Wisdom", "Decrease");
  184.     }
  185.  
  186.     private void ButtonIncreaseWisdom_Click(System.Object sender, System.EventArgs e)
  187.     {
  188.         DistributePoints("Wisdom", "Increase");
  189.     }
  190.  
  191.     private void ButtonDecreaseCharisma_Click(System.Object sender, System.EventArgs e)
  192.     {
  193.         DistributePoints("Charisma", "Decrease");
  194.     }
  195.  
  196.     private void ButtonIncreaseCharisma_Click(System.Object sender, System.EventArgs e)
  197.     {
  198.         DistributePoints("Charisma", "Increase");
  199.     }
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement