Ramaraunt1

Untitled

Dec 22nd, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.79 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. public static string bodyWhole(int genderID)
  197. {
  198. if (genderID == Gender.Male())
  199. {
  200. return "man_body";
  201. }
  202. else if (genderID == Gender.Female())
  203. {
  204. return "woman_body";
  205. }
  206. else
  207. {
  208. return "If you see this there is no gender of this person.";
  209. }
  210. }
  211. public static string Head(int genderID)
  212. {
  213. if (genderID == Gender.Male())
  214. {
  215. return "maleHead";
  216. }
  217. else if (genderID == Gender.Female())
  218. {
  219. return "femaleHead";
  220. }
  221. else
  222. {
  223. return "If you see this there is no gender of this person.";
  224. }
  225. }
  226.  
  227. public static string Arms(int genderID)
  228. {
  229. if (genderID == Gender.Male())
  230. {
  231. return "maleArms";
  232. }
  233. else if (genderID == Gender.Female())
  234. {
  235. return "femaleArms";
  236. }
  237. else
  238. {
  239. return "If you see this there is no gender of this person.";
  240. }
  241. }
  242.  
  243. public static string Legs(int genderID)
  244. {
  245. if (genderID == Gender.Male())
  246. {
  247. return "maleLegs";
  248. }
  249. else if (genderID == Gender.Female())
  250. {
  251. return "femaleLegs";
  252. }
  253. else
  254. {
  255. return "If you see this there is no gender of this person.";
  256. }
  257. }
  258.  
  259. public static string Torso(int genderID)
  260. {
  261. if (genderID == Gender.Male())
  262. {
  263. return "maleTorso";
  264. }
  265. else if (genderID == Gender.Female())
  266. {
  267. return "femaleTorso";
  268. }
  269. else
  270. {
  271. return "If you see this there is no gender of this person.";
  272. }
  273. }
  274.  
  275. public static string Hands(int genderID)
  276. {
  277. if (genderID == Gender.Male())
  278. {
  279. return "maleHands";
  280. }
  281. else if (genderID == Gender.Female())
  282. {
  283. return "femaleHands";
  284. }
  285. else
  286. {
  287. return "If you see this there is no gender of this person.";
  288. }
  289. }
  290.  
  291. public static string Feet(int genderID)
  292. {
  293. if (genderID == Gender.Male())
  294. {
  295. return "maleFeet";
  296. }
  297. else if (genderID == Gender.Female())
  298. {
  299. return "femaleFeet";
  300. }
  301. else
  302. {
  303. return "If you see this there is no gender of this person.";
  304. }
  305. }
  306.  
  307. public static string Ears(int genderID)
  308. {
  309. if (genderID == Gender.Male())
  310. {
  311. return "man_body/maleEars";
  312. }
  313. else if (genderID == Gender.Female())
  314. {
  315. return "femaleEars";
  316. }
  317. else
  318. {
  319. return "If you see this there is no gender of this person.";
  320. }
  321. }
  322.  
  323. public static string Mouth(int genderID)
  324. {
  325. if (genderID == Gender.Male())
  326. {
  327. return "maleMouth";
  328. }
  329. else if (genderID == Gender.Female())
  330. {
  331. return "femaleMouth";
  332. }
  333. else
  334. {
  335. return "If you see this there is no gender of this person.";
  336. }
  337. }
  338.  
  339. public static string Eyes(int genderID)
  340. {
  341. if (genderID == Gender.Male())
  342. {
  343. return "maleEyes";
  344. }
  345. else if (genderID == Gender.Female())
  346. {
  347. return "femaleEyes";
  348. }
  349. else
  350. {
  351. return "If you see this there is no gender of this person.";
  352. }
  353. }
  354.  
  355. public static string Tongue(int genderID)
  356. {
  357. if (genderID == Gender.Male())
  358. {
  359. return "maleTongue";
  360. }
  361. else if (genderID == Gender.Female())
  362. {
  363. return "femaleTongue";
  364. }
  365. else
  366. {
  367. return "If you see this there is no gender of this person.";
  368. }
  369. }
  370. }
  371. #endregion
  372.  
  373. #region Skin Color Class
  374. public static class SkinColor
  375. {
  376. private static int caucasian = 0;
  377. private static int black = 1;
  378. private static int brown = 2;
  379. private static int arabian = 3;
  380. private static int oriental = 4;
  381. private static int pale = 5;
  382.  
  383. public static int Caucasian()
  384. {
  385. return caucasian;
  386. }
  387. public static int Black()
  388. {
  389. return black;
  390. }
  391. public static int Brown()
  392. {
  393. return brown;
  394. }
  395. public static int Arabian()
  396. {
  397. return arabian;
  398. }
  399. public static int Oriental()
  400. {
  401. return oriental;
  402. }
  403. public static int Pale()
  404. {
  405. return pale;
  406. }
  407. //etc etc
  408. }
  409. #endregion
  410.  
  411. #region Skin Color Return Material Class
  412. public static class SkinMaterial
  413. {
  414. public static string get(int skinID)
  415. {
  416. if (skinID == SkinColor.Caucasian())
  417. {
  418. return "whiteSkin";
  419. }
  420. else if (skinID == SkinColor.Arabian())
  421. {
  422. return "bronzeSkin";
  423. }
  424. else if (skinID == SkinColor.Oriental())
  425. {
  426. return "asianSkin";
  427. }
  428. else if (skinID == SkinColor.Black())
  429. {
  430. return "blackSkin";
  431. }
  432. else if (skinID == SkinColor.Brown())
  433. {
  434. return "brownSkin";
  435. }
  436. else if (skinID == SkinColor.Pale())
  437. {
  438. return "snowSkin";
  439. }
  440. else
  441. {
  442. return "If you see this there is an improper skin id for this person.";
  443. }
  444. }
  445. }
  446. #endregion
  447.  
  448. #region Eye Color Class
  449. public static class EyeColor
  450. {
  451. private static int black = 0;
  452. private static int brown = 1;
  453. private static int blue = 2;
  454. private static int cyan = 3;
  455. private static int lightBrown = 4;
  456. private static int yellow = 5;
  457. private static int red = 6;
  458. private static int purple = 6;
  459. private static int orange = 8;
  460. private static int white = 9;
  461.  
  462. public static int Black()
  463. {
  464. return black;
  465. }
  466.  
  467. public static int Brown()
  468. {
  469. return brown;
  470. }
  471.  
  472. public static int Blue()
  473. {
  474. return blue;
  475. }
  476.  
  477. public static int Cyan()
  478. {
  479. return cyan;
  480. }
  481.  
  482. public static int LightBrown()
  483. {
  484. return lightBrown;
  485. }
  486.  
  487. public static int Yellow()
  488. {
  489. return yellow;
  490. }
  491.  
  492. public static int Red()
  493. {
  494. return red;
  495. }
  496.  
  497. public static int Purple()
  498. {
  499. return purple;
  500. }
  501.  
  502. public static int Orange()
  503. {
  504. return orange;
  505. }
  506.  
  507. public static int White()
  508. {
  509. return white;
  510. }
  511. }
  512. #endregion
  513.  
  514. #region Eye Color Return Material Class
  515. public static class EyeMaterial
  516. {
  517. public static string get(int eyeID)
  518. {
  519. if (eyeID == EyeColor.Black())
  520. {
  521. return "blackEyes";
  522. }
  523. else if (eyeID == EyeColor.Blue())
  524. {
  525. return "blueEyes";
  526. }
  527. else if (eyeID == EyeColor.Brown())
  528. {
  529. return "brownEyes";
  530. }
  531. else if (eyeID == EyeColor.Cyan())
  532. {
  533. return "cyanEyes";
  534. }
  535. else if (eyeID == EyeColor.LightBrown())
  536. {
  537. return "lightBrownEyes";
  538. }
  539. else if (eyeID == EyeColor.Orange())
  540. {
  541. return "orangeEyes";
  542. }
  543. else if (eyeID == EyeColor.Purple())
  544. {
  545. return "purpleEyes";
  546. }
  547. else if (eyeID == EyeColor.Red())
  548. {
  549. return "redEyes";
  550. }
  551. else if (eyeID == EyeColor.White())
  552. {
  553. return "whiteEyes";
  554. }
  555. else if (eyeID == EyeColor.Yellow())
  556. {
  557. return "yellowEyes";
  558. }
  559. else
  560. {
  561. return "If you see this there is an error getting a materal for someone's eyes!";
  562. }
  563. }
  564. }
  565. #endregion
  566.  
  567. #region Hair Color Class
  568. public static class HairColor
  569. {
  570. private static int white = 0;
  571. private static int red = 1;
  572. private static int black = 2;
  573. private static int blond = 3;
  574. private static int brown = 4;
  575. private static int lightBrown = 5;
  576. //etc etc
  577. }
  578. #endregion
  579.  
  580. #endregion
Advertisement
Add Comment
Please, Sign In to add comment