Advertisement
Razelda

D&D C_maker

Mar 4th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Razeldas_D_and_D_C_Builder
  8. {
  9.     class Program
  10.     {
  11.  
  12.         static int STR;
  13.         static int DEX;
  14.         static int CON;
  15.         static int INT;
  16.         static int WIS;
  17.         static int CHA;
  18.         static int STRmod;
  19.         static int DEXmod;
  20.         static int CONmod;
  21.         static int INTmod;
  22.         static int WISmod;
  23.         static int CHAmod;
  24.         static int clvl2;
  25.         static string chclass;
  26.         static string cname;
  27.         static string crace;
  28.  
  29.  
  30.         static void Main(string[] args)
  31.         {
  32.             Console.ForegroundColor = ConsoleColor.Green;
  33.             intro_image();
  34.             Console.WriteLine();
  35.             Console.WriteLine();
  36.             Console.WriteLine(" What would you like to name your Charactor? :");
  37.             Console.WriteLine();
  38.             cname = Console.ReadLine();
  39.            
  40.             Console.WriteLine();
  41.             Console.WriteLine();
  42.             Console.WriteLine(" What is the Race of this Charactor? :");
  43.             Console.WriteLine();
  44.             crace = Console.ReadLine();
  45.  
  46.             Random rnd = new Random();
  47.             STR = rnd.Next(1, 21);
  48.             DEX = rnd.Next(1, 21);
  49.             CON = rnd.Next(1, 21);
  50.             INT = rnd.Next(1, 21);
  51.             WIS = rnd.Next(1, 21);
  52.             CHA = rnd.Next(1, 21);
  53.  
  54.             clevel(STR, out STR,DEX,out DEX,CON,out CON,INT,out INT,WIS,out WIS,CHA,out CHA,out clvl2);
  55.  
  56.             Ch_Class();
  57.  
  58.             output();
  59.  
  60.         }
  61.  
  62.         static void clevel(int STR1, out int STR, int DEX1, out int DEX, int CON1, out int CON, int INT1, out int INT, int WIS1, out int WIS,int CHA1,out int CHA,out int clvl2)
  63.         {
  64.             int rp = 0;
  65.             do
  66.             {
  67.                 String clvl1 = "1";
  68.                 Console.WriteLine(" What Level is this Character starting out at? (defalt 1)");
  69.                 Console.WriteLine();
  70.                 clvl1 = Console.ReadLine();
  71.                 clvl2 = 1;
  72.                 try
  73.                 {
  74.                     clvl2 = Convert.ToInt32(clvl1);
  75.                 }
  76.                 catch (FormatException e)
  77.                 {
  78.                     Console.WriteLine();
  79.                 }
  80.                 catch (OverflowException e)
  81.                 {
  82.                     Console.WriteLine();
  83.                 }
  84.                
  85.  
  86.                 if (clvl2 > 20)
  87.                 {
  88.                     rp = +1;
  89.                     Console.WriteLine(" D&D levels do not go higher then 20");
  90.                     STR = STR1;
  91.                     DEX = DEX1;
  92.                     CON = CON1;
  93.                     INT = INT1;
  94.                     WIS = WIS1;
  95.                     CHA = CHA1;
  96.                     clvl2 = 1;
  97.                 }
  98.                 else if (clvl2 > 1 )
  99.                 {
  100.                     rp = +1;
  101.                     STR = STR1 + clvl2;
  102.                     DEX = DEX1 + clvl2;
  103.                     CON = CON1 + clvl2;
  104.                     INT = INT1 + clvl2;
  105.                     WIS = WIS1 + clvl2;
  106.                     CHA = CHA1 + clvl2;
  107.                 }
  108.                 else
  109.                 {
  110.                     rp = +1;
  111.                     STR = STR1;
  112.                     DEX = DEX1;
  113.                     CON = CON1;
  114.                     INT = INT1;
  115.                     WIS = WIS1;
  116.                     CHA = CHA1;
  117.                 }
  118.  
  119.              } while(rp < 0);
  120.                
  121.  
  122.  
  123.         }
  124.  
  125.         static void Ch_Class()
  126.         {
  127.             Console.WriteLine();
  128.             Console.WriteLine(" Select a Class Type:");
  129.             Console.WriteLine(" A: Warror");
  130.             Console.WriteLine(" B: Wizard");
  131.             Console.WriteLine(" C: Bard");
  132.             int selection = 0;
  133.             selection = (int)Console.ReadKey().Key;
  134.  
  135.            
  136.             if (selection == 65) //a Selected
  137.             {
  138.                 STRmod = 0 + 2;
  139.                 DEXmod = 0 + 2;
  140.                 CONmod = 0 + 1;
  141.                 INTmod = 0 - 3;
  142.                 WISmod = 0 - 2;
  143.                 CHAmod = 0 - 4;
  144.                 chclass = "Warror";
  145.             }
  146.             else if (selection == 66) // b Selected
  147.             {
  148.                 STRmod = 0 - 2;
  149.                 DEXmod = 0 - 2;
  150.                 CONmod = 0 - 1;
  151.                 INTmod = 0 + 4;
  152.                 WISmod = 0 + 2;
  153.                 CHAmod = 0 - 4;
  154.                 chclass = "Wizard";
  155.             }
  156.             else if (selection == 67) // c Selected
  157.             {
  158.                 STRmod = 0 - 2;
  159.                 DEXmod = 0 - 2;
  160.                 CONmod = 0 + 1;
  161.                 INTmod = 0 + 1;
  162.                 WISmod = 0 + 3;
  163.                 CHAmod = 0 + 2;
  164.                 chclass = "Bard";
  165.             }
  166.             else
  167.             {
  168.                 STRmod = 0;
  169.                 DEXmod = 0;
  170.                 CONmod = 0;
  171.                 INTmod = 0;
  172.                 WISmod = 0;
  173.                 CHAmod = 0;
  174.                 chclass = "None";
  175.             }
  176.  
  177.             Console.WriteLine(Environment.NewLine);
  178.  
  179.  
  180.  
  181.         }
  182.  
  183.         static void output()
  184.         {
  185.             Console.Clear();
  186.  
  187.             string STR2 = STR.ToString("00");
  188.             string DEX2 = DEX.ToString("00");
  189.             string CON2 = CON.ToString("00");
  190.             string INT2 = INT.ToString("00");
  191.             string WIS2 = WIS.ToString("00");
  192.             string CHA2 = CHA.ToString("00");
  193.  
  194.             int TSTR = STR + STRmod;
  195.             int TDEX = DEX + DEXmod;
  196.             int TCON = CON + CONmod;
  197.             int TINT = INT + INTmod;
  198.             int TWIS = WIS + WISmod;
  199.             int TCHA = CHA + CHAmod;
  200.  
  201.             string TSTR2 = TSTR.ToString("00");
  202.             string TDEX2 = TDEX.ToString("00");
  203.             string TCON2 = TCON.ToString("00");
  204.             string TINT2 = TINT.ToString("00");
  205.             string TWIS2 = TWIS.ToString("00");
  206.             string TCHA2 = TCHA.ToString("00");
  207.  
  208.             String STRmod2;
  209.             STR_PosNeg(STRmod, out STRmod2);
  210.  
  211.             String DEXmod2;
  212.             STR_PosNeg(DEXmod, out DEXmod2);
  213.  
  214.             String CONmod2;
  215.             STR_PosNeg(CONmod, out CONmod2);
  216.  
  217.             String INTmod2;
  218.             STR_PosNeg(INTmod, out INTmod2);
  219.  
  220.             String WISmod2;
  221.             STR_PosNeg(WISmod, out WISmod2);
  222.  
  223.             String CHAmod2;
  224.             STR_PosNeg(CHAmod, out CHAmod2);
  225.  
  226.             Console.WriteLine();
  227.             Console.WriteLine(" Character Name: {0}", cname);
  228.             Console.WriteLine(" Level: {0}", clvl2);
  229.             Console.WriteLine(" Race: {0}", crace);
  230.             Console.WriteLine(" Class: {0}", chclass);
  231.             Console.WriteLine();
  232.             Console.WriteLine(" ***************************************");
  233.             Console.WriteLine(" ***************************************");
  234.             Console.WriteLine(" ** Ability Name          | MOD | New **");
  235.             Console.WriteLine(" ***************************************");
  236.             Console.WriteLine(" ** Strength        =  {0} |  {1} |  {2} **", STR2,STRmod2,TSTR2);
  237.             Console.WriteLine(" ** Dexterity       =  {0} |  {1} |  {2} **", DEX2,DEXmod2,TDEX2);
  238.             Console.WriteLine(" ** Constitution    =  {0} |  {1} |  {2} **", CON2,CONmod2,TCON2);
  239.             Console.WriteLine(" ** Intelligence    =  {0} |  {1} |  {2} **", INT2,INTmod2,TINT2);
  240.             Console.WriteLine(" ** Wisdom          =  {0} |  {1} |  {2} **", WIS2,WISmod2,TWIS2);
  241.             Console.WriteLine(" ** Charisma        =  {0} |  {1} |  {2} **", CHA2,CHAmod2,TCHA2);
  242.             Console.WriteLine(" ***************************************");
  243.             Console.WriteLine(" ***************************************");
  244.             Console.WriteLine();
  245.             Console.WriteLine(" Press ENTER to close.");
  246.             string quit1 = Console.ReadLine();
  247.         }
  248.  
  249.         static void STR_PosNeg(int STRmod, out String STRmod2)
  250.         {
  251.             if (STRmod > 0)
  252.             {
  253.                 STRmod2 = STRmod.ToString("+0");
  254.             }
  255.             else
  256.             {
  257.                 STRmod2 = STRmod.ToString();
  258.             }
  259.         }
  260.  
  261.         static void DEX_PosNeg(int DEXmod, out String DEXmod2)
  262.         {
  263.             if (DEXmod > 0)
  264.             {
  265.                 DEXmod2 = DEXmod.ToString("+0");
  266.             }
  267.             else
  268.             {
  269.                 DEXmod2 = DEXmod.ToString();
  270.             }
  271.         }
  272.  
  273.         static void CON_PosNeg(int CONmod, out String CONmod2)
  274.         {
  275.             if (CONmod > 0)
  276.             {
  277.                 CONmod2 = CONmod.ToString("+0");
  278.             }
  279.             else
  280.             {
  281.                 CONmod2 = CONmod.ToString();
  282.             }
  283.         }
  284.  
  285.         static void INT_PosNeg(int INTmod, out String INTmod2)
  286.         {
  287.             if (INTmod > 0)
  288.             {
  289.                 INTmod2 = INTmod.ToString("+0");
  290.             }
  291.             else
  292.             {
  293.                 INTmod2 = INTmod.ToString();
  294.             }
  295.         }
  296.  
  297.         static void WIS_PosNeg(int WISmod, out String WISmod2)
  298.         {
  299.             if (WISmod > 0)
  300.             {
  301.                 WISmod2 = WISmod.ToString("+0");
  302.             }
  303.             else
  304.             {
  305.                 WISmod2 = WISmod.ToString();
  306.             }
  307.         }
  308.  
  309.         static void CHA_PosNeg(int CHAmod, out String CHAmod2)
  310.         {
  311.             if (CHAmod > 0)
  312.             {
  313.                 CHAmod2 = CHAmod.ToString("+0");
  314.             }
  315.             else
  316.             {
  317.                 CHAmod2 = CHAmod.ToString();
  318.             }
  319.         }
  320.  
  321.         static void intro_image()
  322.         {
  323.             Console.WriteLine(" *****************************************");
  324.             Console.WriteLine(" *****************************************");
  325.             Console.WriteLine(" **  :::::::::   :::::::     :::::::::  **");
  326.             Console.WriteLine(" **  :+:    :+: :+:   :+:    :+:    :+: **");
  327.             Console.WriteLine(" **  +:+    +:+  +:+ +:+     +:+    +:+ **");
  328.             Console.WriteLine(" **  +#+    +:+   +#++:  ++# +#+    +:+ **");
  329.             Console.WriteLine(" **  +#+    +#+  +#+ +#+#+#  +#+    +#+ **");
  330.             Console.WriteLine(" **  #+#    #+# #+#   #+#+   #+#    #+# **");
  331.             Console.WriteLine(" **  #########   ##########  #########  **");
  332.             Console.WriteLine(" *****************************************");
  333.             Console.WriteLine(" *****************************************");
  334.         }
  335.  
  336.         }
  337. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement