X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Ffiles.c;h=11c9abccd1bf7567e2caf2958e12756685d0af7f;hb=bd519d53bf8418cc2225f944092684de915be365;hp=332098b3897a1b2fccabb64d7936f59c290201bf;hpb=506f17eb59d6726b90efa1d3874f65ea41b3ca45;p=hengband%2Fhengband.git diff --git a/src/files.c b/src/files.c index 332098b38..11c9abccd 100644 --- a/src/files.c +++ b/src/files.c @@ -15,17 +15,26 @@ #include "angband.h" #include "util.h" +#include "files.h" +#include "core.h" #include "birth.h" #include "files.h" #include "bldg.h" +#include "cmd-magiceat.h" +#include "cmd-dump.h" #include "world.h" +#include "player-inventory.h" +#include "player-race.h" #include "player-status.h" #include "player-move.h" #include "player-class.h" #include "player-skill.h" +#include "player-personality.h" +#include "player-sex.h" +#include "player-effects.h" #include "sort.h" #include "mutation.h" #include "quest.h" @@ -39,18 +48,48 @@ #include "monster-status.h" #include "object-flavor.h" #include "object-hook.h" +#include "realm.h" #include "realm-hex.h" #include "cmd-pet.h" #include "spells.h" #include "term.h" #include "view-mainwindow.h" #include "floor-events.h" +#include "floor-town.h" #include "dungeon-file.h" #include "init.h" #include "monster-spell.h" #include "floor.h" #include "dungeon.h" #include "melee.h" +#include "objectkind.h" +#include "autopick.h" +#include "save.h" +#include "realm-song.h" + +concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code +concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms +concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms +concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms +concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms +concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms. +concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms +concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms +concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms +concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms +concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary) +concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms +concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms + +s16b signal_count; /* Hack -- Count interupts */ + +/* + * Buffer to hold the current savefile name + * 'savefile' holds full path name. 'savefile_base' holds only base name. + */ +char savefile[1024]; +char savefile_base[40]; + /* @@ -112,11 +151,11 @@ void safe_setuid_grab(void) # ifdef SAFE_SETUID_POSIX - if (setuid(player_euid) != 0) + if (setuid(p_ptr->player_egid) != 0) { quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!")); } - if (setgid(player_egid) != 0) + if (setgid(p_ptr->player_egid) != 0) { quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!")); } @@ -367,7 +406,7 @@ static named_num gf_desc[] = * F:\:\:\ * Specify the attr/char values for unaware "objects" by kind tval * U:\:\:\ - * Specify the attr/char values for p_ptr->inventory_list "objects" by kind tval + * Specify the attr/char values for inventory "objects" by kind tval * E:\:\:\ * Define a macro action, given an encoded macro action * A:\ @@ -531,7 +570,7 @@ errr process_pref_file_command(char *buf) } break; - /* Process "E::" -- attribute for p_ptr->inventory_list objects */ + /* Process "E::" -- attribute for inventory objects */ case 'E': if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) == 2) { @@ -592,8 +631,8 @@ errr process_pref_file_command(char *buf) } break; - /* Process "X:" -- current_world_ptr->game_turn option off */ - /* Process "Y:" -- current_world_ptr->game_turn option on */ + /* Process "X:" -- turn option off */ + /* Process "Y:" -- turn option on */ case 'X': case 'Y': for (i = 0; option_info[i].o_desc; i++) @@ -605,8 +644,8 @@ errr process_pref_file_command(char *buf) int os = option_info[i].o_set; int ob = option_info[i].o_bit; - if ((p_ptr->playing || character_xtra) && - (OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard) + if ((p_ptr->playing || current_world_ptr->character_xtra) && + (OPT_PAGE_BIRTH == option_info[i].o_page) && !current_world_ptr->wizard) { msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf); msg_print(NULL); @@ -615,7 +654,6 @@ errr process_pref_file_command(char *buf) if (buf[0] == 'X') { - /* Clear */ option_flag[os] &= ~(1L << ob); (*option_info[i].o_var) = FALSE; } @@ -1108,8 +1146,6 @@ static errr process_pref_file_aux(concptr name, int preftype) bool bypass = FALSE; - - /* Open the file */ fp = my_fopen(name, "r"); /* No such file */ @@ -1236,8 +1272,6 @@ errr process_pref_file(concptr name) char buf[1024]; errr err1, err2; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_PREF, name); /* Process the system pref file */ @@ -1246,8 +1280,6 @@ errr process_pref_file(concptr name) /* Stop at parser errors, but not at non-existing file */ if (err1 > 0) return err1; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); /* Process the user pref file */ @@ -1332,11 +1364,7 @@ errr check_time_init(void) char buf[1024]; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "time.txt"); - - /* Open the file */ fp = my_fopen(buf, "r"); /* No file, no restrictions */ @@ -1458,8 +1486,6 @@ errr check_load_init(void) char temphost[MAXHOSTNAMELEN+1]; char thishost[MAXHOSTNAMELEN+1]; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "load.txt"); /* Open the "load" file */ @@ -1722,7 +1748,7 @@ static void display_player_melee_bonus(int hand, int hand_entry) sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam); /* Dump the bonuses to hit/dam */ - if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) + if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM)) display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE); else if (p_ptr->ryoute) display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE); @@ -1736,37 +1762,37 @@ static void display_player_melee_bonus(int hand, int hand_entry) * Prints the following information on the screen. * @return なし */ -static void display_player_middle(void) +static void display_player_middle(player_type *creature_ptr) { char buf[160]; /* Base skill */ - HIT_PROB show_tohit = p_ptr->dis_to_h_b; + HIT_PROB show_tohit = creature_ptr->dis_to_h_b; HIT_POINT show_todam = 0; /* Range weapon */ - object_type *o_ptr = &p_ptr->inventory_list[INVEN_BOW]; + object_type *o_ptr = &creature_ptr->inventory_list[INVEN_BOW]; int tmul = 0; int e; - if (p_ptr->migite) + if (creature_ptr->migite) { display_player_melee_bonus(0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1); } - if (p_ptr->hidarite) + if (creature_ptr->hidarite) { display_player_melee_bonus(1, left_hander ? ENTRY_RIGHT_HAND2: ENTRY_LEFT_HAND2); } - else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) + else if ((creature_ptr->pclass == CLASS_MONK) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM)) { int i; - if (p_ptr->special_defense & KAMAE_MASK) + if (creature_ptr->special_defense & KAMAE_MASK) { for (i = 0; i < MAX_KAMAE; i++) { - if ((p_ptr->special_defense >> i) & KAMAE_GENBU) break; + if ((creature_ptr->special_defense >> i) & KAMAE_GENBU) break; } if (i < MAX_KAMAE) display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), kamae_shurui[i].desc), TERM_YELLOW); @@ -1780,30 +1806,30 @@ static void display_player_middle(void) if (object_is_known(o_ptr)) show_todam += o_ptr->to_d; if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW)) - show_tohit += p_ptr->weapon_exp[0][o_ptr->sval] / 400; + show_tohit += creature_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 += (creature_ptr->weapon_exp[0][o_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200; - show_tohit += p_ptr->skill_thb / BTH_PLUS_ADJ; + show_tohit += creature_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); - if (p_ptr->inventory_list[INVEN_BOW].k_idx) + if (creature_ptr->inventory_list[INVEN_BOW].k_idx) { - tmul = bow_tmul(p_ptr->inventory_list[INVEN_BOW].sval); + tmul = bow_tmul(creature_ptr->inventory_list[INVEN_BOW].sval); /* Get extra "power" from "extra might" */ - if (p_ptr->xtra_might) tmul++; + if (creature_ptr->xtra_might) tmul++; - tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128); + tmul = tmul * (100 + (int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128); } /* shoot power */ display_player_one_line(ENTRY_SHOOT_POWER, format("x%d.%02d", tmul/100, tmul%100), TERM_L_BLUE); /* Dump the armor class */ - display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", p_ptr->dis_ac, p_ptr->dis_to_a), TERM_L_BLUE); + display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE); /* Dump speed */ { @@ -1811,48 +1837,48 @@ static void display_player_middle(void) TERM_COLOR attr; int i; - i = p_ptr->pspeed-110; + i = creature_ptr->pspeed-110; /* Hack -- Visually "undo" the Search Mode Slowdown */ - if (p_ptr->action == ACTION_SEARCH) i += 10; + if (creature_ptr->action == ACTION_SEARCH) i += 10; if (i > 0) { - if (!p_ptr->riding) + if (!creature_ptr->riding) attr = TERM_L_GREEN; else attr = TERM_GREEN; } else if (i == 0) { - if (!p_ptr->riding) + if (!creature_ptr->riding) attr = TERM_L_BLUE; else attr = TERM_GREEN; } else { - if (!p_ptr->riding) + if (!creature_ptr->riding) attr = TERM_L_UMBER; else attr = TERM_RED; } - if (!p_ptr->riding) + if (!creature_ptr->riding) { - if (IS_FAST()) tmp_speed += 10; - if (p_ptr->slow) tmp_speed -= 10; - if (p_ptr->lightspeed) tmp_speed = 99; + if (IS_FAST(creature_ptr)) tmp_speed += 10; + if (creature_ptr->slow) tmp_speed -= 10; + if (creature_ptr->lightspeed) tmp_speed = 99; } else { - if (MON_FAST(¤t_floor_ptr->m_list[p_ptr->riding])) tmp_speed += 10; - if (MON_SLOW(¤t_floor_ptr->m_list[p_ptr->riding])) tmp_speed -= 10; + if (MON_FAST(&p_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10; + if (MON_SLOW(&p_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10; } if (tmp_speed) { - if (!p_ptr->riding) + if (!creature_ptr->riding) sprintf(buf, "(%+d%+d)", i-tmp_speed, tmp_speed); else sprintf(buf, _("乗馬中 (%+d%+d)", "Riding (%+d%+d)"), i-tmp_speed, tmp_speed); @@ -1864,7 +1890,7 @@ static void display_player_middle(void) } else { - if (!p_ptr->riding) + if (!creature_ptr->riding) sprintf(buf, "(%+d)", i); else sprintf(buf, _("乗馬中 (%+d)", "Riding (%+d)"), i); @@ -1874,36 +1900,36 @@ static void display_player_middle(void) } /* Dump character level */ - display_player_one_line(ENTRY_LEVEL, format("%d", p_ptr->lev), TERM_L_GREEN); + display_player_one_line(ENTRY_LEVEL, format("%d", creature_ptr->lev), TERM_L_GREEN); /* Dump experience */ - if (p_ptr->prace == RACE_ANDROID) e = ENTRY_EXP_ANDR; + if (creature_ptr->prace == RACE_ANDROID) e = ENTRY_EXP_ANDR; else e = ENTRY_CUR_EXP; - if (p_ptr->exp >= p_ptr->max_exp) - display_player_one_line(e, format("%ld", p_ptr->exp), TERM_L_GREEN); + if (creature_ptr->exp >= creature_ptr->max_exp) + display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_L_GREEN); else - display_player_one_line(e, format("%ld", p_ptr->exp), TERM_YELLOW); + display_player_one_line(e, format("%ld", creature_ptr->exp), TERM_YELLOW); /* Dump max experience */ - if (p_ptr->prace == RACE_ANDROID) + if (creature_ptr->prace == RACE_ANDROID) /* Nothing */; else - display_player_one_line(ENTRY_MAX_EXP, format("%ld", p_ptr->max_exp), TERM_L_GREEN); + display_player_one_line(ENTRY_MAX_EXP, format("%ld", creature_ptr->max_exp), TERM_L_GREEN); /* Dump exp to advance */ - if (p_ptr->prace == RACE_ANDROID) e = ENTRY_EXP_TO_ADV_ANDR; + if (creature_ptr->prace == RACE_ANDROID) e = ENTRY_EXP_TO_ADV_ANDR; else e = ENTRY_EXP_TO_ADV; - if (p_ptr->lev >= PY_MAX_LEVEL) + if (creature_ptr->lev >= PY_MAX_LEVEL) display_player_one_line(e, "*****", TERM_L_GREEN); - else if (p_ptr->prace == RACE_ANDROID) - display_player_one_line(e, format("%ld", (s32b)(player_exp_a[p_ptr->lev - 1] * p_ptr->expfact / 100L)), TERM_L_GREEN); + else if (creature_ptr->prace == RACE_ANDROID) + display_player_one_line(e, format("%ld", (s32b)(player_exp_a[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN); else - display_player_one_line(e, format("%ld", (s32b)(player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L)), TERM_L_GREEN); + display_player_one_line(e, format("%ld", (s32b)(player_exp[creature_ptr->lev - 1] * creature_ptr->expfact / 100L)), TERM_L_GREEN); /* Dump gold */ - display_player_one_line(ENTRY_GOLD, format("%ld", p_ptr->au), TERM_L_GREEN); + display_player_one_line(ENTRY_GOLD, format("%ld", creature_ptr->au), TERM_L_GREEN); /* Dump Day */ { @@ -1916,20 +1942,20 @@ static void display_player_middle(void) display_player_one_line(ENTRY_DAY, buf, TERM_L_GREEN); /* Dump hit point */ - if (p_ptr->chp >= p_ptr->mhp) - display_player_one_line(ENTRY_HP, format("%4d/%4d", p_ptr->chp , p_ptr->mhp), TERM_L_GREEN); - else if (p_ptr->chp > (p_ptr->mhp * hitpoint_warn) / 10) - display_player_one_line(ENTRY_HP, format("%4d/%4d", p_ptr->chp , p_ptr->mhp), TERM_YELLOW); + if (creature_ptr->chp >= creature_ptr->mhp) + display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp , creature_ptr->mhp), TERM_L_GREEN); + else if (creature_ptr->chp > (creature_ptr->mhp * hitpoint_warn) / 10) + display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp , creature_ptr->mhp), TERM_YELLOW); else - display_player_one_line(ENTRY_HP, format("%4d/%4d", p_ptr->chp , p_ptr->mhp), TERM_RED); + display_player_one_line(ENTRY_HP, format("%4d/%4d", creature_ptr->chp , creature_ptr->mhp), TERM_RED); /* Dump mana power */ - if (p_ptr->csp >= p_ptr->msp) - display_player_one_line(ENTRY_SP, format("%4d/%4d", p_ptr->csp , p_ptr->msp), TERM_L_GREEN); - else if (p_ptr->csp > (p_ptr->msp * mana_warn) / 10) - display_player_one_line(ENTRY_SP, format("%4d/%4d", p_ptr->csp , p_ptr->msp), TERM_YELLOW); + if (creature_ptr->csp >= creature_ptr->msp) + display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp , creature_ptr->msp), TERM_L_GREEN); + else if (creature_ptr->csp > (creature_ptr->msp * mana_warn) / 10) + display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp , creature_ptr->msp), TERM_YELLOW); else - display_player_one_line(ENTRY_SP, format("%4d/%4d", p_ptr->csp , p_ptr->msp), TERM_RED); + display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp , creature_ptr->msp), TERM_RED); /* Dump play time */ display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", current_world_ptr->play_time/(60*60), (current_world_ptr->play_time/60)%60, current_world_ptr->play_time%60), TERM_L_GREEN); @@ -2043,7 +2069,7 @@ static concptr likert(int x, int y) * @details * This code is "imitated" elsewhere to "dump" a character sheet. */ -static void display_player_various(void) +static void display_player_various(player_type *creature_ptr) { int tmp, damage[2], to_h[2], blows1, blows2, i, basedam; int xthn, xthb, xfos, xsrh; @@ -2057,18 +2083,18 @@ static void display_player_various(void) object_type *o_ptr; - if (p_ptr->muta2 & MUT2_HORNS) muta_att++; - if (p_ptr->muta2 & MUT2_SCOR_TAIL) muta_att++; - if (p_ptr->muta2 & MUT2_BEAK) muta_att++; - if (p_ptr->muta2 & MUT2_TRUNK) muta_att++; - if (p_ptr->muta2 & MUT2_TENTACLES) muta_att++; + if (creature_ptr->muta2 & MUT2_HORNS) muta_att++; + if (creature_ptr->muta2 & MUT2_SCOR_TAIL) muta_att++; + if (creature_ptr->muta2 & MUT2_BEAK) muta_att++; + if (creature_ptr->muta2 & MUT2_TRUNK) muta_att++; + if (creature_ptr->muta2 & MUT2_TENTACLES) muta_att++; - xthn = p_ptr->skill_thn + (p_ptr->to_h_m * BTH_PLUS_ADJ); + xthn = creature_ptr->skill_thn + (creature_ptr->to_h_m * BTH_PLUS_ADJ); /* Shooting Skill (with current bow and normal missile) */ - o_ptr = &p_ptr->inventory_list[INVEN_BOW]; - tmp = p_ptr->to_h_b + o_ptr->to_h; - xthb = p_ptr->skill_thb + (tmp * BTH_PLUS_ADJ); + o_ptr = &creature_ptr->inventory_list[INVEN_BOW]; + tmp = creature_ptr->to_h_b + o_ptr->to_h; + xthb = creature_ptr->skill_thb + (tmp * BTH_PLUS_ADJ); /* If the player is wielding one? */ if (o_ptr->k_idx) @@ -2076,23 +2102,23 @@ static void display_player_various(void) ENERGY energy_fire = bow_energy(o_ptr->sval); /* Calculate shots per round */ - shots = p_ptr->num_fire * 100; + shots = creature_ptr->num_fire * 100; shot_frac = (shots * 100 / energy_fire) % 100; shots = shots / energy_fire; if (o_ptr->name1 == ART_CRIMSON) { shots = 1; shot_frac = 0; - if (p_ptr->pclass == CLASS_ARCHER) + if (creature_ptr->pclass == CLASS_ARCHER) { /* Extra shot at level 10 */ - if (p_ptr->lev >= 10) shots++; + if (creature_ptr->lev >= 10) shots++; /* Extra shot at level 30 */ - if (p_ptr->lev >= 30) shots++; + if (creature_ptr->lev >= 30) shots++; /* Extra shot at level 45 */ - if (p_ptr->lev >= 45) shots++; + if (creature_ptr->lev >= 45) shots++; } } } @@ -2104,26 +2130,26 @@ static void display_player_various(void) for(i = 0; i < 2; i++) { - damage[i] = p_ptr->dis_to_d[i] * 100; - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) + damage[i] = creature_ptr->dis_to_d[i] * 100; + if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM)) { - PLAYER_LEVEL level = p_ptr->lev; + PLAYER_LEVEL level = creature_ptr->lev; if (i) { damage[i] = 0; break; } - if (p_ptr->pclass == CLASS_FORCETRAINER) level = MAX(1, level - 3); - if (p_ptr->special_defense & KAMAE_BYAKKO) + if (creature_ptr->pclass == CLASS_FORCETRAINER) level = MAX(1, level - 3); + if (creature_ptr->special_defense & KAMAE_BYAKKO) basedam = monk_ave_damage[level][1]; - else if (p_ptr->special_defense & (KAMAE_GENBU | KAMAE_SUZAKU)) + else if (creature_ptr->special_defense & (KAMAE_GENBU | KAMAE_SUZAKU)) basedam = monk_ave_damage[level][2]; else basedam = monk_ave_damage[level][0]; } else { - o_ptr = &p_ptr->inventory_list[INVEN_RARM + i]; + o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i]; /* Average damage per round */ if (o_ptr->k_idx) @@ -2137,10 +2163,10 @@ static void display_player_various(void) 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; + basedam = ((o_ptr->dd + creature_ptr->to_dd[i]) * (o_ptr->ds + creature_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); + basedam = calc_expect_crit(o_ptr->weight, to_h[i], basedam, creature_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 */ @@ -2153,7 +2179,7 @@ static void display_player_various(void) basedam *= 11; basedam /= 9; } - if ((p_ptr->pclass != CLASS_SAMURAI) && have_flag(flgs, TR_FORCE_WEAPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5))) + if ((creature_ptr->pclass != CLASS_SAMURAI) && have_flag(flgs, TR_FORCE_WEAPON) && (creature_ptr->csp > (o_ptr->dd * o_ptr->ds / 5))) basedam = basedam * 7 / 2; } else basedam = 0; @@ -2162,18 +2188,18 @@ static void display_player_various(void) if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) damage[i] = 1; if (damage[i] < 0) damage[i] = 0; } - blows1 = p_ptr->migite ? p_ptr->num_blow[0]: 0; - blows2 = p_ptr->hidarite ? p_ptr->num_blow[1] : 0; + blows1 = creature_ptr->migite ? creature_ptr->num_blow[0]: 0; + blows2 = creature_ptr->hidarite ? creature_ptr->num_blow[1] : 0; /* Basic abilities */ - xdis = p_ptr->skill_dis; - xdev = p_ptr->skill_dev; - xsav = p_ptr->skill_sav; - xstl = p_ptr->skill_stl; - xsrh = p_ptr->skill_srh; - xfos = p_ptr->skill_fos; - xdig = p_ptr->skill_dig; + xdis = creature_ptr->skill_dis; + xdev = creature_ptr->skill_dev; + xsav = creature_ptr->skill_sav; + xstl = creature_ptr->skill_stl; + xsrh = creature_ptr->skill_srh; + xfos = creature_ptr->skill_fos; + xdig = creature_ptr->skill_dig; desc = likert(xthn, 12); @@ -2222,7 +2248,7 @@ static void display_player_various(void) display_player_one_line(ENTRY_AVG_DMG, desc, TERM_L_BLUE); - display_player_one_line(ENTRY_INFRA, format("%d feet", p_ptr->see_infra * 10), TERM_WHITE); + display_player_one_line(ENTRY_INFRA, format("%d feet", creature_ptr->see_infra * 10), TERM_WHITE); } @@ -2230,6 +2256,7 @@ static void display_player_various(void) /*! * @brief プレイヤーの職業、種族に応じた耐性フラグを返す * Prints ratings on certain abilities + * @param creature_ptr 参照元クリーチャーポインタ * @param flgs フラグを保管する配列 * @return なし * @details @@ -2237,66 +2264,64 @@ static void display_player_various(void) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; /* Classes */ - switch (p_ptr->pclass) + switch (creature_ptr->pclass) { case CLASS_WARRIOR: - if (p_ptr->lev > 44) + if (creature_ptr->lev > 44) add_flag(flgs, TR_REGEN); case CLASS_SAMURAI: - if (p_ptr->lev > 29) + if (creature_ptr->lev > 29) add_flag(flgs, TR_RES_FEAR); break; case CLASS_PALADIN: - if (p_ptr->lev > 39) + if (creature_ptr->lev > 39) add_flag(flgs, TR_RES_FEAR); break; case CLASS_CHAOS_WARRIOR: - if (p_ptr->lev > 29) + if (creature_ptr->lev > 29) add_flag(flgs, TR_RES_CHAOS); - if (p_ptr->lev > 39) + if (creature_ptr->lev > 39) add_flag(flgs, TR_RES_FEAR); break; case CLASS_MONK: case CLASS_FORCETRAINER: - if ((p_ptr->lev > 9) && !heavy_armor()) + if ((creature_ptr->lev > 9) && !heavy_armor(creature_ptr)) add_flag(flgs, TR_SPEED); - if ((p_ptr->lev>24) && !heavy_armor()) + if ((creature_ptr->lev>24) && !heavy_armor(creature_ptr)) add_flag(flgs, TR_FREE_ACT); break; case CLASS_NINJA: - if (heavy_armor()) + if (heavy_armor(creature_ptr)) add_flag(flgs, TR_SPEED); else { - if ((!p_ptr->inventory_list[INVEN_RARM].k_idx || p_ptr->migite) && - (!p_ptr->inventory_list[INVEN_LARM].k_idx || p_ptr->hidarite)) + if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->migite) && + (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->hidarite)) add_flag(flgs, TR_SPEED); - if (p_ptr->lev>24) + if (creature_ptr->lev>24) add_flag(flgs, TR_FREE_ACT); } add_flag(flgs, TR_SLOW_DIGEST); add_flag(flgs, TR_RES_FEAR); - if (p_ptr->lev > 19) add_flag(flgs, TR_RES_POIS); - if (p_ptr->lev > 24) add_flag(flgs, TR_SUST_DEX); - if (p_ptr->lev > 29) add_flag(flgs, TR_SEE_INVIS); + if (creature_ptr->lev > 19) add_flag(flgs, TR_RES_POIS); + if (creature_ptr->lev > 24) add_flag(flgs, TR_SUST_DEX); + if (creature_ptr->lev > 29) add_flag(flgs, TR_SEE_INVIS); break; case CLASS_MINDCRAFTER: - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_RES_FEAR); - if (p_ptr->lev > 19) + if (creature_ptr->lev > 19) add_flag(flgs, TR_SUST_WIS); - if (p_ptr->lev > 29) + if (creature_ptr->lev > 29) add_flag(flgs, TR_RES_CONF); - if (p_ptr->lev > 39) + if (creature_ptr->lev > 39) add_flag(flgs, TR_TELEPATHY); break; case CLASS_BARD: @@ -2309,19 +2334,19 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_REGEN); add_flag(flgs, TR_FREE_ACT); add_flag(flgs, TR_SPEED); - if (p_ptr->lev > 39) add_flag(flgs, TR_REFLECT); + if (creature_ptr->lev > 39) add_flag(flgs, TR_REFLECT); break; case CLASS_MIRROR_MASTER: - if(p_ptr->lev > 39)add_flag(flgs, TR_REFLECT); + if(creature_ptr->lev > 39)add_flag(flgs, TR_REFLECT); break; default: break; /* Do nothing */ } /* Races */ - if (p_ptr->mimic_form) + if (creature_ptr->mimic_form) { - switch(p_ptr->mimic_form) + switch(creature_ptr->mimic_form) { case MIMIC_DEMON: add_flag(flgs, TR_HOLD_EXP); @@ -2355,7 +2380,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_HOLD_EXP); add_flag(flgs, TR_RES_DARK); add_flag(flgs, TR_RES_NETHER); - if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); + if (creature_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); add_flag(flgs, TR_RES_POIS); add_flag(flgs, TR_RES_COLD); add_flag(flgs, TR_SEE_INVIS); @@ -2365,7 +2390,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) } else { - switch (p_ptr->prace) + switch (creature_ptr->prace) { case RACE_ELF: add_flag(flgs, TR_RES_LITE); @@ -2384,10 +2409,10 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) break; case RACE_HALF_TROLL: add_flag(flgs, TR_SUST_STR); - if (p_ptr->lev > 14) + if (creature_ptr->lev > 14) { add_flag(flgs, TR_REGEN); - if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER)) + if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_BERSERKER)) { add_flag(flgs, TR_SLOW_DIGEST); /* @@ -2427,13 +2452,13 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) break; case RACE_YEEK: add_flag(flgs, TR_RES_ACID); - if (p_ptr->lev > 19) + if (creature_ptr->lev > 19) add_flag(flgs, TR_IM_ACID); break; case RACE_KLACKON: add_flag(flgs, TR_RES_CONF); add_flag(flgs, TR_RES_ACID); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_SPEED); break; case RACE_KOBOLD: @@ -2445,33 +2470,33 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) break; case RACE_DARK_ELF: add_flag(flgs, TR_RES_DARK); - if (p_ptr->lev > 19) + if (creature_ptr->lev > 19) add_flag(flgs, TR_SEE_INVIS); break; case RACE_DRACONIAN: add_flag(flgs, TR_LEVITATION); - if (p_ptr->lev > 4) + if (creature_ptr->lev > 4) add_flag(flgs, TR_RES_FIRE); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_RES_COLD); - if (p_ptr->lev > 14) + if (creature_ptr->lev > 14) add_flag(flgs, TR_RES_ACID); - if (p_ptr->lev > 19) + if (creature_ptr->lev > 19) add_flag(flgs, TR_RES_ELEC); - if (p_ptr->lev > 34) + if (creature_ptr->lev > 34) add_flag(flgs, TR_RES_POIS); break; case RACE_MIND_FLAYER: add_flag(flgs, TR_SUST_INT); add_flag(flgs, TR_SUST_WIS); - if (p_ptr->lev > 14) + if (creature_ptr->lev > 14) add_flag(flgs, TR_SEE_INVIS); - if (p_ptr->lev > 29) + if (creature_ptr->lev > 29) add_flag(flgs, TR_TELEPATHY); break; case RACE_IMP: add_flag(flgs, TR_RES_FIRE); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_SEE_INVIS); break; case RACE_GOLEM: @@ -2479,7 +2504,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_FREE_ACT); add_flag(flgs, TR_RES_POIS); add_flag(flgs, TR_SLOW_DIGEST); - if (p_ptr->lev > 34) + if (creature_ptr->lev > 34) add_flag(flgs, TR_HOLD_EXP); break; case RACE_SKELETON: @@ -2487,7 +2512,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_RES_SHARDS); add_flag(flgs, TR_HOLD_EXP); add_flag(flgs, TR_RES_POIS); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_RES_COLD); break; case RACE_ZOMBIE: @@ -2496,14 +2521,14 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_RES_NETHER); add_flag(flgs, TR_RES_POIS); add_flag(flgs, TR_SLOW_DIGEST); - if (p_ptr->lev > 4) + if (creature_ptr->lev > 4) add_flag(flgs, TR_RES_COLD); break; case RACE_VAMPIRE: add_flag(flgs, TR_HOLD_EXP); add_flag(flgs, TR_RES_DARK); add_flag(flgs, TR_RES_NETHER); - if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); + if (creature_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); add_flag(flgs, TR_RES_POIS); add_flag(flgs, TR_RES_COLD); break; @@ -2517,13 +2542,13 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_RES_POIS); add_flag(flgs, TR_SLOW_DIGEST); /* XXX pass_wall */ - if (p_ptr->lev > 34) + if (creature_ptr->lev > 34) add_flag(flgs, TR_TELEPATHY); break; case RACE_SPRITE: add_flag(flgs, TR_RES_LITE); add_flag(flgs, TR_LEVITATION); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_SPEED); break; case RACE_BEASTMAN: @@ -2538,7 +2563,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_RES_FIRE); add_flag(flgs, TR_RES_NETHER); add_flag(flgs, TR_HOLD_EXP); - if (p_ptr->lev > 9) + if (creature_ptr->lev > 9) add_flag(flgs, TR_SEE_INVIS); break; case RACE_DUNADAN: @@ -2562,77 +2587,77 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) } /* Mutations */ - if (p_ptr->muta3) + if (creature_ptr->muta3) { - if (p_ptr->muta3 & MUT3_FLESH_ROT) + if (creature_ptr->muta3 & MUT3_FLESH_ROT) { remove_flag(flgs, TR_REGEN); } - if ((p_ptr->muta3 & MUT3_XTRA_FAT) || - (p_ptr->muta3 & MUT3_XTRA_LEGS) || - (p_ptr->muta3 & MUT3_SHORT_LEG)) + if ((creature_ptr->muta3 & MUT3_XTRA_FAT) || + (creature_ptr->muta3 & MUT3_XTRA_LEGS) || + (creature_ptr->muta3 & MUT3_SHORT_LEG)) { add_flag(flgs, TR_SPEED); } - if (p_ptr->muta3 & MUT3_ELEC_TOUC) + if (creature_ptr->muta3 & MUT3_ELEC_TOUC) { add_flag(flgs, TR_SH_ELEC); } - if (p_ptr->muta3 & MUT3_FIRE_BODY) + if (creature_ptr->muta3 & MUT3_FIRE_BODY) { add_flag(flgs, TR_SH_FIRE); add_flag(flgs, TR_LITE_1); } - if (p_ptr->muta3 & MUT3_WINGS) + if (creature_ptr->muta3 & MUT3_WINGS) { add_flag(flgs, TR_LEVITATION); } - if (p_ptr->muta3 & MUT3_FEARLESS) + if (creature_ptr->muta3 & MUT3_FEARLESS) { add_flag(flgs, TR_RES_FEAR); } - if (p_ptr->muta3 & MUT3_REGEN) + if (creature_ptr->muta3 & MUT3_REGEN) { add_flag(flgs, TR_REGEN); } - if (p_ptr->muta3 & MUT3_ESP) + if (creature_ptr->muta3 & MUT3_ESP) { add_flag(flgs, TR_TELEPATHY); } - if (p_ptr->muta3 & MUT3_MOTION) + if (creature_ptr->muta3 & MUT3_MOTION) { add_flag(flgs, TR_FREE_ACT); } } - if (p_ptr->pseikaku == SEIKAKU_SEXY) + if (creature_ptr->pseikaku == SEIKAKU_SEXY) add_flag(flgs, TR_AGGRAVATE); - if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) + if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) add_flag(flgs, TR_RES_CONF); - if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) + if (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN) { add_flag(flgs, TR_RES_BLIND); add_flag(flgs, TR_RES_CONF); add_flag(flgs, TR_HOLD_EXP); - if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); - if (p_ptr->lev > 9) + if (creature_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1); + if (creature_ptr->lev > 9) add_flag(flgs, TR_SPEED); } - if (p_ptr->special_defense & KATA_FUUJIN) + if (creature_ptr->special_defense & KATA_FUUJIN) add_flag(flgs, TR_REFLECT); - if (p_ptr->special_defense & KAMAE_GENBU) + if (creature_ptr->special_defense & KAMAE_GENBU) add_flag(flgs, TR_REFLECT); - if (p_ptr->special_defense & KAMAE_SUZAKU) + if (creature_ptr->special_defense & KAMAE_SUZAKU) add_flag(flgs, TR_LEVITATION); - if (p_ptr->special_defense & KAMAE_SEIRYU) + if (creature_ptr->special_defense & KAMAE_SEIRYU) { add_flag(flgs, TR_RES_FIRE); add_flag(flgs, TR_RES_COLD); @@ -2644,7 +2669,7 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_SH_ELEC); add_flag(flgs, TR_SH_COLD); } - if (p_ptr->special_defense & KATA_MUSOU) + if (creature_ptr->special_defense & KATA_MUSOU) { add_flag(flgs, TR_RES_FEAR); add_flag(flgs, TR_RES_LITE); @@ -2686,61 +2711,59 @@ static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void tim_player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; - if (IS_HERO() || p_ptr->shero) + if (IS_HERO(creature_ptr) || creature_ptr->shero) add_flag(flgs, TR_RES_FEAR); - if (p_ptr->tim_invis) + if (creature_ptr->tim_invis) add_flag(flgs, TR_SEE_INVIS); - if (p_ptr->tim_regen) + if (creature_ptr->tim_regen) add_flag(flgs, TR_REGEN); if (IS_TIM_ESP()) add_flag(flgs, TR_TELEPATHY); - if (IS_FAST() || p_ptr->slow) + if (IS_FAST(creature_ptr) || creature_ptr->slow) add_flag(flgs, TR_SPEED); - if (IS_OPPOSE_ACID() && !(p_ptr->special_defense & DEFENSE_ACID) && !(prace_is_(RACE_YEEK) && (p_ptr->lev > 19))) + if (IS_OPPOSE_ACID() && !(creature_ptr->special_defense & DEFENSE_ACID) && !(PRACE_IS_(creature_ptr, RACE_YEEK) && (creature_ptr->lev > 19))) add_flag(flgs, TR_RES_ACID); - if (IS_OPPOSE_ELEC() && !(p_ptr->special_defense & DEFENSE_ELEC)) + if (IS_OPPOSE_ELEC() && !(creature_ptr->special_defense & DEFENSE_ELEC)) add_flag(flgs, TR_RES_ELEC); - if (IS_OPPOSE_FIRE() && !(p_ptr->special_defense & DEFENSE_FIRE)) + if (IS_OPPOSE_FIRE() && !(creature_ptr->special_defense & DEFENSE_FIRE)) add_flag(flgs, TR_RES_FIRE); - if (IS_OPPOSE_COLD() && !(p_ptr->special_defense & DEFENSE_COLD)) + if (IS_OPPOSE_COLD() && !(creature_ptr->special_defense & DEFENSE_COLD)) add_flag(flgs, TR_RES_COLD); if (IS_OPPOSE_POIS()) add_flag(flgs, TR_RES_POIS); - if (p_ptr->special_attack & ATTACK_ACID) + if (creature_ptr->special_attack & ATTACK_ACID) add_flag(flgs, TR_BRAND_ACID); - if (p_ptr->special_attack & ATTACK_ELEC) + if (creature_ptr->special_attack & ATTACK_ELEC) add_flag(flgs, TR_BRAND_ELEC); - if (p_ptr->special_attack & ATTACK_FIRE) + if (creature_ptr->special_attack & ATTACK_FIRE) add_flag(flgs, TR_BRAND_FIRE); - if (p_ptr->special_attack & ATTACK_COLD) + if (creature_ptr->special_attack & ATTACK_COLD) add_flag(flgs, TR_BRAND_COLD); - if (p_ptr->special_attack & ATTACK_POIS) + if (creature_ptr->special_attack & ATTACK_POIS) add_flag(flgs, TR_BRAND_POIS); - if (p_ptr->special_defense & DEFENSE_ACID) + if (creature_ptr->special_defense & DEFENSE_ACID) add_flag(flgs, TR_IM_ACID); - if (p_ptr->special_defense & DEFENSE_ELEC) + if (creature_ptr->special_defense & DEFENSE_ELEC) add_flag(flgs, TR_IM_ELEC); - if (p_ptr->special_defense & DEFENSE_FIRE) + if (creature_ptr->special_defense & DEFENSE_FIRE) add_flag(flgs, TR_IM_FIRE); - if (p_ptr->special_defense & DEFENSE_COLD) + if (creature_ptr->special_defense & DEFENSE_COLD) add_flag(flgs, TR_IM_COLD); - if (p_ptr->wraith_form) + if (creature_ptr->wraith_form) add_flag(flgs, TR_REFLECT); /* by henkma */ - if (p_ptr->tim_reflect) + if (creature_ptr->tim_reflect) add_flag(flgs, TR_REFLECT); - if (p_ptr->magicdef) + if (creature_ptr->magicdef) { add_flag(flgs, TR_RES_BLIND); add_flag(flgs, TR_RES_CONF); @@ -2748,15 +2771,15 @@ static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) add_flag(flgs, TR_FREE_ACT); add_flag(flgs, TR_LEVITATION); } - if (p_ptr->tim_res_nether) + if (creature_ptr->tim_res_nether) { add_flag(flgs, TR_RES_NETHER); } - if (p_ptr->tim_sh_fire) + if (creature_ptr->tim_sh_fire) { add_flag(flgs, TR_SH_FIRE); } - if (p_ptr->ult_res) + if (creature_ptr->ult_res) { add_flag(flgs, TR_RES_FEAR); add_flag(flgs, TR_RES_LITE); @@ -2790,7 +2813,7 @@ static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) } /* Hex bonuses */ - if (p_ptr->realm1 == REALM_HEX) + if (creature_ptr->realm1 == REALM_HEX) { if (hex_spelling(HEX_DEMON_AURA)) { @@ -2859,11 +2882,9 @@ void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void known_obj_immunity(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; @@ -2875,7 +2896,7 @@ static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) object_type *o_ptr; /* Object */ - o_ptr = &p_ptr->inventory_list[i]; + o_ptr = &creature_ptr->inventory_list[i]; if (!o_ptr->k_idx) continue; @@ -2896,21 +2917,19 @@ static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void player_immunity(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; - if (prace_is_(RACE_SPECTRE)) + if (PRACE_IS_(creature_ptr, RACE_SPECTRE)) add_flag(flgs, TR_RES_NETHER); - if (p_ptr->mimic_form == MIMIC_VAMPIRE || prace_is_(RACE_VAMPIRE)) + if (creature_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(creature_ptr, RACE_VAMPIRE)) add_flag(flgs, TR_RES_DARK); - if (p_ptr->mimic_form == MIMIC_DEMON_LORD) + if (creature_ptr->mimic_form == MIMIC_DEMON_LORD) add_flag(flgs, TR_RES_FIRE); - else if (prace_is_(RACE_YEEK) && p_ptr->lev > 19) + else if (PRACE_IS_(creature_ptr, RACE_YEEK) && creature_ptr->lev > 19) add_flag(flgs, TR_RES_ACID); } @@ -2921,23 +2940,21 @@ static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void tim_player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void tim_player_immunity(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; - if (p_ptr->special_defense & DEFENSE_ACID) + if (creature_ptr->special_defense & DEFENSE_ACID) add_flag(flgs, TR_RES_ACID); - if (p_ptr->special_defense & DEFENSE_ELEC) + if (creature_ptr->special_defense & DEFENSE_ELEC) add_flag(flgs, TR_RES_ELEC); - if (p_ptr->special_defense & DEFENSE_FIRE) + if (creature_ptr->special_defense & DEFENSE_FIRE) add_flag(flgs, TR_RES_FIRE); - if (p_ptr->special_defense & DEFENSE_COLD) + if (creature_ptr->special_defense & DEFENSE_COLD) add_flag(flgs, TR_RES_COLD); - if (p_ptr->wraith_form) + if (creature_ptr->wraith_form) add_flag(flgs, TR_RES_DARK); } @@ -2948,27 +2965,25 @@ static void tim_player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE]) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -static void player_vuln_flags(BIT_FLAGS flgs[TR_FLAG_SIZE]) +static void player_vuln_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]) { int i; - - /* Clear */ for (i = 0; i < TR_FLAG_SIZE; i++) flgs[i] = 0L; - if ((p_ptr->muta3 & MUT3_VULN_ELEM) || (p_ptr->special_defense & KATA_KOUKIJIN)) + if ((creature_ptr->muta3 & MUT3_VULN_ELEM) || (creature_ptr->special_defense & KATA_KOUKIJIN)) { add_flag(flgs, TR_RES_ACID); add_flag(flgs, TR_RES_ELEC); add_flag(flgs, TR_RES_FIRE); add_flag(flgs, TR_RES_COLD); } - if (prace_is_(RACE_ANDROID)) + if (PRACE_IS_(creature_ptr, RACE_ANDROID)) add_flag(flgs, TR_RES_ELEC); - if (prace_is_(RACE_ENT)) + if (PRACE_IS_(creature_ptr, RACE_ENT)) add_flag(flgs, TR_RES_FIRE); - if (prace_is_(RACE_VAMPIRE) || prace_is_(RACE_S_FAIRY) || - (p_ptr->mimic_form == MIMIC_VAMPIRE)) + if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || PRACE_IS_(creature_ptr, RACE_S_FAIRY) || + (creature_ptr->mimic_form == MIMIC_VAMPIRE)) add_flag(flgs, TR_RES_LITE); } @@ -3056,12 +3071,12 @@ static void display_flag_aux(TERM_LEN row, TERM_LEN col, concptr header, } else if (flag1 == TR_LITE_1) { - if (have_dark_flag(flgs)) + if (HAVE_DARK_FLAG(flgs)) { c_put_str(TERM_L_DARK, "+", row, col); header_color = TERM_WHITE; } - else if (have_lite_flag(flgs)) + else if (HAVE_LITE_FLAG(flgs)) { c_put_str(TERM_WHITE, "+", row, col); header_color = TERM_WHITE; @@ -3134,7 +3149,7 @@ static void display_flag_aux(TERM_LEN row, TERM_LEN col, concptr header, * Special display, part 1 * @return なし */ -static void display_player_flag_info(void) +static void display_player_flag_info(player_type *creature_ptr) { TERM_LEN row; TERM_LEN col; @@ -3142,12 +3157,12 @@ static void display_player_flag_info(void) all_player_flags f; /* Extract flags and store */ - player_flags(f.player_flags); - tim_player_flags(f.tim_player_flags); - player_immunity(f.player_imm); - tim_player_immunity(f.tim_player_imm); - known_obj_immunity(f.known_obj_imm); - player_vuln_flags(f.player_vuln); + player_flags(creature_ptr, f.player_flags); + tim_player_flags(creature_ptr, f.tim_player_flags); + player_immunity(creature_ptr, f.player_imm); + tim_player_immunity(creature_ptr, f.tim_player_imm); + known_obj_immunity(creature_ptr, f.known_obj_imm); + player_vuln_flags(creature_ptr, f.player_vuln); /*** Set 1 ***/ @@ -3248,7 +3263,7 @@ static void display_player_flag_info(void) display_flag_aux(row+0, col, "Speed :", TR_SPEED, &f, 0); display_flag_aux(row+1, col, "FreeAction:", TR_FREE_ACT, &f, 0); display_flag_aux(row+2, col, "SeeInvisi.:", TR_SEE_INVIS, &f, 0); - display_flag_aux(row+3, col, "Hold Exp :", TR_HOLD_EXP, &f, 0); + display_flag_aux(row+3, col, "Hold Exp :", TR_HOLD_EXP, &f, 0); display_flag_aux(row+4, col, "Warning :", TR_WARNING, &f, 0); display_flag_aux(row+5, col, "SlowDigest:", TR_SLOW_DIGEST, &f, 0); display_flag_aux(row+6, col, "Regene. :", TR_REGEN, &f, 0); @@ -3265,7 +3280,7 @@ static void display_player_flag_info(void) * Special display, part 2 * @return なし */ -static void display_player_other_flag_info(void) +static void display_player_other_flag_info(player_type *creature_ptr) { TERM_LEN row; TERM_LEN col; @@ -3273,12 +3288,12 @@ static void display_player_other_flag_info(void) all_player_flags f; /* Extract flags and store */ - player_flags(f.player_flags); - tim_player_flags(f.tim_player_flags); - player_immunity(f.player_imm); - tim_player_immunity(f.tim_player_imm); - known_obj_immunity(f.known_obj_imm); - player_vuln_flags(f.player_vuln); + player_flags(creature_ptr, f.player_flags); + tim_player_flags(creature_ptr, f.tim_player_flags); + player_immunity(creature_ptr, f.player_imm); + tim_player_immunity(creature_ptr, f.tim_player_imm); + known_obj_immunity(creature_ptr, f.known_obj_imm); + player_vuln_flags(creature_ptr, f.player_vuln); /*** Set 1 ***/ @@ -3458,7 +3473,7 @@ static void display_player_other_flag_info(void) * Special display, part 2a * @return なし */ -static void display_player_misc_info(void) +static void display_player_misc_info(player_type *creature_ptr) { char buf[80]; char tmp[80]; @@ -3483,11 +3498,11 @@ put_str("職業 :", 5, 1); #else strcat(tmp," "); #endif - strcat(tmp,p_ptr->name); + strcat(tmp,creature_ptr->name); c_put_str(TERM_L_BLUE, tmp, 1, 34); c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9); - c_put_str(TERM_L_BLUE, (p_ptr->mimic_form ? mimic_info[p_ptr->mimic_form].title : rp_ptr->title), 4, 9); + c_put_str(TERM_L_BLUE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), 4, 9); c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 9); /* Display extras */ @@ -3502,11 +3517,11 @@ put_str("ï¼­ï¼° :", 8, 1); #endif - (void)sprintf(buf, "%d", (int)p_ptr->lev); + (void)sprintf(buf, "%d", (int)creature_ptr->lev); c_put_str(TERM_L_BLUE, buf, 6, 9); - (void)sprintf(buf, "%d/%d", (int)p_ptr->chp, (int)p_ptr->mhp); + (void)sprintf(buf, "%d/%d", (int)creature_ptr->chp, (int)creature_ptr->mhp); c_put_str(TERM_L_BLUE, buf, 7, 9); - (void)sprintf(buf, "%d/%d", (int)p_ptr->csp, (int)p_ptr->msp); + (void)sprintf(buf, "%d/%d", (int)creature_ptr->csp, (int)creature_ptr->msp); c_put_str(TERM_L_BLUE, buf, 8, 9); } @@ -3526,7 +3541,7 @@ put_str("ï¼­ï¼° :", 8, 1); * No mod, no sustain, will be a slate '.' * */ -static void display_player_stat_info(void) +static void display_player_stat_info(player_type *creature_ptr) { int i, e_adj; int stat_col, stat; @@ -3559,37 +3574,37 @@ static void display_player_stat_info(void) { int r_adj; - if (p_ptr->mimic_form) r_adj = mimic_info[p_ptr->mimic_form].r_adj[i]; + if (creature_ptr->mimic_form) r_adj = mimic_info[creature_ptr->mimic_form].r_adj[i]; else r_adj = rp_ptr->r_adj[i]; /* Calculate equipment adjustment */ e_adj = 0; /* Icky formula to deal with the 18 barrier */ - if ((p_ptr->stat_max[i] > 18) && (p_ptr->stat_top[i] > 18)) - e_adj = (p_ptr->stat_top[i] - p_ptr->stat_max[i]) / 10; - if ((p_ptr->stat_max[i] <= 18) && (p_ptr->stat_top[i] <= 18)) - e_adj = p_ptr->stat_top[i] - p_ptr->stat_max[i]; - if ((p_ptr->stat_max[i] <= 18) && (p_ptr->stat_top[i] > 18)) - e_adj = (p_ptr->stat_top[i] - 18) / 10 - p_ptr->stat_max[i] + 18; + if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] > 18)) + e_adj = (creature_ptr->stat_top[i] - creature_ptr->stat_max[i]) / 10; + if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] <= 18)) + e_adj = creature_ptr->stat_top[i] - creature_ptr->stat_max[i]; + if ((creature_ptr->stat_max[i] <= 18) && (creature_ptr->stat_top[i] > 18)) + e_adj = (creature_ptr->stat_top[i] - 18) / 10 - creature_ptr->stat_max[i] + 18; - if ((p_ptr->stat_max[i] > 18) && (p_ptr->stat_top[i] <= 18)) - e_adj = p_ptr->stat_top[i] - (p_ptr->stat_max[i] - 19) / 10 - 19; + if ((creature_ptr->stat_max[i] > 18) && (creature_ptr->stat_top[i] <= 18)) + e_adj = creature_ptr->stat_top[i] - (creature_ptr->stat_max[i] - 19) / 10 - 19; - if (prace_is_(RACE_ENT)) + if (PRACE_IS_(creature_ptr, RACE_ENT)) { switch (i) { case A_STR: case A_CON: - if (p_ptr->lev > 25) r_adj++; - if (p_ptr->lev > 40) r_adj++; - if (p_ptr->lev > 45) r_adj++; + if (creature_ptr->lev > 25) r_adj++; + if (creature_ptr->lev > 40) r_adj++; + if (creature_ptr->lev > 45) r_adj++; break; case A_DEX: - if (p_ptr->lev > 25) r_adj--; - if (p_ptr->lev > 40) r_adj--; - if (p_ptr->lev > 45) r_adj--; + if (creature_ptr->lev > 25) r_adj--; + if (creature_ptr->lev > 40) r_adj--; + if (creature_ptr->lev > 45) r_adj--; break; } } @@ -3598,7 +3613,7 @@ static void display_player_stat_info(void) e_adj -= cp_ptr->c_adj[i]; e_adj -= ap_ptr->a_adj[i]; - if (p_ptr->stat_cur[i] < p_ptr->stat_max[i]) + if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i]) /* Reduced name of stat */ c_put_str(TERM_WHITE, stat_names_reduced[i], row + i+1, stat_col+1); else @@ -3607,8 +3622,8 @@ static void display_player_stat_info(void) /* Internal "natural" max value. Maxes at 18/100 */ /* This is useful to see if you are maxed out */ - cnv_stat(p_ptr->stat_max[i], buf); - if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i]) + cnv_stat(creature_ptr->stat_max[i], buf); + if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i]) { c_put_str(TERM_WHITE, "!", row + i+1, _(stat_col + 6, stat_col + 4)); } @@ -3625,13 +3640,13 @@ static void display_player_stat_info(void) c_put_str(TERM_L_BLUE, buf, row + i+1, stat_col + 22); /* Actual maximal modified value */ - cnv_stat(p_ptr->stat_top[i], buf); + cnv_stat(creature_ptr->stat_top[i], buf); c_put_str(TERM_L_GREEN, buf, row + i+1, stat_col + 26); /* Only display stat_use if not maximal */ - if (p_ptr->stat_use[i] < p_ptr->stat_top[i]) + if (creature_ptr->stat_use[i] < creature_ptr->stat_top[i]) { - cnv_stat(p_ptr->stat_use[i], buf); + cnv_stat(creature_ptr->stat_use[i], buf); c_put_str(TERM_YELLOW, buf, row + i+1, stat_col + 33); } } @@ -3646,7 +3661,7 @@ static void display_player_stat_info(void) /* Process equipment */ for (i = INVEN_RARM; i < INVEN_TOTAL; i++) { - o_ptr = &p_ptr->inventory_list[i]; + o_ptr = &creature_ptr->inventory_list[i]; /* Acquire "known" flags */ object_flags_known(o_ptr, flgs); @@ -3708,7 +3723,7 @@ static void display_player_stat_info(void) } /* Player flags */ - player_flags(flgs); + player_flags(p_ptr, flgs); /* Check stats */ for (stat = 0; stat < A_MAX; stat++) @@ -3718,43 +3733,43 @@ static void display_player_stat_info(void) c = '.'; /* Mutations ... */ - if (p_ptr->muta3 || p_ptr->tsuyoshi) + if (creature_ptr->muta3 || creature_ptr->tsuyoshi) { int dummy = 0; if (stat == A_STR) { - if (p_ptr->muta3 & MUT3_HYPER_STR) dummy += 4; - if (p_ptr->muta3 & MUT3_PUNY) dummy -= 4; - if (p_ptr->tsuyoshi) dummy += 4; + if (creature_ptr->muta3 & MUT3_HYPER_STR) dummy += 4; + if (creature_ptr->muta3 & MUT3_PUNY) dummy -= 4; + if (creature_ptr->tsuyoshi) dummy += 4; } else if (stat == A_WIS || stat == A_INT) { - if (p_ptr->muta3 & MUT3_HYPER_INT) dummy += 4; - if (p_ptr->muta3 & MUT3_MORONIC) dummy -= 4; + if (creature_ptr->muta3 & MUT3_HYPER_INT) dummy += 4; + if (creature_ptr->muta3 & MUT3_MORONIC) dummy -= 4; } else if (stat == A_DEX) { - if (p_ptr->muta3 & MUT3_IRON_SKIN) dummy -= 1; - if (p_ptr->muta3 & MUT3_LIMBER) dummy += 3; - if (p_ptr->muta3 & MUT3_ARTHRITIS) dummy -= 3; + if (creature_ptr->muta3 & MUT3_IRON_SKIN) dummy -= 1; + if (creature_ptr->muta3 & MUT3_LIMBER) dummy += 3; + if (creature_ptr->muta3 & MUT3_ARTHRITIS) dummy -= 3; } else if (stat == A_CON) { - if (p_ptr->muta3 & MUT3_RESILIENT) dummy += 4; - if (p_ptr->muta3 & MUT3_XTRA_FAT) dummy += 2; - if (p_ptr->muta3 & MUT3_ALBINO) dummy -= 4; - if (p_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 2; - if (p_ptr->tsuyoshi) dummy += 4; + if (creature_ptr->muta3 & MUT3_RESILIENT) dummy += 4; + if (creature_ptr->muta3 & MUT3_XTRA_FAT) dummy += 2; + if (creature_ptr->muta3 & MUT3_ALBINO) dummy -= 4; + if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 2; + if (creature_ptr->tsuyoshi) dummy += 4; } else if (stat == A_CHR) { - if (p_ptr->muta3 & MUT3_SILLY_VOI) dummy -= 4; - if (p_ptr->muta3 & MUT3_BLANK_FAC) dummy -= 1; - if (p_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 1; - if (p_ptr->muta3 & MUT3_SCALES) dummy -= 1; - if (p_ptr->muta3 & MUT3_WART_SKIN) dummy -= 2; - if (p_ptr->muta3 & MUT3_ILL_NORM) dummy = 0; + if (creature_ptr->muta3 & MUT3_SILLY_VOI) dummy -= 4; + if (creature_ptr->muta3 & MUT3_BLANK_FAC) dummy -= 1; + if (creature_ptr->muta3 & MUT3_FLESH_ROT) dummy -= 1; + if (creature_ptr->muta3 & MUT3_SCALES) dummy -= 1; + if (creature_ptr->muta3 & MUT3_WART_SKIN) dummy -= 2; + if (creature_ptr->muta3 & MUT3_ILL_NORM) dummy = 0; } /* Boost */ @@ -3816,13 +3831,13 @@ static void display_player_stat_info(void) * Mode 4 = mutations * */ -void display_player(int mode) +void display_player(player_type *creature_ptr, int mode) { int i; char buf[80]; char tmp[64]; - if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && display_mutations) + if ((creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) && display_mutations) mode = (mode % 5); else mode = (mode % 4); @@ -3835,49 +3850,49 @@ void display_player(int mode) { /* Name, Sex, Race, Class */ #ifdef JP - sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の":"", p_ptr->name); + sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の":"", creature_ptr->name); #else - sprintf(tmp, "%s %s", ap_ptr->title, p_ptr->name); + sprintf(tmp, "%s %s", ap_ptr->title, creature_ptr->name); #endif display_player_one_line(ENTRY_NAME, tmp, TERM_L_BLUE); display_player_one_line(ENTRY_SEX, sp_ptr->title, TERM_L_BLUE); - display_player_one_line(ENTRY_RACE, (p_ptr->mimic_form ? mimic_info[p_ptr->mimic_form].title : rp_ptr->title), TERM_L_BLUE); + display_player_one_line(ENTRY_RACE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), TERM_L_BLUE); display_player_one_line(ENTRY_CLASS, cp_ptr->title, TERM_L_BLUE); - if (p_ptr->realm1) + if (creature_ptr->realm1) { - if (p_ptr->realm2) - sprintf(tmp, "%s, %s", realm_names[p_ptr->realm1], realm_names[p_ptr->realm2]); + if (creature_ptr->realm2) + sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]); else - strcpy(tmp, realm_names[p_ptr->realm1]); + strcpy(tmp, realm_names[creature_ptr->realm1]); display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE); } - if ((p_ptr->pclass == CLASS_CHAOS_WARRIOR) || (p_ptr->muta2 & MUT2_CHAOS_GIFT)) - display_player_one_line(ENTRY_PATRON, chaos_patrons[p_ptr->chaos_patron], TERM_L_BLUE); + if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT)) + display_player_one_line(ENTRY_PATRON, chaos_patrons[creature_ptr->chaos_patron], TERM_L_BLUE); /* Age, Height, Weight, Social */ /* 身長はセンチメートルに、体重はキログラムに変更してあります */ #ifdef JP - display_player_one_line(ENTRY_AGE, format("%d才" ,(int)p_ptr->age), TERM_L_BLUE); - display_player_one_line(ENTRY_HEIGHT, format("%dcm" ,(int)((p_ptr->ht*254)/100)), TERM_L_BLUE); - display_player_one_line(ENTRY_WEIGHT, format("%dkg" ,(int)((p_ptr->wt*4536)/10000)), TERM_L_BLUE); - display_player_one_line(ENTRY_SOCIAL, format("%d " ,(int)p_ptr->sc), TERM_L_BLUE); + display_player_one_line(ENTRY_AGE, format("%d才" ,(int)creature_ptr->age), TERM_L_BLUE); + display_player_one_line(ENTRY_HEIGHT, format("%dcm" ,(int)((creature_ptr->ht*254)/100)), TERM_L_BLUE); + display_player_one_line(ENTRY_WEIGHT, format("%dkg" ,(int)((creature_ptr->wt*4536)/10000)), TERM_L_BLUE); + display_player_one_line(ENTRY_SOCIAL, format("%d " ,(int)creature_ptr->sc), TERM_L_BLUE); #else - display_player_one_line(ENTRY_AGE, format("%d" ,(int)p_ptr->age), TERM_L_BLUE); - display_player_one_line(ENTRY_HEIGHT, format("%d" ,(int)p_ptr->ht), TERM_L_BLUE); - display_player_one_line(ENTRY_WEIGHT, format("%d" ,(int)p_ptr->wt), TERM_L_BLUE); - display_player_one_line(ENTRY_SOCIAL, format("%d" ,(int)p_ptr->sc), TERM_L_BLUE); + display_player_one_line(ENTRY_AGE, format("%d" ,(int)creature_ptr->age), TERM_L_BLUE); + display_player_one_line(ENTRY_HEIGHT, format("%d" ,(int)creature_ptr->ht), TERM_L_BLUE); + display_player_one_line(ENTRY_WEIGHT, format("%d" ,(int)creature_ptr->wt), TERM_L_BLUE); + display_player_one_line(ENTRY_SOCIAL, format("%d" ,(int)creature_ptr->sc), TERM_L_BLUE); #endif - display_player_one_line(ENTRY_ALIGN, format("%s" ,your_alignment()), TERM_L_BLUE); + display_player_one_line(ENTRY_ALIGN, format("%s" ,your_alignment(creature_ptr)), TERM_L_BLUE); /* Display the stats */ for (i = 0; i < A_MAX; i++) { /* Special treatment of "injured" stats */ - if (p_ptr->stat_cur[i] < p_ptr->stat_max[i]) + if (creature_ptr->stat_cur[i] < creature_ptr->stat_max[i]) { int value; @@ -3885,7 +3900,7 @@ void display_player(int mode) put_str(stat_names_reduced[i], 3 + i, 53); /* Get the current stat */ - value = p_ptr->stat_use[i]; + value = creature_ptr->stat_use[i]; /* Obtain the current stat (modified) */ cnv_stat(value, buf); @@ -3894,7 +3909,7 @@ void display_player(int mode) c_put_str(TERM_YELLOW, buf, 3 + i, 60); /* Acquire the max stat */ - value = p_ptr->stat_top[i]; + value = creature_ptr->stat_top[i]; /* Obtain the maximum stat (modified) */ cnv_stat(value, buf); @@ -3910,13 +3925,13 @@ void display_player(int mode) put_str(stat_names[i], 3 + i, 53); /* Obtain the current stat (modified) */ - cnv_stat(p_ptr->stat_use[i], buf); + cnv_stat(creature_ptr->stat_use[i], buf); /* Display the current stat (modified) */ c_put_str(TERM_L_GREEN, buf, 3 + i, 60); } - if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i]) + if (creature_ptr->stat_max[i] == creature_ptr->stat_max_max[i]) { c_put_str(TERM_WHITE, "!", 3 + i, _(58, 58-2)); } @@ -3930,59 +3945,59 @@ void display_player(int mode) for (i = 0; i < 4; i++) { - put_str(p_ptr->history[i], i + 12, 10); + put_str(creature_ptr->history[i], i + 12, 10); } *statmsg = '\0'; - if (p_ptr->is_dead) + if (creature_ptr->is_dead) { - if (p_ptr->total_winner) + if (current_world_ptr->total_winner) { #ifdef JP - sprintf(statmsg, "…あなたは勝利の後%sした。", streq(p_ptr->died_from, "Seppuku") ? "切腹" : "引退"); + sprintf(statmsg, "…あなたは勝利の後%sした。", streq(creature_ptr->died_from, "Seppuku") ? "切腹" : "引退"); #else - sprintf(statmsg, "...You %s after the winning.", streq(p_ptr->died_from, "Seppuku") ? "did Seppuku" : "retired from the adventure"); + sprintf(statmsg, "...You %s after the winning.", streq(creature_ptr->died_from, "Seppuku") ? "did Seppuku" : "retired from the adventure"); #endif } - else if (!current_floor_ptr->dun_level) + else if (!p_ptr->current_floor_ptr->dun_level) { #ifdef JP - sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(), p_ptr->died_from); + sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(), creature_ptr->died_from); #else - sprintf(statmsg, "...You were killed by %s in %s.", p_ptr->died_from, map_name()); + sprintf(statmsg, "...You were killed by %s in %s.", creature_ptr->died_from, map_name()); #endif } - else if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) + else if (creature_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->current_floor_ptr->inside_quest)) { /* Get the quest text */ /* Bewere that INIT_ASSIGN resets the cur_num. */ init_flags = INIT_NAME_ONLY; - process_dungeon_file("q_info.txt", 0, 0, 0, 0); + process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0); #ifdef JP - sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[p_ptr->inside_quest].name, p_ptr->died_from); + sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[creature_ptr->current_floor_ptr->inside_quest].name, creature_ptr->died_from); #else - sprintf(statmsg, "...You were killed by %s in the quest '%s'.", p_ptr->died_from, quest[p_ptr->inside_quest].name); + sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[creature_ptr->current_floor_ptr->inside_quest].name); #endif } else { #ifdef JP - sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)current_floor_ptr->dun_level, p_ptr->died_from); + sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)p_ptr->current_floor_ptr->dun_level, creature_ptr->died_from); #else - sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, current_floor_ptr->dun_level, map_name()); + sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, p_ptr->current_floor_ptr->dun_level, map_name()); #endif } } - else if (character_dungeon) + else if (current_world_ptr->character_dungeon) { - if (!current_floor_ptr->dun_level) + if (!p_ptr->current_floor_ptr->dun_level) { sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name()); } - else if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) + else if (creature_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->current_floor_ptr->inside_quest)) { /* Clear the text */ /* Must be done before doing INIT_SHOW_TEXT */ @@ -3995,16 +4010,16 @@ void display_player(int mode) /* Get the quest text */ init_flags = INIT_NAME_ONLY; - process_dungeon_file("q_info.txt", 0, 0, 0, 0); + process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0); - sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[p_ptr->inside_quest].name); + sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[creature_ptr->current_floor_ptr->inside_quest].name); } else { #ifdef JP - sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)current_floor_ptr->dun_level); + sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)p_ptr->current_floor_ptr->dun_level); #else - sprintf(statmsg, "...Now, you are exploring level %d of %s.", current_floor_ptr->dun_level, map_name()); + sprintf(statmsg, "...Now, you are exploring level %d of %s.", p_ptr->current_floor_ptr->dun_level, map_name()); #endif } } @@ -4031,8 +4046,8 @@ void display_player(int mode) /* Display "various" info */ else { - display_player_middle(); - display_player_various(); + display_player_middle(creature_ptr); + display_player_various(creature_ptr); } } @@ -4042,20 +4057,20 @@ void display_player(int mode) /* See "http://www.cs.berkeley.edu/~davidb/angband.html" */ /* Dump the info */ - display_player_misc_info(); - display_player_stat_info(); - display_player_flag_info(); + display_player_misc_info(creature_ptr); + display_player_stat_info(creature_ptr); + display_player_flag_info(creature_ptr); } /* Special */ else if (mode == 3) { - display_player_other_flag_info(); + display_player_other_flag_info(creature_ptr); } else if (mode == 4) { - do_cmd_knowledge_mutations(); + do_cmd_knowledge_mutations(creature_ptr); } } @@ -4064,14 +4079,14 @@ void display_player(int mode) * @param fff ファイルポインタ * @return なし */ -static void dump_aux_display_player(FILE *fff) +static void dump_aux_display_player(player_type *creature_ptr, FILE *fff) { TERM_LEN x, y; TERM_COLOR a; char c; char buf[1024]; - display_player(0); + display_player(creature_ptr, 0); /* Dump part of the screen */ for (y = 1; y < 22; y++) @@ -4097,7 +4112,7 @@ static void dump_aux_display_player(FILE *fff) } /* Display history */ - display_player(1); + display_player(creature_ptr, 1); /* Dump part of the screen */ for (y = 10; y < 19; y++) @@ -4125,7 +4140,7 @@ static void dump_aux_display_player(FILE *fff) fprintf(fff, "\n"); /* Display flags (part 1) */ - display_player(2); + display_player(creature_ptr, 2); /* Dump part of the screen */ for (y = 2; y < 22; y++) @@ -4156,7 +4171,7 @@ static void dump_aux_display_player(FILE *fff) fprintf(fff, "\n"); /* Display flags (part 2) */ - display_player(3); + display_player(creature_ptr, 3); /* Dump part of the screen */ for (y = 1; y < 22; y++) @@ -4193,21 +4208,21 @@ static void dump_aux_display_player(FILE *fff) * @param fff ファイルポインタ * @return なし */ -static void dump_aux_pet(FILE *fff) +static void dump_aux_pet(player_type *master_ptr, FILE *fff) { int i; bool pet = FALSE; bool pet_settings = FALSE; GAME_TEXT pet_name[MAX_NLEN]; - for (i = current_floor_ptr->m_max - 1; i >= 1; i--) + for (i = master_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) { - monster_type *m_ptr = ¤t_floor_ptr->m_list[i]; + monster_type *m_ptr = &master_ptr->current_floor_ptr->m_list[i]; if (!monster_is_valid(m_ptr)) continue; if (!is_pet(m_ptr)) continue; pet_settings = TRUE; - if (!m_ptr->nickname && (p_ptr->riding != i)) continue; + if (!m_ptr->nickname && (master_ptr->riding != i)) continue; if (!pet) { fprintf(fff, _("\n\n [主なペット]\n\n", "\n\n [Leading Pets]\n\n")); @@ -4222,22 +4237,22 @@ static void dump_aux_pet(FILE *fff) fprintf(fff, _("\n\n [ペットへの命令]\n", "\n\n [Command for Pets]\n")); fprintf(fff, _("\n ドアを開ける: %s", "\n Pets open doors: %s"), - (p_ptr->pet_extra_flags & PF_OPEN_DOORS) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_OPEN_DOORS) ? "ON" : "OFF"); fprintf(fff, _("\n アイテムを拾う: %s", "\n Pets pick up items: %s"), - (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_PICKUP_ITEMS) ? "ON" : "OFF"); fprintf(fff, _("\n テレポート系魔法を使う: %s", "\n Allow teleport: %s"), - (p_ptr->pet_extra_flags & PF_TELEPORT) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_TELEPORT) ? "ON" : "OFF"); fprintf(fff, _("\n 攻撃魔法を使う: %s", "\n Allow cast attack spell: %s"), - (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_ATTACK_SPELL) ? "ON" : "OFF"); fprintf(fff, _("\n 召喚魔法を使う: %s", "\n Allow cast summon spell: %s"), - (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_SUMMON_SPELL) ? "ON" : "OFF"); fprintf(fff, _("\n プレイヤーを巻き込む範囲魔法を使う: %s", "\n Allow involve player in area spell: %s"), - (p_ptr->pet_extra_flags & PF_BALL_SPELL) ? "ON" : "OFF"); + (master_ptr->pet_extra_flags & PF_BALL_SPELL) ? "ON" : "OFF"); fputc('\n', fff); } @@ -4451,10 +4466,11 @@ static void dump_aux_class_special(FILE *fff) /*! * @brief クエスト情報をファイルにダンプする + * @param creature_ptr プレーヤーへの参照ポインタ * @param fff ファイルポインタ * @return なし */ -static void dump_aux_quest(FILE *fff) +static void dump_aux_quest(player_type *creature_ptr, FILE *fff) { QUEST_IDX i; QUEST_IDX *quest_num; @@ -4471,9 +4487,9 @@ static void dump_aux_quest(FILE *fff) /* Dump Quest Information */ fputc('\n', fff); - do_cmd_knowledge_quests_completed(fff, quest_num); + do_cmd_knowledge_quests_completed(creature_ptr, fff, quest_num); fputc('\n', fff); - do_cmd_knowledge_quests_failed(fff, quest_num); + do_cmd_knowledge_quests_failed(creature_ptr, fff, quest_num); fputc('\n', fff); /* Free Memory */ @@ -4490,7 +4506,7 @@ static void dump_aux_last_message(FILE *fff) { if (p_ptr->is_dead) { - if (!p_ptr->total_winner) + if (!current_world_ptr->total_winner) { int i; @@ -4522,7 +4538,7 @@ static void dump_aux_recall(FILE *fff) int y; fprintf(fff, _("\n [帰還場所]\n\n", "\n [Recall Depth]\n\n")); - for (y = 1; y < max_d_idx; y++) + for (y = 1; y < current_world_ptr->max_d_idx; y++) { bool seiha = FALSE; @@ -4593,7 +4609,7 @@ static void dump_aux_options(FILE *fff) fputc('\n', fff); - if (p_ptr->noscore) + if (current_world_ptr->noscore) fprintf(fff, _("\n 何か不正なことをしてしまっています。\n", "\n You have done something illegal.\n")); fputc('\n', fff); @@ -4605,42 +4621,42 @@ static void dump_aux_options(FILE *fff) * @param fff ファイルポインタ * @return なし */ -static void dump_aux_arena(FILE *fff) +static void dump_aux_arena(player_type *creature_ptr, FILE *fff) { if (lite_town || vanilla_town) return; - if (p_ptr->arena_number < 0) + if (creature_ptr->arena_number < 0) { - if (p_ptr->arena_number <= ARENA_DEFEATED_OLD_VER) + if (creature_ptr->arena_number <= ARENA_DEFEATED_OLD_VER) { fprintf(fff, _("\n 闘技場: 敗北\n", "\n Arena: Defeated\n")); } else { #ifdef JP - fprintf(fff, "\n 闘技場: %d回戦で%sの前に敗北\n", -p_ptr->arena_number, - r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name); + fprintf(fff, "\n 闘技場: %d回戦で%sの前に敗北\n", -creature_ptr->arena_number, + r_name + r_info[arena_info[-1 - creature_ptr->arena_number].r_idx].name); #else fprintf(fff, "\n Arena: Defeated by %s in the %d%s fight\n", - r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name, - -p_ptr->arena_number, get_ordinal_number_suffix(-p_ptr->arena_number)); + r_name + r_info[arena_info[-1 - creature_ptr->arena_number].r_idx].name, + -creature_ptr->arena_number, get_ordinal_number_suffix(-creature_ptr->arena_number)); #endif } } - else if (p_ptr->arena_number > MAX_ARENA_MONS + 2) + else if (creature_ptr->arena_number > MAX_ARENA_MONS + 2) { fprintf(fff, _("\n 闘技場: 真のチャンピオン\n", "\n Arena: True Champion\n")); } - else if (p_ptr->arena_number > MAX_ARENA_MONS - 1) + else if (creature_ptr->arena_number > MAX_ARENA_MONS - 1) { fprintf(fff, _("\n 闘技場: チャンピオン\n", "\n Arena: Champion\n")); } else { #ifdef JP - fprintf(fff, "\n 闘技場: %2d勝\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number)); + fprintf(fff, "\n 闘技場: %2d勝\n", (creature_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : creature_ptr->arena_number)); #else - fprintf(fff, "\n Arena: %2d Victor%s\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number), (p_ptr->arena_number > 1) ? "ies" : "y"); + fprintf(fff, "\n Arena: %2d Victor%s\n", (creature_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : creature_ptr->arena_number), (creature_ptr->arena_number > 1) ? "ies" : "y"); #endif } @@ -4747,23 +4763,23 @@ static void dump_aux_monsters(FILE *fff) * @param fff ファイルポインタ * @return なし */ -static void dump_aux_race_history(FILE *fff) +static void dump_aux_race_history(player_type *creature_ptr, FILE *fff) { - if (p_ptr->old_race1 || p_ptr->old_race2) + if (creature_ptr->old_race1 || creature_ptr->old_race2) { int i; - fprintf(fff, _("\n\n あなたは%sとして生まれた。", "\n\n You were born as %s."), race_info[p_ptr->start_race].title); + fprintf(fff, _("\n\n あなたは%sとして生まれた。", "\n\n You were born as %s."), race_info[creature_ptr->start_race].title); for (i = 0; i < MAX_RACES; i++) { - if (p_ptr->start_race == i) continue; + if (creature_ptr->start_race == i) continue; if (i < 32) { - if (!(p_ptr->old_race1 & 1L << i)) continue; + if (!(creature_ptr->old_race1 & 1L << i)) continue; } else { - if (!(p_ptr->old_race2 & 1L << (i-32))) continue; + if (!(creature_ptr->old_race2 & 1L << (i-32))) continue; } fprintf(fff, _("\n あなたはかつて%sだった。", "\n You were a %s before."), race_info[i].title); } @@ -4825,9 +4841,9 @@ static void dump_aux_virtues(FILE *fff) else fprintf(fff, "%s ???\n", stat_names[v_nr]); } - fprintf(fff, _("\n属性 : %s\n", "\nYour alighnment : %s\n"), your_alignment()); + fprintf(fff, _("\n属性 : %s\n", "\nYour alighnment : %s\n"), your_alignment(p_ptr)); fprintf(fff, "\n"); - dump_virtues(fff); + dump_virtues(p_ptr, fff); } @@ -4841,7 +4857,7 @@ static void dump_aux_mutations(FILE *fff) if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) { fprintf(fff, _("\n\n [突然変異]\n\n", "\n\n [Mutations]\n\n")); - dump_mutations(fff); + dump_mutations(p_ptr, fff); } } @@ -4872,7 +4888,6 @@ static void dump_aux_equipment_inventory(FILE *fff) fprintf(fff, "\n\n"); } - /* Dump the p_ptr->inventory_list */ fprintf(fff, _(" [キャラクタの持ち物]\n\n", " [Character Inventory]\n\n")); for (i = 0; i < INVEN_PACK; i++) @@ -4880,7 +4895,6 @@ static void dump_aux_equipment_inventory(FILE *fff) /* Don't dump the empty slots */ if (!p_ptr->inventory_list[i].k_idx) break; - /* Dump the p_ptr->inventory_list slots */ object_desc(o_name, &p_ptr->inventory_list[i], 0); fprintf(fff, "%c) %s\n", index_to_label(i), o_name); } @@ -4963,10 +4977,11 @@ static void dump_aux_home_museum(FILE *fff) /*! * @brief ダンプ出力のメインルーチン * Output the character dump to a file + * @param creature_ptr プレーヤーへの参照ポインタ * @param fff ファイルポインタ * @return エラーコード */ -errr make_character_dump(FILE *fff) +errr make_character_dump(player_type *creature_ptr, FILE *fff) { #ifdef JP fprintf(fff, " [変愚蛮怒 %d.%d.%d キャラクタ情報]\n\n", @@ -4978,19 +4993,19 @@ errr make_character_dump(FILE *fff) update_playtime(); - dump_aux_display_player(fff); + dump_aux_display_player(p_ptr, fff); dump_aux_last_message(fff); dump_aux_options(fff); dump_aux_recall(fff); - dump_aux_quest(fff); - dump_aux_arena(fff); + dump_aux_quest(creature_ptr, fff); + dump_aux_arena(p_ptr, fff); dump_aux_monsters(fff); dump_aux_virtues(fff); - dump_aux_race_history(fff); + dump_aux_race_history(p_ptr, fff); dump_aux_realm_history(fff); dump_aux_class_special(fff); dump_aux_mutations(fff); - dump_aux_pet(fff); + dump_aux_pet(p_ptr, fff); fputs("\n\n", fff); dump_aux_equipment_inventory(fff); dump_aux_home_museum(fff); @@ -5002,19 +5017,18 @@ errr make_character_dump(FILE *fff) /*! * @brief プレイヤーステータスをファイルダンプ出力する * Hack -- Dump a character description file + * @param creature_ptr プレーヤーへの参照ポインタ * @param name 出力ファイル名 * @return エラーコード * @details * Allow the "full" flag to dump additional info, * and trigger its usage from various places in the code. */ -errr file_character(concptr name) +errr file_character(player_type *creature_ptr, concptr name) { int fd = -1; FILE *fff = NULL; char buf[1024]; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); /* File type is "TEXT" */ @@ -5050,7 +5064,7 @@ errr file_character(concptr name) return (-1); } - (void)make_character_dump(fff); + (void)make_character_dump(creature_ptr, fff); my_fclose(fff); @@ -5262,22 +5276,14 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG Term_get_size(&wid, &hgt); rows = hgt - 4; - /* Wipe finder */ strcpy(finder_str, ""); - - /* Wipe shower */ strcpy(shower_str, ""); - - /* Wipe caption */ strcpy(caption, ""); - - /* Wipe the hooks */ for (i = 0; i < 68; i++) { hook[i][0] = '\0'; } - /* Copy the filename */ strcpy(filename, name); n = strlen(filename); @@ -5296,59 +5302,39 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG /* Redirect the name */ name = filename; - /* Hack */ if (what) { - /* Caption */ strcpy(caption, what); - - /* Access the "file" */ strcpy(path, name); - - /* Open */ fff = my_fopen(path, "r"); } /* Look in "help" */ if (!fff) { - /* Caption */ sprintf(caption, _("ヘルプ・ファイル'%s'", "Help file '%s'"), name); - - /* Build the filename */ path_build(path, sizeof(path), ANGBAND_DIR_HELP, name); - - /* Open the file */ fff = my_fopen(path, "r"); } /* Look in "info" */ if (!fff) { - /* Caption */ sprintf(caption, _("スポイラー・ファイル'%s'", "Info file '%s'"), name); - - /* Build the filename */ path_build(path, sizeof(path), ANGBAND_DIR_INFO, name); - - /* Open the file */ fff = my_fopen(path, "r"); } /* Look in "info" */ if (!fff) { - /* Build the filename */ path_build(path, sizeof(path), ANGBAND_DIR, name); for (i = 0; path[i]; i++) if ('\\' == path[i]) path[i] = PATH_SEP[0]; - /* Caption */ sprintf(caption, _("スポイラー・ファイル'%s'", "Info file '%s'"), name); - - /* Open the file */ fff = my_fopen(path, "r"); } @@ -5357,7 +5343,7 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG msg_format(_("'%s'をオープンできません。", "Cannot open '%s'."), name); msg_print(NULL); - return (TRUE); + return TRUE; } @@ -5432,7 +5418,7 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG /* Hack -- Re-Open the file */ fff = my_fopen(path, "r"); - if (!fff) return (FALSE); + if (!fff) return FALSE; /* File has been restarted */ next = 0; @@ -5706,8 +5692,6 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG if (!get_string(_("ファイル名: ", "File name: "), xtmp, 80)) continue; my_fclose(fff); - - /* Build the filename */ path_build(buff, sizeof(buff), ANGBAND_DIR_USER, xtmp); /* Hack -- Re-Open the file */ @@ -5747,10 +5731,10 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG my_fclose(fff); /* Escape */ - if (skey == 'q') return (FALSE); + if (skey == 'q') return FALSE; /* Normal return */ - return (TRUE); + return TRUE; } @@ -5773,18 +5757,19 @@ void do_cmd_help(void) /*! * @brief プレイヤーの名前をチェックして修正する * Process the player name. + * @param player_ptr プレーヤーへの参照ポインタ * @param sf セーブファイル名に合わせた修正を行うならばTRUE * @return なし * @details * Extract a clean "base name". * Build the savefile name if needed. */ -void process_player_name(bool sf) +void process_player_name(player_type *creature_ptr, bool sf) { int i, k = 0; char old_player_base[32] = ""; - if (character_generated) strcpy(old_player_base, player_base); + if (current_world_ptr->character_generated) strcpy(old_player_base, p_ptr->base_name); /* Cannot be too long */ #if defined(MACINTOSH) || defined(ACORN) @@ -5829,7 +5814,7 @@ void process_player_name(bool sf) if (c == '.') c = '_'; /* Accept all the letters */ - player_base[k++] = c; + p_ptr->base_name[k++] = c; } #else @@ -5846,35 +5831,35 @@ void process_player_name(bool sf) /* Accept some letters */ #ifdef JP if(iskanji(c)){ - if(k + 2 >= sizeof(player_base) || !p_ptr->name[i+1]) break; - player_base[k++] = c; + if(k + 2 >= sizeof(p_ptr->base_name) || !p_ptr->name[i+1]) break; + p_ptr->base_name[k++] = c; i++; - player_base[k++] = p_ptr->name[i]; + p_ptr->base_name[k++] = p_ptr->name[i]; } #ifdef SJIS - else if (iskana(c)) player_base[k++] = c; + else if (iskana(c)) p_ptr->base_name[k++] = c; #endif else #endif /* Convert path separator to underscore */ if (!strncmp(PATH_SEP, p_ptr->name+i, strlen(PATH_SEP))){ - player_base[k++] = '_'; + p_ptr->base_name[k++] = '_'; i += strlen(PATH_SEP); } /* Convert some characters to underscore */ #if defined(WINDOWS) - else if (my_strchr("\"*,/:;<>?\\|", c)) player_base[k++] = '_'; + else if (my_strchr("\"*,/:;<>?\\|", c)) p_ptr->base_name[k++] = '_'; #endif - else if (isprint(c)) player_base[k++] = c; + else if (isprint(c)) p_ptr->base_name[k++] = c; } #endif /* Terminate */ - player_base[k] = '\0'; + p_ptr->base_name[k] = '\0'; /* Require a "base" name */ - if (!player_base[0]) strcpy(player_base, "PLAYER"); + if (!p_ptr->base_name[0]) strcpy(p_ptr->base_name, "PLAYER"); #ifdef SAVEFILE_MUTABLE @@ -5887,7 +5872,7 @@ void process_player_name(bool sf) { concptr s; s = savefile; - while (1) + while (TRUE) { concptr t; t = my_strstr(s, PATH_SEP); @@ -5906,24 +5891,22 @@ void process_player_name(bool sf) { char temp[128]; - strcpy(savefile_base, player_base); + strcpy(savefile_base, p_ptr->base_name); #ifdef SAVEFILE_USE_UID - /* Rename the savefile, using the player_uid and player_base */ - (void)sprintf(temp, "%d.%s", player_uid, player_base); + /* Rename the savefile, using the p_ptr->player_uid and p_ptr->base_name */ + (void)sprintf(temp, "%d.%s", p_ptr->player_uid, p_ptr->base_name); #else - /* Rename the savefile, using the player_base */ - (void)sprintf(temp, "%s", player_base); + /* Rename the savefile, using the p_ptr->base_name */ + (void)sprintf(temp, "%s", p_ptr->base_name); #endif - - /* Build the filename */ path_build(savefile, sizeof(savefile), ANGBAND_DIR_SAVE, temp); } /* Load an autopick preference file */ - if (character_generated) + if (current_world_ptr->character_generated) { - if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE); + if (!streq(old_player_base, p_ptr->base_name)) autopick_load_pref(creature_ptr, FALSE); } } @@ -5934,30 +5917,30 @@ void process_player_name(bool sf) * @return なし * @details *
- * Assumes that "display_player(0)" has just been called
+ * Assumes that "display_player()" has just been called
  * Perhaps we should NOT ask for a name (at "birth()") on
  * Unix machines?  XXX XXX
  * What a horrible name for a global function.  
  * 
