Beispiel #1
0
	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 ;
	}
Beispiel #2
0
	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;
	}
Beispiel #3
0
	void Awake()
	{
		instance = this.gameObject.GetComponent<playerScript>();
		state = State.IDLE;
		_upToDate = true;
		target = null;
		_agent = GetComponent<NavMeshAgent>();
		_animator = GetComponent<Animator>();
		stats = GetComponent<statScript>();
	}
Beispiel #4
0
	void Start () {
		_stats = GameObject.Find ("Maya").GetComponent<statScript> ();
		_text = GetComponent<Text> ();
	}