Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. #include<time.h>
  5.  
  6. int diceSelect(void);
  7. int roleD2();
  8. int roleD3();
  9. int roleD4();
  10. int roleD5();
  11. int roleD6();
  12. int roleD8();
  13. int roleD10();
  14. int roleD12();
  15. int roleD20();
  16. int roleD30();
  17. int roleD100();
  18.  
  19. struct toon {
  20. char name[40];
  21. char playerName[40];
  22. char alignment[5];
  23. char deityName[40];
  24. char homeland[30];
  25. char race[20];
  26. char size[10];
  27. char gender[10];
  28. char hairColor[15];
  29. char eyeColor[15];
  30. int age;
  31. int height;
  32. float weight;
  33. };
  34. struct armor {
  35. char equipName[40];
  36. int ACbonus;
  37. char type[20];
  38. int checkPen;
  39. float spellFail;
  40. float weight;
  41. char properties[145];
  42. };
  43.  
  44. typedef struct armor armor;
  45.  
  46. struct charAbScore{
  47. int STR;
  48. int DEX;
  49. int CON;
  50. int INT;
  51. int WIS;
  52. int CHA;
  53. };
  54. struct charAbMods {
  55. int STRmod;
  56. int DEXmod;
  57. int CONmod;
  58. int INTmod;
  59. int WISmod;
  60. int CHAmod;
  61. };
  62. struct combatStats {
  63. int HP;
  64. int speed; //in ft
  65. int fortitude;
  66. int reflex;
  67. int will;
  68. int initiative;
  69. int BAB;
  70. int spellResist;
  71. int damageReduc;
  72. int AC; //armor class
  73. int tAC; //touch
  74. int ffAC; //flat footed
  75. };
  76. struct weapon {
  77. char name[40];
  78. int attackBon;
  79. int crit;
  80. char type[15];
  81. int range; //in ft
  82. char ammoType[20]; //arrows/ bullets/ darts
  83. int damage;
  84. };
  85.  
  86. typedef struct weapon weapon;
  87.  
  88. struct player {
  89. struct toon character;
  90. armor head;
  91. armor chest;
  92. armor legs;
  93. armor gaunt;
  94. armor ring1;
  95. armor ring2;
  96. armor ring3;
  97. armor ring4;
  98. armor other;
  99. struct charAbScore scores;
  100. struct charAbMods mods;
  101. struct combatStats stats;
  102. weapon equiped;
  103. weapon wep1;
  104. weapon wep2;
  105. weapon wep3;
  106. };
  107.  
  108. typedef struct player PLAYER;
  109.  
  110. int main()
  111. {
  112. PLAYER mychar; {
  113. mychar.character.name, "theDarkLord";
  114. mychar.character.playerName, "Ricky Weber";
  115. mychar.character.deityName, "Demise";
  116. mychar.character.homeland, "Bakini Bottom";
  117. mychar.character.race, "Something Racist";
  118. mychar.character.size, "Medium";
  119. mychar.character.gender, "Male";
  120. mychar.character.hairColor, "Brown";
  121. mychar.character.eyeColor, "Blue-Grey";
  122. mychar.character.age = 18;
  123. mychar.character.height = 68;
  124. mychar.character.weight = 145;
  125. mychar.character.alignment, "LE";
  126. };
  127. 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);
  128. system("pause");
  129. }
  130.  
  131. int diceSelect()
  132. {
  133. int menu;
  134.  
  135. printf("What kind of dice would you like to roll?");
  136. 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");
  137. scanf("%d", &menu);
  138.  
  139. switch (menu)
  140. {
  141. case 1:
  142. {
  143. roleD2();
  144. break;
  145. }
  146. case 2:
  147. {
  148. roleD3();
  149. break;
  150. }
  151. case 3:
  152. {
  153. roleD4();
  154. break;
  155. }
  156. case 4:
  157. {
  158. roleD5();
  159. break;
  160. }
  161. case 5:
  162. {
  163. roleD6();
  164. break;
  165. }
  166. case 6:
  167. {
  168. roleD8();
  169. break;
  170. }
  171. case 7:
  172. {
  173. roleD10();
  174. break;
  175. }
  176. case 8:
  177. {
  178. roleD12();
  179. break;
  180. }
  181. case 9:
  182. {
  183. roleD20();
  184. break;
  185. }
  186. case 10:
  187. {
  188. roleD30();
  189. break;
  190. }
  191. case 0:
  192. {
  193. break;
  194. }
  195. default:
  196. {
  197. printf("Invalid input, homie. Try Again.");
  198. }
  199. }
  200.  
  201. }
  202. int roleD2()
  203. {
  204. int dieNum;
  205. int roll;
  206.  
  207. printf("How many D2's would you like to roll?");
  208. scanf("%d", &dieNum);
  209.  
  210. srand((unsigned)time(NULL));
  211.  
  212. roll = (dieNum *(rand() % 2 + 1));
  213. printf("You rolled a %d", roll);
  214. }
  215. int roleD3()
  216. {
  217. int dieNum;
  218. int roll;
  219.  
  220. printf("How many D3's would you like to roll?");
  221. scanf("%d", &dieNum);
  222.  
  223. srand((unsigned)time(NULL));
  224.  
  225. roll = (dieNum *(rand() % 3 + 1));
  226. printf("You rolled a %d", roll);
  227. }
  228. int roleD4()
  229. {
  230. int dieNum;
  231. int roll;
  232.  
  233. printf("How many D4's would you like to roll?");
  234. scanf("%d", &dieNum);
  235.  
  236. srand((unsigned)time(NULL));
  237.  
  238. roll = (dieNum *(rand() % 4 + 1));
  239. printf("You rolled a %d", roll);
  240. }
  241. int roleD5()
  242. {
  243. int dieNum;
  244. int roll;
  245.  
  246. printf("How many D5's would you like to roll?");
  247. scanf("%d", &dieNum);
  248.  
  249. srand((unsigned)time(NULL));
  250.  
  251. roll = (dieNum *(rand() % 5 + 1));
  252. printf("You rolled a %d", roll);
  253. }
  254. int roleD6()
  255. {
  256. int dieNum;
  257. int roll;
  258.  
  259. printf("How many D6's would you like to roll?");
  260. scanf("%d", &dieNum);
  261.  
  262. srand((unsigned)time(NULL));
  263.  
  264. roll = (dieNum *(rand() % 6 + 1));
  265. printf("You rolled a %d", roll);
  266. }
  267. int roleD8()
  268. {
  269. int dieNum;
  270. int roll;
  271.  
  272. printf("How many D8's would you like to roll?");
  273. scanf("%d", &dieNum);
  274.  
  275. srand((unsigned)time(NULL));
  276.  
  277. roll = (dieNum *(rand() % 8 + 1));
  278. printf("You rolled a %d", roll);
  279. }
  280. int roleD10()
  281. {
  282. int dieNum;
  283. int roll;
  284.  
  285. printf("How many D10's would you like to roll?");
  286. scanf("%d", &dieNum);
  287.  
  288. srand((unsigned)time(NULL));
  289.  
  290. roll = (dieNum *(rand() % 10 + 1));
  291. printf("You rolled a %d", roll);
  292. }
  293. int roleD12()
  294. {
  295. int dieNum;
  296. int roll;
  297.  
  298. printf("How many D12's would you like to roll?");
  299. scanf("%d", &dieNum);
  300.  
  301. srand((unsigned)time(NULL));
  302.  
  303. roll = (dieNum *(rand() % 12 + 1));
  304. printf("You rolled a %d", roll);
  305. }
  306. int roleD20()
  307. {
  308. int dieNum;
  309. int roll;
  310.  
  311. printf("How many D20's would you like to roll?");
  312. scanf("%d", &dieNum);
  313.  
  314. srand((unsigned)time(NULL));
  315.  
  316. roll = (dieNum *(rand() % 20 + 1));
  317. printf("You rolled a %d", roll);
  318. }
  319. int roleD30()
  320. {
  321. int dieNum;
  322. int roll;
  323.  
  324. printf("How many D30's would you like to roll?");
  325. scanf("%d", &dieNum);
  326.  
  327. srand((unsigned)time(NULL));
  328.  
  329. roll = (dieNum *(rand() % 30 + 1));
  330. printf("You rolled a %d", roll);
  331. }
  332. int roleD100()
  333. {
  334. int dieNum;
  335. int roll;
  336.  
  337. printf("How many D100's would you like to roll?");
  338. scanf("%d", &dieNum);
  339.  
  340. srand((unsigned)time(NULL));
  341.  
  342. roll = (dieNum *(rand() % 100 + 1));
  343. printf("You rolled a %d", roll);
  344. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement