1 #include "floor/floor-events.h"
2 #include "cmd-io/cmd-dump.h"
3 #include "core/disturbance.h"
4 #include "core/player-redraw-types.h"
5 #include "core/player-update-types.h"
6 #include "core/window-redrawer.h"
7 #include "dungeon/dungeon-flag-types.h"
8 #include "dungeon/dungeon.h"
9 #include "dungeon/quest.h"
10 #include "floor/cave.h"
11 #include "floor/floor.h"
12 #include "game-option/birth-options.h"
13 #include "game-option/cheat-options.h"
14 #include "game-option/disturbance-options.h"
15 #include "game-option/map-screen-options.h"
16 #include "grid/feature-flag-types.h"
17 #include "grid/grid.h"
18 #include "main/sound-of-music.h"
19 #include "mind/mind-ninja.h"
20 #include "monster-floor/monster-lite.h"
21 #include "monster-race/monster-race.h"
22 #include "monster-race/race-flags1.h"
23 #include "monster-race/race-flags7.h"
24 #include "monster/monster-info.h"
25 #include "monster/monster-list.h"
26 #include "monster/monster-status.h"
27 #include "object-enchant/object-ego.h"
28 #include "object-enchant/special-object-flags.h"
29 #include "object-hook/hook-checker.h"
30 #include "object-hook/hook-enchant.h"
31 #include "object/object-kind.h"
32 #include "object/object-mark-types.h"
33 #include "object/object-value.h"
34 #include "perception/object-perception.h"
35 #include "player/special-defense-types.h"
36 #include "sv-definition/sv-amulet-types.h"
37 #include "sv-definition/sv-protector-types.h"
38 #include "sv-definition/sv-ring-types.h"
39 #include "system/floor-type-definition.h"
40 #include "util/bit-flags-calculator.h"
41 #include "view/display-messages.h"
42 #include "world/world.h"
44 void day_break(player_type *subject_ptr)
46 msg_print(_("夜が明けた。", "The sun has risen."));
47 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
48 if (!subject_ptr->wild_mode) {
49 for (POSITION y = 0; y < floor_ptr->height; y++) {
50 for (POSITION x = 0; x < floor_ptr->width; x++) {
51 grid_type *g_ptr = &floor_ptr->grid_array[y][x];
52 g_ptr->info |= CAVE_GLOW;
54 g_ptr->info |= CAVE_MARK;
56 note_spot(subject_ptr, y, x);
61 subject_ptr->update |= PU_MONSTERS | PU_MON_LITE;
62 subject_ptr->redraw |= PR_MAP;
63 subject_ptr->window |= PW_OVERHEAD | PW_DUNGEON;
64 if (((subject_ptr->special_defense & NINJA_S_STEALTH) != 0) && ((floor_ptr->grid_array[subject_ptr->y][subject_ptr->x].info & CAVE_GLOW) != 0))
65 set_superstealth(subject_ptr, FALSE);
68 void night_falls(player_type *subject_ptr)
70 msg_print(_("日が沈んだ。", "The sun has fallen."));
71 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
72 if (!subject_ptr->wild_mode) {
73 for (POSITION y = 0; y < floor_ptr->height; y++) {
74 for (POSITION x = 0; x < floor_ptr->width; x++) {
75 grid_type *g_ptr = &floor_ptr->grid_array[y][x];
76 feature_type *f_ptr = &f_info[get_feat_mimic(g_ptr)];
77 if (is_mirror_grid(g_ptr) || have_flag(f_ptr->flags, FF_QUEST_ENTER) || have_flag(f_ptr->flags, FF_ENTRANCE))
80 g_ptr->info &= ~(CAVE_GLOW);
81 if (!have_flag(f_ptr->flags, FF_REMEMBER)) {
82 g_ptr->info &= ~(CAVE_MARK);
83 note_spot(subject_ptr, y, x);
87 glow_deep_lava_and_bldg(subject_ptr);
91 subject_ptr->update |= PU_MONSTERS | PU_MON_LITE;
92 subject_ptr->redraw |= PR_MAP;
93 subject_ptr->window |= PW_OVERHEAD | PW_DUNGEON;
95 if (((subject_ptr->special_defense & NINJA_S_STEALTH) != 0) && ((floor_ptr->grid_array[subject_ptr->y][subject_ptr->x].info & CAVE_GLOW) != 0))
96 set_superstealth(subject_ptr, FALSE);
100 * ダンジョンの雰囲気を計算するための非線形基準値 / Dungeon rating is no longer linear
102 static int rating_boost(int delta) { return delta * delta + 50 * delta; }
105 * @brief ダンジョンの雰囲気を算出する。
106 * / Examine all monsters and unidentified objects, and get the feeling of current dungeon floor
107 * @return 算出されたダンジョンの雰囲気ランク
109 static byte get_dungeon_feeling(player_type *subject_ptr)
111 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
112 if (!floor_ptr->dun_level)
117 for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) {
118 monster_type *m_ptr = &floor_ptr->m_list[i];
121 if (!monster_is_valid(m_ptr) || is_pet(m_ptr))
124 r_ptr = &r_info[m_ptr->r_idx];
125 if (r_ptr->flags1 & (RF1_UNIQUE)) {
126 if (r_ptr->level + 10 > floor_ptr->dun_level)
127 delta += (r_ptr->level + 10 - floor_ptr->dun_level) * 2 * base;
128 } else if (r_ptr->level > floor_ptr->dun_level)
129 delta += (r_ptr->level - floor_ptr->dun_level) * base;
131 if (r_ptr->flags1 & RF1_FRIENDS) {
132 if (5 <= get_monster_crowd_number(floor_ptr, i))
134 } else if (2 <= get_monster_crowd_number(floor_ptr, i))
137 rating += rating_boost(delta);
140 for (MONSTER_IDX i = 1; i < floor_ptr->o_max; i++) {
141 object_type *o_ptr = &floor_ptr->o_list[i];
142 object_kind *k_ptr = &k_info[o_ptr->k_idx];
144 if (!object_is_valid(o_ptr) || (object_is_known(o_ptr) && ((o_ptr->marked & OM_TOUCHED) != 0)) || ((o_ptr->ident & IDENT_SENSE) != 0))
147 if (object_is_ego(o_ptr)) {
148 ego_item_type *e_ptr = &e_info[o_ptr->name2];
149 delta += e_ptr->rating * base;
152 if (object_is_artifact(o_ptr)) {
153 PRICE cost = object_value_real(subject_ptr, o_ptr);
168 if (o_ptr->tval == TV_DRAG_ARMOR)
171 if (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
174 if (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
177 if (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
180 if (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
183 if (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_SPEED && !object_is_cursed(o_ptr))
186 if (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY && !object_is_cursed(o_ptr))
189 if (o_ptr->tval == TV_AMULET && o_ptr->sval == SV_AMULET_THE_MAGI && !object_is_cursed(o_ptr))
192 if (!object_is_cursed(o_ptr) && !object_is_broken(o_ptr) && k_ptr->level > floor_ptr->dun_level)
193 delta += (k_ptr->level - floor_ptr->dun_level) * base;
195 rating += rating_boost(delta);
198 if (rating > rating_boost(1000))
201 if (rating > rating_boost(800))
204 if (rating > rating_boost(600))
207 if (rating > rating_boost(400))
210 if (rating > rating_boost(300))
213 if (rating > rating_boost(200))
216 if (rating > rating_boost(100))
219 if (rating > rating_boost(0))
226 * @brief ダンジョンの雰囲気を更新し、変化があった場合メッセージを表示する
227 * / Update dungeon feeling, and announce it if changed
230 void update_dungeon_feeling(player_type *subject_ptr)
232 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
233 if (!floor_ptr->dun_level)
236 if (subject_ptr->phase_out)
239 int delay = MAX(10, 150 - subject_ptr->skill_fos) * (150 - floor_ptr->dun_level) * TURNS_PER_TICK / 100;
240 if (current_world_ptr->game_turn < subject_ptr->feeling_turn + delay && !cheat_xtra)
243 int quest_num = quest_number(subject_ptr, floor_ptr->dun_level);
245 && (is_fixed_quest_idx(quest_num) && !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || !(quest[quest_num].flags & QUEST_FLAG_PRESET))))
248 byte new_feeling = get_dungeon_feeling(subject_ptr);
249 subject_ptr->feeling_turn = current_world_ptr->game_turn;
250 if (subject_ptr->feeling == new_feeling)
253 subject_ptr->feeling = new_feeling;
254 do_cmd_feeling(subject_ptr);
255 select_floor_music(subject_ptr);
256 subject_ptr->redraw |= PR_DEPTH;
258 disturb(subject_ptr, FALSE, FALSE);
262 * Glow deep lava and building entrances in the floor
264 void glow_deep_lava_and_bldg(player_type *subject_ptr)
266 if (d_info[subject_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
269 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
270 for (POSITION y = 0; y < floor_ptr->height; y++) {
271 for (POSITION x = 0; x < floor_ptr->width; x++) {
273 g_ptr = &floor_ptr->grid_array[y][x];
274 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_GLOW))
277 for (DIRECTION i = 0; i < 9; i++) {
278 POSITION yy = y + ddy_ddd[i];
279 POSITION xx = x + ddx_ddd[i];
280 if (!in_bounds2(floor_ptr, yy, xx))
283 floor_ptr->grid_array[yy][xx].info |= CAVE_GLOW;
288 subject_ptr->update |= PU_VIEW | PU_LITE | PU_MON_LITE;
289 subject_ptr->redraw |= PR_MAP;
293 * Actually erase the entire "lite" array, redrawing every grid
295 void forget_lite(floor_type *floor_ptr)
297 if (!floor_ptr->lite_n)
300 for (int i = 0; i < floor_ptr->lite_n; i++) {
301 POSITION y = floor_ptr->lite_y[i];
302 POSITION x = floor_ptr->lite_x[i];
303 floor_ptr->grid_array[y][x].info &= ~(CAVE_LITE);
306 floor_ptr->lite_n = 0;
310 * Update the set of grids "illuminated" by the player's lite.
312 * This routine needs to use the results of "update_view()"
314 * Note that "blindness" does NOT affect "torch lite". Be careful!
316 * We optimize most lites (all non-artifact lites) by using "obvious"
317 * facts about the results of "small" lite radius, and we attempt to
318 * list the "nearby" grids before the more "distant" ones in the
319 * array of torch-lit grids.
321 * We assume that "radius zero" lite is in fact no lite at all.
323 * Torch Lantern Artifacts
333 void update_lite(player_type *subject_ptr)
335 POSITION p = subject_ptr->cur_lite;
337 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
338 for (int i = 0; i < floor_ptr->lite_n; i++) {
339 POSITION y = floor_ptr->lite_y[i];
340 POSITION x = floor_ptr->lite_x[i];
341 floor_ptr->grid_array[y][x].info &= ~(CAVE_LITE);
342 floor_ptr->grid_array[y][x].info |= CAVE_TEMP;
343 tmp_pos.y[tmp_pos.n] = y;
344 tmp_pos.x[tmp_pos.n] = x;
348 floor_ptr->lite_n = 0;
350 cave_lite_hack(floor_ptr, subject_ptr->y, subject_ptr->x);
351 cave_lite_hack(floor_ptr, subject_ptr->y + 1, subject_ptr->x);
352 cave_lite_hack(floor_ptr, subject_ptr->y - 1, subject_ptr->x);
353 cave_lite_hack(floor_ptr, subject_ptr->y, subject_ptr->x + 1);
354 cave_lite_hack(floor_ptr, subject_ptr->y, subject_ptr->x - 1);
355 cave_lite_hack(floor_ptr, subject_ptr->y + 1, subject_ptr->x + 1);
356 cave_lite_hack(floor_ptr, subject_ptr->y + 1, subject_ptr->x - 1);
357 cave_lite_hack(floor_ptr, subject_ptr->y - 1, subject_ptr->x + 1);
358 cave_lite_hack(floor_ptr, subject_ptr->y - 1, subject_ptr->x - 1);
362 if (cave_los_bold(floor_ptr, subject_ptr->y + 1, subject_ptr->x)) {
363 cave_lite_hack(floor_ptr, subject_ptr->y + 2, subject_ptr->x);
364 cave_lite_hack(floor_ptr, subject_ptr->y + 2, subject_ptr->x + 1);
365 cave_lite_hack(floor_ptr, subject_ptr->y + 2, subject_ptr->x - 1);
368 if (cave_los_bold(floor_ptr, subject_ptr->y - 1, subject_ptr->x)) {
369 cave_lite_hack(floor_ptr, subject_ptr->y - 2, subject_ptr->x);
370 cave_lite_hack(floor_ptr, subject_ptr->y - 2, subject_ptr->x + 1);
371 cave_lite_hack(floor_ptr, subject_ptr->y - 2, subject_ptr->x - 1);
374 if (cave_los_bold(floor_ptr, subject_ptr->y, subject_ptr->x + 1)) {
375 cave_lite_hack(floor_ptr, subject_ptr->y, subject_ptr->x + 2);
376 cave_lite_hack(floor_ptr, subject_ptr->y + 1, subject_ptr->x + 2);
377 cave_lite_hack(floor_ptr, subject_ptr->y - 1, subject_ptr->x + 2);
380 if (cave_los_bold(floor_ptr, subject_ptr->y, subject_ptr->x - 1)) {
381 cave_lite_hack(floor_ptr, subject_ptr->y, subject_ptr->x - 2);
382 cave_lite_hack(floor_ptr, subject_ptr->y + 1, subject_ptr->x - 2);
383 cave_lite_hack(floor_ptr, subject_ptr->y - 1, subject_ptr->x - 2);
392 if (cave_los_bold(floor_ptr, subject_ptr->y + 1, subject_ptr->x + 1))
393 cave_lite_hack(floor_ptr, subject_ptr->y + 2, subject_ptr->x + 2);
395 if (cave_los_bold(floor_ptr, subject_ptr->y + 1, subject_ptr->x - 1))
396 cave_lite_hack(floor_ptr, subject_ptr->y + 2, subject_ptr->x - 2);
398 if (cave_los_bold(floor_ptr, subject_ptr->y - 1, subject_ptr->x + 1))
399 cave_lite_hack(floor_ptr, subject_ptr->y - 2, subject_ptr->x + 2);
401 if (cave_los_bold(floor_ptr, subject_ptr->y - 1, subject_ptr->x - 1))
402 cave_lite_hack(floor_ptr, subject_ptr->y - 2, subject_ptr->x - 2);
404 POSITION min_y = subject_ptr->y - p;
408 POSITION max_y = subject_ptr->y + p;
409 if (max_y > floor_ptr->height - 1)
410 max_y = floor_ptr->height - 1;
412 POSITION min_x = subject_ptr->x - p;
416 POSITION max_x = subject_ptr->x + p;
417 if (max_x > floor_ptr->width - 1)
418 max_x = floor_ptr->width - 1;
420 for (POSITION y = min_y; y <= max_y; y++) {
421 for (POSITION x = min_x; x <= max_x; x++) {
422 int dy = (subject_ptr->y > y) ? (subject_ptr->y - y) : (y - subject_ptr->y);
423 int dx = (subject_ptr->x > x) ? (subject_ptr->x - x) : (x - subject_ptr->x);
424 if ((dy <= 2) && (dx <= 2))
427 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
431 if (floor_ptr->grid_array[y][x].info & CAVE_VIEW)
432 cave_lite_hack(floor_ptr, y, x);
437 for (int i = 0; i < floor_ptr->lite_n; i++) {
438 POSITION y = floor_ptr->lite_y[i];
439 POSITION x = floor_ptr->lite_x[i];
440 g_ptr = &floor_ptr->grid_array[y][x];
441 if (g_ptr->info & CAVE_TEMP)
444 cave_note_and_redraw_later(floor_ptr, g_ptr, y, x);
447 for (int i = 0; i < tmp_pos.n; i++) {
448 POSITION y = tmp_pos.y[i];
449 POSITION x = tmp_pos.x[i];
450 g_ptr = &floor_ptr->grid_array[y][x];
451 g_ptr->info &= ~(CAVE_TEMP);
452 if (g_ptr->info & CAVE_LITE)
455 cave_redraw_later(floor_ptr, g_ptr, y, x);
459 subject_ptr->update |= PU_DELAY_VIS;
463 * Clear the viewable space
465 void forget_view(floor_type *floor_ptr)
467 if (!floor_ptr->view_n)
470 for (int i = 0; i < floor_ptr->view_n; i++) {
471 POSITION y = floor_ptr->view_y[i];
472 POSITION x = floor_ptr->view_x[i];
474 g_ptr = &floor_ptr->grid_array[y][x];
475 g_ptr->info &= ~(CAVE_VIEW);
478 floor_ptr->view_n = 0;
482 * Helper function for "update_view()" below
484 * We are checking the "viewability" of grid (y,x) by the player.
486 * This function assumes that (y,x) is legal (i.e. on the map).
488 * Grid (y1,x1) is on the "diagonal" between (subject_ptr->y,subject_ptr->x) and (y,x)
489 * Grid (y2,x2) is "adjacent", also between (subject_ptr->y,subject_ptr->x) and (y,x).
491 * Note that we are using the "CAVE_XTRA" field for marking grids as
492 * "easily viewable". This bit is cleared at the end of "update_view()".
494 * This function adds (y,x) to the "viewable set" if necessary.
496 * This function now returns "TRUE" if vision is "blocked" by grid (y,x).
498 static bool update_view_aux(player_type *subject_ptr, POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
500 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
503 g1_c_ptr = &floor_ptr->grid_array[y1][x1];
504 g2_c_ptr = &floor_ptr->grid_array[y2][x2];
505 bool f1 = (cave_los_grid(g1_c_ptr));
506 bool f2 = (cave_los_grid(g2_c_ptr));
510 bool v1 = (f1 && (g1_c_ptr->info & CAVE_VIEW));
511 bool v2 = (f2 && (g2_c_ptr->info & CAVE_VIEW));
516 g_ptr = &floor_ptr->grid_array[y][x];
517 bool wall = (!cave_los_grid(g_ptr));
518 bool z1 = (v1 && (g1_c_ptr->info & CAVE_XTRA));
519 bool z2 = (v2 && (g2_c_ptr->info & CAVE_XTRA));
521 g_ptr->info |= CAVE_XTRA;
522 cave_view_hack(floor_ptr, g_ptr, y, x);
527 cave_view_hack(floor_ptr, g_ptr, y, x);
532 cave_view_hack(floor_ptr, g_ptr, y, x);
537 cave_view_hack(floor_ptr, g_ptr, y, x);
541 if (los(subject_ptr, subject_ptr->y, subject_ptr->x, y, x)) {
542 cave_view_hack(floor_ptr, g_ptr, y, x);
550 * Calculate the viewable space
552 * 1: Process the player
553 * 1a: The player is always (easily) viewable
554 * 2: Process the diagonals
555 * 2a: The diagonals are (easily) viewable up to the first wall
556 * 2b: But never go more than 2/3 of the "full" distance
557 * 3: Process the main axes
558 * 3a: The main axes are (easily) viewable up to the first wall
559 * 3b: But never go more than the "full" distance
560 * 4: Process sequential "strips" in each of the eight octants
561 * 4a: Each strip runs along the previous strip
562 * 4b: The main axes are "previous" to the first strip
563 * 4c: Process both "sides" of each "direction" of each strip
564 * 4c1: Each side aborts as soon as possible
565 * 4c2: Each side tells the next strip how far it has to check
567 void update_view(player_type *subject_ptr)
572 int se, sw, ne, nw, es, en, ws, wn;
576 floor_type *floor_ptr = subject_ptr->current_floor_ptr;
577 POSITION y_max = floor_ptr->height - 1;
578 POSITION x_max = floor_ptr->width - 1;
581 if (view_reduce_view && !floor_ptr->dun_level) {
582 full = MAX_SIGHT / 2;
583 over = MAX_SIGHT * 3 / 4;
586 over = MAX_SIGHT * 3 / 2;
589 for (n = 0; n < floor_ptr->view_n; n++) {
590 y = floor_ptr->view_y[n];
591 x = floor_ptr->view_x[n];
592 g_ptr = &floor_ptr->grid_array[y][x];
593 g_ptr->info &= ~(CAVE_VIEW);
594 g_ptr->info |= CAVE_TEMP;
595 tmp_pos.y[tmp_pos.n] = y;
596 tmp_pos.x[tmp_pos.n] = x;
600 floor_ptr->view_n = 0;
603 g_ptr = &floor_ptr->grid_array[y][x];
604 g_ptr->info |= CAVE_XTRA;
605 cave_view_hack(floor_ptr, g_ptr, y, x);
608 for (d = 1; d <= z; d++) {
609 g_ptr = &floor_ptr->grid_array[y + d][x + d];
610 g_ptr->info |= CAVE_XTRA;
611 cave_view_hack(floor_ptr, g_ptr, y + d, x + d);
612 if (!cave_los_grid(g_ptr))
616 for (d = 1; d <= z; d++) {
617 g_ptr = &floor_ptr->grid_array[y + d][x - d];
618 g_ptr->info |= CAVE_XTRA;
619 cave_view_hack(floor_ptr, g_ptr, y + d, x - d);
620 if (!cave_los_grid(g_ptr))
624 for (d = 1; d <= z; d++) {
625 g_ptr = &floor_ptr->grid_array[y - d][x + d];
626 g_ptr->info |= CAVE_XTRA;
627 cave_view_hack(floor_ptr, g_ptr, y - d, x + d);
628 if (!cave_los_grid(g_ptr))
632 for (d = 1; d <= z; d++) {
633 g_ptr = &floor_ptr->grid_array[y - d][x - d];
634 g_ptr->info |= CAVE_XTRA;
635 cave_view_hack(floor_ptr, g_ptr, y - d, x - d);
636 if (!cave_los_grid(g_ptr))
640 for (d = 1; d <= full; d++) {
641 g_ptr = &floor_ptr->grid_array[y + d][x];
642 g_ptr->info |= CAVE_XTRA;
643 cave_view_hack(floor_ptr, g_ptr, y + d, x);
644 if (!cave_los_grid(g_ptr))
649 for (d = 1; d <= full; d++) {
650 g_ptr = &floor_ptr->grid_array[y - d][x];
651 g_ptr->info |= CAVE_XTRA;
652 cave_view_hack(floor_ptr, g_ptr, y - d, x);
653 if (!cave_los_grid(g_ptr))
658 for (d = 1; d <= full; d++) {
659 g_ptr = &floor_ptr->grid_array[y][x + d];
660 g_ptr->info |= CAVE_XTRA;
661 cave_view_hack(floor_ptr, g_ptr, y, x + d);
662 if (!cave_los_grid(g_ptr))
667 for (d = 1; d <= full; d++) {
668 g_ptr = &floor_ptr->grid_array[y][x - d];
669 g_ptr->info |= CAVE_XTRA;
670 cave_view_hack(floor_ptr, g_ptr, y, x - d);
671 if (!cave_los_grid(g_ptr))
676 for (n = 1; n <= over / 2; n++) {
677 POSITION ypn, ymn, xpn, xmn;
682 while ((z + n + (n >> 1)) > full)
690 m = MIN(z, y_max - ypn);
691 if ((xpn <= x_max) && (n < se)) {
692 for (k = n, d = 1; d <= m; d++) {
693 if (update_view_aux(subject_ptr, ypn + d, xpn, ypn + d - 1, xpn - 1, ypn + d - 1, xpn)) {
703 if ((xmn >= 0) && (n < sw)) {
704 for (k = n, d = 1; d <= m; d++) {
705 if (update_view_aux(subject_ptr, ypn + d, xmn, ypn + d - 1, xmn + 1, ypn + d - 1, xmn)) {
718 if ((xpn <= x_max) && (n < ne)) {
719 for (k = n, d = 1; d <= m; d++) {
720 if (update_view_aux(subject_ptr, ymn - d, xpn, ymn - d + 1, xpn - 1, ymn - d + 1, xpn)) {
730 if ((xmn >= 0) && (n < nw)) {
731 for (k = n, d = 1; d <= m; d++) {
732 if (update_view_aux(subject_ptr, ymn - d, xmn, ymn - d + 1, xmn + 1, ymn - d + 1, xmn)) {
744 m = MIN(z, x_max - xpn);
745 if ((ypn <= x_max) && (n < es)) {
746 for (k = n, d = 1; d <= m; d++) {
747 if (update_view_aux(subject_ptr, ypn, xpn + d, ypn - 1, xpn + d - 1, ypn, xpn + d - 1)) {
757 if ((ymn >= 0) && (n < en)) {
758 for (k = n, d = 1; d <= m; d++) {
759 if (update_view_aux(subject_ptr, ymn, xpn + d, ymn + 1, xpn + d - 1, ymn, xpn + d - 1)) {
772 if ((ypn <= y_max) && (n < ws)) {
773 for (k = n, d = 1; d <= m; d++) {
774 if (update_view_aux(subject_ptr, ypn, xmn - d, ypn - 1, xmn - d + 1, ypn, xmn - d + 1)) {
784 if ((ymn >= 0) && (n < wn)) {
785 for (k = n, d = 1; d <= m; d++) {
786 if (update_view_aux(subject_ptr, ymn, xmn - d, ymn + 1, xmn - d + 1, ymn, xmn - d + 1)) {
798 for (n = 0; n < floor_ptr->view_n; n++) {
799 y = floor_ptr->view_y[n];
800 x = floor_ptr->view_x[n];
801 g_ptr = &floor_ptr->grid_array[y][x];
802 g_ptr->info &= ~(CAVE_XTRA);
803 if (g_ptr->info & CAVE_TEMP)
806 cave_note_and_redraw_later(floor_ptr, g_ptr, y, x);
809 for (n = 0; n < tmp_pos.n; n++) {
812 g_ptr = &floor_ptr->grid_array[y][x];
813 g_ptr->info &= ~(CAVE_TEMP);
814 if (g_ptr->info & CAVE_VIEW)
817 cave_redraw_later(floor_ptr, g_ptr, y, x);
821 subject_ptr->update |= PU_DELAY_VIS;