OSDN Git Service

combined head-ego.
[hengband/hengband.git] / src / files.c
index e420993..3596383 100644 (file)
@@ -822,7 +822,7 @@ cptr process_pref_file_expr(char **sp, char *fp)
        char b2 = ']';
 
        char f = ' ';
-       static char tmp[8];
+       static char tmp[10];
 
        /* Initial */
        s = (*sp);
@@ -1074,6 +1074,13 @@ cptr process_pref_file_expr(char **sp, char *fp)
                                else
                                        v = "0";
                        }
+
+                       /* Money */
+                       else if (streq(b+1, "MONEY"))
+                       {
+                               sprintf(tmp, "%09ld", (long int)p_ptr->au);
+                               v = tmp;
+                       }
                }
 
                /* Constant */
@@ -1595,8 +1602,8 @@ static struct
        {29, 10, 21, "£È£Ð"},
        {29, 11, 21, "£Í£Ð"},
        {29, 20, 21, "¥×¥ì¥¤»þ´Ö"},
-       {53, 10, -1, "ÂǷ⹶·â  :"},
-       {53, 11, -1, "¼Í·â¹¶·â  :"},
+       {53, 10, -1, "ÂÇ·âÌ¿Ãæ  :"},
+       {53, 11, -1, "¼Í·âÌ¿Ãæ  :"},
        {53, 12, -1, "ËâË¡Ëɸ栠:"},
        {53, 13, -1, "±£Ì©¹ÔÆ°  :"},
        {53, 15, -1, "ÃγР     :"},
@@ -1712,7 +1719,9 @@ static void display_player_melee_bonus(int hand, int hand_entry)
        /* Hack -- add in weapon info if known */
        if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
        if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
-
+       
+       show_tohit += p_ptr->skill_thn / BTH_PLUS_ADJ;
+       
        /* Melee attacks */
        sprintf(buf, "(%+d,%+d)", show_tohit, show_todam);
 
