… | |
… | |
337 | |
337 | |
338 | case RING: |
338 | case RING: |
339 | flag = monster->flag [FLAG_USE_RING]; |
339 | flag = monster->flag [FLAG_USE_RING]; |
340 | break; |
340 | break; |
341 | |
341 | |
|
|
342 | case RANGED: |
342 | case WAND: |
343 | case WAND: |
343 | case HORN: |
344 | case HORN: |
344 | case ROD: |
345 | case ROD: |
345 | flag = monster->flag [FLAG_USE_RANGE]; |
346 | flag = monster->flag [FLAG_USE_RANGE]; |
346 | break; |
347 | break; |
… | |
… | |
593 | |
594 | |
594 | for (bow = mon->inv; bow; bow = bow->below) |
595 | for (bow = mon->inv; bow; bow = bow->below) |
595 | if (bow->type == BOW && bow->race == item->race) |
596 | if (bow->type == BOW && bow->race == item->race) |
596 | { |
597 | { |
597 | mon->set_flag (FLAG_READY_BOW); |
598 | mon->set_flag (FLAG_READY_BOW); |
598 | LOG (llevTrace, "Found correct bow for arrows.\n"); |
|
|
599 | return; /* nothing more to do for arrows */ |
599 | return; /* nothing more to do for arrows */ |
600 | } |
600 | } |
601 | } |
601 | } |
602 | |
602 | |
603 | if (item->type == TREASURE && mon->will_apply & WILL_APPLY_TREASURE) |
603 | if (item->type == TREASURE && mon->will_apply & WILL_APPLY_TREASURE) |
… | |
… | |
941 | */ |
941 | */ |
942 | if (head->spellitem == NULL) |
942 | if (head->spellitem == NULL) |
943 | { |
943 | { |
944 | if ((spell_item = monster_choose_random_spell (head)) == NULL) |
944 | if ((spell_item = monster_choose_random_spell (head)) == NULL) |
945 | { |
945 | { |
946 | LOG (llevTrace, "Turned off spells in %s\n", &head->name); |
|
|
947 | head->clr_flag (FLAG_CAST_SPELL); /* Will be turned on when picking up book */ |
946 | head->clr_flag (FLAG_CAST_SPELL); /* Will be turned on when picking up book */ |
948 | return 0; |
947 | return 0; |
949 | } |
948 | } |
950 | |
949 | |
951 | if (spell_item->type == SPELLBOOK) |
950 | if (spell_item->type == SPELLBOOK) |
… | |
… | |
1830 | return 1; |
1829 | return 1; |
1831 | |
1830 | |
1832 | if (op->map) |
1831 | if (op->map) |
1833 | unordered_mapwalk (mapwalk_buf, op, -MAX_LIGHT_RADIUS, -MAX_LIGHT_RADIUS, MAX_LIGHT_RADIUS, MAX_LIGHT_RADIUS) |
1832 | unordered_mapwalk (mapwalk_buf, op, -MAX_LIGHT_RADIUS, -MAX_LIGHT_RADIUS, MAX_LIGHT_RADIUS, MAX_LIGHT_RADIUS) |
1834 | { |
1833 | { |
|
|
1834 | mapspace &ms = m->at (nx, ny); |
|
|
1835 | |
|
|
1836 | ms.update (); |
|
|
1837 | |
1835 | /* Check the spaces with the max light radius to see if any of them |
1838 | /* Check the spaces with the max light radius to see if any of them |
1836 | * have lights, and if any of them light the player enough, then return 1. |
1839 | * have lights, and if any of them light the player enough, then return 1. |
1837 | */ |
1840 | */ |
1838 | int light = m->at (nx, ny).light; |
1841 | int light = ms.light; |
1839 | |
1842 | |
1840 | if (expect_false (light > 0) && idistance (dx, dy) <= light) |
1843 | if (expect_false (light > 0) && idistance (dx, dy) <= light) |
1841 | return 1; |
1844 | return 1; |
1842 | } |
1845 | } |
1843 | } |
1846 | } |