#altdip - #dip with "what to dip?" and "what to dip it into?" asked in the opposite order; ignores floor water; used for context-sensitive inventory item-action: the potion has already been selected and is in cmdq ready to answer the first getobj() prompt */
| 2376 | inventory item-action: the potion has already been selected and is in |
| 2377 | cmdq ready to answer the first getobj() prompt */ |
| 2378 | int |
| 2379 | dip_into(void) |
| 2380 | { |
| 2381 | struct obj *obj, *potion; |
| 2382 | char qbuf[QBUFSZ]; |
| 2383 | |
| 2384 | if (!cmdq_peek(CQ_CANNED)) { |
| 2385 | impossible("dip_into: where is potion?"); |
| 2386 | return ECMD_FAIL; |
| 2387 | } |
| 2388 | /* note: drink_ok() callback for quaffing is also used to validate |
| 2389 | a potion to dip into */ |
| 2390 | drink_ok_extra = 0; /* affects drink_ok(): haven't been asked about and |
| 2391 | * declined to use a floor feature like a fountain */ |
| 2392 | potion = getobj("dip", drink_ok, GETOBJ_NOFLAGS); |
| 2393 | if (!potion || potion->oclass != POTION_CLASS) |
| 2394 | return ECMD_CANCEL; |
| 2395 | |
| 2396 | /* "What do you want to dip into <the potion>? [abc or ?*] " */ |
| 2397 | Snprintf(qbuf, sizeof qbuf, "dip into %s%s", |
| 2398 | is_plural(potion) ? "one of " : "", thesimpleoname(potion)); |
| 2399 | obj = getobj(qbuf, dip_ok, GETOBJ_PROMPT); |
| 2400 | if (!obj) |
| 2401 | return ECMD_CANCEL; |
| 2402 | if (inaccessible_equipment(obj, "dip", FALSE)) |
| 2403 | return ECMD_OK; |
| 2404 | return potion_dip(obj, potion); |
| 2405 | } |
| 2406 | |
| 2407 | staticfn void |
| 2408 | poof(struct obj *potion) |
nothing calls this directly
no test coverage detected