Exemplo n.º 1
0
    public void Hit(
        Creature attacker,
        int damage            = 1,
        AbilityEffect source  = null,
        Ability ability       = null,
        DamageType damageType = DamageType.Default
        )
    {
        var attack = new Attack(attacker, this, damage, source, damageType);

        GameLog.Message($"{attacker.Text()} attacks {Text()} by {damage} damage" +
                        $"{(ability != null && source != null ? $" with {ability.name} ({source.Description(attacker)})" : "")}" +
                        $"{(ability == null && source != null ? $" with {source.Text(attacker)}" : "")}");

        attack.ApplyBuffs();
        attack.Execute();

        GameManager.instance.ExecutePlannedActions();
    }