returns 1 if it won't attack. */
| 260 | |
| 261 | /* returns 1 if it won't attack. */ |
| 262 | int |
| 263 | demon_talk(struct monst *mtmp) |
| 264 | { |
| 265 | long cash, demand, offer; |
| 266 | |
| 267 | if (u_wield_art(ART_EXCALIBUR) || u_wield_art(ART_DEMONBANE)) { |
| 268 | if (canspotmon(mtmp)) |
| 269 | pline("%s looks very angry.", Amonnam(mtmp)); |
| 270 | else |
| 271 | You_feel("tension building."); |
| 272 | mtmp->mpeaceful = mtmp->mtame = 0; |
| 273 | set_malign(mtmp); |
| 274 | newsym(mtmp->mx, mtmp->my); |
| 275 | return 0; |
| 276 | } |
| 277 | |
| 278 | if (is_fainted()) { |
| 279 | reset_faint(); /* if fainted - wake up */ |
| 280 | } else { |
| 281 | stop_occupation(); |
| 282 | if (gm.multi > 0) { |
| 283 | nomul(0); |
| 284 | unmul((char *) 0); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /* Slight advantage given. */ |
| 289 | if (is_dprince(mtmp->data) && mtmp->minvis) { |
| 290 | boolean wasunseen = !canspotmon(mtmp); |
| 291 | |
| 292 | mtmp->minvis = mtmp->perminvis = 0; |
| 293 | if (wasunseen && canspotmon(mtmp)) { |
| 294 | pline("%s appears before you.", Amonnam(mtmp)); |
| 295 | mtmp->mstrategy &= ~STRAT_APPEARMSG; |
| 296 | } |
| 297 | newsym(mtmp->mx, mtmp->my); |
| 298 | } |
| 299 | if (gy.youmonst.data->mlet == S_DEMON) { /* Won't blackmail their own. */ |
| 300 | if (!Deaf) |
| 301 | pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp), |
| 302 | flags.female ? "Sister" : "Brother"); |
| 303 | else if (canseemon(mtmp)) |
| 304 | pline("%s says something.", Amonnam(mtmp)); |
| 305 | if (!tele_restrict(mtmp)) |
| 306 | (void) rloc(mtmp, RLOC_MSG); |
| 307 | return 1; |
| 308 | } |
| 309 | cash = money_cnt(gi.invent); |
| 310 | demand = (cash * (rnd(80) + 20 * Athome)) |
| 311 | / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); |
| 312 | |
| 313 | if (!demand || gm.multi < 0) { /* you have no gold or can't move */ |
| 314 | mtmp->mpeaceful = 0; |
| 315 | set_malign(mtmp); |
| 316 | return 0; |
| 317 | } else { |
| 318 | /* make sure that the demand is unmeetable if the monster |
| 319 | has the Amulet, preventing monster from being satisfied |
no test coverage detected