変愚蛮怒のメインリポジトリです
修訂 | 77e2c6684cd68bfea687737591be5ace8e66e35e (tree) |
---|---|
時間 | 2020-03-15 12:45:28 |
作者 | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #40256 get_mon_num()に 新しく optionを追加し GMN_ARENA を追加. / Add option argument to get_mon_num() and define GMN_ARENA.
@@ -2274,7 +2274,7 @@ void player_outfit(player_type *creature_ptr) | ||
2274 | 2274 | for (i = rand_range(3, 4); i > 0; i--) |
2275 | 2275 | { |
2276 | 2276 | object_prep(q_ptr, lookup_kind(TV_CORPSE, SV_CORPSE)); |
2277 | - q_ptr->pval = get_mon_num(creature_ptr, 2); | |
2277 | + q_ptr->pval = get_mon_num(creature_ptr, 2, 0); | |
2278 | 2278 | if (q_ptr->pval) |
2279 | 2279 | { |
2280 | 2280 | q_ptr->number = 1; |
@@ -1542,7 +1542,6 @@ void update_gambling_monsters(player_type *player_ptr) | ||
1542 | 1542 | int mon_level; |
1543 | 1543 | int power[4]; |
1544 | 1544 | bool tekitou; |
1545 | - bool old_inside_battle = player_ptr->phase_out; | |
1546 | 1545 | |
1547 | 1546 | for (i = 0; i < current_world_ptr->max_d_idx; i++) |
1548 | 1547 | { |
@@ -1573,9 +1572,7 @@ void update_gambling_monsters(player_type *player_ptr) | ||
1573 | 1572 | while (TRUE) |
1574 | 1573 | { |
1575 | 1574 | get_mon_num_prep(player_ptr, monster_can_entry_arena, NULL); |
1576 | - player_ptr->phase_out = TRUE; | |
1577 | - r_idx = get_mon_num(player_ptr, mon_level); | |
1578 | - player_ptr->phase_out = old_inside_battle; | |
1575 | + r_idx = get_mon_num(player_ptr, mon_level, GMN_ARENA); | |
1579 | 1576 | if (!r_idx) continue; |
1580 | 1577 | |
1581 | 1578 | if ((r_info[r_idx].flags1 & RF1_UNIQUE) || (r_info[r_idx].flags7 & RF7_UNIQUE2)) |
@@ -2253,14 +2250,14 @@ static void castle_quest(player_type *player_ptr) | ||
2253 | 2250 | |
2254 | 2251 | if (q_ptr->r_idx == 0) |
2255 | 2252 | { |
2256 | - q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6)); | |
2253 | + q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6), 0); | |
2257 | 2254 | } |
2258 | 2255 | |
2259 | 2256 | monster_race *r_ptr; |
2260 | 2257 | r_ptr = &r_info[q_ptr->r_idx]; |
2261 | 2258 | while ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->rarity != 1)) |
2262 | 2259 | { |
2263 | - q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level) + 4 + randint1(6); | |
2260 | + q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6), 0); | |
2264 | 2261 | r_ptr = &r_info[q_ptr->r_idx]; |
2265 | 2262 | } |
2266 | 2263 |
@@ -4015,7 +4012,6 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4015 | 4012 | */ |
4016 | 4013 | void determine_daily_bounty(player_type *player_ptr, bool conv_old) |
4017 | 4014 | { |
4018 | - bool old_inside_battle = player_ptr->phase_out; | |
4019 | 4015 | int max_dl = 3, i; |
4020 | 4016 | if (!conv_old) |
4021 | 4017 | { |
@@ -4030,12 +4026,11 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old) | ||
4030 | 4026 | max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3); |
4031 | 4027 | } |
4032 | 4028 | |
4033 | - player_ptr->phase_out = TRUE; | |
4034 | 4029 | get_mon_num_prep(player_ptr, NULL, NULL); |
4035 | 4030 | |
4036 | 4031 | while (TRUE) |
4037 | 4032 | { |
4038 | - today_mon = get_mon_num(player_ptr, max_dl); | |
4033 | + today_mon = get_mon_num(player_ptr, max_dl, GMN_ARENA); | |
4039 | 4034 | monster_race *r_ptr; |
4040 | 4035 | r_ptr = &r_info[today_mon]; |
4041 | 4036 |
@@ -4047,9 +4042,6 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old) | ||
4047 | 4042 | if (r_ptr->rarity > 10) continue; |
4048 | 4043 | break; |
4049 | 4044 | } |
4050 | - | |
4051 | - player_ptr->today_mon = 0; | |
4052 | - player_ptr->phase_out = old_inside_battle; | |
4053 | 4045 | } |
4054 | 4046 | |
4055 | 4047 |
@@ -4065,7 +4057,7 @@ void determine_bounty_uniques(player_type *player_ptr) | ||
4065 | 4057 | { |
4066 | 4058 | while (TRUE) |
4067 | 4059 | { |
4068 | - current_world_ptr->bounty_r_idx[i] = get_mon_num(player_ptr, MAX_DEPTH - 1); | |
4060 | + current_world_ptr->bounty_r_idx[i] = get_mon_num(player_ptr, MAX_DEPTH - 1, GMN_ARENA); | |
4069 | 4061 | monster_race *r_ptr; |
4070 | 4062 | r_ptr = &r_info[current_world_ptr->bounty_r_idx[i]]; |
4071 | 4063 |
@@ -3611,7 +3611,7 @@ static void process_fishing(player_type *creature_ptr) | ||
3611 | 3611 | MONRACE_IDX r_idx; |
3612 | 3612 | bool success = FALSE; |
3613 | 3613 | get_mon_num_prep(creature_ptr, monster_is_fishing_target, NULL); |
3614 | - r_idx = get_mon_num(creature_ptr, creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level); | |
3614 | + r_idx = get_mon_num(creature_ptr, creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level, 0); | |
3615 | 3615 | msg_print(NULL); |
3616 | 3616 | if (r_idx && one_in_(2)) |
3617 | 3617 | { |
@@ -345,7 +345,10 @@ extern void compact_monsters(player_type *player_ptr, int size); | ||
345 | 345 | extern void wipe_monsters_list(player_type *player_ptr); |
346 | 346 | extern MONSTER_IDX m_pop(player_type *player_ptr); |
347 | 347 | extern errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2); |
348 | -extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level); | |
348 | + | |
349 | +#define GMN_ARENA 0x00000001 //!< 賭け闘技場向け生成 | |
350 | +extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level, BIT_FLAGS option); | |
351 | + | |
349 | 352 | extern int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx); |
350 | 353 | extern void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold); |
351 | 354 | extern void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full); |
@@ -989,7 +989,7 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo | ||
989 | 989 | * Note that if no monsters are "appropriate", then this function will |
990 | 990 | * fail, and return zero, but this should *almost* never happen. |
991 | 991 | */ |
992 | -MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level) | |
992 | +MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level, BIT_FLAGS option) | |
993 | 993 | { |
994 | 994 | int delay = mysqrt(level * 10000L) + 400L; |
995 | 995 | int reinforcement_possibility = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10))); |
@@ -1003,7 +1003,7 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level) | ||
1003 | 1003 | level += 3; |
1004 | 1004 | } |
1005 | 1005 | |
1006 | - if (!player_ptr->phase_out && !(d_info[player_ptr->dungeon_idx].flags1 & DF1_BEGINNER)) | |
1006 | + if (!(option & GMN_ARENA) && !(d_info[player_ptr->dungeon_idx].flags1 & DF1_BEGINNER)) | |
1007 | 1007 | { |
1008 | 1008 | if (ironman_nightmare && !randint0(reinforcement_possibility)) |
1009 | 1009 | { |
@@ -1032,7 +1032,7 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level) | ||
1032 | 1032 | MONRACE_IDX r_idx = table[i].index; |
1033 | 1033 | monster_race *r_ptr; |
1034 | 1034 | r_ptr = &r_info[r_idx]; |
1035 | - if (!player_ptr->phase_out && !chameleon_change_m_idx) | |
1035 | + if (!(option & GMN_ARENA) && !chameleon_change_m_idx) | |
1036 | 1036 | { |
1037 | 1037 | if (((r_ptr->flags1 & (RF1_UNIQUE)) || |
1038 | 1038 | (r_ptr->flags7 & (RF7_NAZGUL))) && |
@@ -2007,7 +2007,7 @@ void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, M | ||
2007 | 2007 | |
2008 | 2008 | if (d_info[player_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level += 2 + randint1(3); |
2009 | 2009 | |
2010 | - r_idx = get_mon_num(player_ptr, level); | |
2010 | + r_idx = get_mon_num(player_ptr, level, 0); | |
2011 | 2011 | r_ptr = &r_info[r_idx]; |
2012 | 2012 | |
2013 | 2013 | chameleon_change_m_idx = 0; |
@@ -2116,7 +2116,7 @@ static MONRACE_IDX initial_r_appearance(player_type *player_ptr, MONRACE_IDX r_i | ||
2116 | 2116 | DEPTH min = MIN(floor_ptr->base_level - 5, 50); |
2117 | 2117 | while (--attempts) |
2118 | 2118 | { |
2119 | - MONRACE_IDX ap_r_idx = get_mon_num(player_ptr, floor_ptr->base_level + 10); | |
2119 | + MONRACE_IDX ap_r_idx = get_mon_num(player_ptr, floor_ptr->base_level + 10, 0); | |
2120 | 2120 | if (r_info[ap_r_idx].level >= min) return ap_r_idx; |
2121 | 2121 | } |
2122 | 2122 |
@@ -2711,7 +2711,7 @@ bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POS | ||
2711 | 2711 | if (!is_cave_empty_bold2(player_ptr, ny, nx)) continue; |
2712 | 2712 | |
2713 | 2713 | get_mon_num_prep(player_ptr, place_monster_can_escort, get_monster_hook2(player_ptr, ny, nx)); |
2714 | - z = get_mon_num(player_ptr, r_ptr->level); | |
2714 | + z = get_mon_num(player_ptr, r_ptr->level, 0); | |
2715 | 2715 | if (!z) break; |
2716 | 2716 | |
2717 | 2717 | (void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, z, mode); |
@@ -2738,7 +2738,7 @@ bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mo | ||
2738 | 2738 | { |
2739 | 2739 | MONRACE_IDX r_idx; |
2740 | 2740 | get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x)); |
2741 | - r_idx = get_mon_num(player_ptr, player_ptr->current_floor_ptr->monster_level); | |
2741 | + r_idx = get_mon_num(player_ptr, player_ptr->current_floor_ptr->monster_level, 0); | |
2742 | 2742 | if (!r_idx) return FALSE; |
2743 | 2743 | |
2744 | 2744 | if ((one_in_(5) || (player_ptr->current_floor_ptr->base_level == 0)) && |
@@ -2770,7 +2770,7 @@ bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x) | ||
2770 | 2770 | monster_race *r_ptr = NULL; |
2771 | 2771 | while (--attempts) |
2772 | 2772 | { |
2773 | - r_idx = get_mon_num(player_ptr, floor_ptr->monster_level); | |
2773 | + r_idx = get_mon_num(player_ptr, floor_ptr->monster_level, 0); | |
2774 | 2774 | if (!r_idx) return FALSE; |
2775 | 2775 | |
2776 | 2776 | r_ptr = &r_info[r_idx]; |
@@ -2996,7 +2996,7 @@ bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSI | ||
2996 | 2996 | summon_unique_okay = (mode & PM_ALLOW_UNIQUE) ? TRUE : FALSE; |
2997 | 2997 | get_mon_num_prep(player_ptr, summon_specific_okay, get_monster_hook2(player_ptr, y, x)); |
2998 | 2998 | |
2999 | - MONRACE_IDX r_idx = get_mon_num(player_ptr, (floor_ptr->dun_level + lev) / 2 + 5); | |
2999 | + MONRACE_IDX r_idx = get_mon_num(player_ptr, (floor_ptr->dun_level + lev) / 2 + 5, 0); | |
3000 | 3000 | if (!r_idx) |
3001 | 3001 | { |
3002 | 3002 | summon_specific_type = 0; |
@@ -30,7 +30,7 @@ void vault_prep_clone(player_type *player_ptr) | ||
30 | 30 | get_mon_num_prep(player_ptr, vault_aux_simple, NULL); |
31 | 31 | |
32 | 32 | /* Pick a race to clone */ |
33 | - vault_aux_race = get_mon_num(player_ptr, player_ptr->current_floor_ptr->dun_level + 10); | |
33 | + vault_aux_race = get_mon_num(player_ptr, player_ptr->current_floor_ptr->dun_level + 10, 0); | |
34 | 34 | |
35 | 35 | /* Remove the monster restriction */ |
36 | 36 | get_mon_num_prep(player_ptr, NULL, NULL); |
@@ -50,7 +50,7 @@ void vault_prep_symbol(player_type *player_ptr) | ||
50 | 50 | get_mon_num_prep(player_ptr, vault_aux_simple, NULL); |
51 | 51 | |
52 | 52 | /* Pick a race to clone */ |
53 | - r_idx = get_mon_num(player_ptr, player_ptr->current_floor_ptr->dun_level + 10); | |
53 | + r_idx = get_mon_num(player_ptr, player_ptr->current_floor_ptr->dun_level + 10, 0); | |
54 | 54 | |
55 | 55 | /* Remove the monster restriction */ |
56 | 56 | get_mon_num_prep(player_ptr, NULL, NULL); |
@@ -2899,7 +2899,7 @@ static void a_m_aux_4(player_type *owner_ptr, object_type *o_ptr, int power) | ||
2899 | 2899 | get_mon_num_prep(owner_ptr, item_monster_okay, NULL); |
2900 | 2900 | while (TRUE) |
2901 | 2901 | { |
2902 | - i = get_mon_num(owner_ptr, floor_ptr->dun_level); | |
2902 | + i = get_mon_num(owner_ptr, floor_ptr->dun_level, 0); | |
2903 | 2903 | r_ptr = &r_info[i]; |
2904 | 2904 | check = (floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - floor_ptr->dun_level) : 0; |
2905 | 2905 | if (!r_ptr->rarity) continue; |
@@ -4645,7 +4645,7 @@ void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro) | ||
4645 | 4645 | GAME_TEXT m_name[MAX_NLEN]; |
4646 | 4646 | concptr desc; |
4647 | 4647 | get_mon_num_prep(creature_ptr, get_nightmare, NULL); |
4648 | - r_ptr = &r_info[get_mon_num(creature_ptr, MAX_DEPTH)]; | |
4648 | + r_ptr = &r_info[get_mon_num(creature_ptr, MAX_DEPTH, 0)]; | |
4649 | 4649 | power = r_ptr->level + 10; |
4650 | 4650 | desc = r_name + r_ptr->name; |
4651 | 4651 | get_mon_num_prep(creature_ptr, NULL, NULL); |
@@ -55,7 +55,7 @@ void determine_random_questor(player_type *player_ptr, quest_type *q_ptr) | ||
55 | 55 | * Random monster 5 - 10 levels out of depth |
56 | 56 | * (depending on level) |
57 | 57 | */ |
58 | - r_idx = get_mon_num(player_ptr, q_ptr->level + 5 + randint1(q_ptr->level / 10)); | |
58 | + r_idx = get_mon_num(player_ptr, q_ptr->level + 5 + randint1(q_ptr->level / 10), GMN_ARENA); | |
59 | 59 | monster_race *r_ptr; |
60 | 60 | r_ptr = &r_info[r_idx]; |
61 | 61 |
@@ -319,7 +319,7 @@ bool build_type5(player_type *player_ptr) | ||
319 | 319 | while (attempts--) |
320 | 320 | { |
321 | 321 | /* Get a (hard) monster type */ |
322 | - r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 11); | |
322 | + r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 11, 0); | |
323 | 323 | r_ptr = &r_info[r_idx]; |
324 | 324 | |
325 | 325 | /* Decline incorrect alignment */ |
@@ -529,7 +529,7 @@ bool build_type6(player_type *player_ptr) | ||
529 | 529 | while (attempts--) |
530 | 530 | { |
531 | 531 | /* Get a (hard) monster type */ |
532 | - r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 11); | |
532 | + r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 11, 0); | |
533 | 533 | r_ptr = &r_info[r_idx]; |
534 | 534 | |
535 | 535 | /* Decline incorrect alignment */ |
@@ -839,7 +839,7 @@ bool build_type13(player_type *player_ptr) | ||
839 | 839 | while (attempts--) |
840 | 840 | { |
841 | 841 | /* Get a (hard) monster type */ |
842 | - r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 0); | |
842 | + r_idx = get_mon_num(player_ptr, floor_ptr->dun_level + 0, 0); | |
843 | 843 | r_ptr = &r_info[r_idx]; |
844 | 844 | |
845 | 845 | /* Decline incorrect alignment */ |
@@ -86,7 +86,7 @@ bool build_type15(player_type *player_ptr) | ||
86 | 86 | /* Place fixed lite berathers */ |
87 | 87 | for (dir1 = 4; dir1 < 8; dir1++) |
88 | 88 | { |
89 | - MONRACE_IDX r_idx = get_mon_num(player_ptr, floor_ptr->dun_level); | |
89 | + MONRACE_IDX r_idx = get_mon_num(player_ptr, floor_ptr->dun_level, 0); | |
90 | 90 | |
91 | 91 | y = yval + 2 * ddy_ddd[dir1]; |
92 | 92 | x = xval + 2 * ddx_ddd[dir1]; |
@@ -150,7 +150,7 @@ bool build_type15(player_type *player_ptr) | ||
150 | 150 | g_ptr->feat = feat_glass_wall; |
151 | 151 | get_mon_num_prep(player_ptr, vault_aux_lite, NULL); |
152 | 152 | |
153 | - r_idx = get_mon_num(player_ptr, floor_ptr->dun_level); | |
153 | + r_idx = get_mon_num(player_ptr, floor_ptr->dun_level, 0); | |
154 | 154 | if (r_idx) place_monster_aux(player_ptr, 0, yval, xval, r_idx, 0L); |
155 | 155 | |
156 | 156 | /* Walls around the breather */ |
@@ -217,7 +217,7 @@ bool build_type15(player_type *player_ptr) | ||
217 | 217 | /* Place shard berathers */ |
218 | 218 | for (dir1 = 4; dir1 < 8; dir1++) |
219 | 219 | { |
220 | - MONRACE_IDX r_idx = get_mon_num(player_ptr, floor_ptr->dun_level); | |
220 | + MONRACE_IDX r_idx = get_mon_num(player_ptr, floor_ptr->dun_level, 0); | |
221 | 221 | |
222 | 222 | y = yval + ddy_ddd[dir1]; |
223 | 223 | x = xval + ddx_ddd[dir1]; |
@@ -2395,7 +2395,7 @@ static MONRACE_IDX poly_r_idx(player_type *caster_ptr, MONRACE_IDX r_idx) | ||
2395 | 2395 | MONRACE_IDX r; |
2396 | 2396 | for (int i = 0; i < 1000; i++) |
2397 | 2397 | { |
2398 | - r = get_mon_num(caster_ptr, (caster_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5); | |
2398 | + r = get_mon_num(caster_ptr, (caster_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5, 0); | |
2399 | 2399 | if (!r) break; |
2400 | 2400 | |
2401 | 2401 | r_ptr = &r_info[r]; |