| 551 | } |
| 552 | |
| 553 | staticfn void |
| 554 | do_entity(struct entity *etmp) |
| 555 | { |
| 556 | coordxy newx, newy, oldx, oldy; |
| 557 | int at_portcullis; |
| 558 | boolean must_jump = FALSE, relocates = FALSE, e_inview; |
| 559 | struct rm *crm; |
| 560 | |
| 561 | if (!etmp->edata) |
| 562 | return; |
| 563 | |
| 564 | e_inview = e_canseemon(etmp); |
| 565 | oldx = etmp->ex; |
| 566 | oldy = etmp->ey; |
| 567 | at_portcullis = is_db_wall(oldx, oldy); |
| 568 | crm = &levl[oldx][oldy]; |
| 569 | |
| 570 | if (automiss(etmp) && e_survives_at(etmp, oldx, oldy)) { |
| 571 | if (e_inview && (at_portcullis || IS_DRAWBRIDGE(crm->typ))) |
| 572 | pline_The("%s passes through %s!", |
| 573 | at_portcullis ? "portcullis" : "drawbridge", |
| 574 | e_nam(etmp)); |
| 575 | if (is_u(etmp)) |
| 576 | spoteffects(FALSE); |
| 577 | return; |
| 578 | } |
| 579 | if (e_missed(etmp, FALSE)) { |
| 580 | if (at_portcullis) { |
| 581 | pline_The("portcullis misses %s!", e_nam(etmp)); |
| 582 | } else { |
| 583 | debugpline1("The drawbridge misses %s!", e_nam(etmp)); |
| 584 | } |
| 585 | if (e_survives_at(etmp, oldx, oldy)) { |
| 586 | return; |
| 587 | } else { |
| 588 | debugpline0("Mon can't survive here"); |
| 589 | if (at_portcullis) |
| 590 | must_jump = TRUE; |
| 591 | else |
| 592 | relocates = TRUE; /* just ride drawbridge in */ |
| 593 | } |
| 594 | } else { |
| 595 | if (crm->typ == DRAWBRIDGE_DOWN) { |
| 596 | if (is_u(etmp)) { |
| 597 | svk.killer.format = NO_KILLER_PREFIX; |
| 598 | Strcpy(svk.killer.name, |
| 599 | "crushed to death underneath a drawbridge"); |
| 600 | } |
| 601 | pline("%s crushed underneath the drawbridge.", |
| 602 | E_phrase(etmp, "are")); /* no jump */ |
| 603 | e_died(etmp, |
| 604 | XKILL_NOCORPSE | (e_inview ? XKILL_GIVEMSG : XKILL_NOMSG), |
| 605 | CRUSHING); /* no corpse */ |
| 606 | return; /* Note: Beyond this point, we know we're */ |
| 607 | } /* not at an opened drawbridge, since all */ |
| 608 | must_jump = TRUE; /* *missable* creatures survive on the */ |
| 609 | } /* square, and all the unmissed ones die. */ |
| 610 | if (must_jump) { |
no test coverage detected