Ramaraunt1

Untitled

Dec 22nd, 2016
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.75 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. attributes = new Attributes();
  120. equipment = new Equiped();
  121. AIInfos = new AI();
  122.  
  123. //define the basic characteristics of the actor as 0 (default).
  124. attributes.gender = 0;
  125. attributes.eyeColor = 0;
  126. attributes.skinColor = 0;
  127. attributes.hairColor = 0;
  128. attributes.hairStyle = 0;
  129. attributes.beardStyle = 0;
  130. attributes.age = 0;
  131.  
  132. //define the slots as 0 (unfilled)
  133. equipment.hands = 0;
  134. equipment.feet = 0;
  135. equipment.head = 0;
  136. equipment.neck = 0;
  137. equipment.torso = 0;
  138. equipment.legs = 0;
  139. equipment.arms = 0;
  140. equipment.finger = 0;
  141. equipment.face = 0;
  142. equipment.back = 0;
  143. for (int cur_item_slot = 0; cur_item_slot < 4; cur_item_slot++)
  144. {
  145. equipment.items[cur_item_slot] = 0;
  146. }
  147.  
  148. //define all AI stuffs to default values
  149. AIInfos.AIState = 0;
  150. AIInfos.AIType = 0;
  151. AIInfos.isPlayer = false;
  152.  
  153. //Set builtSuccessfully to true.
  154. builtSuccessfully = true;
  155. }
  156. #endregion
  157.  
  158.  
  159. //This is the designated constructor with all attributes. It will define a person the way you want him.
  160. #region designated constructor
  161. public Actor(Attributes attributes, Equiped equipment, AI AIInfos)
  162. {
  163. //Move over the arguments to the properties.
  164. this.attributes = attributes;
  165. this.equipment = equipment;
  166. this.AIInfos = AIInfos;
  167.  
  168. //It has been built!
  169. builtSuccessfully = true;
  170.  
  171. }
  172. #endregion
  173. }
  174. #endregion
  175.  
  176. //These are classes that can be called to get deffinitions of IDs and names of things. Made for ease of use purposes.
  177. //If you are adding new items to the game, or are adding new hairstyles and whatnot, most of that stuff is configured here!
  178. #region ID classes
  179.  
  180. #region Gender Class
  181. public static class Gender
  182. {
  183. private static int male = 1;
  184. private static int female = 0;
  185.  
  186. public static int Male()
  187. {
  188. return male;
  189. }
  190. public static int Female()
  191. {
  192. return female;
  193. }
  194. }
  195. #endregion
  196.  
  197. #region Body Parts Return Class
  198. public static class BodyPart
  199. {
  200. public static string bodyFrame()
  201. {
  202. return ("Objects/bones/main_frame");
  203. }
  204. public static string bodyWhole(int genderID)
  205. {
  206. if (genderID == Gender.Male())
  207. {
  208. return "man_body";
  209. }
  210. else if (genderID == Gender.Female())
  211. {
  212. return "woman_body";
  213. }
  214. else
  215. {
  216. return "If you see this there is no gender of this person.";
  217. }
  218. }
  219.  
  220. public static string Head(int genderID)
  221. {
  222. if (genderID == Gender.Male())
  223. {
  224. return "Objects/MaleParts/maleHead";
  225. }
  226. else if (genderID == Gender.Female())
  227. {
  228. return "femaleHead";
  229. }
  230. else
  231. {
  232. return "If you see this there is no gender of this person.";
  233. }
  234. }
  235.  
  236. public static string Arms(int genderID)
  237. {
  238. if (genderID == Gender.Male())
  239. {
  240. return "Objects/MaleParts/maleArms";
  241. }
  242. else if (genderID == Gender.Female())
  243. {
  244. return "femaleArms";
  245. }
  246. else
  247. {
  248. return "If you see this there is no gender of this person.";
  249. }
  250. }
  251.  
  252. public static string Legs(int genderID)
  253. {
  254. if (genderID == Gender.Male())
  255. {
  256. return "Objects/MaleParts/maleLegs";
  257. }
  258. else if (genderID == Gender.Female())
  259. {
  260. return "femaleLegs";
  261. }
  262. else
  263. {
  264. return "If you see this there is no gender of this person.";
  265. }
  266. }
  267.  
  268. public static string Torso(int genderID)
  269. {
  270. if (genderID == Gender.Male())
  271. {
  272. return "Objects/MaleParts/maleTorso";
  273. }
  274. else if (genderID == Gender.Female())
  275. {
  276. return "femaleTorso";
  277. }
  278. else
  279. {
  280. return "If you see this there is no gender of this person.";
  281. }
  282. }
  283.  
  284. public static string Hands(int genderID)
  285. {
  286. if (genderID == Gender.Male())
  287. {
  288. return "Objects/MaleParts/maleHands";
  289. }
  290. else if (genderID == Gender.Female())
  291. {
  292. return "femaleHands";
  293. }
  294. else
  295. {
  296. return "If you see this there is no gender of this person.";
  297. }
  298. }
  299.  
  300. public static string Feet(int genderID)
  301. {
  302. if (genderID == Gender.Male())
  303. {
  304. return "Objects/MaleParts/maleFeet";
  305. }
  306. else if (genderID == Gender.Female())
  307. {
  308. return "femaleFeet";
  309. }
  310. else
  311. {
  312. return "If you see this there is no gender of this person.";
  313. }
  314. }
  315.  
  316. public static string Ears(int genderID)
  317. {
  318. if (genderID == Gender.Male())
  319. {
  320. return "Objects/MaleParts/maleEars";
  321. }
  322. else if (genderID == Gender.Female())
  323. {
  324. return "femaleEars";
  325. }
  326. else
  327. {
  328. return "If you see this there is no gender of this person.";
  329. }
  330. }
  331.  
  332. public static string Mouth(int genderID)
  333. {
  334. if (genderID == Gender.Male())
  335. {
  336. return "Objects/MaleParts/maleMouth";
  337. }
  338. else if (genderID == Gender.Female())
  339. {
  340. return "femaleMouth";
  341. }
  342. else
  343. {
  344. return "If you see this there is no gender of this person.";
  345. }
  346. }
  347.  
  348. public static string Eyes(int genderID)
  349. {
  350. if (genderID == Gender.Male())
  351. {
  352. return "Objects/MaleParts/maleEyes";
  353. }
  354. else if (genderID == Gender.Female())
  355. {
  356. return "femaleEyes";
  357. }
  358. else
  359. {
  360. return "If you see this there is no gender of this person.";
  361. }
  362. }
  363.  
  364. public static string Tongue(int genderID)
  365. {
  366. if (genderID == Gender.Male())
  367. {
  368. return "Objects/MaleParts/maleTongue";
  369. }
  370. else if (genderID == Gender.Female())
  371. {
  372. return "femaleTongue";
  373. }
  374. else
  375. {
  376. return "If you see this there is no gender of this person.";
  377. }
  378. }
  379. }
  380. #endregion
  381.  
  382. #region Skin Color Class
  383. public static class SkinColor
  384. {
  385. private static int caucasian = 0;
  386. private static int black = 1;
  387. private static int brown = 2;
  388. private static int arabian = 3;
  389. private static int oriental = 4;
  390. private static int pale = 5;
  391.  
  392. public static int Caucasian()
  393. {
  394. return caucasian;
  395. }
  396. public static int Black()
  397. {
  398. return black;
  399. }
  400. public static int Brown()
  401. {
  402. return brown;
  403. }
  404. public static int Arabian()
  405. {
  406. return arabian;
  407. }
  408. public static int Oriental()
  409. {
  410. return oriental;
  411. }
  412. public static int Pale()
  413. {
  414. return pale;
  415. }
  416. //etc etc
  417. }
  418. #endregion
  419.  
  420. #region Skin Color Return Material Class
  421. public static class SkinMaterial
  422. {
  423. public static string get(int skinID)
  424. {
  425. if (skinID == SkinColor.Caucasian())
  426. {
  427. return "Materials/Skin/whiteSkin";
  428. }
  429. else if (skinID == SkinColor.Arabian())
  430. {
  431. return "Materials/Skin/bronzeSkin";
  432. }
  433. else if (skinID == SkinColor.Oriental())
  434. {
  435. return "Materials/Skin/asianSkin";
  436. }
  437. else if (skinID == SkinColor.Black())
  438. {
  439. return "Materials/Skin/blackSkin";
  440. }
  441. else if (skinID == SkinColor.Brown())
  442. {
  443. return "Materials/Skin/brownSkin";
  444. }
  445. else if (skinID == SkinColor.Pale())
  446. {
  447. return "Materials/Skin/paleSkin";
  448. }
  449. else
  450. {
  451. return "If you see this there is an improper skin id for this person.";
  452. }
  453. }
  454. }
  455. #endregion
  456.  
  457. #region Tongue Class
  458. public static class TongueMaterial
  459. {
  460. public static string get()
  461. {
  462. return "Materials/Tongue/normalTongue";
  463. }
  464. }
  465. #endregion
  466.  
  467. #region Mouth Class
  468. public static class MouthMaterial
  469. {
  470. public static string get()
  471. {
  472. return "Materials/Mouth/cleanMouth";
  473. }
  474. }
  475. #endregion
  476.  
  477. #region Eye Color Class
  478. public static class EyeColor
  479. {
  480. private static int black = 0;
  481. private static int brown = 1;
  482. private static int blue = 2;
  483. private static int cyan = 3;
  484. private static int lightBrown = 4;
  485. private static int yellow = 5;
  486. private static int red = 6;
  487. private static int purple = 6;
  488. private static int orange = 8;
  489. private static int white = 9;
  490.  
  491. public static int Black()
  492. {
  493. return black;
  494. }
  495.  
  496. public static int Brown()
  497. {
  498. return brown;
  499. }
  500.  
  501. public static int Blue()
  502. {
  503. return blue;
  504. }
  505.  
  506. public static int Cyan()
  507. {
  508. return cyan;
  509. }
  510.  
  511. public static int LightBrown()
  512. {
  513. return lightBrown;
  514. }
  515.  
  516. public static int Yellow()
  517. {
  518. return yellow;
  519. }
  520.  
  521. public static int Red()
  522. {
  523. return red;
  524. }
  525.  
  526. public static int Purple()
  527. {
  528. return purple;
  529. }
  530.  
  531. public static int Orange()
  532. {
  533. return orange;
  534. }
  535.  
  536. public static int White()
  537. {
  538. return white;
  539. }
  540. }
  541. #endregion
  542.  
  543. #region Eye Color Return Material Class
  544. public static class EyeMaterial
  545. {
  546. public static string get(int eyeID)
  547. {
  548. if (eyeID == EyeColor.Black())
  549. {
  550. return "Materials/Eyes/blackEyes";
  551. }
  552. else if (eyeID == EyeColor.Blue())
  553. {
  554. return "Materials/Eyes/blueEyes";
  555. }
  556. else if (eyeID == EyeColor.Brown())
  557. {
  558. return "Materials/Eyes/brownEyes";
  559. }
  560. else if (eyeID == EyeColor.Cyan())
  561. {
  562. return "Materials/Eyes/cyanEyes";
  563. }
  564. else if (eyeID == EyeColor.LightBrown())
  565. {
  566. return "Materials/Eyes/lightBrownEyes";
  567. }
  568. else if (eyeID == EyeColor.Orange())
  569. {
  570. return "Materials/Eyes/orangeEyes";
  571. }
  572. else if (eyeID == EyeColor.Purple())
  573. {
  574. return "Materials/Eyes/purpleEyes";
  575. }
  576. else if (eyeID == EyeColor.Red())
  577. {
  578. return "Materials/Eyes/redEyes";
  579. }
  580. else if (eyeID == EyeColor.White())
  581. {
  582. return "Materials/Eyes/whiteEyes";
  583. }
  584. else if (eyeID == EyeColor.Yellow())
  585. {
  586. return "Materials/Eyes/yellowEyes";
  587. }
  588. else
  589. {
  590. return "If you see this there is an error getting a materal for someone's eyes!";
  591. }
  592. }
  593. }
  594. #endregion
  595.  
  596. #region Hair Color Class
  597. public static class HairColor
  598. {
  599. private static int white = 0;
  600. private static int red = 1;
  601. private static int black = 2;
  602. private static int blond = 3;
  603. private static int brown = 4;
  604. private static int lightBrown = 5;
  605. //etc etc
  606. }
  607. #endregion
  608.  
  609. #endregion
Advertisement
Add Comment
Please, Sign In to add comment