Start riding, with the given monster */
| 194 | |
| 195 | /* Start riding, with the given monster */ |
| 196 | boolean |
| 197 | mount_steed( |
| 198 | struct monst *mtmp, /* The animal */ |
| 199 | boolean force) /* Quietly force this animal */ |
| 200 | { |
| 201 | struct obj *otmp; |
| 202 | char buf[BUFSZ]; |
| 203 | struct permonst *ptr; |
| 204 | |
| 205 | /* Sanity checks */ |
| 206 | if (u.usteed) { |
| 207 | You("are already riding %s.", mon_nam(u.usteed)); |
| 208 | return (FALSE); |
| 209 | } |
| 210 | |
| 211 | /* Is the player in the right form? */ |
| 212 | if (Hallucination && !force) { |
| 213 | pline("Maybe you should find a designated driver."); |
| 214 | return (FALSE); |
| 215 | } |
| 216 | /* While riding, Wounded_legs refers to the steed's |
| 217 | * legs, not the hero's legs. |
| 218 | * That opens up a potential abuse where the player |
| 219 | * can mount a steed, then dismount immediately to |
| 220 | * heal leg damage, because leg damage is always |
| 221 | * healed upon dismount (Wounded_legs context switch). |
| 222 | * By preventing a hero with Wounded_legs from |
| 223 | * mounting a steed, the potential for abuse is |
| 224 | * reduced. However, dismounting still immediately |
| 225 | * heals the steed's wounded legs. [In 3.4.3 and |
| 226 | * earlier, that unintentionally made the hero's |
| 227 | * temporary 1 point Dex loss become permanent.] |
| 228 | */ |
| 229 | if (Wounded_legs) { |
| 230 | char qbuf[QBUFSZ]; |
| 231 | |
| 232 | legs_in_no_shape("riding", FALSE); |
| 233 | Sprintf(qbuf, "Heal your leg%s?", |
| 234 | ((HWounded_legs & BOTH_SIDES) == BOTH_SIDES) ? "s" : ""); |
| 235 | if (force && wizard && y_n(qbuf) == 'y') |
| 236 | heal_legs(0); |
| 237 | else |
| 238 | return (FALSE); |
| 239 | } |
| 240 | |
| 241 | if (Upolyd && (!humanoid(gy.youmonst.data) |
| 242 | || verysmall(gy.youmonst.data) |
| 243 | || bigmonst(gy.youmonst.data) |
| 244 | || slithy(gy.youmonst.data))) { |
| 245 | You("won't fit on a saddle."); |
| 246 | return (FALSE); |
| 247 | } |
| 248 | if (!force && (near_capacity() > SLT_ENCUMBER)) { |
| 249 | You_cant("do that while carrying so much stuff."); |
| 250 | return (FALSE); |
| 251 | } |
| 252 | |
| 253 | /* Can the player reach and see the monster? */ |
no test coverage detected