Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Razeldas_D_and_D_C_Builder
- {
- class Program
- {
- static int STR;
- static int DEX;
- static int CON;
- static int INT;
- static int WIS;
- static int CHA;
- static int STRmod;
- static int DEXmod;
- static int CONmod;
- static int INTmod;
- static int WISmod;
- static int CHAmod;
- static int clvl2;
- static string chclass;
- static string cname;
- static string crace;
- static void Main(string[] args)
- {
- Console.ForegroundColor = ConsoleColor.Green;
- intro_image();
- Console.WriteLine();
- Console.WriteLine();
- Console.WriteLine(" What would you like to name your Charactor? :");
- Console.WriteLine();
- cname = Console.ReadLine();
- Console.WriteLine();
- Console.WriteLine();
- Console.WriteLine(" What is the Race of this Charactor? :");
- Console.WriteLine();
- crace = Console.ReadLine();
- Random rnd = new Random();
- STR = rnd.Next(1, 21);
- DEX = rnd.Next(1, 21);
- CON = rnd.Next(1, 21);
- INT = rnd.Next(1, 21);
- WIS = rnd.Next(1, 21);
- CHA = rnd.Next(1, 21);
- clevel(STR, out STR,DEX,out DEX,CON,out CON,INT,out INT,WIS,out WIS,CHA,out CHA,out clvl2);
- Ch_Class();
- output();
- }
- 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)
- {
- int rp = 0;
- do
- {
- String clvl1 = "1";
- Console.WriteLine(" What Level is this Character starting out at? (defalt 1)");
- Console.WriteLine();
- clvl1 = Console.ReadLine();
- clvl2 = 1;
- try
- {
- clvl2 = Convert.ToInt32(clvl1);
- }
- catch (FormatException e)
- {
- Console.WriteLine();
- }
- catch (OverflowException e)
- {
- Console.WriteLine();
- }
- if (clvl2 > 20)
- {
- rp = +1;
- Console.WriteLine(" D&D levels do not go higher then 20");
- STR = STR1;
- DEX = DEX1;
- CON = CON1;
- INT = INT1;
- WIS = WIS1;
- CHA = CHA1;
- clvl2 = 1;
- }
- else if (clvl2 > 1 )
- {
- rp = +1;
- STR = STR1 + clvl2;
- DEX = DEX1 + clvl2;
- CON = CON1 + clvl2;
- INT = INT1 + clvl2;
- WIS = WIS1 + clvl2;
- CHA = CHA1 + clvl2;
- }
- else
- {
- rp = +1;
- STR = STR1;
- DEX = DEX1;
- CON = CON1;
- INT = INT1;
- WIS = WIS1;
- CHA = CHA1;
- }
- } while(rp < 0);
- }
- static void Ch_Class()
- {
- Console.WriteLine();
- Console.WriteLine(" Select a Class Type:");
- Console.WriteLine(" A: Warror");
- Console.WriteLine(" B: Wizard");
- Console.WriteLine(" C: Bard");
- int selection = 0;
- selection = (int)Console.ReadKey().Key;
- if (selection == 65) //a Selected
- {
- STRmod = 0 + 2;
- DEXmod = 0 + 2;
- CONmod = 0 + 1;
- INTmod = 0 - 3;
- WISmod = 0 - 2;
- CHAmod = 0 - 4;
- chclass = "Warror";
- }
- else if (selection == 66) // b Selected
- {
- STRmod = 0 - 2;
- DEXmod = 0 - 2;
- CONmod = 0 - 1;
- INTmod = 0 + 4;
- WISmod = 0 + 2;
- CHAmod = 0 - 4;
- chclass = "Wizard";
- }
- else if (selection == 67) // c Selected
- {
- STRmod = 0 - 2;
- DEXmod = 0 - 2;
- CONmod = 0 + 1;
- INTmod = 0 + 1;
- WISmod = 0 + 3;
- CHAmod = 0 + 2;
- chclass = "Bard";
- }
- else
- {
- STRmod = 0;
- DEXmod = 0;
- CONmod = 0;
- INTmod = 0;
- WISmod = 0;
- CHAmod = 0;
- chclass = "None";
- }
- Console.WriteLine(Environment.NewLine);
- }
- static void output()
- {
- Console.Clear();
- string STR2 = STR.ToString("00");
- string DEX2 = DEX.ToString("00");
- string CON2 = CON.ToString("00");
- string INT2 = INT.ToString("00");
- string WIS2 = WIS.ToString("00");
- string CHA2 = CHA.ToString("00");
- int TSTR = STR + STRmod;
- int TDEX = DEX + DEXmod;
- int TCON = CON + CONmod;
- int TINT = INT + INTmod;
- int TWIS = WIS + WISmod;
- int TCHA = CHA + CHAmod;
- string TSTR2 = TSTR.ToString("00");
- string TDEX2 = TDEX.ToString("00");
- string TCON2 = TCON.ToString("00");
- string TINT2 = TINT.ToString("00");
- string TWIS2 = TWIS.ToString("00");
- string TCHA2 = TCHA.ToString("00");
- String STRmod2;
- STR_PosNeg(STRmod, out STRmod2);
- String DEXmod2;
- STR_PosNeg(DEXmod, out DEXmod2);
- String CONmod2;
- STR_PosNeg(CONmod, out CONmod2);
- String INTmod2;
- STR_PosNeg(INTmod, out INTmod2);
- String WISmod2;
- STR_PosNeg(WISmod, out WISmod2);
- String CHAmod2;
- STR_PosNeg(CHAmod, out CHAmod2);
- Console.WriteLine();
- Console.WriteLine(" Character Name: {0}", cname);
- Console.WriteLine(" Level: {0}", clvl2);
- Console.WriteLine(" Race: {0}", crace);
- Console.WriteLine(" Class: {0}", chclass);
- Console.WriteLine();
- Console.WriteLine(" ***************************************");
- Console.WriteLine(" ***************************************");
- Console.WriteLine(" ** Ability Name | MOD | New **");
- Console.WriteLine(" ***************************************");
- Console.WriteLine(" ** Strength = {0} | {1} | {2} **", STR2,STRmod2,TSTR2);
- Console.WriteLine(" ** Dexterity = {0} | {1} | {2} **", DEX2,DEXmod2,TDEX2);
- Console.WriteLine(" ** Constitution = {0} | {1} | {2} **", CON2,CONmod2,TCON2);
- Console.WriteLine(" ** Intelligence = {0} | {1} | {2} **", INT2,INTmod2,TINT2);
- Console.WriteLine(" ** Wisdom = {0} | {1} | {2} **", WIS2,WISmod2,TWIS2);
- Console.WriteLine(" ** Charisma = {0} | {1} | {2} **", CHA2,CHAmod2,TCHA2);
- Console.WriteLine(" ***************************************");
- Console.WriteLine(" ***************************************");
- Console.WriteLine();
- Console.WriteLine(" Press ENTER to close.");
- string quit1 = Console.ReadLine();
- }
- static void STR_PosNeg(int STRmod, out String STRmod2)
- {
- if (STRmod > 0)
- {
- STRmod2 = STRmod.ToString("+0");
- }
- else
- {
- STRmod2 = STRmod.ToString();
- }
- }
- static void DEX_PosNeg(int DEXmod, out String DEXmod2)
- {
- if (DEXmod > 0)
- {
- DEXmod2 = DEXmod.ToString("+0");
- }
- else
- {
- DEXmod2 = DEXmod.ToString();
- }
- }
- static void CON_PosNeg(int CONmod, out String CONmod2)
- {
- if (CONmod > 0)
- {
- CONmod2 = CONmod.ToString("+0");
- }
- else
- {
- CONmod2 = CONmod.ToString();
- }
- }
- static void INT_PosNeg(int INTmod, out String INTmod2)
- {
- if (INTmod > 0)
- {
- INTmod2 = INTmod.ToString("+0");
- }
- else
- {
- INTmod2 = INTmod.ToString();
- }
- }
- static void WIS_PosNeg(int WISmod, out String WISmod2)
- {
- if (WISmod > 0)
- {
- WISmod2 = WISmod.ToString("+0");
- }
- else
- {
- WISmod2 = WISmod.ToString();
- }
- }
- static void CHA_PosNeg(int CHAmod, out String CHAmod2)
- {
- if (CHAmod > 0)
- {
- CHAmod2 = CHAmod.ToString("+0");
- }
- else
- {
- CHAmod2 = CHAmod.ToString();
- }
- }
- static void intro_image()
- {
- Console.WriteLine(" *****************************************");
- Console.WriteLine(" *****************************************");
- Console.WriteLine(" ** ::::::::: ::::::: ::::::::: **");
- Console.WriteLine(" ** :+: :+: :+: :+: :+: :+: **");
- Console.WriteLine(" ** +:+ +:+ +:+ +:+ +:+ +:+ **");
- Console.WriteLine(" ** +#+ +:+ +#++: ++# +#+ +:+ **");
- Console.WriteLine(" ** +#+ +#+ +#+ +#+#+# +#+ +#+ **");
- Console.WriteLine(" ** #+# #+# #+# #+#+ #+# #+# **");
- Console.WriteLine(" ** ######### ########## ######### **");
- Console.WriteLine(" *****************************************");
- Console.WriteLine(" *****************************************");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement