public override void Attack(LiveEntity target) { LookAt(target); state.Exit(this); state = new GruntAttackingState(target); state.Enter(this); }
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); } }
public abstract void Attack(LiveEntity target);
public virtual bool ProcessHit(LiveEntity target, GameObject hitBox) { return(false); }
public virtual bool ProcessHit(LiveEntity target) { return(false); }