Example #1
0
 public override void Attack(LiveEntity target)
 {
     LookAt(target);
     state.Exit(this);
     state = new GruntAttackingState(target);
     state.Enter(this);
 }
Example #2
0
        public override bool ProcessHit(LiveEntity target, GameObject hitBox)
        {
            Vector2 vectorToTarget = (target.attachedObject.transform.position - attachedObject.transform.position);

            if (!target.invincible && hitBox.GetComponent <Collider2D>().IsTouching(target.attachedObject.GetComponent <Collider2D>()))
            {
                target.ApplyKnockback(vectorToTarget.normalized * 400, 0.05f, 0.02f, 0.2f);
                target.TakeDamage(Stats["damage"]);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
 public abstract void Attack(LiveEntity target);
Example #4
0
 public virtual bool ProcessHit(LiveEntity target, GameObject hitBox)
 {
     return(false);
 }
Example #5
0
 public virtual bool ProcessHit(LiveEntity target)
 {
     return(false);
 }