increase a towel's wetness */
| 1035 | |
| 1036 | /* increase a towel's wetness */ |
| 1037 | void |
| 1038 | wet_a_towel( |
| 1039 | struct obj *obj, |
| 1040 | int amt, /* positive: new val; negative: increment by -amt; zero: no-op */ |
| 1041 | boolean verbose) |
| 1042 | { |
| 1043 | int newspe = (amt <= 0) ? obj->spe - amt : amt; |
| 1044 | |
| 1045 | /* new state is only reported if it's an increase */ |
| 1046 | if (newspe > obj->spe) { |
| 1047 | if (verbose) { |
| 1048 | const char *wetness = (newspe < 3) |
| 1049 | ? (!obj->spe ? "damp" : "damper") |
| 1050 | : (!obj->spe ? "wet" : "wetter"); |
| 1051 | |
| 1052 | if (carried(obj)) |
| 1053 | pline("%s gets %s.", Yobjnam2(obj, (const char *) 0), |
| 1054 | wetness); |
| 1055 | else if (mcarried(obj) && canseemon(obj->ocarry)) |
| 1056 | pline("%s %s gets %s.", s_suffix(Monnam(obj->ocarry)), |
| 1057 | xname(obj), wetness); |
| 1058 | } |
| 1059 | } |
| 1060 | |
| 1061 | if (newspe != obj->spe) |
| 1062 | finish_towel_change(obj, newspe); |
| 1063 | } |
| 1064 | |
| 1065 | /* decrease a towel's wetness; unlike when wetting, 0 is not a no-op */ |
| 1066 | void |
no test coverage detected