OSDN Git Service

[Refactor] #37353 monster_name() を monster.h へ移動。
[hengband/hengband.git] / src / effects.c
index 83f8510..e125852 100644 (file)
@@ -22,6 +22,7 @@
 #include "object-hook.h"
 #include "wild.h"
 #include "spells-floor.h"
+#include "player-move.h"
 
 /*!
  * @brief プレイヤーの継続行動を設定する。
@@ -49,7 +50,7 @@ void set_action(ACTION_IDX typ)
                        }
                        case ACTION_REST:
                        {
-                               resting = 0;
+                               p_ptr->resting = 0;
                                break;
                        }
                        case ACTION_LEARN:
@@ -1241,7 +1242,7 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                }
                else if (!p_ptr->wraith_form)
                {
-                       msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and turn into a wraith-being!"));
+                       msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
                        notice = TRUE;
                        chg_virtue(V_UNLIFE, 3);
                        chg_virtue(V_HONOUR, -2);
@@ -1624,7 +1625,7 @@ bool set_superstealth(bool set)
        {
                if (!(p_ptr->special_defense & NINJA_S_STEALTH))
                {
-                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+                       if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
                        {
                                msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
                                p_ptr->monlite = p_ptr->old_monlite = TRUE;
@@ -3165,8 +3166,6 @@ bool inc_stat(int stat)
                {
                        /* Approximate gain value */
                        gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
-
-                       /* Paranoia */
                        if (gain < 1) gain = 1;
 
                        /* Apply the bonus */
@@ -3250,8 +3249,6 @@ bool dec_stat(int stat, int amount, int permanent)
                        /* and one-half of the stat bonus times the percentage, with a */
                        /* minimum damage of half the percentage. -CWS */
                        loss = (((cur-18) / 2 + 1) / 2 + 1);
-
-                       /* Paranoia */
                        if (loss < 1) loss = 1;
 
                        /* Randomize the loss */
@@ -3655,7 +3652,7 @@ void change_race(CHARACTER_IDX new_race, concptr effect_msg)
 #ifdef JP
        msg_format("あなたは%s%sに変化した!", effect_msg, title);
 #else
-       msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
+       msg_format("You current_world_ptr->game_turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
 #endif
 
        chg_virtue(V_CHANCE, 2);
@@ -3826,7 +3823,7 @@ void do_poly_self(void)
        while ((power > randint0(15)) && one_in_(3))
        {
                power -= 7;
-               (void)gain_random_mutation(0);
+               (void)gain_mutation(p_ptr, 0);
        }
 
        if (power > randint0(5))
@@ -3838,7 +3835,7 @@ void do_poly_self(void)
        /* Note: earlier deductions may have left power < 0 already. */
        while (power > 0)
        {
-               mutate_player();
+               status_shuffle();
                power--;
        }
 }
@@ -3862,8 +3859,6 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
        char tmp[1024];
 
        int warning = (p_ptr->mhp * hitpoint_warn / 10);
-
-       /* Paranoia */
        if (p_ptr->is_dead) return 0;
 
        if (p_ptr->sutemi) damage *= 2;
@@ -3876,7 +3871,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
                disturb(TRUE, TRUE);
                if (auto_more)
                {
-                       now_damaged = TRUE;
+                       p_ptr->now_damaged = TRUE;
                }
        }
 
@@ -3968,8 +3963,6 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
                chg_virtue(V_SACRIFICE, 10);
 
                handle_stuff();
-
-               /* Leaving */
                p_ptr->leaving = TRUE;
 
                /* Note death */
@@ -3984,7 +3977,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
                }
                else
                {
-                       QUEST_IDX q_idx = quest_number(dun_level);
+                       QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
                        bool seppuku = streq(hit_from, "Seppuku");
                        bool winning_seppuku = p_ptr->total_winner && seppuku;
 
@@ -4027,13 +4020,13 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
 
                                if (p_ptr->inside_arena)
                                        strcpy(buf,_("アリーナ", "in the Arena"));
-                               else if (!dun_level)
+                               else if (!current_floor_ptr->dun_level)
                                        strcpy(buf,_("地上", "on the surface"));
                                else if (q_idx && (is_fixed_quest_idx(q_idx) &&
                                         !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
                                        strcpy(buf,_("クエスト", "in a quest"));
                                else
-                                       sprintf(buf,_("%d階", "level %d"), (int)dun_level);
+                                       sprintf(buf,_("%d階", "level %d"), (int)current_floor_ptr->dun_level);
 
                                sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
                                do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
@@ -4182,7 +4175,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
                if (auto_more)
                {
                        /* stop auto_more even if DAMAGE_USELIFE */
-                       now_damaged = TRUE;
+                       p_ptr->now_damaged = TRUE;
                }
 
                msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));