| 1165 | } |
| 1166 | |
| 1167 | bool examine_index(int i) override |
| 1168 | { |
| 1169 | ASSERT(i >= 0 && i < static_cast<int>(items.size())); |
| 1170 | if (items[i]->data) |
| 1171 | { |
| 1172 | // XXX: Sinful hack: mutation entry type is encoded in the quantity |
| 1173 | // field (which is otherwise unused) |
| 1174 | if (items[i]->quantity == MUT_ENTRY_MUTATION) |
| 1175 | { |
| 1176 | // XX don't use C casts |
| 1177 | const mutation_type mut = *((mutation_type*)(items[i]->data)); |
| 1178 | describe_mutation(mut); |
| 1179 | } |
| 1180 | else if (items[i]->quantity == MUT_ENTRY_BANE) |
| 1181 | { |
| 1182 | const bane_type bane = *((bane_type*)(items[i]->data)); |
| 1183 | describe_bane(bane); |
| 1184 | } |
| 1185 | else if (items[i]->quantity == MUT_ENTRY_FAKEMUT) |
| 1186 | { |
| 1187 | const string* mut = (string*)(items[i]->data); |
| 1188 | describe_info inf; |
| 1189 | inf.title = uppercase_first(*mut).c_str(); |
| 1190 | |
| 1191 | const string key = make_stringf("%s mutation", mut->c_str()); |
| 1192 | string lookup = getLongDescription(key); |
| 1193 | hint_replace_cmds(lookup); |
| 1194 | inf.body << lookup; |
| 1195 | show_description(inf); |
| 1196 | } |
| 1197 | } |
| 1198 | else if (items[i]->quantity == MUT_ENTRY_TALISMAN) |
| 1199 | { |
| 1200 | if (you.form == you.default_form && you.active_talisman()) |
| 1201 | describe_item_popup(*you.active_talisman()); |
| 1202 | else if (you.form == transformation::flux) |
| 1203 | { |
| 1204 | item_def bauble; |
| 1205 | bauble.base_type = OBJ_BAUBLES; |
| 1206 | bauble.sub_type = BAUBLE_FLUX; |
| 1207 | bauble.quantity = 1; |
| 1208 | describe_item_popup(bauble); |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | return true; |
| 1213 | } |
| 1214 | }; |
| 1215 | |
| 1216 | void display_mutations() |
nothing calls this directly
no test coverage detected