Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // ABOUT //
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /*
- * This file contains scripts that are used to hold information about each Actor. Actors can be players or NPCs.
- *
- * It is not necessary to add an object to a scene that contains this script.
- */
- //These are tiny classes that contain information used in each Actor.
- #region Property Classes
- public class Attributes
- {
- /*
- *This class contains physical charactaristics of a human, and is used in the Actor class.
- */
- public int gender;
- public int eyeColor;
- public int skinColor;
- public int hairColor;
- public int hairStyle;
- public int beardStyle;
- public int age;
- }
- public class Equiped
- {
- /*
- * This class contains the items the character has equiped in each slot. It is used by the Actor class.
- */
- public int hands;
- public int feet;
- public int head;
- public int neck;
- public int torso;
- public int legs;
- public int arms;
- public int finger;
- public int face;
- public int back;
- public int[] items = new int[4];
- public ArrayList inventory;
- }
- public class AI
- {
- /*
- * This class contains AI information for the actor.
- */
- public bool isPlayer;
- public int AIType;
- public int AIState;
- public GameObject spawn;
- }
- #endregion
- //This is the main class for actors, where each actor is instantiated.
- #region Actor Class
- public class Actor
- {
- /*
- * This class defines an individual character in the game. It contains all of its information for how they should be spawned in, indlucing
- * things like skin color, eye color, gender, armor, weapons, etc.
- *
- * Once the mission template system is set up, you will never call any of these things directly.
- *
- * - Ramaraunt
- */
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // PROPERTIES //
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /*
- * This is where the properties, or attributes, of each Actor is defined.
- */
- //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;
- private static int actorCount = 0;
- //This is the ID of the current Actor.
- private int ID { get; set; }
- //This is a boolean, which is true if the actor is built successfully.
- private bool builtSuccessfully = false;
- public bool getStatus()
- {
- return builtSuccessfully;
- }
- //This object contains information related to physical characteristics of the actor. See Attributes class above.
- private Attributes attributes { get; set; }
- //This object contains information related to items the actor is carrying. See Equiped class above.
- private Equiped equipment { get; set; }
- //This object contains information related to the actor's AI. See AI class above.
- private AI AIInfos;
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // CONSTRUCTORS //
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /*
- * The following methods are called in order to create a new instance of Actor.
- */
- //This is the default constructor with no attributes. It will define a naked guy. Don't use this unless you are testing.
- #region default constructor
- public Actor()
- {
- //Assign the ID, and increment actorCount.
- ID = actorCount;
- actorCount++;
- attributes = new Attributes();
- equipment = new Equiped();
- AIInfos = new AI();
- //define the basic characteristics of the actor as 0 (default).
- attributes.gender = 0;
- attributes.eyeColor = 0;
- attributes.skinColor = 0;
- attributes.hairColor = 0;
- attributes.hairStyle = 0;
- attributes.beardStyle = 0;
- attributes.age = 0;
- //define the slots as 0 (unfilled)
- equipment.hands = 0;
- equipment.feet = 0;
- equipment.head = 0;
- equipment.neck = 0;
- equipment.torso = 0;
- equipment.legs = 0;
- equipment.arms = 0;
- equipment.finger = 0;
- equipment.face = 0;
- equipment.back = 0;
- for (int cur_item_slot = 0; cur_item_slot < 4; cur_item_slot++)
- {
- equipment.items[cur_item_slot] = 0;
- }
- //define all AI stuffs to default values
- AIInfos.AIState = 0;
- AIInfos.AIType = 0;
- AIInfos.isPlayer = false;
- //Set builtSuccessfully to true.
- builtSuccessfully = true;
- }
- #endregion
- //This is the designated constructor with all attributes. It will define a person the way you want him.
- #region designated constructor
- public Actor(Attributes attributes, Equiped equipment, AI AIInfos)
- {
- //Move over the arguments to the properties.
- this.attributes = attributes;
- this.equipment = equipment;
- this.AIInfos = AIInfos;
- //It has been built!
- builtSuccessfully = true;
- }
- #endregion
- }
- #endregion
- //These are classes that can be called to get deffinitions of IDs and names of things. Made for ease of use purposes.
- //If you are adding new items to the game, or are adding new hairstyles and whatnot, most of that stuff is configured here!
- #region ID classes
- #region Gender Class
- public static class Gender
- {
- private static int male = 1;
- private static int female = 0;
- public static int Male()
- {
- return male;
- }
- public static int Female()
- {
- return female;
- }
- }
- #endregion
- #region Body Parts Return Class
- public static class BodyPart
- {
- public static string bodyFrame()
- {
- return ("Objects/bones/main_frame");
- }
- public static string bodyWhole(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "man_body";
- }
- else if (genderID == Gender.Female())
- {
- return "woman_body";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Head(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleHead";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleHead";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Arms(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleArms";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleArms";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Legs(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleLegs";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleLegs";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Torso(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleTorso";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleTorso";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Hands(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleHands";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleHands";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Feet(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleFeet";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleFeet";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Ears(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleEars";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleEars";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Mouth(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleMouth";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleMouth";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Eyes(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleEyes";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleEyes";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Tongue(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "Objects/MaleParts/maleTongue";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleTongue";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- }
- #endregion
- #region Skin Color Class
- public static class SkinColor
- {
- private static int caucasian = 0;
- private static int black = 1;
- private static int brown = 2;
- private static int arabian = 3;
- private static int oriental = 4;
- private static int pale = 5;
- public static int Caucasian()
- {
- return caucasian;
- }
- public static int Black()
- {
- return black;
- }
- public static int Brown()
- {
- return brown;
- }
- public static int Arabian()
- {
- return arabian;
- }
- public static int Oriental()
- {
- return oriental;
- }
- public static int Pale()
- {
- return pale;
- }
- //etc etc
- }
- #endregion
- #region Skin Color Return Material Class
- public static class SkinMaterial
- {
- public static string get(int skinID)
- {
- if (skinID == SkinColor.Caucasian())
- {
- return "Materials/Skin/whiteSkin";
- }
- else if (skinID == SkinColor.Arabian())
- {
- return "Materials/Skin/bronzeSkin";
- }
- else if (skinID == SkinColor.Oriental())
- {
- return "Materials/Skin/asianSkin";
- }
- else if (skinID == SkinColor.Black())
- {
- return "Materials/Skin/blackSkin";
- }
- else if (skinID == SkinColor.Brown())
- {
- return "Materials/Skin/brownSkin";
- }
- else if (skinID == SkinColor.Pale())
- {
- return "Materials/Skin/paleSkin";
- }
- else
- {
- return "If you see this there is an improper skin id for this person.";
- }
- }
- }
- #endregion
- #region Tongue Class
- public static class TongueMaterial
- {
- public static string get()
- {
- return "Materials/Tongue/normalTongue";
- }
- }
- #endregion
- #region Mouth Class
- public static class MouthMaterial
- {
- public static string get()
- {
- return "Materials/Mouth/cleanMouth";
- }
- }
- #endregion
- #region Eye Color Class
- public static class EyeColor
- {
- private static int black = 0;
- private static int brown = 1;
- private static int blue = 2;
- private static int cyan = 3;
- private static int lightBrown = 4;
- private static int yellow = 5;
- private static int red = 6;
- private static int purple = 6;
- private static int orange = 8;
- private static int white = 9;
- public static int Black()
- {
- return black;
- }
- public static int Brown()
- {
- return brown;
- }
- public static int Blue()
- {
- return blue;
- }
- public static int Cyan()
- {
- return cyan;
- }
- public static int LightBrown()
- {
- return lightBrown;
- }
- public static int Yellow()
- {
- return yellow;
- }
- public static int Red()
- {
- return red;
- }
- public static int Purple()
- {
- return purple;
- }
- public static int Orange()
- {
- return orange;
- }
- public static int White()
- {
- return white;
- }
- }
- #endregion
- #region Eye Color Return Material Class
- public static class EyeMaterial
- {
- public static string get(int eyeID)
- {
- if (eyeID == EyeColor.Black())
- {
- return "Materials/Eyes/blackEyes";
- }
- else if (eyeID == EyeColor.Blue())
- {
- return "Materials/Eyes/blueEyes";
- }
- else if (eyeID == EyeColor.Brown())
- {
- return "Materials/Eyes/brownEyes";
- }
- else if (eyeID == EyeColor.Cyan())
- {
- return "Materials/Eyes/cyanEyes";
- }
- else if (eyeID == EyeColor.LightBrown())
- {
- return "Materials/Eyes/lightBrownEyes";
- }
- else if (eyeID == EyeColor.Orange())
- {
- return "Materials/Eyes/orangeEyes";
- }
- else if (eyeID == EyeColor.Purple())
- {
- return "Materials/Eyes/purpleEyes";
- }
- else if (eyeID == EyeColor.Red())
- {
- return "Materials/Eyes/redEyes";
- }
- else if (eyeID == EyeColor.White())
- {
- return "Materials/Eyes/whiteEyes";
- }
- else if (eyeID == EyeColor.Yellow())
- {
- return "Materials/Eyes/yellowEyes";
- }
- else
- {
- return "If you see this there is an error getting a materal for someone's eyes!";
- }
- }
- }
- #endregion
- #region Hair Color Class
- public static class HairColor
- {
- private static int white = 0;
- private static int red = 1;
- private static int black = 2;
- private static int blond = 3;
- private static int brown = 4;
- private static int lightBrown = 5;
- //etc etc
- }
- #endregion
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment