| 279 | } |
| 280 | |
| 281 | staticfn void |
| 282 | chat_with_leader(struct monst *mtmp) |
| 283 | { |
| 284 | if (!mtmp->mpeaceful || Qstat(pissed_off)) |
| 285 | return; |
| 286 | |
| 287 | /* Rule 0: Cheater checks. */ |
| 288 | if (u.uhave.questart && !Qstat(met_nemesis)) |
| 289 | Qstat(cheater) = TRUE; |
| 290 | |
| 291 | /* It is possible for you to get the amulet without completing |
| 292 | * the quest. If so, try to induce the player to quest. |
| 293 | */ |
| 294 | if (Qstat(got_thanks)) { |
| 295 | /* Rule 1: You've gone back with/without the amulet. */ |
| 296 | if (u.uhave.amulet) |
| 297 | finish_quest((struct obj *) 0); |
| 298 | |
| 299 | /* Rule 2: You've gone back before going for the amulet. */ |
| 300 | else |
| 301 | qt_pager("posthanks"); |
| 302 | |
| 303 | /* Rule 3: You've got the artifact and are back to return it. */ |
| 304 | } else if (u.uhave.questart) { |
| 305 | struct obj *otmp; |
| 306 | |
| 307 | for (otmp = gi.invent; otmp; otmp = otmp->nobj) |
| 308 | if (is_quest_artifact(otmp)) |
| 309 | break; |
| 310 | |
| 311 | finish_quest(otmp); |
| 312 | |
| 313 | /* Rule 4: You haven't got the artifact yet. */ |
| 314 | } else if (Qstat(got_quest)) { |
| 315 | qt_pager("encourage"); |
| 316 | |
| 317 | /* Rule 5: You aren't yet acceptable - or are you? */ |
| 318 | } else { |
| 319 | int purity = 0; |
| 320 | |
| 321 | if (!Qstat(met_leader)) { |
| 322 | qt_pager("leader_first"); |
| 323 | Qstat(met_leader) = TRUE; |
| 324 | Qstat(not_ready) = 0; |
| 325 | } else |
| 326 | qt_pager("leader_next"); |
| 327 | |
| 328 | /* the quest leader might have passed through the portal into |
| 329 | the regular dungeon; none of the remaining make sense there */ |
| 330 | if (!on_level(&u.uz, &qstart_level)) |
| 331 | return; |
| 332 | |
| 333 | if (not_capable()) { |
| 334 | qt_pager("badlevel"); |
| 335 | exercise(A_WIS, TRUE); |
| 336 | expulsion(FALSE); |
| 337 | } else if ((purity = is_pure(TRUE)) < 0) { |
| 338 | if (!Qstat(pissed_off)) { |
no test coverage detected