#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"
# 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!"));
}
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);
}
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)
{
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);
#endif
- display_player_one_line(ENTRY_ALIGN, format("%s" ,your_alignment()), TERM_L_BLUE);
+ display_player_one_line(ENTRY_ALIGN, format("%s" ,your_alignment(p_ptr)), TERM_L_BLUE);
/* Display the stats */
else if (mode == 4)
{
- do_cmd_knowledge_mutations();
+ do_cmd_knowledge_mutations(p_ptr);
}
}
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 */
/* 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);
}
{
p_ptr->playing = FALSE;
p_ptr->leaving = TRUE;
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
+ do_cmd_write_nikki(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 */
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 */
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 = current_world_ptr->character_xtra;
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
/* Hack -- prevent modification birth options in this file */
Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ...", "Panic save..."));
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----"));
+ do_cmd_write_nikki(p_ptr, NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----"));
/* Flush output */
Term_fresh();