| 76 | } |
| 77 | |
| 78 | staticfn int |
| 79 | use_camera(struct obj *obj) |
| 80 | { |
| 81 | if (Underwater) { |
| 82 | pline("Using your camera underwater would void the warranty."); |
| 83 | return ECMD_OK; |
| 84 | } |
| 85 | if (!getdir((char *) 0)) |
| 86 | return ECMD_CANCEL; |
| 87 | |
| 88 | if (obj->spe <= 0) { |
| 89 | pline1(nothing_happens); |
| 90 | return ECMD_TIME; |
| 91 | } |
| 92 | consume_obj_charge(obj, TRUE); |
| 93 | |
| 94 | if (obj->cursed && !rn2(2)) { |
| 95 | (void) zapyourself(obj, TRUE); |
| 96 | } else if (u.uswallow) { |
| 97 | You("take a picture of %s %s.", s_suffix(mon_nam(u.ustuck)), |
| 98 | mbodypart(u.ustuck, STOMACH)); |
| 99 | } else if (u.dz) { |
| 100 | You("take a picture of the %s.", |
| 101 | (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy)); |
| 102 | } else if (!u.dx && !u.dy) { |
| 103 | /* TODO: we ought to have a "selfie" joke here... */ |
| 104 | (void) zapyourself(obj, TRUE); |
| 105 | } else { |
| 106 | do_blinding_ray(obj); |
| 107 | } |
| 108 | return ECMD_TIME; |
| 109 | } |
| 110 | |
| 111 | staticfn int |
| 112 | use_towel(struct obj *obj) |
no test coverage detected