変愚蛮怒のメインリポジトリです
Revision | 211b5878739c7ec1faa98b74d381370583598e91 (tree) |
---|---|
Time | 2019-04-29 23:56:24 |
Author | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #37353 determine_bounty_uniques() を bldg.c/h へ移動。
@@ -4245,3 +4245,52 @@ void determine_today_mon(bool conv_old) | ||
4245 | 4245 | p_ptr->inside_battle = old_inside_battle; |
4246 | 4246 | } |
4247 | 4247 | |
4248 | + | |
4249 | + | |
4250 | +/*! | |
4251 | + * @brief 賞金首となるユニークを確定する / Determine bounty uniques | |
4252 | + * @return なし | |
4253 | + */ | |
4254 | +void determine_bounty_uniques(void) | |
4255 | +{ | |
4256 | + int i, j; | |
4257 | + MONRACE_IDX tmp; | |
4258 | + monster_race *r_ptr; | |
4259 | + | |
4260 | + get_mon_num_prep(NULL, NULL); | |
4261 | + for (i = 0; i < MAX_KUBI; i++) | |
4262 | + { | |
4263 | + while (1) | |
4264 | + { | |
4265 | + current_world_ptr->bounty_r_idx[i] = get_mon_num(MAX_DEPTH - 1); | |
4266 | + r_ptr = &r_info[current_world_ptr->bounty_r_idx[i]]; | |
4267 | + | |
4268 | + if (!(r_ptr->flags1 & RF1_UNIQUE)) continue; | |
4269 | + | |
4270 | + if (!(r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON))) continue; | |
4271 | + | |
4272 | + if (r_ptr->rarity > 100) continue; | |
4273 | + | |
4274 | + if (no_questor_or_bounty_uniques(current_world_ptr->bounty_r_idx[i])) continue; | |
4275 | + | |
4276 | + for (j = 0; j < i; j++) | |
4277 | + if (current_world_ptr->bounty_r_idx[i] == current_world_ptr->bounty_r_idx[j]) break; | |
4278 | + | |
4279 | + if (j == i) break; | |
4280 | + } | |
4281 | + } | |
4282 | + | |
4283 | + /* Sort them */ | |
4284 | + for (i = 0; i < MAX_KUBI - 1; i++) | |
4285 | + { | |
4286 | + for (j = i; j < MAX_KUBI; j++) | |
4287 | + { | |
4288 | + if (r_info[current_world_ptr->bounty_r_idx[i]].level > r_info[current_world_ptr->bounty_r_idx[j]].level) | |
4289 | + { | |
4290 | + tmp = current_world_ptr->bounty_r_idx[i]; | |
4291 | + current_world_ptr->bounty_r_idx[i] = current_world_ptr->bounty_r_idx[j]; | |
4292 | + current_world_ptr->bounty_r_idx[j] = tmp; | |
4293 | + } | |
4294 | + } | |
4295 | + } | |
4296 | +} |
@@ -96,3 +96,4 @@ extern void do_cmd_bldg(void); | ||
96 | 96 | |
97 | 97 | extern void clear_bldg(int min_row, int max_row); |
98 | 98 | extern void determine_today_mon(bool conv_old); |
99 | +extern void determine_bounty_uniques(void); |
@@ -5273,55 +5273,6 @@ void extract_option_vars(void) | ||
5273 | 5273 | } |
5274 | 5274 | } |
5275 | 5275 | |
5276 | - | |
5277 | -/*! | |
5278 | - * @brief 賞金首となるユニークを確定する / Determine bounty uniques | |
5279 | - * @return なし | |
5280 | - */ | |
5281 | -void determine_bounty_uniques(void) | |
5282 | -{ | |
5283 | - int i, j; | |
5284 | - MONRACE_IDX tmp; | |
5285 | - monster_race *r_ptr; | |
5286 | - | |
5287 | - get_mon_num_prep(NULL, NULL); | |
5288 | - for (i = 0; i < MAX_KUBI; i++) | |
5289 | - { | |
5290 | - while (1) | |
5291 | - { | |
5292 | - current_world_ptr->bounty_r_idx[i] = get_mon_num(MAX_DEPTH - 1); | |
5293 | - r_ptr = &r_info[current_world_ptr->bounty_r_idx[i]]; | |
5294 | - | |
5295 | - if (!(r_ptr->flags1 & RF1_UNIQUE)) continue; | |
5296 | - | |
5297 | - if (!(r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON))) continue; | |
5298 | - | |
5299 | - if (r_ptr->rarity > 100) continue; | |
5300 | - | |
5301 | - if (no_questor_or_bounty_uniques(current_world_ptr->bounty_r_idx[i])) continue; | |
5302 | - | |
5303 | - for (j = 0; j < i; j++) | |
5304 | - if (current_world_ptr->bounty_r_idx[i] == current_world_ptr->bounty_r_idx[j]) break; | |
5305 | - | |
5306 | - if (j == i) break; | |
5307 | - } | |
5308 | - } | |
5309 | - | |
5310 | - /* Sort them */ | |
5311 | - for (i = 0; i < MAX_KUBI - 1; i++) | |
5312 | - { | |
5313 | - for (j = i; j < MAX_KUBI; j++) | |
5314 | - { | |
5315 | - if (r_info[current_world_ptr->bounty_r_idx[i]].level > r_info[current_world_ptr->bounty_r_idx[j]].level) | |
5316 | - { | |
5317 | - tmp = current_world_ptr->bounty_r_idx[i]; | |
5318 | - current_world_ptr->bounty_r_idx[i] = current_world_ptr->bounty_r_idx[j]; | |
5319 | - current_world_ptr->bounty_r_idx[j] = tmp; | |
5320 | - } | |
5321 | - } | |
5322 | - } | |
5323 | -} | |
5324 | - | |
5325 | 5276 | /*! |
5326 | 5277 | * @brief 1ゲームプレイの主要ルーチン / Actually play a game |
5327 | 5278 | * @return なし |
@@ -381,7 +381,6 @@ extern void do_cmd_suicide(void); | ||
381 | 381 | |
382 | 382 | /* dungeon.c */ |
383 | 383 | extern void extract_option_vars(void); |
384 | -extern void determine_bounty_uniques(void); | |
385 | 384 | extern void play_game(bool new_game); |
386 | 385 | extern s32b turn_real(s32b hoge); |
387 | 386 | extern void prevent_turn_overflow(void); |