OSDN Git Service

クエスト達成時に, 階段が鏡の上(下?)に作られるのを禁止.
[hengbandforosx/hengbandosx.git] / src / files.c
index 88f49d1..801191e 100644 (file)
@@ -590,7 +590,7 @@ errr process_pref_file_command(char *buf)
                            option_info[i].o_text &&
                            streq(option_info[i].o_text, buf + 2))
                        {
-                               if (alive && 6 == option_info[i].o_page && !wizard)
+                               if (p_ptr->playing && 6 == option_info[i].o_page && !p_ptr->wizard)
                                {
 #ifdef JP
                                        msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤­¤Þ¤»¤ó! '%s'", buf);        
@@ -630,7 +630,7 @@ errr process_pref_file_command(char *buf)
                            option_info[i].o_text &&
                            streq(option_info[i].o_text, buf + 2))
                        {
-                               if (alive && 6 == option_info[i].o_page && !wizard)
+                               if (p_ptr->playing && 6 == option_info[i].o_page && !p_ptr->wizard)
                                {
 #ifdef JP
                                        msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤­¤Þ¤»¤ó! '%s'", buf);        
@@ -1754,9 +1754,9 @@ static void display_player_middle(void)
        if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
 
        if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
-               show_tohit += (weapon_exp[0][o_ptr->sval])/400;
+               show_tohit += (p_ptr->weapon_exp[0][o_ptr->sval])/400;
        else
-               show_tohit += (weapon_exp[0][o_ptr->sval]-4000)/200;
+               show_tohit += (p_ptr->weapon_exp[0][o_ptr->sval]-4000)/200;
 
        /* Range attacks */
        display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
@@ -4083,12 +4083,12 @@ void display_player(int mode)
 
                        for (i = 0; i < 4; i++)
                        {
-                               put_str(history[i], i + 12, 10);
+                               put_str(p_ptr->history[i], i + 12, 10);
                        }
 
                        *statmsg = '\0';
 
-                       if (death && total_winner)
+                       if (p_ptr->is_dead && p_ptr->total_winner)
                        {
 #ifdef JP
                                strcpy(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¾¡Íø¤Î¸å°úÂष¤¿¡£");
@@ -4096,7 +4096,7 @@ void display_player(int mode)
                                strcpy(statmsg, "...You retired from the adventure after the winning.");
 #endif
                        }
-                       else if (death)
+                       else if (p_ptr->is_dead)
                        {
                                if (dun_level)
                                {
@@ -4108,25 +4108,25 @@ void display_player(int mode)
                                                process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
 
 #ifdef JP
-                                               sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢¥¯¥¨¥¹¥È¡Ö%s¡×¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", quest[p_ptr->inside_quest].name, died_from);
+                                               sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢¥¯¥¨¥¹¥È¡Ö%s¡×¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", quest[p_ptr->inside_quest].name, p_ptr->died_from);
 #else
-                                               sprintf(statmsg, "...You were killed by %s in the quest '%s'.", died_from, quest[p_ptr->inside_quest].name);
+                                               sprintf(statmsg, "...You were killed by %s in the quest '%s'.", p_ptr->died_from, quest[p_ptr->inside_quest].name);
 #endif
                                        }
                                        else
                                        {                                       
 #ifdef JP
-                                               sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, died_from);
+                                               sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, p_ptr->died_from);
 #else
-                                               sprintf(statmsg, "...You were killed by %s on level %d of %s.", died_from, dun_level, map_name());
+                                               sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, dun_level, map_name());
 #endif
                                        }
                                }
                                else
 #ifdef JP
-                                       sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), died_from);
+                                       sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), p_ptr->died_from);
 #else
-                                       sprintf(statmsg, "...You were killed by %s in %s.", died_from, map_name());
+                                       sprintf(statmsg, "...You were killed by %s in %s.", p_ptr->died_from, map_name());
 #endif
                        }
                        else if (character_dungeon)
@@ -4230,11 +4230,6 @@ errr make_character_dump(FILE *fff)
        char            buf[1024];
 
 
