Protect an item from erosion with grease. Returns TRUE if the grease * wears off. */
| 357 | * wears off. |
| 358 | */ |
| 359 | boolean |
| 360 | grease_protect( |
| 361 | struct obj *otmp, |
| 362 | const char *ostr, |
| 363 | struct monst *victim) |
| 364 | { |
| 365 | static const char txt[] = "protected by the layer of grease!"; |
| 366 | boolean vismon = victim && (victim != &gy.youmonst) && canseemon(victim); |
| 367 | |
| 368 | if (ostr) { |
| 369 | if (victim == &gy.youmonst) |
| 370 | Your("%s %s %s", ostr, vtense(ostr, "are"), txt); |
| 371 | else if (vismon) |
| 372 | pline("%s's %s %s %s", Monnam(victim), |
| 373 | ostr, vtense(ostr, "are"), txt); |
| 374 | } else if (victim == &gy.youmonst || vismon) { |
| 375 | pline("%s %s", Yobjnam2(otmp, "are"), txt); |
| 376 | } |
| 377 | if (!rn2(2)) { |
| 378 | otmp->greased = 0; |
| 379 | if (carried(otmp)) { |
| 380 | pline_The("grease dissolves."); |
| 381 | update_inventory(); |
| 382 | } |
| 383 | return TRUE; |
| 384 | } |
| 385 | return FALSE; |
| 386 | } |
| 387 | |
| 388 | /* create a "living" statue at x,y */ |
| 389 | staticfn void |