Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
    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);
        }
    }