| 44 | REQUIRE_GLOBAL(world); |
| 45 | |
| 46 | static command_result df_cprobe(color_ostream &out, vector<string> & parameters) { |
| 47 | auto unit = Gui::getSelectedUnit(out); |
| 48 | if (!unit) |
| 49 | return CR_FAILURE; |
| 50 | |
| 51 | out.print("Creature {}, race {} (0x{:x}), civ {} (0x{:x})\n", |
| 52 | unit->id, unit->race, unit->race, unit->civ_id, unit->civ_id); |
| 53 | |
| 54 | for (auto inv_item : unit->inventory) { |
| 55 | df::item* item = inv_item->item; |
| 56 | if (inv_item->mode == df::inv_item_role_type::Worn) { |
| 57 | out << " wears item: #" << item->id; |
| 58 | if (item->flags.bits.owned) |
| 59 | out << " (owned)"; |
| 60 | else |
| 61 | out << " (not owned)"; |
| 62 | if (item->getEffectiveArmorLevel() != 0) |
| 63 | out << ", armor"; |
| 64 | out << std::endl; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return CR_OK; |
| 69 | } |
| 70 | |
| 71 | static void describeTile(color_ostream &out, df::tiletype tiletype) { |
| 72 | out.print("{}", static_cast<int>(tiletype)); |
nothing calls this directly
no test coverage detected