| 1305 | } |
| 1306 | |
| 1307 | string origin_desc(const item_def &item) |
| 1308 | { |
| 1309 | if (!origin_describable(item)) |
| 1310 | return ""; |
| 1311 | |
| 1312 | if (_origin_is_original_equip(item)) |
| 1313 | return "Original Equipment"; |
| 1314 | |
| 1315 | string desc; |
| 1316 | if (item.orig_monnum) |
| 1317 | { |
| 1318 | if (item.orig_monnum < 0) |
| 1319 | { |
| 1320 | int iorig = -item.orig_monnum; |
| 1321 | switch (iorig) |
| 1322 | { |
| 1323 | case IT_SRC_SHOP: |
| 1324 | desc += "You bought " + _article_it(item) + " in a shop "; |
| 1325 | break; |
| 1326 | case IT_SRC_START: |
| 1327 | desc += "Buggy Original Equipment: "; |
| 1328 | break; |
| 1329 | case AQ_SCROLL: |
| 1330 | desc += "You acquired " + _article_it(item) + " "; |
| 1331 | break; |
| 1332 | case AQ_INVENTED: |
| 1333 | desc += "You invented it yourself "; |
| 1334 | break; |
| 1335 | #if TAG_MAJOR_VERSION == 34 |
| 1336 | case AQ_CARD_GENIE: |
| 1337 | desc += "You drew the Genie "; |
| 1338 | break; |
| 1339 | #endif |
| 1340 | case AQ_WIZMODE: |
| 1341 | desc += "Your wizardly powers created "+ _article_it(item)+ " "; |
| 1342 | break; |
| 1343 | default: |
| 1344 | if (iorig > GOD_NO_GOD && iorig < NUM_GODS) |
| 1345 | { |
| 1346 | desc += god_name(static_cast<god_type>(iorig)) |
| 1347 | + " gifted " + _article_it(item) + " to you "; |
| 1348 | } |
| 1349 | else |
| 1350 | { |
| 1351 | // Bug really. |
| 1352 | desc += "You stumbled upon " + _article_it(item) + " "; |
| 1353 | } |
| 1354 | break; |
| 1355 | } |
| 1356 | } |
| 1357 | else if (item.orig_monnum == MONS_DANCING_WEAPON) |
| 1358 | desc += "You subdued it "; |
| 1359 | else |
| 1360 | { |
| 1361 | desc += "You took " + _article_it(item) + " off " |
| 1362 | + _origin_monster_name(item) + " "; |
| 1363 | } |
| 1364 | } |
no test coverage detected