Esempio n. 1
0
 public void Attack(GameObject combatTarget)
 {
     GetComponent <ActionScheduler>().StartAction(this);
     target = combatTarget.GetComponent <Health>();
 }
Esempio n. 2
0
 public void Attack(GameObject combatTarget)
 {
     actionscheduler.StartAction(this);
     print("i f**k you up!");
     target = combatTarget.GetComponent <Health>();
 }
Esempio n. 3
0
 public void Cancel()
 {
     StopAttack();
     target = null;
     mover.Cancel();
 }
Esempio n. 4
0
 public void Attack(CombatTarget combatTarget)
 {
     actionScheduler.StartAction(this);
     target       = combatTarget.transform;
     targetHealth = target.GetComponent <Health>();
 }
Esempio n. 5
0
        public void LaunchProjectile(Transform rightHand, Transform leftHand, Health target, GameObject instigator, float calculatedDamage)
        {
            Projectile projectileInstance = Instantiate(projectile, GetTransform(rightHand, leftHand).position, Quaternion.identity);

            projectileInstance.SetTarget(target, instigator, calculatedDamage);
        }
Esempio n. 6
0
 public void Cancel()
 {
     StopAttack();
     _target = null;
 }
Esempio n. 7
0
 //Unsets the target so that we can move and not continue attacking
 private void CancelAttack()
 {
     StopAttack();
     m_Target = null;
 }
Esempio n. 8
0
 public void SetTarget(Health target, float damage)
 {
     this.target = target;
     this.damage = damage;
 }
Esempio n. 9
0
        void Hit()
        {
            Health healthComponent = target.GetComponent <Health>();

            healthComponent.TackDamage(weaponDamage);
        }
Esempio n. 10
0
 public void Cancel()
 {
     target = null;
     StopAttack();
 }
Esempio n. 11
0
        // Update is called once per frame
        void Update()
        {
            Health health = target.GetTarget();

            textDisplay.text = health ? String.Format($"{health.CurrentHealth}/{health.MaxHealth} {health.GetPercentage():0}%") : "N/A";
        }
Esempio n. 12
0
 public void Cancel()
 {
     GetComponent <Animator>().ResetTrigger("attack");
     GetComponent <Animator>().SetTrigger("stopAttack");
     this.target = null;
 }
Esempio n. 13
0
 public bool GetIsInWeaponRange(Health target)
 {
     return(Vector3.Distance(this.transform.position, target.transform.position) < weaponRange);
 }
Esempio n. 14
0
 public void Cancel()
 {
     StopAttackTrigger();
     _target = null;
     GetComponent <Mover>().Cancel();
 }
Esempio n. 15
0
        public void LaunchProjectile(Transform rightHand, Transform leftHand, Health target)
        {
            Projectile projectileInstance = Instantiate(projectile, GetTransform(rightHand, leftHand).position, Quaternion.identity);

            projectileInstance.SetTarget(target, weaponDamage);
        }
Esempio n. 16
0
 public void Cancel()
 {
     StopAttack();
     target = null;
     GetComponent <Mover>().Cancel();
 }
Esempio n. 17
0
 public void Cancel()
 {
     StopAttacking();
     target = null;
 }
Esempio n. 18
0
 public void Attack(GameObject combatTarget)
 {
     //implementation of IAction
     GetComponent <ActionScheduler>().StartAction(this);
     target = combatTarget.GetComponent <Health>();  //previously combatTarget.transform
 }