﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Arugula.Math;

public class AttackRollExample : MonoBehaviour
{
    public Dice dice;
    public int baseDamage = 50;

    public void Update()
    {
        if (Input.GetKeyUp(KeyCode.Space))
            Attack();
    }

    void Attack()
    {
        bool critical = false;
        int damage = dice.Roll(baseDamage, out critical);

        if (critical)
            Debug.Log("<color=yellow><i><b>" + damage + "!</b></i></color>");
        else
            Debug.Log(damage);
    }
}
