OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / dungeon.c
index 658a0e1..46d5ab0 100644 (file)
@@ -101,7 +101,7 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
        }
 
        /* Stop everything */
-       if (disturb_minor) disturb(0, 0);
+       if (disturb_minor) disturb(FALSE, FALSE);
 
        /* Get an object description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -736,11 +736,8 @@ static void regenhp(int percent)
        /* Notice changes */
        if (old_chp != p_ptr->chp)
        {
-               /* Redraw */
                p_ptr->redraw |= (PR_HP);
-
                p_ptr->window |= (PW_PLAYER);
-
                wild_regen = 20;
        }
 }
@@ -828,12 +825,9 @@ static void regenmana(int upkeep_factor, int regen_amount)
        /* Redraw mana */
        if (old_csp != p_ptr->csp)
        {
-               /* Redraw */
                p_ptr->redraw |= (PR_MANA);
-
                p_ptr->window |= (PW_PLAYER);
                p_ptr->window |= (PW_SPELL);
-
                wild_regen = 20;
        }
 }
@@ -1008,7 +1002,7 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is now out */
        else if (o_ptr->xtra4 == 0)
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
 
                /* Recalculate torch radius */
@@ -1024,7 +1018,7 @@ static void notice_lite_change(object_type *o_ptr)
                if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
                    && (turn % (TURNS_PER_TICK*2)))
                {
-                       if (disturb_minor) disturb(0, 1);
+                       if (disturb_minor) disturb(FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
                }
        }
@@ -1032,7 +1026,7 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is getting dim */
        else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
        {
-               if (disturb_minor) disturb(0, 1);
+               if (disturb_minor) disturb(FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
        }
 }
@@ -1149,7 +1143,7 @@ static void recharged_notice(object_type *o_ptr)
                                msg_format("Your %s is recharged.", o_name);
 #endif
 
-                       disturb(0, 0);
+                       disturb(FALSE, FALSE);
 
                        /* Done. */
                        return;
@@ -1351,7 +1345,7 @@ static void process_world_aux_digestion(void)
                        if (!p_ptr->paralyzed && (randint0(100) < 10))
                        {
                                msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food."));
-                               disturb(1, 1);
+                               disturb(TRUE, TRUE);
 
                                /* Hack -- faint (bypass free action) */
                                (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
@@ -1363,7 +1357,6 @@ static void process_world_aux_digestion(void)
                                /* Calculate damage */
                                HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
 
-                               /* Take damage */
                                if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
                        }
                }
@@ -1390,7 +1383,6 @@ static void process_world_aux_hp_and_sp(void)
        /* Take damage from poison */
        if (p_ptr->poisoned && !IS_INVULN())
        {
-               /* Take damage */
                take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
        }
 
@@ -1437,7 +1429,6 @@ static void process_world_aux_hp_and_sp(void)
                        dam = 1;
                }
 
-               /* Take damage */
                take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
        }
 
@@ -1448,7 +1439,6 @@ static void process_world_aux_hp_and_sp(void)
                {
                        if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
-                               /* Take damage */
                                msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
                                take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
                                cave_no_regen = TRUE;
@@ -1520,7 +1510,6 @@ static void process_world_aux_hp_and_sp(void)
        {
                if (p_ptr->total_weight > weight_limit())
                {
-                       /* Take damage */
                        msg_print(_("溺れている!", "You are drowning!"));
                        take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
                        cave_no_regen = TRUE;
@@ -2049,7 +2038,7 @@ static void process_world_aux_mutation(void)
 
        if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("ウガァァア!", "RAAAAGHH!"));
                msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
                (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
@@ -2060,7 +2049,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_fear)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
                        set_afraid(p_ptr->afraid + 13 + randint1(26));
                }
@@ -2070,7 +2059,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2081,7 +2070,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        p_ptr->redraw |= PR_EXTRA;
                        msg_print(_("いひきがもーろーとひてきたきがふる...ヒック!", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!"));
                }
@@ -2118,7 +2107,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_chaos)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        p_ptr->redraw |= PR_EXTRA;
                        (void)set_image(p_ptr->image + randint0(50) + 20);
                }
