Exemplo n.º 1
0
 public void Attack(GameObject combatTarget)
 {
     GetComponent <ActionScheduler>().StartAction(this);
     target = combatTarget.GetComponent <Health>();
 }
Exemplo n.º 2
0
 public void Attack(GameObject combatTarget)
 {
     actionscheduler.StartAction(this);
     print("i f**k you up!");
     target = combatTarget.GetComponent <Health>();
 }
Exemplo n.º 3
0
 public void Cancel()
 {
     StopAttack();
     target = null;
     mover.Cancel();
 }
Exemplo n.º 4
0
 public void Attack(CombatTarget combatTarget)
 {
     actionScheduler.StartAction(this);
     target       = combatTarget.transform;
     targetHealth = target.GetComponent <Health>();
 }
Exemplo 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);
        }
Exemplo n.º 6
0
 public void Cancel()
 {
     StopAttack();
     _target = null;
 }
Exemplo n.º 7
0
 //Unsets the target so that we can move and not continue attacking
 private void CancelAttack()
 {
     StopAttack();
     m_Target = null;
 }
Exemplo n.º 8
0
 public void SetTarget(Health target, float damage)
 {
     this.target = target;
     this.damage = damage;
 }
Exemplo n.º 9
0
        void Hit()
        {
            Health healthComponent = target.GetComponent <Health>();

            healthComponent.TackDamage(weaponDamage);
        }
Exemplo n.º 10
0
 public void Cancel()
 {
     target = null;
     StopAttack();
 }
Exemplo 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";
        }
Exemplo n.º 12
0
 public void Cancel()
 {
     GetComponent <Animator>().ResetTrigger("attack");
     GetComponent <Animator>().SetTrigger("stopAttack");
     this.target = null;
 }
Exemplo n.º 13
0
 public bool GetIsInWeaponRange(Health target)
 {
     return(Vector3.Distance(this.transform.position, target.transform.position) < weaponRange);
 }
Exemplo n.º 14
0
 public void Cancel()
 {
     StopAttackTrigger();
     _target = null;
     GetComponent <Mover>().Cancel();
 }
Exemplo 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);
        }
Exemplo n.º 16
0
 public void Cancel()
 {
     StopAttack();
     target = null;
     GetComponent <Mover>().Cancel();
 }
Exemplo n.º 17
0
 public void Cancel()
 {
     StopAttacking();
     target = null;
 }
Exemplo n.º 18
0
 public void Attack(GameObject combatTarget)
 {
     //implementation of IAction
     GetComponent <ActionScheduler>().StartAction(this);
     target = combatTarget.GetComponent <Health>();  //previously combatTarget.transform
 }