OSDN Git Service

This commit was manufactured by cvs2svn to create tag
[hengbandforosx/hengbandosx.git] / src / effects.c
index fc8d104..302c9b1 100644 (file)
@@ -99,7 +99,7 @@ void set_action(int typ)
 #ifdef JP
                        msg_print("Ãí°Õ¿¼¤¯Ê⤭»Ï¤á¤¿¡£");
 #else
-                       msg_print("You began to walk carefully.");
+                       msg_print("You begin to walk carefully.");
 #endif
                        p_ptr->redraw |= (PR_SPEED);
                        break;
@@ -109,7 +109,7 @@ void set_action(int typ)
 #ifdef JP
                        msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
 #else
-                       msg_print("You began Learning");
+                       msg_print("You begin Learning");
 #endif
                        break;
                }
@@ -118,7 +118,7 @@ void set_action(int typ)
 #ifdef JP
                        msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
 #else
-                       msg_print("You began fishing...");
+                       msg_print("You begin fishing...");
 #endif
                        break;
                }
@@ -127,7 +127,7 @@ void set_action(int typ)
 #ifdef JP
                        msg_print("­¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
 #else
-                       msg_print("You began to walk extremely fast.");
+                       msg_print("You begin to walk extremely fast.");
 #endif
                        break;
                }
@@ -174,6 +174,8 @@ void reset_tim_flags(void)
        p_ptr->tim_ffall = 0;
        p_ptr->tim_sh_touki = 0;
        p_ptr->tim_sh_fire = 0;
+       p_ptr->tim_sh_holy = 0;
+       p_ptr->tim_eyeeye = 0;
        p_ptr->resist_magic = 0;
        p_ptr->tsuyoshi = 0;
        p_ptr->kabenuke = 0;
@@ -201,7 +203,7 @@ void reset_tim_flags(void)
        p_ptr->special_attack = 0L;
        p_ptr->special_defense = 0L;
 
-       while(p_ptr->energy > 99) p_ptr->energy -= 100;
+       while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
        world_player = FALSE;
 
        if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
@@ -234,7 +236,7 @@ bool set_mimic(int v, int p, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -243,14 +245,14 @@ bool set_mimic(int v, int p, bool do_dec)
                {
                        if (p_ptr->tim_mimic > v) return FALSE;
                }
-                else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
+               else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
                {
 #ifdef JP
-                        msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
+                       msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
 #else
-                        msg_print("You feel that your body change.");
+                       msg_print("You feel that your body changes.");
 #endif
-                        p_ptr->mimic_form=p;
+                       p_ptr->mimic_form=p;
                        notice = TRUE;
                }
        }
@@ -258,22 +260,22 @@ bool set_mimic(int v, int p, bool do_dec)
        /* Shut */
        else
        {
-                if (p_ptr->tim_mimic)
+               if (p_ptr->tim_mimic)
                {
 #ifdef JP
-                        msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
+                       msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
 #else
-                        msg_print("You are no longer transformed.");
+                       msg_print("You are no longer transformed.");
 #endif
                        if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
-                        p_ptr->mimic_form=0;
+                       p_ptr->mimic_form=0;
                        notice = TRUE;
                        p = 0;
                }
        }
 
        /* Use the value */
-        p_ptr->tim_mimic = v;
+       p_ptr->tim_mimic = v;
 
        /* Nothing to notice */
        if (!notice)
@@ -283,11 +285,11 @@ bool set_mimic(int v, int p, bool do_dec)
        if (disturb_state)
                disturb(0, 0);
 
-        /* Redraw title */
-        p_ptr->redraw |= (PR_BASIC | PR_STATUS);
+       /* Redraw title */
+       p_ptr->redraw |= (PR_BASIC | PR_STATUS);
 
        /* Recalculate bonuses */
-        p_ptr->update |= (PU_BONUS | PU_HP);
+       p_ptr->update |= (PU_BONUS | PU_HP);
 
        handle_stuff();
 
