armor put on or taken off; might be magical variety */
| 576 | |
| 577 | /* armor put on or taken off; might be magical variety */ |
| 578 | void |
| 579 | update_mon_extrinsics( |
| 580 | struct monst *mon, |
| 581 | struct obj *obj, /* armor being worn or taken off */ |
| 582 | boolean on, |
| 583 | boolean silently) |
| 584 | { |
| 585 | int unseen; |
| 586 | uchar mask; |
| 587 | struct obj *otmp; |
| 588 | int which = (int) objects[obj->otyp].oc_oprop, |
| 589 | altwhich = altprop(obj); |
| 590 | |
| 591 | unseen = !canseemon(mon); |
| 592 | if (!which && !altwhich) |
| 593 | goto maybe_blocks; |
| 594 | |
| 595 | again: |
| 596 | if (on) { |
| 597 | switch (which) { |
| 598 | case INVIS: |
| 599 | mon->minvis = !mon->invis_blkd; |
| 600 | break; |
| 601 | case FAST: { |
| 602 | boolean save_in_mklev = gi.in_mklev; |
| 603 | if (silently) |
| 604 | gi.in_mklev = TRUE; |
| 605 | mon_adjust_speed(mon, 0, obj); |
| 606 | gi.in_mklev = save_in_mklev; |
| 607 | break; |
| 608 | } |
| 609 | /* properties handled elsewhere */ |
| 610 | case ANTIMAGIC: |
| 611 | case REFLECTING: |
| 612 | case PROTECTION: |
| 613 | break; |
| 614 | /* properties which have no effect for monsters */ |
| 615 | case CLAIRVOYANT: |
| 616 | case STEALTH: |
| 617 | case TELEPAT: |
| 618 | break; |
| 619 | /* properties which should have an effect but aren't implemented */ |
| 620 | case LEVITATION: |
| 621 | case FLYING: |
| 622 | case WWALKING: |
| 623 | break; |
| 624 | /* properties which maybe should have an effect but don't */ |
| 625 | case DISPLACED: |
| 626 | case FUMBLING: |
| 627 | case JUMPING: |
| 628 | break; |
| 629 | default: |
| 630 | mon->mextrinsics |= (unsigned short) res_to_mr(which); |
| 631 | break; |
| 632 | } |
| 633 | } else { /* off */ |
| 634 | switch (which) { |
| 635 | case INVIS: |
no test coverage detected