From c02230e80f4eafddd5a5365030bb9837820582c3 Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 26 Jan 2021 22:36:09 +0900 Subject: [PATCH 1/1] =?utf8?q?[Fix]=20#41316=20=E8=B3=9E=E9=87=91=E9=A6=96?= =?utf8?q?=E7=94=9F=E6=88=90=E6=99=82=E3=81=AB=E5=88=A4=E6=98=8E=E3=81=97?= =?utf8?q?=E3=81=9Fget=5Fmon=5Fnum=5Fprep(),=20get=5Fmon=5Fnum()=E3=81=AE?= =?utf8?q?=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3=20/=20Fix=20get=5Fmon=5Fnum?= =?utf8?q?=5Fprep(),=20get=5Fmon=5Fnum()=20found=20by=20process=20bounty?= =?utf8?q?=20selection.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * get_mon_num_prep()時、条件を通った後ダンジョンごとのMONSTER_DIV修正でprop値が0になる部分を最低1保証. * 最低階層処理をget_mon_num()に回したことに伴う、prep値とtotal値の食い違いを修正. --- src/market/bounty.c | 2 +- src/monster/monster-list.c | 8 +++++--- src/monster/monster-util.c | 12 +++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/market/bounty.c b/src/market/bounty.c index 876ac7979..7fda5f54a 100644 --- a/src/market/bounty.c +++ b/src/market/bounty.c @@ -289,7 +289,7 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old) r_ptr = &r_info[today_mon]; if (cheat_hear) { - msg_format("日替わり: %s ", r_ptr->name + r_name); + msg_format("日替わり候補: %s ", r_ptr->name + r_name); } if (r_ptr->flags1 & RF1_UNIQUE) diff --git a/src/monster/monster-list.c b/src/monster/monster-list.c index 612390db7..d8f67c61e 100644 --- a/src/monster/monster-list.c +++ b/src/monster/monster-list.c @@ -134,9 +134,11 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve /* Process probabilities */ for (i = 0; i < alloc_race_size; i++) { - if (table[i].level < min_level) continue; - if (max_level < table[i].level) break; // sorted by depth array, table[i].prob3 = 0; + if (table[i].level < min_level) + continue; + if (max_level < table[i].level) + break; // sorted by depth array, r_idx = table[i].index; r_ptr = &r_info[r_idx]; if (!(option & GMN_ARENA) && !chameleon_change_m_idx) { @@ -162,7 +164,7 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve } if (cheat_hear) { - msg_format(_("モンスター第3次候補数:%d(%d-%dF) ", "monster third selection:%d(%d-%dF) "), mon_num, min_level, max_level); + msg_format(_("モンスター第3次候補数:%d(%d-%dF)%d ", "monster third selection:%d(%d-%dF)%d "), mon_num, min_level, max_level, total); } if (total <= 0) diff --git a/src/monster/monster-util.c b/src/monster/monster-util.c index 7ec78508f..bdc2366a1 100644 --- a/src/monster/monster-util.c +++ b/src/monster/monster-util.c @@ -326,6 +326,7 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo int mon_num = 0; DEPTH lev_min = 127; DEPTH lev_max = 0; + int total = 0; floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < alloc_race_size; i++) { alloc_entry *entry = &alloc_race_table[i]; @@ -346,12 +347,16 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo continue; } + if (entry->prob1 <= 0) + continue; + mon_num++; if (lev_min > entry->level) lev_min = entry->level; if (lev_max < entry->level) lev_max = entry->level; + entry->prob2 = entry->prob1; if (floor_ptr->dun_level && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest)) && !restrict_monster_to_dungeon(player_ptr, entry->index) && !player_ptr->phase_out) { @@ -359,10 +364,15 @@ errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hoo entry->prob2 = hoge / 64; if (randint0(64) < (hoge & 0x3f)) entry->prob2++; + if (entry->prob2 <= 0) + entry->prob2 = 1; } + + total += entry->prob2; + } if (cheat_hear) { - msg_format(_("モンスター第2次候補数:%d(%d-%dF) ", "monster second selection:%d(%d-%dF) "), mon_num, lev_min, lev_max); + msg_format(_("モンスター第2次候補数:%d(%d-%dF)%d ", "monster second selection:%d(%d-%dF)&d "), mon_num, lev_min, lev_max, total); } return 0; } -- 2.11.0