OSDN Git Service

[Refactor] #define ALLOW_EASY_OPEN による分岐処理削除。 / Delete #define branch by ALLOW_EASY_OPEN.
[hengband/hengband.git] / src / effects.c
index d8b790b..ad8889e 100644 (file)
@@ -12,7 +12,6 @@
  * 2013 Deskull rearranged comment for Doxygen.\n
  */
 
-
 #include "angband.h"
 
 /*!
@@ -282,7 +281,6 @@ void dispel_player(void)
                /* Update monsters */
                p_ptr->update |= (PU_MONSTERS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                p_ptr->energy_need += ENERGY_NEED();
@@ -430,7 +428,6 @@ bool set_blind(TIME_EFFECT v)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
@@ -779,7 +776,6 @@ bool set_image(TIME_EFFECT v)
        /* Update monsters */
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
@@ -1283,8 +1279,8 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
 
 /*!
  * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @param v 継続時間/ 0ならば無条件にリセット
+ * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
 bool set_shero(TIME_EFFECT v, bool do_dec)
@@ -1441,7 +1437,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1460,7 +1455,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1526,7 +1520,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1545,7 +1538,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                        p_ptr->energy_need += ENERGY_NEED();
@@ -3453,7 +3445,7 @@ bool set_cut(TIME_EFFECT v)
  * 7500 food units, without overflowing the 32767 maximum limit.\n
  *\n
  * Perhaps we should disturb the player with various messages,
- * especially messages about hunger status changes.  XXX XXX XXX\n
+ * especially messages about hunger status changes.  \n
  *\n
  * Digestion of food is handled in "dungeon.c", in which, normally,
  * the player digests about 20 food units per 100 game turns, more
@@ -3837,7 +3829,6 @@ bool dec_stat(int stat, int amount, int permanent)
                p_ptr->update |= (PU_BONUS);
        }
 
-       /* Done */
        return (res);
 }
 
@@ -3877,7 +3868,10 @@ bool hp_player(int num)
 {
        int vir;
        vir = virtue_number(V_VITALITY);
-       if (vir)
+
+       if(num <= 0) return (FALSE);
+
+       if(vir)
        {
                num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
        }
@@ -3899,7 +3893,6 @@ bool hp_player(int num)
                /* Redraw */
                p_ptr->redraw |= (PR_HP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
 
                /* Heal 0-4 */
@@ -3940,12 +3933,12 @@ bool hp_player(int num)
  */
 static cptr desc_stat_pos[] =
 {
-_("強く", "strong"),
-_("知的に", "smart"),
-_("賢く", "wise"),
-_("器用に", "dextrous"),
-_("健康に", "healthy"),
-_("美しく", "cute")
+       _("強く", "strong"),
+       _("知的に", "smart"),
+       _("賢く", "wise"),
+       _("器用に", "dextrous"),
+       _("健康に", "healthy"),
+       _("美しく", "cute")
 };
 
 
@@ -3954,22 +3947,12 @@ _("美しく", "cute")
  */
 static cptr desc_stat_neg[] =
 {
-#ifdef JP
-"弱く",
-"無知に",
-"愚かに",
-"不器用に",
-"不健康に",
-"醜く"
-#else
-       "weak",
-       "stupid",
-       "naive",
-       "clumsy",
-       "sickly",
-       "ugly"
-#endif
-
+       _("弱く", "weak"),
+       _("無知に", "stupid"),
+       _("愚かに", "naive"),
+       _("不器用に", "clumsy"),
+       _("不健康に", "sickly"),
+       _("醜く", "ugly")
 };
 
 
@@ -3994,7 +3977,6 @@ bool do_dec_stat(int stat)
        /* Sustain */
        if (sust && (!ironman_nightmare || randint0(13)))
        {
-               /* Message */
                msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
                                        desc_stat_neg[stat]);
 
@@ -4005,7 +3987,6 @@ bool do_dec_stat(int stat)
        /* Attempt to reduce the stat */
        if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
        {
-               /* Message */
                msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
 
                /* Notice effect */
@@ -4025,7 +4006,6 @@ bool do_res_stat(int stat)
        /* Attempt to increase */
        if (res_stat(stat))
        {
-               /* Message */
                msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
 
                /* Notice */
@@ -4063,7 +4043,6 @@ bool do_inc_stat(int stat)
                else if (stat == A_CON)
                        chg_virtue(V_VITALITY, 1);
 
-               /* Message */
                msg_format(_("ワーオ!とても%sなった!", "Wow!  You feel very %s!"), desc_stat_pos[stat]);
 
                /* Notice */
@@ -4073,7 +4052,6 @@ bool do_inc_stat(int stat)
        /* Restoration worked */
        if (res)
        {
-               /* Message */
                msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
 
                /* Notice */
@@ -4093,7 +4071,6 @@ bool restore_level(void)
        /* Restore experience */
        if (p_ptr->exp < p_ptr->max_exp)
        {
-               /* Message */
                msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
 
                /* Restore the experience */
@@ -4110,7 +4087,6 @@ bool restore_level(void)
        return (FALSE);
 }
 
-
 /*
  * Forget everything
  */
@@ -4151,7 +4127,6 @@ bool lose_all_info(void)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Mega-Hack -- Forget the map */
@@ -4209,7 +4184,7 @@ void change_race(CHARACTER_IDX new_race, cptr effect_msg)
        }
        else
        {
-               p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
+               p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
        }
        p_ptr->prace = new_race;
        rp_ptr = &race_info[p_ptr->prace];
@@ -4390,9 +4365,9 @@ void do_poly_self(void)
 /*
  * Decreases players hit points and sets death flag if necessary
  *
- * XXX XXX XXX Invulnerability needs to be changed into a "shield"
+ * Invulnerability needs to be changed into a "shield"
  *
- * XXX XXX XXX Hack -- this function allows the user to save (or quit)
+ * Hack -- this function allows the user to save (or quit)
  * the game when he dies, since the "You die." message is shown before
  * setting the player to "dead".
  */
@@ -4489,7 +4464,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
        /* Display the hitpoints */
        p_ptr->redraw |= (PR_HP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_PLAYER);
 
        if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
@@ -4508,7 +4482,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                        if(!save_player()) msg_print("セーブ失敗!");
 #endif
 
-               /* Sound */
                sound(SOUND_DEATH);
 
                chg_virtue(V_SACRIFICE, 10);
@@ -4530,7 +4503,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                }
                else
                {
-                       int q_idx = quest_number(dun_level);
+                       QUEST_IDX q_idx = quest_number(dun_level);
                        bool seppuku = streq(hit_from, "Seppuku");
                        bool winning_seppuku = p_ptr->total_winner && seppuku;
 
@@ -4731,7 +4704,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                        now_damaged = TRUE;
                }
 
-               /* Message */
                msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
                msg_print(NULL);
                flush();
@@ -4791,7 +4763,7 @@ void calc_android_exp(void)
                object_type forge;
                object_type *q_ptr = &forge;
                u32b value, exp;
-               int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
+               DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
 
                if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
                if (!o_ptr->k_idx) continue;
@@ -5205,3 +5177,4 @@ bool choose_ele_immune(TIME_EFFECT immune_turn)
        screen_load();
        return TRUE;
 }
+