*/ -void get_name(void) +void get_name(player_type *creature_ptr) { char tmp[64]; /* Save the player name */ - strcpy(tmp, p_ptr->name); + strcpy(tmp, creature_ptr->name); /* Prompt for a new name */ if (get_string(_("キャラクターの名前を入力して下さい: ", "Enter a name for your character: "), tmp, 15)) { /* Use the name */ - strcpy(p_ptr->name, tmp); + strcpy(creature_ptr->name, tmp); } - if (0 == strlen(p_ptr->name)) + if (0 == strlen(creature_ptr->name)) { /* Use default name */ - strcpy(p_ptr->name, "PLAYER"); + strcpy(creature_ptr->name, "PLAYER"); } strcpy(tmp,ap_ptr->title); @@ -5967,7 +5950,7 @@ void get_name(void) #else strcat(tmp, " "); #endif - strcat(tmp,p_ptr->name); + strcat(tmp,creature_ptr->name); /* Re-Draw the name (in light blue) */ Term_erase(34, 1, 255); @@ -5982,11 +5965,12 @@ void get_name(void) /*! * @brief セーブするコマンドのメインルーチン * Save the game + * @param creature_ptr プレーヤーへの参照ポインタ * @param is_autosave オートセーブ中の処理ならばTRUE * @return なし * @details */ -void do_cmd_save_game(int is_autosave) +void do_cmd_save_game(player_type *creature_ptr, int is_autosave) { /* Autosaves do not disturb */ if (is_autosave) @@ -5995,12 +5979,12 @@ void do_cmd_save_game(int is_autosave) } else { - disturb(TRUE, TRUE); + disturb(p_ptr, TRUE, TRUE); } /* Clear messages */ msg_print(NULL); - handle_stuff(); + handle_stuff(creature_ptr); prt(_("ゲームをセーブしています...", "Saving game..."), 0, 0); @@ -6013,7 +5997,7 @@ void do_cmd_save_game(int is_autosave) signals_ignore_tstp(); /* Save the player */ - if (save_player()) + if (save_player(creature_ptr)) { prt(_("ゲームをセーブしています... 終了", "Saving game... done."), 0, 0); } @@ -6033,7 +6017,7 @@ void do_cmd_save_game(int is_autosave) (void)strcpy(p_ptr->died_from, _("(元気に生きている)", "(alive and well)")); /* HACK -- don't get sanity blast on updating view */ - is_loading_now = FALSE; + current_world_ptr->is_loading_now = FALSE; update_creature(p_ptr); @@ -6041,7 +6025,7 @@ void do_cmd_save_game(int is_autosave) mproc_init(); /* HACK -- reset the hackish flag */ - is_loading_now = TRUE; + current_world_ptr->is_loading_now = TRUE; } @@ -6055,7 +6039,7 @@ void do_cmd_save_and_exit(void) { p_ptr->playing = FALSE; p_ptr->leaving = TRUE; - do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----")); + exe_write_diary(p_ptr, NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----")); } @@ -6101,17 +6085,15 @@ static void make_bones(void) /* Ignore wizards and borgs */ - if (!(p_ptr->noscore & 0x00FF)) + if (!(current_world_ptr->noscore & 0x00FF)) { /* Ignore people who die in town */ - if (current_floor_ptr->dun_level) + if (p_ptr->current_floor_ptr->dun_level) { char tmp[128]; /* "Bones" name */ - sprintf(tmp, "bone.%03d", current_floor_ptr->dun_level); - - /* Build the filename */ + sprintf(tmp, "bone.%03d", p_ptr->current_floor_ptr->dun_level); path_build(str, sizeof(str), ANGBAND_DIR_BONE, tmp); /* Attempt to open the bones file */ @@ -6163,7 +6145,7 @@ bool (*tombstone_aux)(void) = NULL; * Display a "tomb-stone" * @return なし */ -void print_tomb(void) +void print_tomb(player_type *dead_ptr) { bool done = FALSE; @@ -6188,8 +6170,6 @@ void print_tomb(void) int extra_line = 0; #endif Term_clear(); - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt")); /* Open the News file */ @@ -6212,7 +6192,7 @@ void print_tomb(void) } /* King or Queen */ - if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL)) + if (current_world_ptr->total_winner || (dead_ptr->lev > PY_MAX_LEVEL)) { #ifdef JP /* 英日切り替え */ @@ -6225,10 +6205,10 @@ void print_tomb(void) /* Normal */ else { - p = player_title[p_ptr->pclass][(p_ptr->lev - 1) / 5]; + p = player_title[dead_ptr->pclass][(dead_ptr->lev - 1) / 5]; } - center_string(buf, p_ptr->name); + center_string(buf, dead_ptr->name); put_str(buf, 6, 11); #ifndef JP @@ -6242,35 +6222,35 @@ void print_tomb(void) center_string(buf, cp_ptr->title); put_str(buf, 10, 11); - (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)p_ptr->lev); + (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)dead_ptr->lev); center_string(buf, tmp); put_str(buf, 11, 11); - (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)p_ptr->exp); + (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)dead_ptr->exp); center_string(buf, tmp); put_str(buf, 12, 11); - (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)p_ptr->au); + (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)dead_ptr->au); center_string(buf, tmp); put_str(buf, 13, 11); #ifdef JP /* 墓に刻む言葉をオリジナルより細かく表示 */ - if (streq(p_ptr->died_from, "途中終了")) + if (streq(dead_ptr->died_from, "途中終了")) { strcpy(tmp, "<自殺>"); } - else if (streq(p_ptr->died_from, "ripe")) + else if (streq(dead_ptr->died_from, "ripe")) { strcpy(tmp, "引退後に天寿を全う"); } - else if (streq(p_ptr->died_from, "Seppuku")) + else if (streq(dead_ptr->died_from, "Seppuku")) { strcpy(tmp, "勝利の後、切腹"); } else { - roff_to_buf(p_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp); + roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp); t = tmp + strlen(tmp) + 1; if (*t) { @@ -6310,12 +6290,12 @@ void print_tomb(void) center_string(buf, tmp); put_str(buf, 14, 11); - if (!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku")) + if (!streq(dead_ptr->died_from, "ripe") && !streq(dead_ptr->died_from, "Seppuku")) { - if (current_floor_ptr->dun_level == 0) + if (dead_ptr->current_floor_ptr->dun_level == 0) { - concptr field_name = p_ptr->town_num ? "街" : "荒野"; - if (streq(p_ptr->died_from, "途中終了")) + concptr field_name = dead_ptr->town_num ? "街" : "荒野"; + if (streq(dead_ptr->died_from, "途中終了")) { sprintf(tmp, "%sで死んだ", field_name); } @@ -6326,24 +6306,24 @@ void print_tomb(void) } else { - if (streq(p_ptr->died_from, "途中終了")) + if (streq(dead_ptr->died_from, "途中終了")) { - sprintf(tmp, "地下 %d 階で死んだ", (int)current_floor_ptr->dun_level); + sprintf(tmp, "地下 %d 階で死んだ", (int)dead_ptr->current_floor_ptr->dun_level); } else { - sprintf(tmp, "に地下 %d 階で殺された", (int)current_floor_ptr->dun_level); + sprintf(tmp, "に地下 %d 階で殺された", (int)dead_ptr->current_floor_ptr->dun_level); } } center_string(buf, tmp); put_str(buf, 15 + extra_line, 11); } #else - (void)sprintf(tmp, "Killed on Level %d", current_floor_ptr->dun_level); + (void)sprintf(tmp, "Killed on Level %d", dead_ptr->current_floor_ptr->dun_level); center_string(buf, tmp); put_str(buf, 14, 11); - roff_to_buf(format("by %s.", p_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp); + roff_to_buf(format("by %s.", dead_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp); center_string(buf, tmp); put_str(buf, 15, 11); t = tmp + strlen(tmp) + 1; @@ -6363,7 +6343,7 @@ void print_tomb(void) (void)sprintf(tmp, "%-.24s", ctime(&ct)); center_string(buf, tmp); put_str(buf, 17, 11); - msg_format(_("さようなら、%s!", "Goodbye, %s!"), p_ptr->name); + msg_format(_("さようなら、%s!", "Goodbye, %s!"), dead_ptr->name); } } @@ -6371,9 +6351,10 @@ void print_tomb(void) /*! * @brief 死亡、引退時の簡易ステータス表示 / * Display some character info + * @param creature_ptr プレーヤーへの参照ポインタ * @return なし */ -void show_info(void) +void show_info(player_type *creature_ptr) { int i, j, k, l; object_type *o_ptr; @@ -6382,11 +6363,11 @@ void show_info(void) /* Hack -- Know everything in the inven/equip */ for (i = 0; i < INVEN_TOTAL; i++) { - o_ptr = &p_ptr->inventory_list[i]; + o_ptr = &creature_ptr->inventory_list[i]; if (!o_ptr->k_idx) continue; /* Aware and Known */ - object_aware(o_ptr); + object_aware(creature_ptr, o_ptr); object_known(o_ptr); } @@ -6401,14 +6382,14 @@ void show_info(void) if (!o_ptr->k_idx) continue; /* Aware and Known */ - object_aware(o_ptr); + object_aware(creature_ptr, o_ptr); object_known(o_ptr); } } /* Hack -- Recalculate bonuses */ - p_ptr->update |= (PU_BONUS); - handle_stuff(); + creature_ptr->update |= (PU_BONUS); + handle_stuff(creature_ptr); /* Flush all input keys */ flush(); @@ -6439,37 +6420,33 @@ void show_info(void) screen_save(); /* Dump a character file */ - (void)file_character(out_val); + (void)file_character(creature_ptr, out_val); screen_load(); } update_playtime(); - display_player(0); + display_player(creature_ptr, 0); - /* Prompt for p_ptr->inventory_list */ prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0); /* Allow abort at this point */ if (inkey() == ESCAPE) return; - - /* Show equipment and p_ptr->inventory_list */ - /* Equipment -- if any */ - if (p_ptr->equip_cnt) + if (creature_ptr->equip_cnt) { Term_clear(); - (void)show_equip(0, USE_FULL); + (void)show_equip(creature_ptr, 0, USE_FULL, 0); prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0); if (inkey() == ESCAPE) return; } /* Inventory -- if any */ - if (p_ptr->inven_cnt) + if (creature_ptr->inven_cnt) { Term_clear(); - (void)show_inven(0, USE_FULL); + (void)show_inven(creature_ptr, 0, USE_FULL, 0); prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0); if (inkey() == ESCAPE) return; @@ -6506,7 +6483,6 @@ void show_info(void) c_put_str(tval_to_attr[o_ptr->tval], o_name, j+2, 7); } - /* Caption */ prt(format(_("我が家に置いてあったアイテム ( %d ページ): -続く-", "Your home contains (page %d): -more-"), k+1), 0, 0); /* Wait for it */ @@ -6516,75 +6492,11 @@ void show_info(void) } } -/*! - * @brief スコアファイル出力 - * Display some character info - * @return なし - */ -bool check_score(void) -{ - Term_clear(); - - /* No score file */ - if (highscore_fd < 0) - { - msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable.")); - msg_print(NULL); - return FALSE; - } - -#ifndef SCORE_WIZARDS - /* Wizard-mode pre-empts scoring */ - if (p_ptr->noscore & 0x000F) - { - msg_print(_("ウィザード・モードではスコアが記録されません。", "Score not registered for wizards.")); - msg_print(NULL); - return FALSE; - } -#endif - -#ifndef SCORE_BORGS - /* Borg-mode pre-empts scoring */ - if (p_ptr->noscore & 0x00F0) - { - msg_print(_("ボーグ・モードではスコアが記録されません。", "Score not registered for borgs.")); - msg_print(NULL); - return FALSE; - } -#endif - -#ifndef SCORE_CHEATERS - /* Cheaters are not scored */ - if (p_ptr->noscore & 0xFF00) - { - msg_print(_("詐欺をやった人はスコアが記録されません。", "Score not registered for cheaters.")); - msg_print(NULL); - return FALSE; - } -#endif - - /* Interupted */ - if (!p_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting"))) - { - msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption.")); - msg_print(NULL); - return FALSE; - } - - /* Quitter */ - if (!p_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting"))) - { - msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting.")); - msg_print(NULL); - return FALSE; - } - return TRUE; -} - /*! * @brief 異常発生時のゲーム緊急終了処理 / * Handle abrupt death of the visual system + * @param creature_ptr プレーヤーへの参照ポインタ * @return なし * @details *
@@ -6594,10 +6506,10 @@ bool check_score(void)
  * save file so that player can see tombstone when restart.
  * 
*/ -void exit_game_panic(void) +void exit_game_panic(player_type *creature_ptr) { /* If nothing important has happened, just quit */ - if (!character_generated || character_saved) quit(_("緊急事態", "panic")); + if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(_("緊急事態", "panic")); /* Mega-Hack -- see "msg_print()" */ msg_flag = FALSE; @@ -6605,8 +6517,8 @@ void exit_game_panic(void) /* Clear the top line */ prt("", 0, 0); - /* Hack -- current_world_ptr->game_turn off some things */ - disturb(TRUE, TRUE); + /* Hack -- turn off some things */ + disturb(p_ptr, TRUE, TRUE); /* Mega-Hack -- Delay death */ if (p_ptr->chp < 0) p_ptr->is_dead = FALSE; @@ -6621,7 +6533,7 @@ void exit_game_panic(void) (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)")); /* Panic save, or get worried */ - if (!save_player()) quit(_("緊急セーブ失敗!", "panic save failed!")); + if (!save_player(creature_ptr)) quit(_("緊急セーブ失敗!", "panic save failed!")); /* Successful panic save */ quit(_("緊急セーブ成功!", "panic save succeeded!")); @@ -6647,11 +6559,7 @@ errr get_rnd_line(concptr file_name, int entry, char *output) int counter, test; int line_num = 0; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, file_name); - - /* Open the file */ fp = my_fopen(buf, "r"); /* Failed */ @@ -6776,8 +6684,6 @@ errr process_autopick_file(concptr name) char buf[1024]; errr err = 0; - - /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); err = process_pref_file_aux(buf, PREF_TYPE_AUTOPICK); @@ -6796,17 +6702,15 @@ errr process_histpref_file(concptr name) { char buf[1024]; errr err = 0; - bool old_character_xtra = character_xtra; - - /* Build the filename */ + bool old_character_xtra = current_world_ptr->character_xtra; path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); /* Hack -- prevent modification birth options in this file */ - character_xtra = TRUE; + current_world_ptr->character_xtra = TRUE; err = process_pref_file_aux(buf, PREF_TYPE_HISTPREF); - character_xtra = old_character_xtra; + current_world_ptr->character_xtra = old_character_xtra; return (err); } @@ -6826,7 +6730,7 @@ static errr counts_seek(int fd, u32b where, bool flag) int i; #ifdef SAVEFILE_USE_UID - (void)sprintf(temp1, "%d.%s.%d%d%d", player_uid, savefile_base, p_ptr->pclass, p_ptr->pseikaku, p_ptr->age); + (void)sprintf(temp1, "%d.%s.%d%d%d", p_ptr->player_uid, savefile_base, p_ptr->pclass, p_ptr->pseikaku, p_ptr->age); #else (void)sprintf(temp1, "%s.%d%d%d", savefile_base, p_ptr->pclass, p_ptr->pseikaku, p_ptr->age); #endif @@ -6834,7 +6738,7 @@ static errr counts_seek(int fd, u32b where, bool flag) temp1[i] ^= (i+1) * 63; seekpoint = 0; - while (1) + while (TRUE) { if (fd_seek(fd, seekpoint + 3 * sizeof(u32b))) return 1; @@ -7017,7 +6921,7 @@ static void handle_signal_simple(int sig) /* Nothing to save, just quit */ - if (!character_generated || character_saved) quit(NULL); + if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL); /* Count the signals */ @@ -7030,12 +6934,12 @@ static void handle_signal_simple(int sig) /* Mark the savefile */ (void)strcpy(p_ptr->died_from, _("強制終了", "Abortion")); - forget_lite(); - forget_view(); - clear_mon_lite(); + forget_lite(p_ptr->current_floor_ptr); + forget_view(p_ptr->current_floor_ptr); + clear_mon_lite(p_ptr->current_floor_ptr); /* Close stuff */ - close_game(); + close_game(p_ptr); /* Quit */ quit(_("強制終了", "interrupt")); @@ -7047,9 +6951,9 @@ static void handle_signal_simple(int sig) /* Cause of "death" */ (void)strcpy(p_ptr->died_from, _("強制終了中", "Interrupting")); - forget_lite(); - forget_view(); - clear_mon_lite(); + forget_lite(p_ptr->current_floor_ptr); + forget_view(p_ptr->current_floor_ptr); + clear_mon_lite(p_ptr->current_floor_ptr); /* Stop playing */ p_ptr->playing = FALSE; @@ -7059,7 +6963,7 @@ static void handle_signal_simple(int sig) p_ptr->leaving = TRUE; /* Close stuff */ - close_game(); + close_game(p_ptr); /* Quit */ quit(_("強制終了", "interrupt")); @@ -7120,12 +7024,12 @@ static void handle_signal_abort(int sig) /* Nothing to save, just quit */ - if (!character_generated || character_saved) quit(NULL); + if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL); - forget_lite(); - forget_view(); - clear_mon_lite(); + forget_lite(p_ptr->current_floor_ptr); + forget_view(p_ptr->current_floor_ptr); + clear_mon_lite(p_ptr->current_floor_ptr); /* Clear the bottom line */ Term_erase(0, hgt - 1, 255); @@ -7137,7 +7041,7 @@ static void handle_signal_abort(int sig) Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ...", "Panic save...")); - do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----")); + exe_write_diary(p_ptr, NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----")); /* Flush output */ Term_fresh(); @@ -7152,7 +7056,7 @@ static void handle_signal_abort(int sig) signals_ignore_tstp(); /* Attempt to save */ - if (save_player()) + if (save_player(p_ptr)) { Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ成功!", "Panic save succeeded!")); }