Adding ids output to cursecheck (#2093)

Co-authored-by: Guilherme Abraham <guilherme.abraham@zpesystems.com>
Co-authored-by: Myk <myk002@yahoo.com>
develop
Guilherme Abraham 2022-04-22 00:22:05 -03:00 committed by GitHub
parent 9c9a7ef99a
commit 2aa28d34b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

@ -313,6 +313,7 @@ Options:
:detail: Print full name, date of birth, date of curse and some status :detail: Print full name, date of birth, date of curse and some status
info (some vampires might use fake identities in-game, though). info (some vampires might use fake identities in-game, though).
:ids: Print the creature and race IDs.
:nick: Set the type of curse as nickname (does not always show up :nick: Set the type of curse as nickname (does not always show up
in-game, some vamps don't like nicknames). in-game, some vamps don't like nicknames).
:all: Include dead and passive cursed creatures (can result in a quite :all: Include dead and passive cursed creatures (can result in a quite

@ -57,6 +57,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- `autochop`: preferably designate larger trees over smaller ones - `autochop`: preferably designate larger trees over smaller ones
- `blueprint`: ``track`` phase renamed to ``carve``. carved fortifications and (optionally) engravings are now captured in blueprints - `blueprint`: ``track`` phase renamed to ``carve``. carved fortifications and (optionally) engravings are now captured in blueprints
- `tweak` stable-cursor: Keep the cursor stable even when the viewport moves a small amount - `tweak` stable-cursor: Keep the cursor stable even when the viewport moves a small amount
- `cursecheck`: Added a new parameter, ``ids``, to print creature and race IDs of the cursed creature.
## Documentation ## Documentation
- Add more examples to the plugin skeleton files so they are more informative for a newbie - Add more examples to the plugin skeleton files so they are more informative for a newbie

@ -146,6 +146,7 @@ command_result cursecheck (color_ostream &out, vector <string> & parameters)
Gui::getCursorCoords(cursorX,cursorY,cursorZ); Gui::getCursorCoords(cursorX,cursorY,cursorZ);
bool giveDetails = false; bool giveDetails = false;
bool giveUnitID = false;
bool giveNick = false; bool giveNick = false;
bool ignoreDead = true; bool ignoreDead = true;
bool verbose = false; bool verbose = false;
@ -162,6 +163,7 @@ command_result cursecheck (color_ostream &out, vector <string> & parameters)
" By default dead and passive creatures (aka really dead) are ignored.\n" " By default dead and passive creatures (aka really dead) are ignored.\n"
"Options:\n" "Options:\n"
" detail - show details (name and age shown ingame might differ)\n" " detail - show details (name and age shown ingame might differ)\n"
" ids - add creature and race IDs to be show on the output\n"
" nick - try to set cursetype as nickname (does not always work)\n" " nick - try to set cursetype as nickname (does not always work)\n"
" all - include dead and passive creatures\n" " all - include dead and passive creatures\n"
" verbose - show all curse tags (if you really want to know it all)\n" " verbose - show all curse tags (if you really want to know it all)\n"
@ -170,6 +172,8 @@ command_result cursecheck (color_ostream &out, vector <string> & parameters)
} }
if(parameters[i] == "detail") if(parameters[i] == "detail")
giveDetails = true; giveDetails = true;
if(parameters[i] == "ids")
giveUnitID = true;
if(parameters[i] == "nick") if(parameters[i] == "nick")
giveNick = true; giveNick = true;
if(parameters[i] == "all") if(parameters[i] == "all")
@ -269,6 +273,11 @@ command_result cursecheck (color_ostream &out, vector <string> & parameters)
<< bitfield_to_string(unit->curse.add_tags2) << endl; << bitfield_to_string(unit->curse.add_tags2) << endl;
} }
} }
if (giveUnitID)
{
out.print("Creature %d, race %d (%x)\n", unit->id, unit->race, unit->race);
}
} }
} }