@@ -1784,7 +1793,9 @@ static void display_player_middle(void)
                show_tohit += p_ptr->weapon_exp[0][o_ptr->sval] / 400;
        else
                show_tohit += (p_ptr->weapon_exp[0][o_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200;
-
+       
+       show_tohit += p_ptr->skill_thb / BTH_PLUS_ADJ;
+       
        /* Range attacks */
        display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
 
@@ -2071,13 +2082,14 @@ static cptr likert(int x, int y)
  */
 static void display_player_various(void)
 {
-       int         tmp, damage[2], blows1, blows2, i, basedam;
+       int         tmp, damage[2], to_h[2], blows1, blows2, i, basedam;
        int                     xthn, xthb, xfos, xsrh;
        int                     xdis, xdev, xsav, xstl;
        cptr            desc;
        int         muta_att = 0;
        u32b flgs[TR_FLAG_SIZE];
        int             shots, shot_frac;
+       bool dokubari;
 
        object_type             *o_ptr;
 
@@ -2152,9 +2164,19 @@ static void display_player_various(void)
                        /* Average damage per round */
                        if (o_ptr->k_idx)
                        {
-                               if (object_is_known(o_ptr)) damage[i] += o_ptr->to_d * 100;
+                               to_h[i] = 0;
+                               dokubari = FALSE;                               
+                               
+                               if((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) dokubari = TRUE;
+                               if (object_is_known(o_ptr))
+                               { 
+                                       damage[i] += o_ptr->to_d * 100;
+                                       to_h[i] += o_ptr->to_h;
+                               }
                                basedam = ((o_ptr->dd + p_ptr->to_dd[i]) * (o_ptr->ds + p_ptr->to_ds[i] + 1)) * 50;
                                object_flags_known(o_ptr, flgs);
+                                                               
+                               basedam = calc_expect_crit(o_ptr->weight, to_h[i], basedam, p_ptr->dis_to_h[i], dokubari);
                                if ((o_ptr->ident & IDENT_MENTAL) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
                                {
                                        /* vorpal blade */
@@ -2547,7 +2569,7 @@ static void player_flags(u32b flgs[TR_FLAG_SIZE])
        case RACE_S_FAIRY:
                add_flag(flgs, TR_LEVITATION);
                break;
-       case RACE_KUTA:
+       case RACE_KUTAR:
                add_flag(flgs, TR_RES_CONF);
                break;
        case RACE_ANDROID:
@@ -2779,6 +2801,18 @@ static void tim_player_flags(u32b flgs[TR_FLAG_SIZE])
                add_flag(flgs, TR_SUST_CON);
                add_flag(flgs, TR_SUST_CHR);
        }
+
+       /* Hex bonuses */
+       if (p_ptr->realm1 == REALM_HEX)
+       {
+               if (hex_spelling(HEX_DEMON_AURA))
+               {
+                       add_flag(flgs, TR_SH_FIRE);
+                       add_flag(flgs, TR_REGEN);
+               }
+               if (hex_spelling(HEX_ICE_ARMOR)) add_flag(flgs, TR_SH_COLD);
+               if (hex_spelling(HEX_SHOCK_CLOAK)) add_flag(flgs, TR_SH_ELEC);
+       }
 }
 
 
@@ -2950,6 +2984,8 @@ static void display_flag_aux(int row, int col, cptr header,
        int     i;
        bool    vuln = FALSE;
        int max_i;
+       byte header_color = TERM_L_DARK;
+       int header_col = col;
 
        if (have_flag(f->player_vuln, flag1) &&
            !(have_flag(f->known_obj_imm, flag1) ||
@@ -2957,9 +2993,6 @@ static void display_flag_aux(int row, int col, cptr header,
              have_flag(f->tim_player_imm, flag1)))
                vuln = TRUE;
 
-       /* Header */
-       if (!(mode & DP_IMM)) c_put_str(TERM_WHITE, header, row, col);
-
        /* Advance */
        col += strlen(header) + 1;
 
@@ -2986,16 +3019,30 @@ static void display_flag_aux(int row, int col, cptr header,
                /* Check flags */
                if (mode & DP_CURSE)
                {
-                       if ((mode & DP_CURSE) && (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE)))
+                       if (have_flag(flgs, TR_ADD_L_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
+                       {
+                               c_put_str(TERM_L_DARK, "+", row, col);
+                               header_color = TERM_WHITE;
+                       }
+                       if (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE))
+                       {
                                c_put_str(TERM_WHITE, "+", row, col);
-                       if ((mode & DP_CURSE) && (o_ptr->curse_flags & TRC_PERMA_CURSE))
+                               header_color = TERM_WHITE;
+                       }
+                       if (o_ptr->curse_flags & TRC_PERMA_CURSE)
+                       {
                                c_put_str(TERM_WHITE, "*", row, col);
+                               header_color = TERM_WHITE;
+                       }
                }
                else
                {
                        if (have_flag(flgs, flag1))
+                       {
                                c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE),
                                          (mode & DP_IMM) ? "*" : "+", row, col);
+                               header_color = TERM_WHITE;
+                       }
                }
 
                /* Advance */
@@ -3003,23 +3050,50 @@ static void display_flag_aux(int row, int col, cptr header,
        }
 
        /* Assume that player flag is already written */
-       if (mode & DP_IMM) return;
+       if (mode & DP_IMM)
+       {
+               if (header_color != TERM_L_DARK)
+               {
+                       /* Overwrite Header Color */
+                       c_put_str(header_color, header, row, header_col);
+               }
+               return;
+       }
 
        /* Default */
        c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
 
        /* Player flags */
-       if (have_flag(f->player_flags, flag1)) c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE), "+", row, col);
+       if (have_flag(f->player_flags, flag1))
+       {
+               c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE), "+", row, col);
+               header_color = TERM_WHITE;
+       }
 
        /* Timed player flags */
-       if (have_flag(f->tim_player_flags, flag1)) c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
+       if (have_flag(f->tim_player_flags, flag1))
+       {
+               c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
+               header_color = TERM_WHITE;
+       }
 
        /* Immunity */
-       if (have_flag(f->tim_player_imm, flag1)) c_put_str(TERM_YELLOW, "*", row, col);
-       if (have_flag(f->player_imm, flag1)) c_put_str(TERM_WHITE, "*", row, col);
+       if (have_flag(f->tim_player_imm, flag1))
+       {
+               c_put_str(TERM_YELLOW, "*", row, col);
+               header_color = TERM_WHITE;
+       }
+       if (have_flag(f->player_imm, flag1))
+       {
+               c_put_str(TERM_WHITE, "*", row, col);
+               header_color = TERM_WHITE;
+       }
 
        /* Vulnerability */
        if (vuln) c_put_str(TERM_RED, "v", row, col + 1);
+
+       /* Header */
+       c_put_str(header_color, header, row, header_col);
 }
 
 
@@ -3245,49 +3319,49 @@ static void display_player_other_flag_info(void)
        row = 3;
        col = col + 12 + 7;
 
-       display_player_equippy(row-2, col+12, 0);
-       c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+12);
-
-#ifdef JP
-       display_flag_aux(row+ 0, col, "¥Æ¥ì¥Ñ¥·¡¼:", TR_TELEPATHY, &f, 0);
-       display_flag_aux(row+ 1, col, "¼Ù°­ESP   :", TR_ESP_EVIL, &f, 0);
-       display_flag_aux(row+ 2, col, "̵À¸ÊªESP :", TR_ESP_NONLIVING, &f, 0);
-       display_flag_aux(row+ 3, col, "Á±ÎÉESP   :", TR_ESP_GOOD, &f, 0);
-       display_flag_aux(row+ 4, col, "ÉÔ»àESP   :", TR_ESP_UNDEAD, &f, 0);
-       display_flag_aux(row+ 5, col, "°­ËâESP   :", TR_ESP_DEMON, &f, 0);
-       display_flag_aux(row+ 6, col, "ζESP     :", TR_ESP_DRAGON, &f, 0);
-       display_flag_aux(row+ 7, col, "¿Í´ÖESP   :", TR_ESP_HUMAN, &f, 0);
-       display_flag_aux(row+ 8, col, "ưʪESP   :", TR_ESP_ANIMAL, &f, 0);
-       display_flag_aux(row+ 9, col, "¥ª¡¼¥¯ESP :", TR_ESP_ORC, &f, 0);
-       display_flag_aux(row+10, col, "¥È¥í¥ëESP :", TR_ESP_TROLL, &f, 0);
-       display_flag_aux(row+11, col, "µð¿ÍESP   :", TR_ESP_GIANT, &f, 0);
-
-       display_flag_aux(row+13, col, "ÏÓÎÏ°Ý»ý  :", TR_SUST_STR, &f, 0);
-       display_flag_aux(row+14, col, "ÃÎÎÏ°Ý»ý  :", TR_SUST_INT, &f, 0);
-       display_flag_aux(row+15, col, "¸­¤µ°Ý»ý  :", TR_SUST_WIS, &f, 0);
-       display_flag_aux(row+16, col, "´ïÍÑ°Ý»ý  :", TR_SUST_DEX, &f, 0);
-       display_flag_aux(row+17, col, "Âѵװݻý  :", TR_SUST_CON, &f, 0);
-       display_flag_aux(row+18, col, "Ì¥ÎÏ°Ý»ý  :", TR_SUST_CHR, &f, 0);
-#else
-       display_flag_aux(row+ 0, col, "Telepathy :", TR_TELEPATHY, &f, 0);
-       display_flag_aux(row+ 1, col, "ESP Evil  :", TR_ESP_EVIL, &f, 0);
-       display_flag_aux(row+ 2, col, "ESP Noliv.:", TR_ESP_NONLIVING, &f, 0);
-       display_flag_aux(row+ 3, col, "ESP Good  :", TR_ESP_GOOD, &f, 0);
-       display_flag_aux(row+ 4, col, "ESP Undead:", TR_ESP_UNDEAD, &f, 0);
-       display_flag_aux(row+ 5, col, "ESP Demon :", TR_ESP_DEMON, &f, 0);
-       display_flag_aux(row+ 6, col, "ESP Dragon:", TR_ESP_DRAGON, &f, 0);
-       display_flag_aux(row+ 7, col, "ESP Human :", TR_ESP_HUMAN, &f, 0);
-       display_flag_aux(row+ 8, col, "ESP Animal:", TR_ESP_ANIMAL, &f, 0);
-       display_flag_aux(row+ 9, col, "ESP Orc   :", TR_ESP_ORC, &f, 0);
-       display_flag_aux(row+10, col, "ESP Troll :", TR_ESP_TROLL, &f, 0);
-       display_flag_aux(row+11, col, "ESP Giant :", TR_ESP_GIANT, &f, 0);
-
-       display_flag_aux(row+13, col, "Sust Str  :", TR_SUST_STR, &f, 0);
-       display_flag_aux(row+14, col, "Sust Int  :", TR_SUST_INT, &f, 0);
-       display_flag_aux(row+15, col, "Sust Wis  :", TR_SUST_WIS, &f, 0);
-       display_flag_aux(row+16, col, "Sust Dex  :", TR_SUST_DEX, &f, 0);
-       display_flag_aux(row+17, col, "Sust Con  :", TR_SUST_CON, &f, 0);
-       display_flag_aux(row+18, col, "Sust Chr  :", TR_SUST_CHR, &f, 0);
+       display_player_equippy(row-2, col+13, 0);
+       c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+13);
+
+#ifdef JP
+       display_flag_aux(row+ 0, col, "¥Æ¥ì¥Ñ¥·¡¼ :", TR_TELEPATHY, &f, 0);
+       display_flag_aux(row+ 1, col, "¼Ù°­ESP    :", TR_ESP_EVIL, &f, 0);
+       display_flag_aux(row+ 2, col, "̵À¸ÊªESP  :", TR_ESP_NONLIVING, &f, 0);
+       display_flag_aux(row+ 3, col, "Á±ÎÉESP    :", TR_ESP_GOOD, &f, 0);
+       display_flag_aux(row+ 4, col, "ÉÔ»àESP    :", TR_ESP_UNDEAD, &f, 0);
+       display_flag_aux(row+ 5, col, "°­ËâESP    :", TR_ESP_DEMON, &f, 0);
+       display_flag_aux(row+ 6, col, "ζESP      :", TR_ESP_DRAGON, &f, 0);
+       display_flag_aux(row+ 7, col, "¿Í´ÖESP    :", TR_ESP_HUMAN, &f, 0);
+       display_flag_aux(row+ 8, col, "ưʪESP    :", TR_ESP_ANIMAL, &f, 0);
+       display_flag_aux(row+ 9, col, "¥ª¡¼¥¯ESP  :", TR_ESP_ORC, &f, 0);
+       display_flag_aux(row+10, col, "¥È¥í¥ëESP  :", TR_ESP_TROLL, &f, 0);
+       display_flag_aux(row+11, col, "µð¿ÍESP    :", TR_ESP_GIANT, &f, 0);
+       display_flag_aux(row+12, col, "¥æ¥Ë¡¼¥¯ESP:", TR_ESP_UNIQUE, &f, 0);
+       display_flag_aux(row+13, col, "ÏÓÎÏ°Ý»ý   :", TR_SUST_STR, &f, 0);
+       display_flag_aux(row+14, col, "ÃÎÎÏ°Ý»ý   :", TR_SUST_INT, &f, 0);
+       display_flag_aux(row+15, col, "¸­¤µ°Ý»ý   :", TR_SUST_WIS, &f, 0);
+       display_flag_aux(row+16, col, "´ïÍÑ°Ý»ý   :", TR_SUST_DEX, &f, 0);
+       display_flag_aux(row+17, col, "Âѵװݻý   :", TR_SUST_CON, &f, 0);
+       display_flag_aux(row+18, col, "Ì¥ÎÏ°Ý»ý   :", TR_SUST_CHR, &f, 0);
+#else
+       display_flag_aux(row+ 0, col, "Telepathy  :", TR_TELEPATHY, &f, 0);
+       display_flag_aux(row+ 1, col, "ESP Evil   :", TR_ESP_EVIL, &f, 0);
+       display_flag_aux(row+ 2, col, "ESP Noliv. :", TR_ESP_NONLIVING, &f, 0);
+       display_flag_aux(row+ 3, col, "ESP Good   :", TR_ESP_GOOD, &f, 0);
+       display_flag_aux(row+ 4, col, "ESP Undead :", TR_ESP_UNDEAD, &f, 0);
+       display_flag_aux(row+ 5, col, "ESP Demon  :", TR_ESP_DEMON, &f, 0);
+       display_flag_aux(row+ 6, col, "ESP Dragon :", TR_ESP_DRAGON, &f, 0);
+       display_flag_aux(row+ 7, col, "ESP Human  :", TR_ESP_HUMAN, &f, 0);
+       display_flag_aux(row+ 8, col, "ESP Animal :", TR_ESP_ANIMAL, &f, 0);
+       display_flag_aux(row+ 9, col, "ESP Orc    :", TR_ESP_ORC, &f, 0);
+       display_flag_aux(row+10, col, "ESP Troll  :", TR_ESP_TROLL, &f, 0);
+       display_flag_aux(row+11, col, "ESP Giant  :", TR_ESP_GIANT, &f, 0);
+       display_flag_aux(row+12, col, "ESP Unique :", TR_ESP_UNIQUE, &f, 0);
+       display_flag_aux(row+13, col, "Sust Str   :", TR_SUST_STR, &f, 0);
+       display_flag_aux(row+14, col, "Sust Int   :", TR_SUST_INT, &f, 0);
+       display_flag_aux(row+15, col, "Sust Wis   :", TR_SUST_WIS, &f, 0);
+       display_flag_aux(row+16, col, "Sust Dex   :", TR_SUST_DEX, &f, 0);
+       display_flag_aux(row+17, col, "Sust Con   :", TR_SUST_CON, &f, 0);
+       display_flag_aux(row+18, col, "Sust Chr   :", TR_SUST_CHR, &f, 0);
 #endif
 
 