@@ -2126,7 +2115,7 @@ static void process_world_aux_mutation(void)
 
        if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
                msg_print(NULL);
                fire_ball(GF_POIS, 0, p_ptr->lev, 3);
@@ -2136,7 +2125,7 @@ static void process_world_aux_mutation(void)
            !p_ptr->anti_magic && one_in_(9000))
        {
                int dire = 0;
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!", 
                                                "Magical energy flows through you! You must release it!"));
 
@@ -2157,13 +2146,13 @@ static void process_world_aux_mutation(void)
                if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
        if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                if (one_in_(2))
                {
                        msg_print(_("精力的でなくなった気がする。", "You feel less energetic."));
@@ -2194,7 +2183,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
 
                banish_monsters(100);
@@ -2266,13 +2255,13 @@ static void process_world_aux_mutation(void)
                if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, mode))
                {
                        msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
        if ((p_ptr->muta2 & MUT2_RAW_CHAOS) && !p_ptr->anti_magic && one_in_(8000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
 
                msg_print(NULL);
@@ -2285,7 +2274,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("非物質化した!", "You feel insubstantial!"));
 
                msg_print(NULL);
@@ -2327,7 +2316,7 @@ static void process_world_aux_mutation(void)
 
                if (!sustained)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("自分が衰弱していくのが分かる!", "You can feel yourself wasting away!"));
                        msg_print(NULL);
                        (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
@@ -2344,7 +2333,7 @@ static void process_world_aux_mutation(void)
                if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, mode))
                {
                        msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
        if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic && one_in_(3000))
@@ -2362,7 +2351,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!"));
                msg_print(NULL);
                set_food(PY_FOOD_WEAK);
@@ -2410,7 +2399,7 @@ static void process_world_aux_mutation(void)
 
        if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic && one_in_(5000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("無敵な気がする!", "You feel invincible!"));
                msg_print(NULL);
                (void)set_invuln(randint1(8) + 8, FALSE);
@@ -2451,7 +2440,7 @@ static void process_world_aux_mutation(void)
                INVENTORY_IDX slot = 0;
                object_type *o_ptr = NULL;
 
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
                take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
 
@@ -2528,14 +2517,14 @@ static void process_world_aux_curse(void)
                        msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name);
                        if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
                        {
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                                teleport_player(50, 0L);
                        }
                        else
                        {
                                msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。", 
                                                         "You can inscribe {.} on your %s to disable random teleportation. "), o_name);
-                               disturb(1, 1);
+                               disturb(TRUE, TRUE);
                        }
                }
                /* Make a chainsword noise */
