From 547dbe05faa3bf02f9ca5254fd5d3ea5b72f6421 Mon Sep 17 00:00:00 2001 From: Raoul XQ Date: Wed, 13 Apr 2011 13:22:14 +0200 Subject: [PATCH] Add --showallflags flag to display all flags Add --showallflags flag to display all flags of a creature. (Default: Display a few important ones.) --- tools/playground/skillmodify.cpp | 121 ++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 26 deletions(-) diff --git a/tools/playground/skillmodify.cpp b/tools/playground/skillmodify.cpp index 4e00ffa71..0f6a04a9f 100644 --- a/tools/playground/skillmodify.cpp +++ b/tools/playground/skillmodify.cpp @@ -23,6 +23,7 @@ * - Hide skills with level 0 and 0 experience points * Done: + * - Add --showallflags flag to display all flags (default: display a few important ones) * - Add --showdead flag to also display dead creatures * - Display more creature flags * - Show creature type (again) @@ -93,6 +94,7 @@ bool showhauler = true; bool showsocial = false; bool showfirstlineonly = false; bool showdead = false; +bool showallflags = false; int hauler_labors[] = { LABOR_STONE_HAULING @@ -136,6 +138,7 @@ void usage(int argc, const char * argv[]) << "--nicks : Only show/modify creatures with custom nickname" << endl << "-ll : List available labors" << endl << "--showdead : Also show/modify dead creatures" << endl + << "--showallflags: Show all flags of a creature" << endl << endl << "Modifying options:" << endl << "-al : Add labor to creature" << endl @@ -372,33 +375,95 @@ void printCreature(DFHack::Context * DF, const DFHack::t_creature & creature, in cout << "(Labor " << i << ") " << setw(16) << laborname << endl; } } - /* FLAGS 1 */ - if(creature.flags1.bits.dead) { cout << "Flag: Dead" << endl; } - if(creature.flags1.bits.on_ground) { cout << "Flag: On the ground" << endl; } - if(creature.flags1.bits.skeleton) { cout << "Flag: Skeletal" << endl; } - if(creature.flags1.bits.zombie) { cout << "Flag: Zombie" << endl; } - if(creature.flags1.bits.tame) { cout << "Flag: Tame" << endl; } - if(creature.flags1.bits.active_invader) { cout << toCaps("Flag: active_invader") << endl; } - if(creature.flags1.bits.hidden_in_ambush) { cout << toCaps("Flag: hidden_in_ambush") << endl; } - if(creature.flags1.bits.invader_origin) { cout << toCaps("Flag: invader_origin") << endl; } - if(creature.flags1.bits.coward) { cout << toCaps("Flag: coward") << endl; } - if(creature.flags1.bits.hidden_ambusher) { cout << toCaps("Flag: hidden_ambusher") << endl; } - if(creature.flags1.bits.caged) { cout << toCaps("Flag: caged") << endl; } - if(creature.flags1.bits.chained) { cout << toCaps("Flag: chained") << endl; } - if(creature.flags1.bits.royal_guard) { cout << "Flag: Royal guard" << endl; } - if(creature.flags1.bits.fortress_guard) { cout << "Flag: Fortress guard" << endl; } - - /* FLAGS 2 */ - if(creature.flags2.bits.killed) { cout << "Flag: Killed by kill function" << endl; } - if(creature.flags2.bits.resident) { cout << "Flag: Resident" << endl; } - if(creature.flags2.bits.gutted) { cout << "Flag: Gutted" << endl; } - if(creature.flags2.bits.slaughter) { cout << "Flag: Marked for slaughter" << endl; } - if(creature.flags2.bits.underworld) { cout << "Flag: From the underworld" << endl; } - - if(creature.flags1.bits.had_mood && (creature.mood == -1 || creature.mood == 8 ) ) + if (showallflags) { - string artifact_name = Tran->TranslateName(creature.artifact_name,false); - cout << "Artifact: " << artifact_name << endl; + DFHack::t_creaturflags1 f1 = creature.flags1; + DFHack::t_creaturflags2 f2 = creature.flags2; + + if(f1.bits.had_mood){cout<TranslateName(creature.artifact_name,false); + cout << "Artifact: " << artifact_name << endl; + } } } @@ -476,6 +541,10 @@ int main (int argc, const char* argv[]) { showdead = true; } + else if(arg_cur == "--showallflags") + { + showallflags = true; + } else if(arg_cur == "-ras") { remove_skills = true;