| 358 | } |
| 359 | |
| 360 | long |
| 361 | bribe(struct monst *mtmp, const char *prompt) |
| 362 | { |
| 363 | char buf[BUFSZ] = DUMMY; |
| 364 | long offer; |
| 365 | long umoney = money_cnt(gi.invent); |
| 366 | |
| 367 | getlin(prompt, buf); |
| 368 | if (sscanf(buf, "%ld", &offer) != 1) |
| 369 | offer = 0L; |
| 370 | |
| 371 | /*Michael Paddon -- fix for negative offer to monster*/ |
| 372 | /*JAR880815 - */ |
| 373 | if (offer < 0L) { |
| 374 | You("try to shortchange %s, but fumble.", mon_nam(mtmp)); |
| 375 | return 0L; |
| 376 | } else if (offer == 0L) { |
| 377 | You("refuse."); |
| 378 | return 0L; |
| 379 | } else if (offer >= umoney) { |
| 380 | You("give %s all your gold.", mon_nam(mtmp)); |
| 381 | offer = umoney; |
| 382 | } else { |
| 383 | You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); |
| 384 | } |
| 385 | (void) money2mon(mtmp, offer); |
| 386 | disp.botl = TRUE; |
| 387 | return offer; |
| 388 | } |
| 389 | |
| 390 | int |
| 391 | dprince(aligntyp atyp) |