-#ifndef FAKE_VERSION
-       /* Begin dump */
-       fprintf(fff, "  [Angband %d.%d.%d Character Dump]\n\n",
-               VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
-#else
 #ifdef JP
        fprintf(fff, "  [ÊѶòÈÚÅÜ %d.%d.%d ¥­¥ã¥é¥¯¥¿¾ðÊó]\n\n",
                FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
@@ -4243,8 +4238,6 @@ errr make_character_dump(FILE *fff)
                FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
 #endif
 
-#endif
-
        update_playtime();
 
        /* Display player */
@@ -4373,7 +4366,7 @@ errr make_character_dump(FILE *fff)
                if (pet) fprintf(fff, "\n");
        }
 
-       if (death && !total_winner)
+       if (p_ptr->is_dead && !p_ptr->total_winner)
        {
 #ifdef JP
                fprintf(fff, "\n  [»à¤ÌľÁ°¤Î¥á¥Ã¥»¡¼¥¸]\n\n");
@@ -4591,7 +4584,7 @@ errr make_character_dump(FILE *fff)
 #endif
        }
 
-       if (noscore)
+       if (p_ptr->noscore)
 #ifdef JP
 fprintf(fff, "\n ²¿¤«ÉÔÀµ¤Ê¤³¤È¤ò¤·¤Æ¤·¤Þ¤Ã¤Æ¤Þ¤¹¡£");
 #else
@@ -5933,7 +5926,7 @@ void do_cmd_suicide(void)
        flush();
 
        /* Verify Retirement */
-       if (total_winner)
+       if (p_ptr->total_winner)
        {
                /* Verify */
 #ifdef JP
@@ -5956,7 +5949,7 @@ if (!get_check("
        }
 
 
-       if (!noscore)
+       if (!p_ptr->noscore)
        {
                /* Special Verification for suicide */
 #ifdef JP
@@ -5972,15 +5965,15 @@ prt("
        }
 
        /* Stop playing */
-       alive = FALSE;
+       p_ptr->playing = FALSE;
 
        /* Kill the player */
-       death = TRUE;
+       p_ptr->is_dead = TRUE;
 
        /* Leaving */
        p_ptr->leaving = TRUE;
 
-       if (!total_winner)
+       if (!p_ptr->total_winner)
        {
 #ifdef JP
                do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥À¥ó¥¸¥ç¥ó¤Îõº÷¤ËÀä˾¤·¤Æ¼«»¦¤·¤¿¡£");
@@ -5994,9 +5987,9 @@ prt("
 
        /* Cause of death */
 #ifdef JP
-(void)strcpy(died_from, "ÅÓÃ潪λ");
+(void)strcpy(p_ptr->died_from, "ÅÓÃ潪λ");
 #else
-       (void)strcpy(died_from, "Quitting");
+       (void)strcpy(p_ptr->died_from, "Quitting");
 #endif
 
 }
@@ -6043,9 +6036,9 @@ prt("
 
        /* The player is not dead */
 #ifdef JP
-(void)strcpy(died_from, "(¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¥»¡¼¥Ö)");
 #else
-       (void)strcpy(died_from, "(saved)");
+       (void)strcpy(p_ptr->died_from, "(saved)");
 #endif
 
 
@@ -6082,9 +6075,9 @@ prt("
 
        /* Note that the player is not dead */
 #ifdef JP
-(void)strcpy(died_from, "(¸µµ¤¤ËÀ¸¤­¤Æ¤¤¤ë)");
+(void)strcpy(p_ptr->died_from, "(¸µµ¤¤ËÀ¸¤­¤Æ¤¤¤ë)");
 #else
-       (void)strcpy(died_from, "(alive and well)");
+       (void)strcpy(p_ptr->died_from, "(alive and well)");
 #endif
 
 }
@@ -6095,7 +6088,7 @@ prt("
  */
 void do_cmd_save_and_exit(void)
 {
-       alive = FALSE;
+       p_ptr->playing = FALSE;
 
        /* Leaving */
        p_ptr->leaving = TRUE;
@@ -6162,7 +6155,7 @@ long total_points(void)
        if ((p_ptr->pseikaku == SEIKAKU_MUNCHKIN) && point)
        {
                point = 1;
-               if (total_winner) point = 2;
+               if (p_ptr->total_winner) point = 2;
        }
        if (easy_band) point = (0 - point);
 
@@ -6206,7 +6199,7 @@ static void make_bones(void)
 
 
        /* Ignore wizards and borgs */
-       if (!(noscore & 0x00FF))
+       if (!(p_ptr->noscore & 0x00FF))
        {
                /* Ignore people who die in town */
                if (dun_level)
@@ -6320,7 +6313,7 @@ static void print_tomb(void)
 
 
                /* King or Queen */
-               if (total_winner || (p_ptr->lev > PY_MAX_LEVEL))
+               if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
                {
 #ifdef JP
                 /* ±ÑÆüÀÚ¤êÂؤ¨ */
@@ -6382,34 +6375,34 @@ static void print_tomb(void)
 
 #ifdef JP
         /* Êè¤Ë¹ï¤à¸ÀÍÕ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¼¨ */
-        if (streq(died_from, "ÅÓÃ潪λ"))
+        if (streq(p_ptr->died_from, "ÅÓÃ潪λ"))
         {
                 strcpy(tmp, "<¼«»¦>");
         }
         else
         {
-                if (streq(died_from, "ripe"))
+                if (streq(p_ptr->died_from, "ripe"))
                 {
                         strcpy(tmp, "°úÂà¸å¤ËÅ·¼÷¤òÁ´¤¦");
                 }
-                else if (streq(died_from, "Seppuku"))
+                else if (streq(p_ptr->died_from, "Seppuku"))
                 {
                         strcpy(tmp, "¾¡Íø¤Î¸å¡¢ÀÚÊ¢");
                 }
                 else
                 {
-                        strcpy(tmp, died_from);
+                        strcpy(tmp, p_ptr->died_from);
                 }
         }
         center_string(buf, tmp);
         put_str(buf, 14, 11);
 
-        if(!streq(died_from, "ripe") && !streq(died_from, "Seppuku"))
+        if(!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
         {
                 if( dun_level == 0 )
                 {
                        cptr town = (p_ptr->town_num ? "³¹" : "¹ÓÌî");
-                        if(streq(died_from, "ÅÓÃ潪λ"))
+                        if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
                         {
                                 sprintf(tmp, "%s¤Ç»à¤ó¤À", town);
                         }
@@ -6420,7 +6413,7 @@ static void print_tomb(void)
                 }
                 else
                 {
-                        if(streq(died_from, "ÅÓÃ潪λ"))
+                        if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
                         {
                                 sprintf(tmp, "Ãϲ¼ %d ³¬¤Ç»à¤ó¤À", dun_level);
                         }
@@ -6438,14 +6431,14 @@ static void print_tomb(void)
                put_str(buf, 14, 11);
 
 
-               if (strlen(died_from) > 24)
+               if (strlen(p_ptr->died_from) > 24)
                {
-                       strncpy(dummy, died_from, 24);
+                       strncpy(dummy, p_ptr->died_from, 24);
                        dummy[24] = '\0';
                        (void)sprintf(tmp, "by %s.", dummy);
                }
                else
-                       (void)sprintf(tmp, "by %s.", died_from);
+                       (void)sprintf(tmp, "by %s.", p_ptr->died_from);
 
                center_string(buf, tmp);
                put_str(buf, 15, 11);
@@ -6679,7 +6672,7 @@ msg_print("
 
 #ifndef SCORE_WIZARDS
        /* Wizard-mode pre-empts scoring */
-       if (noscore & 0x000F)
+       if (p_ptr->noscore & 0x000F)
        {
 #ifdef JP
 msg_print("¥¦¥£¥¶¡¼¥É¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µ­Ï¿¤µ¤ì¤Þ¤»¤ó¡£");
@@ -6694,7 +6687,7 @@ msg_print("
 
 #ifndef SCORE_BORGS
        /* Borg-mode pre-empts scoring */
-       if (noscore & 0x00F0)
+       if (p_ptr->noscore & 0x00F0)
        {
 #ifdef JP
 msg_print("¥Ü¡¼¥°¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µ­Ï¿¤µ¤ì¤Þ¤»¤ó¡£");
@@ -6709,7 +6702,7 @@ msg_print("
 
 #ifndef SCORE_CHEATERS
        /* Cheaters are not scored */
-       if (noscore & 0xFF00)
+       if (p_ptr->noscore & 0xFF00)
        {
 #ifdef JP
 msg_print("º¾µ½¤ò¤ä¤Ã¤¿¿Í¤Ï¥¹¥³¥¢¤¬µ­Ï¿¤µ¤ì¤Þ¤»¤ó¡£");
@@ -6724,9 +6717,9 @@ msg_print("
 
        /* Interupted */
 #ifdef JP
-if (!total_winner && streq(died_from, "¶¯À©½ªÎ»"))
+if (!p_ptr->total_winner && streq(p_ptr->died_from, "¶¯À©½ªÎ»"))
 #else
-       if (!total_winner && streq(died_from, "Interrupting"))
+       if (!p_ptr->total_winner && streq(p_ptr->died_from, "Interrupting"))
 #endif
 
        {
@@ -6742,9 +6735,9 @@ msg_print("
 
        /* Quitter */
 #ifdef JP
-if (!total_winner && streq(died_from, "ÅÓÃ潪λ"))
+if (!p_ptr->total_winner && streq(p_ptr->died_from, "ÅÓÃ潪λ"))
 #else
-       if (!total_winner && streq(died_from, "Quitting"))
+       if (!p_ptr->total_winner && streq(p_ptr->died_from, "Quitting"))
 #endif
 
        {
@@ -6798,10 +6791,10 @@ void close_game(void)
 
 
        /* Handle death */
-       if (death)
+       if (p_ptr->is_dead)
        {
                /* Handle retirement */
-               if (total_winner) kingly();
+               if (p_ptr->total_winner) kingly();
 
                /* Save memories */
 #ifdef JP
@@ -6840,8 +6833,8 @@ if (!save_player()) msg_print("
                                if (get_check_strict("Stand by for later score registration? ", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
 #endif
                                {
-                                       wait_report_score = TRUE;
-                                       death = FALSE;
+                                       p_ptr->wait_report_score = TRUE;
+                                       p_ptr->is_dead = FALSE;
 #ifdef JP
                                        if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
 #else
@@ -6849,7 +6842,7 @@ if (!save_player()) msg_print("
 #endif
                                }
                        }
-                       if (!wait_report_score)
+                       if (!p_ptr->wait_report_score)
                                (void)top_twenty();
                }
                else if (highscore_fd >= 0)
@@ -6922,19 +6915,19 @@ if (!character_generated || character_saved) quit("
        disturb(1, 0);
 
        /* Mega-Hack -- Delay death */
-       if (p_ptr->chp < 0) death = FALSE;
+       if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
 
        /* Hardcode panic save */
-       panic_save = 1;
+       p_ptr->panic_save = 1;
 
        /* Forbid suspend */
        signals_ignore_tstp();
 
        /* Indicate panic save */
 #ifdef JP
-(void)strcpy(died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
 #else
-       (void)strcpy(died_from, "(panic save)");
+       (void)strcpy(p_ptr->died_from, "(panic save)");
 #endif
 
 
@@ -7330,13 +7323,13 @@ static void handle_signal_simple(int sig)
 
 
        /* Terminate dead characters */
-       if (death)
+       if (p_ptr->is_dead)
        {
                /* Mark the savefile */
 #ifdef JP
-(void)strcpy(died_from, "¶¯À©½ªÎ»");
+(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»");
 #else
-               (void)strcpy(died_from, "Abortion");
+               (void)strcpy(p_ptr->died_from, "Abortion");
 #endif
 
                forget_lite();
@@ -7360,9 +7353,9 @@ quit("
        {
                /* Cause of "death" */
 #ifdef JP
-(void)strcpy(died_from, "¶¯À©½ªÎ»Ãæ");
+(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»Ãæ");
 #else
-               (void)strcpy(died_from, "Interrupting");
+               (void)strcpy(p_ptr->died_from, "Interrupting");
 #endif
 
 
@@ -7371,10 +7364,10 @@ quit("
                clear_mon_lite();
 
                /* Stop playing */
-               alive = FALSE;
+               p_ptr->playing = FALSE;
 
                /* Suicide */
-               death = TRUE;
+               p_ptr->is_dead = TRUE;
 
                /* Leaving */
                p_ptr->leaving = TRUE;
@@ -7470,13 +7463,13 @@ Term_putstr(45, hgt - 1, -1, TERM_RED, "
        Term_fresh();
 
        /* Panic Save */
-       panic_save = 1;
+       p_ptr->panic_save = 1;
 
        /* Panic save */
 #ifdef JP
-(void)strcpy(died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
 #else
-       (void)strcpy(died_from, "(panic save)");
+       (void)strcpy(p_ptr->died_from, "(panic save)");
 #endif