Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class FormerHumanAI : EnemyAI
- {
- public static int Damage = 5;
- public void Update()
- {
- Debug.Log("Calling FormerHuman Update");
- if (this.GetComponent<EnemyAI>().isFiring == true)
- {
- EnemyAttack();
- }
- }
- public override void EnemyAttack()
- {
- if (GlobalHealth.armor > 0)
- {
- Debug.Log("Dealing Armor Damage");
- int adjustedDamage = (int)Mathf.Floor(Damage * .6f);
- int armorDamage = Damage - adjustedDamage;
- GlobalHealth.health -= adjustedDamage;
- GlobalHealth.armor -= armorDamage;
- }
- else
- {
- Debug.Log("Dealing Regular Damage");
- GlobalHealth.health -= Damage;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement