From cd57ad6e208728bafcbc8c7d7b85d88603706978 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 20 Apr 2021 12:40:37 -0400 Subject: Updated natural armor and skills --- src/dmtool.cc | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/dmtool.cc') diff --git a/src/dmtool.cc b/src/dmtool.cc index 7f2c72c..f9d32ab 100644 --- a/src/dmtool.cc +++ b/src/dmtool.cc @@ -17,24 +17,34 @@ void usage(string exename) { cout << indDesc << "List creatures and objects.\n"; cout << indOpt << "cp old-path new-path\n"; cout << indDesc << "Copy old-path to new-path.\n"; + cout << indOpt << "mv old-path new-path\n"; + cout << indDesc << "Move old-path to new-path.\n"; cout << indOpt << "rm path\n"; cout << indDesc << "Remove existing creature, object, or directory.\n"; cout << indOpt << "roll path name\n"; cout << indDesc << "Roll a skill check, save, or attack.\n"; cout << indOpt << "damage path amount [type]\n"; cout << indDesc << "Damage creature by amount. Type defaults to \"force\".\n"; + cout << indOpt << "heal path amount\n"; + cout << indDesc << "Heal creature by amount.\n"; + cout << indOpt << "reset path\n"; + cout << indDesc << "Reset creature to full health (as if completing a long rest).\n"; cout << indOpt << "set path field value\n"; cout << indDesc << "Set a field to a new value, where field is any of:\n"; cout << indDesc << " ability (str, dex, con, int, wis, cha); value is new ability score\n"; cout << indDesc << " skill (athletics, \"sleight of hand\", etc.); value is (none|proficient|expert)\n"; - cout << indDesc << " name; value is new given name\n"; - cout << indOpt << "add path object\n"; - cout << indDesc << "Add object to creature's inventory. If it is armor or a weapon, it will automatically be equipped (if applicable)\n"; - + cout << indDesc << " name; value is new given name.\n"; + cout << indOpt << "add path entry\n"; + cout << indDesc << "Add entry to creature, where entry is an item or spell.\n"; cout << indOpt << "help\n"; cout << indDesc << "Show this help.\n"; } +void print(string path) { + creature::Creature c(utils::loadJson(path)); + cout << genText(c); +} + void list(vector args) { string baseDir = settings::getString("savedir"); vector listPaths; @@ -48,8 +58,7 @@ void list(vector args) { for(auto listPath : listPaths) { if(fs::is_regular_file(fs::status(listPath))) { // Try loading and printing stuff about it - creature::Creature c(utils::loadJson(listPath)); - cout << genText(c); + print(listPath); } else if(fs::is_directory(fs::status(listPath))) { for(fs::directory_entry path : filesystem::directory_iterator(listPath)) { @@ -64,9 +73,12 @@ void list(vector args) { } void cp(vector args) {} +void mv(vector args) {} void rm(vector args) {} void roll(vector args) {} void damage(vector args) {} +void heal(vector args) {} +void reset(vector args) {} void set(vector args) {} void add(vector args) {} @@ -82,9 +94,12 @@ int main(int argc, char *argv[]) { args.erase(args.begin()); if(cmd == "ls") list(args); else if(cmd == "cp") cp(args); + else if(cmd == "mv") mv(args); else if(cmd == "rm") rm(args); else if(cmd == "roll") roll(args); else if(cmd == "damage") damage(args); + else if(cmd == "heal") heal(args); + else if(cmd == "reset") reset(args); else if(cmd == "set") set(args); else if(cmd == "add") add(args); else if(cmd == "help") usage(exename); -- cgit v1.2.3