• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiondfcecd2b58d9819ae26adc753bb2cce6478cbd64 (tree)
Time2019-02-27 02:09:46
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 monster_level を floor_type に取り込む。 / Move monster_level to floor_type structure.

Change Summary

Incremental Difference

--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -5418,7 +5418,7 @@ static void dungeon(bool load_game)
54185418 /*** Process this dungeon level ***/
54195419
54205420 /* Reset the monster generation level */
5421- monster_level = current_floor_ptr->base_level;
5421+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
54225422
54235423 /* Reset the object generation level */
54245424 current_floor_ptr->object_level = current_floor_ptr->base_level;
--- a/src/externs.h
+++ b/src/externs.h
@@ -159,7 +159,6 @@ extern s16b command_new;
159159 extern bool msg_flag;
160160 extern s16b running;
161161 extern GAME_TURN resting;
162-extern DEPTH monster_level;
163162 extern bool invoking_midnight_curse;
164163 extern GAME_TURN turn;
165164 extern GAME_TURN turn_limit;
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -1198,7 +1198,7 @@ static void generate_fixed_floor(void)
11981198 current_floor_ptr->base_level = quest[p_ptr->inside_quest].level;
11991199 current_floor_ptr->dun_level = current_floor_ptr->base_level;
12001200 current_floor_ptr->object_level = current_floor_ptr->base_level;
1201- monster_level = current_floor_ptr->base_level;
1201+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
12021202
12031203 if (record_stair) do_cmd_write_nikki(NIKKI_TO_QUEST, p_ptr->inside_quest, NULL);
12041204 get_mon_num_prep(get_monster_hook(), NULL);
@@ -1354,7 +1354,7 @@ void clear_cave(void)
13541354 current_floor_ptr->base_level = current_floor_ptr->dun_level;
13551355
13561356 /* Reset the monster generation level */
1357- monster_level = current_floor_ptr->base_level;
1357+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
13581358
13591359 /* Reset the object generation level */
13601360 current_floor_ptr->object_level = current_floor_ptr->base_level;
--- a/src/gamevalue.h
+++ b/src/gamevalue.h
@@ -11,7 +11,7 @@
1111 /*!
1212 * @brief 深層モンスターが生成される(NASTY生成)の基本確率(1/x)
1313 * @details
14-* There is a 1/25 (4%) chance of inflating the requested monster_level
14+* There is a 1/25 (4%) chance of inflating the requested current_floor_ptr->monster_level
1515 * during the creation of a monsters (see "get_mon_num()" in "monster.c").
1616 * Lower values yield harder monsters more often.
1717 */
--- a/src/grid.c
+++ b/src/grid.c
@@ -711,9 +711,9 @@ void vault_monsters(POSITION y1, POSITION x1, int num)
711711 if (!cave_empty_grid(g_ptr)) continue;
712712
713713 /* Place the monster (allow groups) */
714- monster_level = current_floor_ptr->base_level + 2;
714+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 2;
715715 (void)place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
716- monster_level = current_floor_ptr->base_level;
716+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
717717 }
718718 }
719719 }
--- a/src/init1.c
+++ b/src/init1.c
@@ -4006,11 +4006,11 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
40064006 /* Create a monster */
40074007 if (random & RANDOM_MONSTER)
40084008 {
4009- monster_level = current_floor_ptr->base_level + monster_index;
4009+ current_floor_ptr->monster_level = current_floor_ptr->base_level + monster_index;
40104010
40114011 place_monster(*y, *x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
40124012
4013- monster_level = current_floor_ptr->base_level;
4013+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
40144014 }
40154015 else if (monster_index)
40164016 {
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -3652,7 +3652,7 @@ bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
36523652 get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
36533653
36543654 /* Pick a monster */
3655- r_idx = get_mon_num(monster_level);
3655+ r_idx = get_mon_num(current_floor_ptr->monster_level);
36563656
36573657 /* Handle failure */
36583658 if (!r_idx) return (FALSE);
@@ -3682,7 +3682,7 @@ bool alloc_horde(POSITION y, POSITION x)
36823682 while (--attempts)
36833683 {
36843684 /* Pick a monster */
3685- r_idx = get_mon_num(monster_level);
3685+ r_idx = get_mon_num(current_floor_ptr->monster_level);
36863686
36873687 /* Handle failure */
36883688 if (!r_idx) return (FALSE);
@@ -3772,7 +3772,7 @@ bool alloc_guardian(bool def_val)
37723772 * @details
37733773 * Place the monster at least "dis" distance from the player.
37743774 * Use "slp" to choose the initial "sleep" status
3775- * Use "monster_level" for the monster level
3775+ * Use "current_floor_ptr->monster_level" for the monster level
37763776 */
37773777 bool alloc_monster(POSITION dis, BIT_FLAGS mode)
37783778 {
--- a/src/rooms-vault.c
+++ b/src/rooms-vault.c
@@ -554,27 +554,27 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm
554554 /* Monster */
555555 case '&':
556556 {
557- monster_level = current_floor_ptr->base_level + 5;
557+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 5;
558558 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
559- monster_level = current_floor_ptr->base_level;
559+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
560560 break;
561561 }
562562
563563 /* Meaner monster */
564564 case '@':
565565 {
566- monster_level = current_floor_ptr->base_level + 11;
566+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 11;
567567 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
568- monster_level = current_floor_ptr->base_level;
568+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
569569 break;
570570 }
571571
572572 /* Meaner monster, plus treasure */
573573 case '9':
574574 {
575- monster_level = current_floor_ptr->base_level + 9;
575+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 9;
576576 place_monster(y, x, PM_ALLOW_SLEEP);
577- monster_level = current_floor_ptr->base_level;
577+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
578578 current_floor_ptr->object_level = current_floor_ptr->base_level + 7;
579579 place_object(y, x, AM_GOOD);
580580 current_floor_ptr->object_level = current_floor_ptr->base_level;
@@ -584,9 +584,9 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm
584584 /* Nasty monster and treasure */
585585 case '8':
586586 {
587- monster_level = current_floor_ptr->base_level + 40;
587+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 40;
588588 place_monster(y, x, PM_ALLOW_SLEEP);
589- monster_level = current_floor_ptr->base_level;
589+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
590590 current_floor_ptr->object_level = current_floor_ptr->base_level + 20;
591591 place_object(y, x, AM_GOOD | AM_GREAT);
592592 current_floor_ptr->object_level = current_floor_ptr->base_level;
@@ -598,9 +598,9 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm
598598 {
599599 if (randint0(100) < 50)
600600 {
601- monster_level = current_floor_ptr->base_level + 3;
601+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 3;
602602 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
603- monster_level = current_floor_ptr->base_level;
603+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
604604 }
605605 if (randint0(100) < 50)
606606 {
--- a/src/rooms.c
+++ b/src/rooms.c
@@ -1407,9 +1407,9 @@ void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int diffi
14071407 if (value < 0)
14081408 {
14091409 /* Meanest monster + treasure */
1410- monster_level = current_floor_ptr->base_level + 40;
1410+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 40;
14111411 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1412- monster_level = current_floor_ptr->base_level;
1412+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
14131413 current_floor_ptr->object_level = current_floor_ptr->base_level + 20;
14141414 place_object(y, x, AM_GOOD);
14151415 current_floor_ptr->object_level = current_floor_ptr->base_level;
@@ -1417,9 +1417,9 @@ void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int diffi
14171417 else if (value < 5)
14181418 {
14191419 /* Mean monster +treasure */
1420- monster_level = current_floor_ptr->base_level + 20;
1420+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 20;
14211421 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1422- monster_level = current_floor_ptr->base_level;
1422+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
14231423 current_floor_ptr->object_level = current_floor_ptr->base_level + 10;
14241424 place_object(y, x, AM_GOOD);
14251425 current_floor_ptr->object_level = current_floor_ptr->base_level;
@@ -1427,9 +1427,9 @@ void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int diffi
14271427 else if (value < 10)
14281428 {
14291429 /* Monster */
1430- monster_level = current_floor_ptr->base_level + 9;
1430+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 9;
14311431 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1432- monster_level = current_floor_ptr->base_level;
1432+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
14331433 }
14341434 else if (value < 17)
14351435 {
@@ -1457,9 +1457,9 @@ void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int diffi
14571457 else if (value < 30)
14581458 {
14591459 /* Monster and trap */
1460- monster_level = current_floor_ptr->base_level + 5;
1460+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 5;
14611461 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1462- monster_level = current_floor_ptr->base_level;
1462+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
14631463 place_trap(y, x);
14641464 }
14651465 else if (value < 40)
@@ -1467,9 +1467,9 @@ void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int diffi
14671467 /* Monster or object */
14681468 if (randint0(100) < 50)
14691469 {
1470- monster_level = current_floor_ptr->base_level + 3;
1470+ current_floor_ptr->monster_level = current_floor_ptr->base_level + 3;
14711471 place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1472- monster_level = current_floor_ptr->base_level;
1472+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
14731473 }
14741474 if (randint0(100) < 50)
14751475 {
--- a/src/types.h
+++ b/src/types.h
@@ -1877,8 +1877,9 @@ typedef struct {
18771877 typedef struct {
18781878 grid_type *grid_array[MAX_HGT];
18791879 DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
1880- DEPTH base_level;
1880+ DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
18811881 DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
1882+ DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
18821883 POSITION width; /* Current dungeon width */
18831884 POSITION height; /* Current dungeon height */
18841885 MONSTER_NUMBER num_repro; /*!< Current reproducer count */
--- a/src/variable.c
+++ b/src/variable.c
@@ -111,7 +111,6 @@ bool msg_flag; /* Used in msg_print() for "buffering" */
111111 s16b running; /* Current counter for running, if any */
112112 GAME_TURN resting; /* Current counter for resting, if any */
113113
114-DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
115114 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
116115
117116 GAME_TURN turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
--- a/src/wild.c
+++ b/src/wild.c
@@ -331,7 +331,7 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
331331 current_floor_ptr->dun_level = 0;
332332
333333 /* Set the monster generation level */
334- monster_level = current_floor_ptr->base_level;
334+ current_floor_ptr->monster_level = current_floor_ptr->base_level;
335335
336336 /* Set the object generation level */
337337 current_floor_ptr->object_level = current_floor_ptr->base_level;
Show on old repository browser