public virtual void AttemptToAttack(Creature source, Creature target) { if (!CanAttack) { return; } if (IsAttacking) { return; } if (Vector3.Distance(source.transform.position, target.transform.position) <= AttackRange) { CombatLog.LogItem($"{source.Name} winding up to attack {target.Name} with {this.Name}!"); StartAttack(source, target); } }
public virtual void Die() { WorldMap.Instance.RemoveCreature(this); CombatLog.LogItem($"{Name} has died!"); if (this.tag == "Anita") { EndConditions.Instance.PlayerLose(); } else { CardHandler.Instance.InsertLoot(Camera.main.WorldToScreenPoint(transform.position), RollLoot()); Destroy(gameObject); } }