リビジョン | 9c267fcdccceebdf334f3ec02f6939e38e55d1e2 (tree) |
---|---|
日時 | 2019-10-16 20:20:12 |
作者 | deskull <deskull@user...> |
コミッター | deskull |
[Refactor] #38997 stair_creation() に player_type * 引数を追加. / Add player_type * argument to stair_creation().
@@ -1611,7 +1611,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr) | ||
1611 | 1611 | teleport_player(222, 0L); |
1612 | 1612 | break; |
1613 | 1613 | case 11: case 12: |
1614 | - (void)stair_creation(); | |
1614 | + (void)stair_creation(user_ptr); | |
1615 | 1615 | break; |
1616 | 1616 | default: |
1617 | 1617 | if (get_check(_("この階を去りますか?", "Leave this level? "))) |
@@ -327,7 +327,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode | ||
327 | 327 | { |
328 | 328 | if (cast) |
329 | 329 | { |
330 | - stair_creation(); | |
330 | + stair_creation(caster_ptr); | |
331 | 331 | } |
332 | 332 | } |
333 | 333 | break; |
@@ -263,8 +263,9 @@ bool place_mirror(void) | ||
263 | 263 | * Create stairs at or move previously created stairs into the player location. |
264 | 264 | * @return なし |
265 | 265 | */ |
266 | -void stair_creation(void) | |
266 | +void stair_creation(player_type *caster_ptr) | |
267 | 267 | { |
268 | + floor_type *floor_ptr = caster_ptr->current_floor_ptr; | |
268 | 269 | saved_floor_type *sf_ptr; |
269 | 270 | saved_floor_type *dest_sf_ptr; |
270 | 271 |
@@ -277,10 +278,10 @@ void stair_creation(void) | ||
277 | 278 | if (ironman_downward) up = FALSE; |
278 | 279 | |
279 | 280 | /* Forbid down staircases on quest level */ |
280 | - if (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE; | |
281 | + if (quest_number(floor_ptr->dun_level) || (floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE; | |
281 | 282 | |
282 | 283 | /* No effect out of standard dungeon floor */ |
283 | - if (!p_ptr->current_floor_ptr->dun_level || (!up && !down) || | |
284 | + if (!floor_ptr->dun_level || (!up && !down) || | |
284 | 285 | (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || |
285 | 286 | p_ptr->inside_arena || p_ptr->phase_out) |
286 | 287 | { |
@@ -331,11 +332,11 @@ void stair_creation(void) | ||
331 | 332 | { |
332 | 333 | POSITION x, y; |
333 | 334 | |
334 | - for (y = 0; y < p_ptr->current_floor_ptr->height; y++) | |
335 | + for (y = 0; y < floor_ptr->height; y++) | |
335 | 336 | { |
336 | - for (x = 0; x < p_ptr->current_floor_ptr->width; x++) | |
337 | + for (x = 0; x < floor_ptr->width; x++) | |
337 | 338 | { |
338 | - grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; | |
339 | + grid_type *g_ptr = &floor_ptr->grid_array[y][x]; | |
339 | 340 | |
340 | 341 | if (!g_ptr->special) continue; |
341 | 342 | if (feat_uses_special(g_ptr->feat)) continue; |
@@ -368,19 +369,19 @@ void stair_creation(void) | ||
368 | 369 | if (up) |
369 | 370 | { |
370 | 371 | cave_set_feat(p_ptr->y, p_ptr->x, |
371 | - (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= p_ptr->current_floor_ptr->dun_level - 2)) ? | |
372 | + (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= floor_ptr->dun_level - 2)) ? | |
372 | 373 | feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair); |
373 | 374 | } |
374 | 375 | else |
375 | 376 | { |
376 | 377 | cave_set_feat(p_ptr->y, p_ptr->x, |
377 | - (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= p_ptr->current_floor_ptr->dun_level + 2)) ? | |
378 | + (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= floor_ptr->dun_level + 2)) ? | |
378 | 379 | feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair); |
379 | 380 | } |
380 | 381 | |
381 | 382 | |
382 | 383 | /* Connect this stairs to the destination */ |
383 | - p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id; | |
384 | + floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id; | |
384 | 385 | } |
385 | 386 | |
386 | 387 | /* |
@@ -5,7 +5,7 @@ extern void wiz_dark(void); | ||
5 | 5 | extern bool warding_glyph(player_type *caster_ptr); |
6 | 6 | extern bool explosive_rune(void); |
7 | 7 | extern bool place_mirror(void); |
8 | -extern void stair_creation(void); | |
8 | +extern void stair_creation(player_type *caster_ptr); | |
9 | 9 | extern void map_area(POSITION range); |
10 | 10 | extern bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate); |
11 | 11 | extern bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx); |