@@ -3868,7 +3942,7 @@ void display_player(int mode)
                                {
                                        /* Get the quest text */
                                        /* Bewere that INIT_ASSIGN resets the cur_num. */
-                                       init_flags = INIT_ASSIGN;
+                                       init_flags = INIT_NAME_ONLY;
 
                                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -3908,7 +3982,7 @@ void display_player(int mode)
                                        quest_text_line = 0;
 
                                        /* Get the quest text */
-                                       init_flags = INIT_SHOW_TEXT;
+                                       init_flags = INIT_NAME_ONLY;
 
                                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -3984,7 +4058,7 @@ void display_player(int mode)
  */
 static void dump_aux_display_player(FILE *fff)
 {
-       int x, y, i;
+       int x, y;
        byte a;
        char c;
        char            buf[1024];
@@ -4108,11 +4182,7 @@ static void dump_aux_display_player(FILE *fff)
                fprintf(fff, "%s\n", buf);
        }
 
-       for (i = 0; (unsigned int) i < (p_ptr->count / 80); i++)
-               fprintf(fff, " ");
        fprintf(fff, "\n");
-       for (i = 0; (unsigned int) i < (p_ptr->count % 80); i++)
-               fprintf(fff, " ");
 }
 
 
@@ -4331,7 +4401,7 @@ static void dump_aux_class_special(FILE *fff)
 
                for (i=0;i<=col;i++)
                {
-                       fprintf(fff, p[i]);
+                       fputs(p[i], fff);
                }
        }
        else if (p_ptr->pclass == CLASS_MAGIC_EATER)
@@ -6342,7 +6412,7 @@ msg_print("
        else
        {
                /* Disturb the player */
-               disturb(1, 0);
+               disturb(1, 1);
        }
 
        /* Clear messages */
@@ -7283,7 +7353,7 @@ void exit_game_panic(void)
        prt("", 0, 0);
 
        /* Hack -- turn off some things */
-       disturb(1, 0);
+       disturb(1, 1);
 
        /* Mega-Hack -- Delay death */
        if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;