Ramaraunt1

Untitled

Dec 22nd, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.21 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4. // ABOUT //
  5. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  6. /*
  7. * This file contains scripts that are used to hold information about each Actor. Actors can be players or NPCs.
  8. *
  9. * It is not necessary to add an object to a scene that contains this script.
  10. */
  11.  
  12. //These are tiny classes that contain information used in each Actor.
  13. #region Property Classes
  14. public class Attributes
  15. {
  16. /*
  17. *This class contains physical charactaristics of a human, and is used in the Actor class.
  18. */
  19. public int gender;
  20. public int eyeColor;
  21. public int skinColor;
  22. public int hairColor;
  23. public int hairStyle;
  24. public int beardStyle;
  25. public int age;
  26.  
  27. }
  28. public class Equiped
  29. {
  30. /*
  31. * This class contains the items the character has equiped in each slot. It is used by the Actor class.
  32. */
  33. public int hands;
  34. public int feet;
  35. public int head;
  36. public int neck;
  37. public int torso;
  38. public int legs;
  39. public int arms;
  40. public int finger;
  41. public int face;
  42. public int back;
  43. public int[] items = new int[4];
  44. public ArrayList inventory;
  45. }
  46. public class AI
  47. {
  48. /*
  49. * This class contains AI information for the actor.
  50. */
  51.  
  52. public bool isPlayer;
  53. public int AIType;
  54. public int AIState;
  55. public GameObject spawn;
  56.  
  57. }
  58. #endregion
  59.  
  60. //This is the main class for actors, where each actor is instantiated.
  61. #region Actor Class
  62. public class Actor
  63. {
  64. /*
  65. * This class defines an individual character in the game. It contains all of its information for how they should be spawned in, indlucing
  66. * things like skin color, eye color, gender, armor, weapons, etc.
  67. *
  68. * Once the mission template system is set up, you will never call any of these things directly.
  69. *
  70. * - Ramaraunt
  71. */
  72.  
  73. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  74. // PROPERTIES //
  75. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  76.  
  77. /*
  78. * This is where the properties, or attributes, of each Actor is defined.
  79. */
  80.  
  81. //This is a static value, which means it isn't different for each actor object. It is used to find out the id of the actor being instantiated;
  82. private static int actorCount = 0;
  83.  
  84. //This is the ID of the current Actor.
  85. private int ID { get; set; }
  86.  
  87. //This is a boolean, which is true if the actor is built successfully.
  88. private bool builtSuccessfully = false;
  89. public bool getStatus()
  90. {
  91. return builtSuccessfully;
  92. }
  93.  
  94. //This object contains information related to physical characteristics of the actor. See Attributes class above.
  95. private Attributes attributes { get; set; }
  96.  
  97. //This object contains information related to items the actor is carrying. See Equiped class above.
  98. private Equiped equipment { get; set; }
  99.  
  100. //This object contains information related to the actor's AI. See AI class above.
  101. private AI AIInfos;
  102.  
  103. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  104. // CONSTRUCTORS //
  105. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  106.  
  107. /*
  108. * The following methods are called in order to create a new instance of Actor.
  109. */
  110.  
  111. //This is the default constructor with no attributes. It will define a naked guy. Don't use this unless you are testing.
  112. #region default constructor
  113. public Actor()
  114. {
  115. //Assign the ID, and increment actorCount.
  116. ID = actorCount;
  117. actorCount++;
  118.  
  119. //define the basic characteristics of the actor as 0 (default).
  120. attributes.gender = 0;
  121. attributes.eyeColor = 0;
  122. attributes.skinColor = 0;
  123. attributes.hairColor = 0;
  124. attributes.hairStyle = 0;
  125. attributes.beardStyle = 0;
  126. attributes.age = 0;
  127.  
  128. //define the slots as 0 (unfilled)
  129. equipment.hands = 0;
  130. equipment.feet = 0;
  131. equipment.head = 0;
  132. equipment.neck = 0;
  133. equipment.torso = 0;
  134. equipment.legs = 0;
  135. equipment.arms = 0;
  136. equipment.finger = 0;
  137. equipment.face = 0;
  138. equipment.back = 0;
  139. for (int cur_item_slot = 0; cur_item_slot < 4; cur_item_slot++)
  140. {
  141. equipment.items[cur_item_slot] = 0;
  142. }
  143.  
  144. //define all AI stuffs to default values
  145. AIInfos.AIState = 0;
  146. AIInfos.AIType = 0;
  147. AIInfos.isPlayer = false;
  148.  
  149. //Set builtSuccessfully to true.
  150. builtSuccessfully = true;
  151. }
  152. #endregion
  153.  
  154.  
  155. //This is the designated constructor with all attributes. It will define a person the way you want him.
  156. #region designated constructor
  157. public Actor(Attributes attributes, Equiped equipment, AI AIInfos)
  158. {
  159. //Move over the arguments to the properties.
  160. this.attributes = attributes;
  161. this.equipment = equipment;
  162. this.AIInfos = AIInfos;
  163.  
  164. //It has been built!
  165. builtSuccessfully = true;
  166.  
  167. }
  168. #endregion
  169. }
  170. #endregion
  171.  
  172. //These are classes that can be called to get deffinitions of IDs and names of things. Made for ease of use purposes.
  173. //If you are adding new items to the game, or are adding new hairstyles and whatnot, most of that stuff is configured here!
  174. #region ID classes
  175.  
  176. #region Gender Class
  177. public static class Gender
  178. {
  179. private static int male = 1;
  180. private static int female = 0;
  181.  
  182. public static int Male()
  183. {
  184. return male;
  185. }
  186. public static int Female()
  187. {
  188. return female;
  189. }
  190. }
  191. #endregion
  192.  
  193. #region Body Parts Return Class
  194. public class BodyPart
  195. {
  196. /*
  197. public static string bodyWhole(int genderID)
  198. {
  199. if (genderID == Gender.Male())
  200. {
  201. return "man_body";
  202. }
  203. else if (genderID == Gender.Female())
  204. {
  205. return "woman_body";
  206. }
  207. else
  208. {
  209. return "If you see this there is no gender of this person.";
  210. }
  211. }
  212. */
  213. public static string Head(int genderID)
  214. {
  215. if (genderID == Gender.Male())
  216. {
  217. return "Objects/MaleParts/maleHead";
  218. }
  219. else if (genderID == Gender.Female())
  220. {
  221. return "femaleHead";
  222. }
  223. else
  224. {
  225. return "If you see this there is no gender of this person.";
  226. }
  227. }
  228.  
  229. public static string Arms(int genderID)
  230. {
  231. if (genderID == Gender.Male())
  232. {
  233. return "Objects/MaleParts/maleArms";
  234. }
  235. else if (genderID == Gender.Female())
  236. {
  237. return "femaleArms";
  238. }
  239. else
  240. {
  241. return "If you see this there is no gender of this person.";
  242. }
  243. }
  244.  
  245. public static string Legs(int genderID)
  246. {
  247. if (genderID == Gender.Male())
  248. {
  249. return "Objects/MaleParts/maleLegs";
  250. }
  251. else if (genderID == Gender.Female())
  252. {
  253. return "femaleLegs";
  254. }
  255. else
  256. {
  257. return "If you see this there is no gender of this person.";
  258. }
  259. }
  260.  
  261. public static string Torso(int genderID)
  262. {
  263. if (genderID == Gender.Male())
  264. {
  265. return "Objects/MaleParts/maleTorso";
  266. }
  267. else if (genderID == Gender.Female())
  268. {
  269. return "femaleTorso";
  270. }
  271. else
  272. {
  273. return "If you see this there is no gender of this person.";
  274. }
  275. }
  276.  
  277. public static string Hands(int genderID)
  278. {
  279. if (genderID == Gender.Male())
  280. {
  281. return "Objects/MaleParts/maleHands";
  282. }
  283. else if (genderID == Gender.Female())
  284. {
  285. return "femaleHands";
  286. }
  287. else
  288. {
  289. return "If you see this there is no gender of this person.";
  290. }
  291. }
  292.  
  293. public static string Feet(int genderID)
  294. {
  295. if (genderID == Gender.Male())
  296. {
  297. return "Objects/MaleParts/maleFeet";
  298. }
  299. else if (genderID == Gender.Female())
  300. {
  301. return "femaleFeet";
  302. }
  303. else
  304. {
  305. return "If you see this there is no gender of this person.";
  306. }
  307. }
  308.  
  309. public static string Ears(int genderID)
  310. {
  311. if (genderID == Gender.Male())
  312. {
  313. return "Objects/MaleParts/maleEars";
  314. }
  315. else if (genderID == Gender.Female())
  316. {
  317. return "femaleEars";
  318. }
  319. else
  320. {
  321. return "If you see this there is no gender of this person.";
  322. }
  323. }
  324.  
  325. public static string Mouth(int genderID)
  326. {
  327. if (genderID == Gender.Male())
  328. {
  329. return "Objects/MaleParts/maleMouth";
  330. }
  331. else if (genderID == Gender.Female())
  332. {
  333. return "femaleMouth";
  334. }
  335. else
  336. {
  337. return "If you see this there is no gender of this person.";
  338. }
  339. }
  340.  
  341. public static string Eyes(int genderID)
  342. {
  343. if (genderID == Gender.Male())
  344. {
  345. return "Objects/MaleParts/maleEyes";
  346. }
  347. else if (genderID == Gender.Female())
  348. {
  349. return "femaleEyes";
  350. }
  351. else
  352. {
  353. return "If you see this there is no gender of this person.";
  354. }
  355. }
  356.  
  357. public static string Tongue(int genderID)
  358. {
  359. if (genderID == Gender.Male())
  360. {
  361. return "Objects/MaleParts/maleTongue";
  362. }
  363. else if (genderID == Gender.Female())
  364. {
  365. return "femaleTongue";
  366. }
  367. else
  368. {
  369. return "If you see this there is no gender of this person.";
  370. }
  371. }
  372. }
  373. #endregion
  374.  
  375. #region Skin Color Class
  376. public static class SkinColor
  377. {
  378. private static int caucasian = 0;
  379. private static int black = 1;
  380. private static int brown = 2;
  381. private static int arabian = 3;
  382. private static int oriental = 4;
  383. private static int pale = 5;
  384.  
  385. public static int Caucasian()
  386. {
  387. return caucasian;
  388. }
  389. public static int Black()
  390. {
  391. return black;
  392. }
  393. public static int Brown()
  394. {
  395. return brown;
  396. }
  397. public static int Arabian()
  398. {
  399. return arabian;
  400. }
  401. public static int Oriental()
  402. {
  403. return oriental;
  404. }
  405. public static int Pale()
  406. {
  407. return pale;
  408. }
  409. //etc etc
  410. }
  411. #endregion
  412.  
  413. #region Skin Color Return Material Class
  414. public static class SkinMaterial
  415. {
  416. public static string get(int skinID)
  417. {
  418. if (skinID == SkinColor.Caucasian())
  419. {
  420. return "Materials/Skin/whiteSkin";
  421. }
  422. else if (skinID == SkinColor.Arabian())
  423. {
  424. return "Materials/Skin/bronzeSkin";
  425. }
  426. else if (skinID == SkinColor.Oriental())
  427. {
  428. return "Materials/Skin/asianSkin";
  429. }
  430. else if (skinID == SkinColor.Black())
  431. {
  432. return "Materials/Skin/blackSkin";
  433. }
  434. else if (skinID == SkinColor.Brown())
  435. {
  436. return "Materials/Skin/brownSkin";
  437. }
  438. else if (skinID == SkinColor.Pale())
  439. {
  440. return "Materials/Skin/snowSkin";
  441. }
  442. else
  443. {
  444. return "If you see this there is an improper skin id for this person.";
  445. }
  446. }
  447. }
  448. #endregion
  449.  
  450. #region Eye Color Class
  451. public static class EyeColor
  452. {
  453. private static int black = 0;
  454. private static int brown = 1;
  455. private static int blue = 2;
  456. private static int cyan = 3;
  457. private static int lightBrown = 4;
  458. private static int yellow = 5;
  459. private static int red = 6;
  460. private static int purple = 6;
  461. private static int orange = 8;
  462. private static int white = 9;
  463.  
  464. public static int Black()
  465. {
  466. return black;
  467. }
  468.  
  469. public static int Brown()
  470. {
  471. return brown;
  472. }
  473.  
  474. public static int Blue()
  475. {
  476. return blue;
  477. }
  478.  
  479. public static int Cyan()
  480. {
  481. return cyan;
  482. }
  483.  
  484. public static int LightBrown()
  485. {
  486. return lightBrown;
  487. }
  488.  
  489. public static int Yellow()
  490. {
  491. return yellow;
  492. }
  493.  
  494. public static int Red()
  495. {
  496. return red;
  497. }
  498.  
  499. public static int Purple()
  500. {
  501. return purple;
  502. }
  503.  
  504. public static int Orange()
  505. {
  506. return orange;
  507. }
  508.  
  509. public static int White()
  510. {
  511. return white;
  512. }
  513. }
  514. #endregion
  515.  
  516. #region Eye Color Return Material Class
  517. public static class EyeMaterial
  518. {
  519. public static string get(int eyeID)
  520. {
  521. if (eyeID == EyeColor.Black())
  522. {
  523. return "Materials/Eyes/blackEyes";
  524. }
  525. else if (eyeID == EyeColor.Blue())
  526. {
  527. return "Materials/Eyes/blueEyes";
  528. }
  529. else if (eyeID == EyeColor.Brown())
  530. {
  531. return "Materials/Eyes/brownEyes";
  532. }
  533. else if (eyeID == EyeColor.Cyan())
  534. {
  535. return "Materials/Eyes/cyanEyes";
  536. }
  537. else if (eyeID == EyeColor.LightBrown())
  538. {
  539. return "Materials/Eyes/lightBrownEyes";
  540. }
  541. else if (eyeID == EyeColor.Orange())
  542. {
  543. return "Materials/Eyes/orangeEyes";
  544. }
  545. else if (eyeID == EyeColor.Purple())
  546. {
  547. return "Materials/Eyes/purpleEyes";
  548. }
  549. else if (eyeID == EyeColor.Red())
  550. {
  551. return "Materials/Eyes/redEyes";
  552. }
  553. else if (eyeID == EyeColor.White())
  554. {
  555. return "Materials/Eyes/whiteEyes";
  556. }
  557. else if (eyeID == EyeColor.Yellow())
  558. {
  559. return "Materials/Eyes/yellowEyes";
  560. }
  561. else
  562. {
  563. return "If you see this there is an error getting a materal for someone's eyes!";
  564. }
  565. }
  566. }
  567. #endregion
  568.  
  569. #region Hair Color Class
  570. public static class HairColor
  571. {
  572. private static int white = 0;
  573. private static int red = 1;
  574. private static int black = 2;
  575. private static int blond = 3;
  576. private static int brown = 4;
  577. private static int lightBrown = 5;
  578. //etc etc
  579. }
  580. #endregion
  581.  
  582. #endregion
Advertisement
Add Comment
Please, Sign In to add comment