#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"
#include "artifact.h"
#include "avatar.h"
#include "shoot.h"
-#include "player-move.h"
#include "patron.h"
#include "monster.h"
#include "monster-process.h"
#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 "player-skill.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];
+
/*
# 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!"));
}
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);
if (buf[0] == 'X')
{
- /* Clear */
option_flag[os] &= ~(1L << ob);
(*option_info[i].o_var) = FALSE;
}
bool bypass = FALSE;
-
- /* Open the file */
fp = my_fopen(name, "r");
/* No such file */
char buf[1024];
errr err1, err2;
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_PREF, name);
/* Process the system pref file */
/* 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 */
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 */
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 */
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);
{
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 ((p_ptr->pclass == CLASS_MONK) && (empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
{
int i;
if (p_ptr->special_defense & KAMAE_MASK)
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))
+ if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
{
PLAYER_LEVEL level = p_ptr->lev;
if (i)
static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
-
- /* Clear */
for (i = 0; i < TR_FLAG_SIZE; i++)
flgs[i] = 0L;
break;
case CLASS_MONK:
case CLASS_FORCETRAINER:
- if ((p_ptr->lev > 9) && !heavy_armor())
+ if ((p_ptr->lev > 9) && !heavy_armor(p_ptr))
add_flag(flgs, TR_SPEED);
- if ((p_ptr->lev>24) && !heavy_armor())
+ if ((p_ptr->lev>24) && !heavy_armor(p_ptr))
add_flag(flgs, TR_FREE_ACT);
break;
case CLASS_NINJA:
- if (heavy_armor())
+ if (heavy_armor(p_ptr))
add_flag(flgs, TR_SPEED);
else
{
static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
-
- /* Clear */
for (i = 0; i < TR_FLAG_SIZE; i++)
flgs[i] = 0L;
if (IS_FAST() || p_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() && !(p_ptr->special_defense & DEFENSE_ACID) && !(PRACE_IS_(p_ptr, RACE_YEEK) && (p_ptr->lev > 19)))
add_flag(flgs, TR_RES_ACID);
if (IS_OPPOSE_ELEC() && !(p_ptr->special_defense & DEFENSE_ELEC))
add_flag(flgs, TR_RES_ELEC);
static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
-
- /* Clear */
for (i = 0; i < TR_FLAG_SIZE; i++)
flgs[i] = 0L;
static void player_immunity(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_(p_ptr, RACE_SPECTRE))
add_flag(flgs, TR_RES_NETHER);
- if (p_ptr->mimic_form == MIMIC_VAMPIRE || prace_is_(RACE_VAMPIRE))
+ if (p_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(p_ptr, RACE_VAMPIRE))
add_flag(flgs, TR_RES_DARK);
if (p_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_(p_ptr, RACE_YEEK) && p_ptr->lev > 19)
add_flag(flgs, TR_RES_ACID);
}
static void tim_player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
-
- /* Clear */
for (i = 0; i < TR_FLAG_SIZE; i++)
flgs[i] = 0L;
static void player_vuln_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
-
- /* Clear */
for (i = 0; i < TR_FLAG_SIZE; i++)
flgs[i] = 0L;
add_flag(flgs, TR_RES_FIRE);
add_flag(flgs, TR_RES_COLD);
}
- if (prace_is_(RACE_ANDROID))
+ if (PRACE_IS_(p_ptr, RACE_ANDROID))
add_flag(flgs, TR_RES_ELEC);
- if (prace_is_(RACE_ENT))
+ if (PRACE_IS_(p_ptr, RACE_ENT))
add_flag(flgs, TR_RES_FIRE);
- if (prace_is_(RACE_VAMPIRE) || prace_is_(RACE_S_FAIRY) ||
+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_S_FAIRY) ||
(p_ptr->mimic_form == MIMIC_VAMPIRE))
add_flag(flgs, TR_RES_LITE);
}
}
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;
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 (prace_is_(RACE_ENT))
+ if (PRACE_IS_(p_ptr, RACE_ENT))
{
switch (i)
{
* Mode 4 = mutations
* </pre>
*/
-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);
{
/* 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;
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);
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);
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));
}
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 (creature_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)
{
#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->inside_quest && is_fixed_quest_idx(creature_ptr->inside_quest))
{
/* Get the quest text */
/* Bewere that INIT_ASSIGN resets the cur_num. */
process_dungeon_file("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->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->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)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, 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)
{
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->inside_quest && is_fixed_quest_idx(creature_ptr->inside_quest))
{
/* Clear the text */
/* Must be done before doing INIT_SHOW_TEXT */
process_dungeon_file("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->inside_quest].name);
}
else
{
else if (mode == 4)
{
- do_cmd_knowledge_mutations();
+ do_cmd_knowledge_mutations(creature_ptr);
}
}
char c;
char buf[1024];
- display_player(0);
+ display_player(p_ptr, 0);
/* Dump part of the screen */
for (y = 1; y < 22; y++)
}
/* Display history */
- display_player(1);
+ display_player(p_ptr, 1);
/* Dump part of the screen */
for (y = 10; y < 19; y++)
fprintf(fff, "\n");
/* Display flags (part 1) */
- display_player(2);
+ display_player(p_ptr, 2);
/* Dump part of the screen */
for (y = 2; y < 22; y++)
fprintf(fff, "\n");
/* Display flags (part 2) */
- display_player(3);
+ display_player(p_ptr, 3);
/* Dump part of the screen */
for (y = 1; y < 22; y++)
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);
}
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);
}
}
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" */
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);
/* 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");
}
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 */
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)
if (c == '.') c = '_';
/* Accept all the letters */
- player_base[k++] = c;
+ p_ptr->base_name[k++] = c;
}
#else
/* 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
{
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(FALSE);
}
}
* @return なし
* @details
* <pre>
- * Assumes that "display_player(0)" has just been called
+ * Assumes that "display_player(p_ptr, 0)" 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.
}
else
{
- disturb(TRUE, TRUE);
+ disturb(p_ptr, TRUE, TRUE);
}
/* Clear messages */
(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);
mproc_init();
/* HACK -- reset the hackish flag */
- is_loading_now = TRUE;
+ current_world_ptr->is_loading_now = TRUE;
}
{
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 ----"));
}
/* "Bones" name */
sprintf(tmp, "bone.%03d", current_floor_ptr->dun_level);
-
- /* Build the filename */
path_build(str, sizeof(str), ANGBAND_DIR_BONE, tmp);
/* Attempt to open the bones file */
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 */
}
update_playtime();
- display_player(0);
+ display_player(p_ptr, 0);
/* Prompt for p_ptr->inventory_list */
prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
if (p_ptr->equip_cnt)
{
Term_clear();
- (void)show_equip(0, USE_FULL);
+ (void)show_equip(0, USE_FULL, 0);
prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
if (inkey() == ESCAPE) return;
if (p_ptr->inven_cnt)
{
Term_clear();
- (void)show_inven(0, USE_FULL);
+ (void)show_inven(0, USE_FULL, 0);
prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
if (inkey() == ESCAPE) return;
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 */
}
}
-/*!
- * @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 異常発生時のゲーム緊急終了処理 /
void exit_game_panic(void)
{
/* 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;
prt("", 0, 0);
/* Hack -- current_world_ptr->game_turn off some things */
- disturb(TRUE, TRUE);
+ disturb(p_ptr, TRUE, TRUE);
/* Mega-Hack -- Delay death */
if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
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 */
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);
{
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);
}
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
/* 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 */
forget_lite();
forget_view();
- clear_mon_lite();
+ clear_mon_lite(current_floor_ptr);
/* Close stuff */
close_game();
forget_lite();
forget_view();
- clear_mon_lite();
+ clear_mon_lite(current_floor_ptr);
/* Stop playing */
p_ptr->playing = FALSE;
/* 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();
+ clear_mon_lite(current_floor_ptr);
/* Clear the bottom line */
Term_erase(0, hgt - 1, 255);
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();