Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- #include<time.h>
- int diceSelect(void);
- int roleD2();
- int roleD3();
- int roleD4();
- int roleD5();
- int roleD6();
- int roleD8();
- int roleD10();
- int roleD12();
- int roleD20();
- int roleD30();
- int roleD100();
- struct toon {
- char name[40];
- char playerName[40];
- char alignment[5];
- char deityName[40];
- char homeland[30];
- char race[20];
- char size[10];
- char gender[10];
- char hairColor[15];
- char eyeColor[15];
- int age;
- int height;
- float weight;
- };
- struct armor {
- char equipName[40];
- int ACbonus;
- char type[20];
- int checkPen;
- float spellFail;
- float weight;
- char properties[145];
- };
- typedef struct armor armor;
- struct charAbScore{
- int STR;
- int DEX;
- int CON;
- int INT;
- int WIS;
- int CHA;
- };
- struct charAbMods {
- int STRmod;
- int DEXmod;
- int CONmod;
- int INTmod;
- int WISmod;
- int CHAmod;
- };
- struct combatStats {
- int HP;
- int speed; //in ft
- int fortitude;
- int reflex;
- int will;
- int initiative;
- int BAB;
- int spellResist;
- int damageReduc;
- int AC; //armor class
- int tAC; //touch
- int ffAC; //flat footed
- };
- struct weapon {
- char name[40];
- int attackBon;
- int crit;
- char type[15];
- int range; //in ft
- char ammoType[20]; //arrows/ bullets/ darts
- int damage;
- };
- typedef struct weapon weapon;
- struct player {
- struct toon character;
- armor head;
- armor chest;
- armor legs;
- armor gaunt;
- armor ring1;
- armor ring2;
- armor ring3;
- armor ring4;
- armor other;
- struct charAbScore scores;
- struct charAbMods mods;
- struct combatStats stats;
- weapon equiped;
- weapon wep1;
- weapon wep2;
- weapon wep3;
- };
- typedef struct player PLAYER;
- int main()
- {
- PLAYER mychar; {
- mychar.character.name, "theDarkLord";
- mychar.character.playerName, "Ricky Weber";
- mychar.character.deityName, "Demise";
- mychar.character.homeland, "Bakini Bottom";
- mychar.character.race, "Something Racist";
- mychar.character.size, "Medium";
- mychar.character.gender, "Male";
- mychar.character.hairColor, "Brown";
- mychar.character.eyeColor, "Blue-Grey";
- mychar.character.age = 18;
- mychar.character.height = 68;
- mychar.character.weight = 145;
- mychar.character.alignment, "LE";
- };
- printf("%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, %d", mychar.character.name, mychar.character.playerName, mychar.character.alignment, mychar.character.deityName, mychar.character.homeland, mychar.character.eyeColor, mychar.character.hairColor, mychar.character.size, mychar.character.gender, mychar.character.race, mychar.character.age, mychar.character.height, mychar.character.weight);
- system("pause");
- }
- int diceSelect()
- {
- int menu;
- printf("What kind of dice would you like to roll?");
- printf("1: D2's 2: D3's 3: D4's 4: D5's 5: D6's 6: D8's 7: D10's 8: D12's 9: D20's 10: D30's 0: None");
- scanf("%d", &menu);
- switch (menu)
- {
- case 1:
- {
- roleD2();
- break;
- }
- case 2:
- {
- roleD3();
- break;
- }
- case 3:
- {
- roleD4();
- break;
- }
- case 4:
- {
- roleD5();
- break;
- }
- case 5:
- {
- roleD6();
- break;
- }
- case 6:
- {
- roleD8();
- break;
- }
- case 7:
- {
- roleD10();
- break;
- }
- case 8:
- {
- roleD12();
- break;
- }
- case 9:
- {
- roleD20();
- break;
- }
- case 10:
- {
- roleD30();
- break;
- }
- case 0:
- {
- break;
- }
- default:
- {
- printf("Invalid input, homie. Try Again.");
- }
- }
- }
- int roleD2()
- {
- int dieNum;
- int roll;
- printf("How many D2's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 2 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD3()
- {
- int dieNum;
- int roll;
- printf("How many D3's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 3 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD4()
- {
- int dieNum;
- int roll;
- printf("How many D4's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 4 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD5()
- {
- int dieNum;
- int roll;
- printf("How many D5's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 5 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD6()
- {
- int dieNum;
- int roll;
- printf("How many D6's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 6 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD8()
- {
- int dieNum;
- int roll;
- printf("How many D8's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 8 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD10()
- {
- int dieNum;
- int roll;
- printf("How many D10's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 10 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD12()
- {
- int dieNum;
- int roll;
- printf("How many D12's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 12 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD20()
- {
- int dieNum;
- int roll;
- printf("How many D20's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 20 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD30()
- {
- int dieNum;
- int roll;
- printf("How many D30's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 30 + 1));
- printf("You rolled a %d", roll);
- }
- int roleD100()
- {
- int dieNum;
- int roll;
- printf("How many D100's would you like to roll?");
- scanf("%d", &dieNum);
- srand((unsigned)time(NULL));
- roll = (dieNum *(rand() % 100 + 1));
- printf("You rolled a %d", roll);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement