Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayerStats : MonoBehaviour {
  6. private string[] firstName = {"Damon","Julian","Noah","Liam","Mason","Jacob","William","Ethan","James","Alexander","Rebecca", "Michael","Bejamin", "Elijah","Daniel","Aiden","Logan","Matthew","Lucas","Jackson","David","Oliver","Olivia","Jayden","Joseph","Gabriel","Samuel","Carter","Anthony","Bill","Bob","John","Dylan","Luke","Henry","Andrew","Isaac","Cristopher","Joshua","Wyatt","Sebastian","Owen","Lee","Omid","Christa","Kenny","Clementine","Marcus","Edward","Alycia","Julia","Juliette","Ellie"}; //Who is this character name?
  7. private string[] lastName = {"Ross","Creagar","Payne","Davis","Mcelfresh","Filiaggi","Taina","Giles","Martinez","Bruno","Rosario","Boltman","Rivera","Lund","Duncan","Warren","McCain","Kyler","Bay","Leon","Patane","Lieu","Michelle","Crowley","Zino","Bellingar","Lynn","Valentine","Marie","Mundy","Willey","Walsh"};
  8. public int playerHP;
  9. public int playerMaxHP;
  10. public int playerStamina;
  11. public int playerMaxStamina;
  12. public int playerWeight; //How much weight the player is carrying, more weight = slower movement speed and stamina regen.
  13. public int playerWeightMax; //How much weight the player can hold before carrying too much, stamina regen is vastly destroyed.
  14. public int athleteLevel; //How much max stamina does the player have? Each level increases max stamina slightly, and even 5 levels the players speed increases slightly.
  15. public int fightingLevel; //How much damage the player will do, forumla is as follow *base damage stat x fighting level = total damage.* Every fighting level equals .1 in fighting damage, for example fighting level 3 gets a 1.3x multiplier.
  16. public int enduranceLevel; //How much health the player gains, when the player takes damage, this will level up, increasing how long they can survive.
  17. public int smartsLevel; //How smart the player is when crafting, higher smarts means more buildings and items to make.
  18. public int charismaLevel; //How easy this player is to talk to, when survivors come to this player, they'll have more dialogue and things to do with AI.
  19. public int anger; //How angry the player is, when the player fails missions, takes too much damage or witnesses someone with high friendship level die, they'll become enraged, when enraged, the player deals more damage, and stamina is greatly increased, however, crafting is disabled, talking to others is disabled, they cannot use items, and cannot use guns or bows.
  20. public int angerMax;
  21. public int thirstLevel; //How thirsty the player is, when thirst becomes a problem, the player cannot run, cannot swing effectively, and cannot dodge effectively, isn't life threatening until later on.
  22. public int thirstMax;
  23. public int hungerLevel; //How hungry the player is, when player begins to starve, they deal less damage, regain stamina much slower. Once stamina reaches 0, player will slowly take damage, until death.
  24. public int hungerMax;
  25. public float movementSpeed;
  26. public int immuneTrait; //Best trait there is, player is immune to infection bites, scratches, anything. Hardest to find but worth.
  27. public int professionalRunnerTrait; //Player has slightly faster movement speed, and gains athlete skill faster.
  28. public int libraryTrait; //Player is much smarter, and can craft pretty much everything without working on the smarts skill.
  29. public int boxerTrait; //Player can fight very well, and with ease. Player levels up faster via fighting and can deal more damage, but in exchange can get enraged slightly faster.
  30. public int sadismTrait; //Player enjoys inflicting pain on others, although...not so much for Z's, fighting bandits or thieves in CQC is easier.
  31. public int masochistTrait; //Player enjoys pain, they freaking love it! They can take a beating much more (more HP) and level up endurance faster.
  32. public int asthmaTrait; //Player regens stamina much slower, and can even take damage if they run for a long period of times, inhalers can prevent this effect for a bit.
  33. public int nerdTrait; //Player is a nerd! Learn how to use smarts much faster, however, the player is weaker at fighting.
  34. public int sadnessTrait; //Player is sad, usually doesn't do much except lower charisma for a bit until it passes, coffee or energy drink cures sadness. Usually happens after a rage passes or witnessing someone die.
  35. public int silverTongueTrait; //Player has a silver tongue! Charisma is much easier to learn and starts off pretty high.
  36. public int musicLoverTrait; //Player loves music, gives more social dialogue.
  37. public int gameLoverTrait; //Player has a much easier time talking to nerds.
  38. public int robberTrait; //Player was a robber pre-apocalypse, can stealth much easier, lock pick easier, but doesn't get along with too many people, and often time cannot be trusted.
  39. public int blacksmithTrait; //Player was a blacksmith, can make weapons with higher quality, repair items without much parts.
  40. public int tapeKindOfGuyTrait; //Player can use tape instead of standard items to fix things, or even make things. (Using this option has a high chance of a low quality item, but gets the job done.
  41. public int loneWolfTrait; //We wolves prefer to hunt alone. Lone wolves tend to do things a lot more efficently, however if a human is near by, regardless of helping them or not, they'll get upset, rage increases over time, and stats will lower, but if alone they'll gain massive stat increases.
  42. public int bluntWeaponMaster; //Player LOVES blunt weapons such as baseball bats, can be learned over time or gained as a trait, blunt weapons last longer, swing faster, and deal more damage with this trait.
  43. public int sharpWeaponMaster; //Player Loves sharp weapons such as butcher knives,can be learned over time or gained as a trait, sharp weapons last longer, swing faster, and deal more damage with this trait.
  44. public int easilyAngerableTrait; //Player gets angry quickly, very quickly. Rage meter increases much faster.
  45. private int totalRandomTraits = 6; //How much traits does the character start with
  46. private Rigidbody characterRB;
  47. public float jumpSpeed;
  48. private float jumpTimer;
  49. private bool isMidJump;
  50. private int jumpTimerMax = 5;
  51.  
  52.  
  53.  
  54. public void CreatePlayer()
  55. {
  56.  
  57. int fn = 0;
  58. int ln = 0;
  59. fn = Random.Range(0, firstName.Length);
  60. ln = Random.Range(0, lastName.Length);
  61. string name = "";
  62. name = firstName[fn] + " " + lastName[ln];
  63. Debug.Log(name);
  64. }
  65. public void Start()
  66. {
  67. characterRB = GetComponent<Rigidbody>();
  68.  
  69. }
  70.  
  71. // Update is called once per frame
  72. void Update()
  73. {
  74. //Moves Forward and back along z axis //Up/Down
  75. transform.Translate(Vector3.forward * Time.deltaTime * Input.GetAxis("Vertical") * movementSpeed);
  76. if (Input.GetKeyDown (KeyCode.LeftShift)) {
  77. movementSpeed *= 1.2f;
  78. }
  79. //Moves Left and right along x Axis //Left/Right
  80. transform.Translate(Vector3.right * Time.deltaTime * Input.GetAxis("Horizontal") * movementSpeed);
  81. //Jumps the player up for a bit.
  82. if (isMidJump == false) {
  83. transform.Translate (Vector3.up * Time.deltaTime * Input.GetAxis ("Jump") * jumpSpeed);
  84. isMidJump = true;
  85. Debug.Log ("I am mid jump.");
  86. }
  87. if (isMidJump == true) {
  88. jumpTimer += Time.deltaTime;
  89. Debug.Log (jumpTimer);
  90. }
  91. if (jumpTimer >= jumpTimerMax) {
  92. jumpTimer = 0;
  93. isMidJump = false;
  94. }
  95. if (Input.GetKeyUp (KeyCode.LeftShift)) {
  96. movementSpeed = 10;
  97. }
  98. }
  99.  
  100.  
  101.  
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement