| 507 | } |
| 508 | |
| 509 | staticfn void |
| 510 | call_kops(struct monst *shkp, boolean nearshop) |
| 511 | { |
| 512 | /* Keystone Kops srt@ucla */ |
| 513 | boolean nokops; |
| 514 | |
| 515 | if (!shkp) |
| 516 | return; |
| 517 | |
| 518 | Soundeffect(se_alarm, 80); |
| 519 | if (!Deaf) |
| 520 | pline("An alarm sounds!"); |
| 521 | |
| 522 | nokops = ((svm.mvitals[PM_KEYSTONE_KOP].mvflags & G_GONE) |
| 523 | && (svm.mvitals[PM_KOP_SERGEANT].mvflags & G_GONE) |
| 524 | && (svm.mvitals[PM_KOP_LIEUTENANT].mvflags & G_GONE) |
| 525 | && (svm.mvitals[PM_KOP_KAPTAIN].mvflags & G_GONE)); |
| 526 | |
| 527 | if (!angry_guards(!!Deaf) && nokops) { |
| 528 | if (flags.verbose && !Deaf) |
| 529 | pline("But no one seems to respond to it."); |
| 530 | return; |
| 531 | } |
| 532 | |
| 533 | if (nokops) |
| 534 | return; |
| 535 | |
| 536 | { |
| 537 | coord mm; |
| 538 | coordxy sx = 0, sy = 0; |
| 539 | |
| 540 | choose_stairs(&sx, &sy, TRUE); |
| 541 | |
| 542 | if (nearshop) { |
| 543 | /* Create swarm around you, if you merely "stepped out" */ |
| 544 | if (flags.verbose) |
| 545 | pline_The("Keystone Kops appear!"); |
| 546 | mm.x = u.ux; |
| 547 | mm.y = u.uy; |
| 548 | makekops(&mm); |
| 549 | return; |
| 550 | } |
| 551 | if (flags.verbose) |
| 552 | pline_The("Keystone Kops are after you!"); |
| 553 | /* Create swarm near down staircase (hinders return to level) */ |
| 554 | if (isok(sx, sy)) { |
| 555 | mm.x = sx; |
| 556 | mm.y = sy; |
| 557 | makekops(&mm); |
| 558 | } |
| 559 | /* Create swarm near shopkeeper (hinders return to shop) */ |
| 560 | mm.x = shkp->mx; |
| 561 | mm.y = shkp->my; |
| 562 | makekops(&mm); |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | /* x,y is strictly inside shop */ |
no test coverage detected