public void takeDamage(statScript attacker){ float damage; if (Random.Range (0, 100) > 75 + attacker.AGI - AGI) return ; damage = Random.Range(attacker.minDamage, attacker.maxDamage) * Mathf.Clamp(1.0f - Armor / 200.0f, 0.0f, 1.0f); HP -= (int)damage; return ; }
void Awake () { state = State.IDLE; _player = GameObject.Find ("Maya"); _agent = GetComponent<NavMeshAgent>(); _animator = GetComponent<Animator> (); _stats = GetComponent<statScript> (); _stats.setSpwanedStats(_player.GetComponent<statScript>().level); _upToDate = true; }
void Awake() { instance = this.gameObject.GetComponent<playerScript>(); state = State.IDLE; _upToDate = true; target = null; _agent = GetComponent<NavMeshAgent>(); _animator = GetComponent<Animator>(); stats = GetComponent<statScript>(); }
void Start () { _stats = GameObject.Find ("Maya").GetComponent<statScript> (); _text = GetComponent<Text> (); }