@@ -310,7 +312,7 @@ bool set_blind(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -404,7 +406,7 @@ bool set_confused(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -417,6 +419,18 @@ msg_print("
                        msg_print("You are confused!");
 #endif
 
+                       if (p_ptr->action == ACTION_LEARN)
+                       {
+#ifdef JP
+                               msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
+#else
+                               msg_print("You cannot continue Learning!");
+#endif
+                               new_mane = FALSE;
+
+                               p_ptr->redraw |= (PR_STATE);
+                               p_ptr->action = ACTION_NONE;
+                       }
                        if (p_ptr->action == ACTION_KAMAE)
                        {
 #ifdef JP
@@ -496,7 +510,7 @@ bool set_poisoned(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -558,7 +572,7 @@ bool set_afraid(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -637,7 +651,7 @@ bool set_paralyzed(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -705,7 +719,7 @@ bool set_image(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
 
        /* Open */
@@ -779,7 +793,7 @@ bool set_fast(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -847,7 +861,7 @@ bool set_lightspeed(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -861,7 +875,7 @@ bool set_lightspeed(int v, bool do_dec)
 #ifdef JP
 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
 #else
-                       msg_print("You feel yourself moving faster!");
+                       msg_print("You feel yourself moving extremely faster!");
 #endif
 
                        notice = TRUE;
@@ -915,7 +929,7 @@ bool set_slow(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -981,7 +995,7 @@ bool set_shield(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1051,7 +1065,7 @@ bool set_tsubureru(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1065,7 +1079,7 @@ bool set_tsubureru(int v, bool do_dec)
 #ifdef JP
 msg_print("²£¤Ë¿­¤Ó¤¿¡£");
 #else
-                       msg_print("You have expand horizontally.");
+                       msg_print("Your body expands horizontally.");
 #endif
 
                        notice = TRUE;
@@ -1080,7 +1094,7 @@ msg_print("
 #ifdef JP
 msg_print("¤â¤¦²£¤Ë¿­¤Ó¤Æ¤¤¤Ê¤¤¡£");
 #else
-                       msg_print("You are no longer expanded.");
+                       msg_print("Your body returns to normal.");
 #endif
 
                        notice = TRUE;
@@ -1121,7 +1135,7 @@ bool set_magicdef(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1135,7 +1149,7 @@ bool set_magicdef(int v, bool do_dec)
 #ifdef JP
                        msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
 #else
-                       msg_print("You feel your magical vulnerability diminish.");
+                       msg_print("You feel more resistant to magic.");
 #endif
 
                        notice = TRUE;
@@ -1150,7 +1164,7 @@ bool set_magicdef(int v, bool do_dec)
 #ifdef JP
                        msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
 #else
-                       msg_print("Your magical defences fall to their normal values.");
+                       msg_print("You feel less resistant to magic.");
 #endif
 
                        notice = TRUE;
@@ -1191,7 +1205,7 @@ bool set_blessed(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1260,7 +1274,7 @@ bool set_hero(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1332,7 +1346,7 @@ bool set_shero(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
        /* Open */
@@ -1405,7 +1419,7 @@ bool set_protevil(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1470,7 +1484,7 @@ bool set_wraith_form(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1566,7 +1580,7 @@ bool set_invuln(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1623,7 +1637,7 @@ msg_print("̵Ũ
                        /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
-                       p_ptr->energy -= 100;
+                       p_ptr->energy_need += ENERGY_NEED();
                }
        }
 
@@ -1660,7 +1674,7 @@ bool set_tim_esp(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1732,7 +1746,7 @@ bool set_tim_invis(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1804,7 +1818,7 @@ bool set_tim_infra(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1818,7 +1832,7 @@ bool set_tim_infra(int v, bool do_dec)
 #ifdef JP
 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤­»Ï¤á¤¿¡ª");
 #else
-                       msg_print("Your eyes began to tingle!");
+                       msg_print("Your eyes begin to tingle!");
 #endif
 
                        notice = TRUE;
@@ -1876,7 +1890,7 @@ bool set_tim_regen(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1890,7 +1904,7 @@ bool set_tim_regen(int v, bool do_dec)
 #ifdef JP
 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
 #else
-                       msg_print("You began to regenerate quicker!");
+                       msg_print("You feel yourself regenerating quickly!");
 #endif
 
                        notice = TRUE;
@@ -1905,7 +1919,7 @@ msg_print("
 #ifdef JP
 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
 #else
-                       msg_print("You no longer regenerate quicker.");
+                       msg_print("You feel yourself regenerating slowly.");
 #endif
 
                        notice = TRUE;
@@ -1945,7 +1959,7 @@ bool set_tim_stealth(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -1959,7 +1973,7 @@ bool set_tim_stealth(int v, bool do_dec)
 #ifdef JP
 msg_print("­²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
 #else
-                       msg_print("You began to walk silently!");
+                       msg_print("You begin to walk silently!");
 #endif
 
                        notice = TRUE;
@@ -2008,7 +2022,7 @@ bool set_superstealth(bool set)
 {
        bool notice = FALSE;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (set)
@@ -2083,7 +2097,7 @@ bool set_tim_ffall(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2097,7 +2111,7 @@ bool set_tim_ffall(int v, bool do_dec)
 #ifdef JP
 msg_print("ÂΤ¬Ãè¤ËÉ⤭»Ï¤á¤¿¡£");
 #else
-                       msg_print("You began to fly!");
+                       msg_print("You begin to fly!");
 #endif
 
                        notice = TRUE;
@@ -2112,7 +2126,7 @@ msg_print("
 #ifdef JP
 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
 #else
-                       msg_print("You no longer flying.");
+                       msg_print("You stop flying.");
 #endif
 
                        notice = TRUE;
@@ -2152,7 +2166,7 @@ bool set_tim_sh_touki(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2166,7 +2180,7 @@ bool set_tim_sh_touki(int v, bool do_dec)
 #ifdef JP
 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
 #else
-                       msg_print("You have enveloped by energy aura!");
+                       msg_print("You have enveloped by the aura of the Force!");
 #endif
 
                        notice = TRUE;
@@ -2181,7 +2195,7 @@ msg_print("
 #ifdef JP
 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
 #else
-                       msg_print("Aura of Force disappeared.");
+                       msg_print("Aura of the Force disappeared.");
 #endif
 
                        notice = TRUE;
@@ -2218,7 +2232,7 @@ bool set_tim_sh_fire(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2278,6 +2292,146 @@ msg_print("
 
 
 /*
+ * Set "p_ptr->tim_sh_holy", notice observable changes
+ */
+bool set_tim_sh_holy(int v, bool do_dec)
+{
+       bool notice = FALSE;
+
+       /* Hack -- Force good values */
+       v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+
+       if (p_ptr->is_dead) return FALSE;
+
+       /* Open */
+       if (v)
+       {
+               if (p_ptr->tim_sh_holy && !do_dec)
+               {
+                       if (p_ptr->tim_sh_holy > v) return FALSE;
+               }
+               else if (!p_ptr->tim_sh_holy)
+               {
+#ifdef JP
+msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
+#else
+                       msg_print("You have enveloped by holy aura!");
+#endif
+
+                       notice = TRUE;
+               }
+       }
+
+       /* Shut */
+       else
+       {
+               if (p_ptr->tim_sh_holy)
+               {
+#ifdef JP
+msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
+#else
+                       msg_print("Holy aura disappeared.");
+#endif
+
+                       notice = TRUE;
+               }
+       }
+
+       /* Use the value */
+       p_ptr->tim_sh_holy = v;
+
+       /* Redraw status bar */
+       p_ptr->redraw |= (PR_STATUS);
+
+       /* Nothing to notice */
+       if (!notice) return (FALSE);
+
+       /* Disturb */
+       if (disturb_state) disturb(0, 0);
+
+       /* Recalculate bonuses */
+       p_ptr->update |= (PU_BONUS);
+
+       /* Handle stuff */
+       handle_stuff();
+
+       /* Result */
+       return (TRUE);
+}
+
+
+
+/*
+ * Set "p_ptr->tim_eyeeye", notice observable changes
+ */
+bool set_tim_eyeeye(int v, bool do_dec)
+{
+       bool notice = FALSE;
+
+       /* Hack -- Force good values */
+       v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+
+       if (p_ptr->is_dead) return FALSE;
+
+       /* Open */
+       if (v)
+       {
+               if (p_ptr->tim_eyeeye && !do_dec)
+               {
+                       if (p_ptr->tim_eyeeye > v) return FALSE;
+               }
+               else if (!p_ptr->tim_eyeeye)
+               {
+#ifdef JP
+msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
+#else
+                       msg_print("You feel like a keeper of commandments!");
+#endif
+
+                       notice = TRUE;
+               }
+       }
+
+       /* Shut */
+       else
+       {
+               if (p_ptr->tim_eyeeye)
+               {
+#ifdef JP
+msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤¿¡£");
+#else
+                       msg_print("You no longer feel like a keeper.");
+#endif
+
+                       notice = TRUE;
+               }
+       }
+
+       /* Use the value */
+       p_ptr->tim_eyeeye = v;
+
+       /* Redraw status bar */
+       p_ptr->redraw |= (PR_STATUS);
+
+       /* Nothing to notice */
+       if (!notice) return (FALSE);
+
+       /* Disturb */
+       if (disturb_state) disturb(0, 0);
+
+       /* Recalculate bonuses */
+       p_ptr->update |= (PU_BONUS);
+
+       /* Handle stuff */
+       handle_stuff();
+
+       /* Result */
+       return (TRUE);
+}
+
+
+
+/*
  * Set "p_ptr->resist_magic", notice observable changes
  */
 bool set_resist_magic(int v, bool do_dec)
@@ -2287,7 +2441,7 @@ bool set_resist_magic(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2356,7 +2510,7 @@ bool set_tim_reflect(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2425,7 +2579,7 @@ bool set_multishadow(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2494,7 +2648,7 @@ bool set_dustrobe(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2563,7 +2717,7 @@ bool set_kabenuke(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2626,7 +2780,7 @@ bool set_tsuyoshi(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2763,16 +2917,16 @@ bool set_ele_attack(u32b attack_type, int v)
                             ((attack_type == ATTACK_ACID) ? "»À" :
                              ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
                               ((attack_type == ATTACK_FIRE) ? "²Ð±ê" : 
-                               ((attack_type == ATTACK_COLD) ? "Î䵤" : 
-                                ((attack_type == ATTACK_POIS) ? "ÆÇ" : 
+                               ((attack_type == ATTACK_COLD) ? "Î䵤" : 
+                                ((attack_type == ATTACK_POIS) ? "ÆÇ" : 
                                        "(¤Ê¤·)"))))));
 #else
                msg_format("For a while, the blows you deal will %s",
                             ((attack_type == ATTACK_ACID) ? "melt with acid!" :
                              ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
                               ((attack_type == ATTACK_FIRE) ? "burn with fire!" : 
-                               ((attack_type == ATTACK_COLD) ? "chill to the bone!" : 
-                                ((attack_type == ATTACK_POIS) ? "poison your enemies!" : 
+                               ((attack_type == ATTACK_COLD) ? "chill to the bone!" : 
+                                ((attack_type == ATTACK_POIS) ? "poison your enemies!" : 
                                        "do nothing special."))))));
 #endif
        }
@@ -2862,16 +3016,16 @@ bool set_ele_immune(u32b immune_type, int v)
                             ((immune_type == DEFENSE_ACID) ? "»À" :
                              ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
                               ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" : 
-                               ((immune_type == DEFENSE_COLD) ? "Î䵤" : 
-                                ((immune_type == DEFENSE_POIS) ? "ÆÇ" : 
+                               ((immune_type == DEFENSE_COLD) ? "Î䵤" : 
+                                ((immune_type == DEFENSE_POIS) ? "ÆÇ" : 
                                        "(¤Ê¤·)"))))));
 #else
                msg_format("For a while, You are immune to %s",
                             ((immune_type == DEFENSE_ACID) ? "acid!" :
                              ((immune_type == DEFENSE_ELEC) ? "electricity!" :
                               ((immune_type == DEFENSE_FIRE) ? "fire!" : 
-                               ((immune_type == DEFENSE_COLD) ? "cold!" : 
-                                ((immune_type == DEFENSE_POIS) ? "poison!" : 
+                               ((immune_type == DEFENSE_COLD) ? "cold!" : 
+                                ((immune_type == DEFENSE_POIS) ? "poison!" : 
                                        "do nothing special."))))));
 #endif
        }
@@ -2901,7 +3055,7 @@ bool set_oppose_acid(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -2967,7 +3121,7 @@ bool set_oppose_elec(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -3033,7 +3187,7 @@ bool set_oppose_fire(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
        /* Open */
@@ -3100,7 +3254,7 @@ bool set_oppose_cold(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -3167,7 +3321,7 @@ bool set_oppose_pois(int v, bool do_dec)
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -3237,7 +3391,7 @@ bool set_stun(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
 
@@ -3425,7 +3579,7 @@ bool set_cut(int v)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        if ((p_ptr->prace == RACE_GOLEM ||
            p_ptr->prace == RACE_SKELETON ||
@@ -3908,7 +4062,7 @@ msg_print("
                {
                        p_ptr->wilderness_x = px;
                        p_ptr->wilderness_y = py;
-                       p_ptr->energy = 100;
+                       p_ptr->energy_need = 0;
                        change_wild_mode();
                }
 
@@ -4119,6 +4273,9 @@ bool dec_stat(int stat, int amount, int permanent)
                p_ptr->stat_cur[stat] = cur;
                p_ptr->stat_max[stat] = max;
 
+               /* Redisplay the stats later */
+               p_ptr->redraw |= (PR_STATS);
+
                /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
        }
@@ -4142,6 +4299,9 @@ bool res_stat(int stat)
                /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
+               /* Redisplay the stats later */
+               p_ptr->redraw |= (PR_STATS);
+
                /* Success */
                return (TRUE);
        }
@@ -4825,7 +4985,7 @@ take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "
  * the game when he dies, since the "You die." message is shown before
  * setting the player to "dead".
  */
-bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
+int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
 {
        int old_chp = p_ptr->chp;
 
@@ -4835,7 +4995,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
        int warning = (p_ptr->mhp * hitpoint_warn / 10);
 
        /* Paranoia */
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return 0;
 
        if (p_ptr->sutemi) damage *= 2;
        if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
@@ -4877,7 +5037,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                        }
                        else
                        {
-                               return FALSE;
+                               return 0;
                        }
                }
  
@@ -4899,7 +5059,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
 #else
                                msg_print("The attack hits Shadow, you are unharmed!");
 #endif
-                               return FALSE;
+                               return 0;
                        }
                }
                    
@@ -4931,6 +5091,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
        p_ptr->chp -= damage;
        if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
        {
+               damage += p_ptr->chp;
                p_ptr->chp = 0;
        }
 
@@ -4955,7 +5116,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
 
 #ifdef JP       /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤­¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
-               if (!munchkin_death)
+               if (!cheat_save)
                        if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
 #endif
 
@@ -4968,7 +5129,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                p_ptr->leaving = TRUE;
 
                /* Note death */
-               death = TRUE;
+               p_ptr->is_dead = TRUE;
 
                if (p_ptr->inside_arena)
                {
@@ -4990,13 +5151,13 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
 
                        /* Note cause of death */
 #ifdef JP
-                       sprintf(died_from, "%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç":"Ëãáã¾õÂÖ¤Ç", hit_from);
+                       sprintf(p_ptr->died_from, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç":"Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
 #else
-                       sprintf(died_from, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
+                       sprintf(p_ptr->died_from, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
 #endif
 
                        /* No longer a winner */
-                       total_winner = FALSE;
+                       p_ptr->total_winner = FALSE;
 
                        if (p_ptr->inside_arena)
 #ifdef JP
@@ -5008,7 +5169,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
 #ifdef JP
                                strcpy(buf,"ÃϾå");
 #else
-                               strcpy(buf,"on The surface");
+                               strcpy(buf,"on the surface");
 #endif
                        else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
 #ifdef JP
@@ -5023,9 +5184,9 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                                sprintf(buf,"level %d", dun_level);
 #endif
 #ifdef JP
-                       sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, died_from);
+                       sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, p_ptr->died_from);
 #else
-                       sprintf(tmp,"killed by %s %s.", died_from, buf);
+                       sprintf(tmp,"killed by %s %s.", p_ptr->died_from, buf);
 #endif
                        do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
 #ifdef JP
@@ -5062,7 +5223,7 @@ msg_format("
                        }
                        else
                        {
-                               if (streq(died_from, "Seppuku"))
+                               if (streq(p_ptr->died_from, "Seppuku"))
                                {
 #ifdef JP
                                  get_rnd_line("seppuku_j.txt", 0, death_message);
@@ -5079,7 +5240,7 @@ get_rnd_line("death_j.txt", 0, death_message);
 #endif
                                }
 #ifdef JP
-                               while (!get_string(streq(died_from, "Seppuku") ? "¼­À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
+                               while (!get_string(streq(p_ptr->died_from, "Seppuku") ? "¼­À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
 #else
                                while (!get_string("Last word: ", death_message, 1024)) ;
 #endif
@@ -5091,7 +5252,7 @@ get_rnd_line("death_j.txt", 0, death_message);
                                        strcpy(death_message, android ? "You are broken." : "You die.");
 #endif
                                }
-                               if (streq(died_from, "Seppuku"))
+                               if (streq(p_ptr->died_from, "Seppuku"))
                                {
 #ifdef JP
                                  int i, len;
@@ -5112,7 +5273,7 @@ get_rnd_line("death_j.txt", 0, death_message);
                                  if (strncmp(str, "¡Ö", 2) == 0) str += 2;
 
                                  str2 = strstr_j(str, "¡×");
-                                 if (str2 != NULL) str2 = '\0';
+                                 if (str2 != NULL) *str2 = '\0';
 
                                  i = 0;
                                  while (i < 9)
@@ -5131,7 +5292,17 @@ get_rnd_line("death_j.txt", 0, death_message);
                                    str = str2 + 1;
                                    if (*str == 0) break;
                                  }
+
+                                 /* Hide cursor */
+                                 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
+
                                  flush();
+#ifdef WORLD_SCORE
+                                 /* Make screen dump */
+                                 screen_dump = make_screen_dump();
+#endif
+
+                                 /* Wait a key press */
                                  (void)inkey();
 #else
                                        msg_print(death_message);
@@ -5143,7 +5314,7 @@ get_rnd_line("death_j.txt", 0, death_message);
                }
 
                /* Dead */
-               return TRUE;
+               return damage;
        }
 
        /* Hitpoint warning */
@@ -5191,10 +5362,10 @@ msg_print("*** 
        {
                p_ptr->wilderness_x = px;
                p_ptr->wilderness_y = py;
-               p_ptr->energy = 100;
+               p_ptr->energy_need = 0;
                change_wild_mode();
        }
-       return TRUE;
+       return damage;
 }
 
 
@@ -5203,7 +5374,7 @@ msg_print("*** 
  */
 void gain_exp(s32b amount)
 {
-       if (death) return;
+       if (p_ptr->is_dead) return;
 
        if (p_ptr->prace == RACE_ANDROID) return;
 
@@ -5226,7 +5397,7 @@ void calc_android_exp(void)
 {
        int i;
        u32b total_exp = 0;
-       if (death) return;
+       if (p_ptr->is_dead) return;
 
        if (p_ptr->prace != RACE_ANDROID) return;
 
@@ -5317,7 +5488,7 @@ bool set_ultimate_res(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -5382,7 +5553,7 @@ bool set_tim_res_nether(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
@@ -5447,7 +5618,7 @@ bool set_tim_res_time(int v, bool do_dec)
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (death) return FALSE;
+       if (p_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)