コード例 #1
0
ファイル: Creature.cs プロジェクト: craus/the-last-moon
    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();
    }