From 52b91a1aca6640b1797a63afc8a9e9a778b0964a Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 25 Dec 2021 16:52:34 -0500 Subject: Added capability to cause two npcs to attack each other --- src/cmd.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cmd.cc') diff --git a/src/cmd.cc b/src/cmd.cc index 7be5e01..7029f0c 100644 --- a/src/cmd.cc +++ b/src/cmd.cc @@ -30,4 +30,10 @@ namespace cmd { if(std::filesystem::directory_entry(p.string() + ".json").is_regular_file()) return p.string() + ".json"; return p; } + + std::string formatRoll(std::string name, std::string type, int rolled, int bonus) { + std::stringstream text; + text << name << " " << type << ": " << rolled << " (d20) + " << bonus << " (" << name << " " << type << " bonus) = " << rolled + bonus << std::endl; + return text.str(); + } } -- cgit v1.2.3