@@ -2616,7 +2605,7 @@ static void process_world_aux_curse(void)
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが動物を引き寄せた!", "Your %s have attracted an animal!"), o_name);
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call demon */
@@ -2628,7 +2617,7 @@ static void process_world_aux_curse(void)
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが悪魔を引き寄せた!", "Your %s have attracted a demon!"), o_name);
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call dragon */
@@ -2641,7 +2630,7 @@ static void process_world_aux_curse(void)
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sがドラゴンを引き寄せた!", "Your %s have attracted an dragon!"), o_name);
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call undead */
@@ -2654,14 +2643,14 @@ static void process_world_aux_curse(void)
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_UNDEAD), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが死霊を引き寄せた!", "Your %s have attracted an undead!"), o_name);
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                        }
                }
                if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
                {
                        if (!p_ptr->resist_fear)
                        {
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                                msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
                                set_afraid(p_ptr->afraid + 13 + randint1(26));
                        }
@@ -2669,7 +2658,7 @@ static void process_world_aux_curse(void)
                /* Teleport player */
                if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Teleport player */
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2863,7 +2852,7 @@ static void process_world_aux_movement(void)
                if (!p_ptr->word_recall)
                {
                        /* Disturbing! */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Determine the level */
                        if (dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon)
@@ -2981,7 +2970,7 @@ static void process_world_aux_movement(void)
                if (!p_ptr->alter_reality)
                {
                        /* Disturbing! */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Determine the level */
                        if (!quest_number(dun_level) && dun_level)
@@ -3244,7 +3233,7 @@ static void update_dungeon_feeling(void)
        /* Update the level indicator */
        p_ptr->redraw |= (PR_DEPTH);
 
-       if (disturb_minor) disturb(0, 0);
+       if (disturb_minor) disturb(FALSE, FALSE);
 }
 
 /*!
@@ -3351,7 +3340,7 @@ static void process_world(void)
                        /* Warning */
                        if (closing_flag <= 2)
                        {
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
 
                                /* Count warnings */
                                closing_flag++;
@@ -3503,7 +3492,7 @@ static void process_world(void)
                if ((hour == 23) && !(min % 15))
                {
                        /* Disturbing */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        switch (min / 15)
                        {
@@ -3529,7 +3518,7 @@ static void process_world(void)
                if (!hour && !min)
                {
 
-                       disturb(1, 1);
+                       disturb(TRUE, TRUE);
                        msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
 
                        if (p_ptr->wild_mode)
@@ -3885,32 +3874,14 @@ static void process_command(void)
                /* Move (usually pick up things) */
                case ';':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
                /* Move (usually do not pick up) */
                case '-':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(TRUE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(!always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
@@ -4633,12 +4604,10 @@ static void pack_overflow(void)
                o_ptr = &inventory[INVEN_PACK];
 
                /* Disturbing */
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                /* Warning */
                msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
-
-               /* Describe */
                object_desc(o_name, o_ptr, 0);
 
                msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
@@ -4727,9 +4696,7 @@ static void process_player(void)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                }
                prt_time();
        }
@@ -4780,7 +4747,6 @@ static void process_player(void)
 
        if (p_ptr->action == ACTION_FISH)
        {
-               /* Delay */
                Term_xtra(TERM_XTRA_DELAY, 10);
                if (one_in_(1000))
                {
@@ -4792,8 +4758,8 @@ static void process_player(void)
                        if (r_idx && one_in_(2))
                        {
                                POSITION y, x;
-                               y = p_ptr->y + ddy[tsuri_dir];
-                               x = p_ptr->x + ddx[tsuri_dir];
+                               y = p_ptr->y + ddy[p_ptr->fishing_dir];
+                               x = p_ptr->x + ddx[p_ptr->fishing_dir];
                                if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
                                {
                                        char m_name[80];
@@ -4806,7 +4772,7 @@ static void process_player(void)
                        {
                                msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn!  The fish stole your bait!"));
                        }
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
@@ -4824,7 +4790,7 @@ static void process_player(void)
                        {
                                flush(); /* Flush input */
 
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
 
                                /* Hack -- Show a Message */
                                msg_print(_("中断しました。", "Canceled."));
@@ -5186,9 +5152,7 @@ static void process_player(void)
 
                                                        /* Assume invisible */
                                                        m_ptr->ml = FALSE;
-
-                                                       /* Update the monster */
-                                                       update_mon(i, FALSE);
+                                                       update_monster(i, FALSE);
 
                                                        if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
                                                        if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
@@ -5221,7 +5185,7 @@ static void process_player(void)
 
                        if (world_player && (p_ptr->energy_need > - 1000))
                        {
-                               /* Redraw map */
+
                                p_ptr->redraw |= (PR_MAP);
 
                                /* Update monsters */
@@ -5311,7 +5275,7 @@ static void dungeon(bool load_game)
        repair_objects = TRUE;
 
 
-       disturb(1, 1);
+       disturb(TRUE, TRUE);
 
        /* Get index of current quest (if any) */
        quest_num = quest_number(dun_level);
@@ -5357,7 +5321,6 @@ static void dungeon(bool load_game)
        /* Redraw dungeon */
        p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);