#include "angband.h"
#include "world.h"
#include "player-status.h"
+#include "sort.h"
+#include "mutation.h"
+#include "quest.h"
+#include "store.h"
+#include "artifact.h"
+#include "avatar.h"
+#include "shoot.h"
+#include "player-move.h"
+#include "patron.h"
+#include "monster-status.h"
/*
struct named_num
{
- cptr name; /* The name of this thing */
+ concptr name; /* The name of this thing */
int num; /* A number associated with it */
};
}
break;
- /* Process "X:<str>" -- turn option off */
- /* Process "Y:<str>" -- turn option on */
+ /* Process "X:<str>" -- current_world_ptr->game_turn option off */
+ /* Process "Y:<str>" -- current_world_ptr->game_turn option on */
case 'X':
case 'Y':
for (i = 0; option_info[i].o_desc; i++)
if (streq(gf_desc[i].name, buf + 2))
{
/* Remember this color set */
- gf_color[gf_desc[i].num] = quark_add(t);
+ gf_color[gf_desc[i].num] = (TERM_COLOR)quark_add(t);
/* Success */
return 0;
* result
* </pre>
*/
-cptr process_pref_file_expr(char **sp, char *fp)
+concptr process_pref_file_expr(char **sp, char *fp)
{
- cptr v;
+ concptr v;
char *b;
char *s;
/* Analyze */
if (*s == b1)
{
- cptr p;
- cptr t;
+ concptr p;
+ concptr t;
/* Skip b1 */
s++;
/* Save */
(*fp) = f;
-
- /* Save */
(*sp) = s;
return (v);
}
* result
* </pre>
*/
-static errr process_pref_file_aux(cptr name, int preftype)
+static errr process_pref_file_aux(concptr name, int preftype)
{
FILE *fp;
if ((buf[0] == '?') && (buf[1] == ':'))
{
char f;
- cptr v;
+ concptr v;
char *s;
/* Start */
* allow conditional evaluation and filename inclusion.
* </pre>
*/
-errr process_pref_file(cptr name)
+errr process_pref_file(concptr name)
{
char buf[1024];
if (prefix(buf, "FRI:")) strcpy(days[5], buf);
if (prefix(buf, "SAT:")) strcpy(days[6], buf);
}
-
- /* Close it */
my_fclose(fp);
#endif
* @param attr 項目表示の色
* @return なし
*/
-static void display_player_one_line(int entry, cptr val, TERM_COLOR attr)
+static void display_player_one_line(int entry, concptr val, TERM_COLOR attr)
{
char buf[40];
int row = disp_player_line[entry].row;
int col = disp_player_line[entry].col;
int len = disp_player_line[entry].len;
- cptr head = disp_player_line[entry].header;
+ concptr head = disp_player_line[entry].header;
int head_len = strlen(head);
sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
/* Dump the bonuses to hit/dam */
- if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+ if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(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);
}
else
{
- if (MON_FAST(&m_list[p_ptr->riding])) tmp_speed += 10;
- if (MON_SLOW(&m_list[p_ptr->riding])) tmp_speed -= 10;
+ 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 (tmp_speed)
display_player_one_line(ENTRY_SP, format("%4d/%4d", p_ptr->csp , p_ptr->msp), TERM_RED);
/* Dump play time */
- display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", playtime/(60*60), (playtime/60)%60, playtime%60), TERM_L_GREEN);
+ 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);
}
* @param y 技能値に対するランク基準比
* @return なし
*/
-static cptr likert(int x, int y)
+static concptr likert(int x, int y)
{
static char dummy[20] = "", dummy2[20] = "";
memset(dummy, 0, strlen(dummy));
int xthn, xthb, xfos, xsrh;
int xdis, xdev, xsav, xstl;
int xdig;
- cptr desc;
+ concptr desc;
int muta_att = 0;
BIT_FLAGS flgs[TR_FLAG_SIZE];
int shots, shot_frac;
bool dokubari;
- object_type *o_ptr;
+ object_type *o_ptr;
if (p_ptr->muta2 & MUT2_HORNS) muta_att++;
if (p_ptr->muta2 & MUT2_SCOR_TAIL) muta_att++;
if (p_ptr->pseikaku == SEIKAKU_SEXY)
add_flag(flgs, TR_AGGRAVATE);
+ if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN)
+ add_flag(flgs, TR_RES_CONF);
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
{
add_flag(flgs, TR_RES_BLIND);
* @param mode 表示オプション
* @return なし
*/
-static void display_flag_aux(TERM_LEN row, TERM_LEN col, cptr header,
+static void display_flag_aux(TERM_LEN row, TERM_LEN col, concptr header,
int flag1, all_player_flags *f, u16b mode)
{
int i;
row = 3;
/* Print out the labels for the columns */
-#ifdef JP
-c_put_str(TERM_WHITE, "能力", row, stat_col+1);
-c_put_str(TERM_BLUE, " 基本", row, stat_col+7);
-c_put_str(TERM_L_BLUE, " 種 職 性 装 ", row, stat_col+13);
-c_put_str(TERM_L_GREEN, "合計", row, stat_col+28);
-c_put_str(TERM_YELLOW, "現在", row, stat_col+35);
-#else
- c_put_str(TERM_WHITE, "Stat", row, stat_col+1);
- c_put_str(TERM_BLUE, " Base", row, stat_col+7);
- c_put_str(TERM_L_BLUE, "RacClaPerMod", row, stat_col+13);
- c_put_str(TERM_L_GREEN, "Actual", row, stat_col+26);
- c_put_str(TERM_YELLOW, "Current", row, stat_col+32);
-#endif
-
+ c_put_str(TERM_WHITE, _("能力", "Stat"), row, stat_col+1);
+ c_put_str(TERM_BLUE, _(" 基本", " Base"), row, stat_col+7);
+ c_put_str(TERM_L_BLUE, _(" 種 職 性 装 ", "RacClaPerMod"), row, stat_col+13);
+ c_put_str(TERM_L_GREEN, _("合計", "Actual"), row, stat_col+28);
+ c_put_str(TERM_YELLOW, _("現在", "Current"), row, stat_col+35);
/* Display the stats */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < A_MAX; i++)
{
int r_adj;
/* Process equipment */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- /* Access object */
o_ptr = &inventory[i];
/* Acquire "known" flags */
object_flags_known(o_ptr, flgs);
/* Initialize color based of sign of pval. */
- for (stat = 0; stat < 6; stat++)
+ for (stat = 0; stat < A_MAX; stat++)
{
/* Default */
a = TERM_SLATE;
player_flags(flgs);
/* Check stats */
- for (stat = 0; stat < 6; stat++)
+ for (stat = 0; stat < A_MAX; stat++)
{
/* Default */
a = TERM_SLATE;
/* Display the stats */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < A_MAX; i++)
{
/* Special treatment of "injured" stats */
if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
sprintf(statmsg, "...You %s after the winning.", streq(p_ptr->died_from, "Seppuku") ? "did Seppuku" : "retired from the adventure");
#endif
}
- else if (!dun_level)
+ else if (!current_floor_ptr->dun_level)
{
#ifdef JP
sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(), p_ptr->died_from);
else
{
#ifdef JP
- sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)dun_level, p_ptr->died_from);
+ sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)current_floor_ptr->dun_level, p_ptr->died_from);
#else
- sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, dun_level, map_name());
+ sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, current_floor_ptr->dun_level, map_name());
#endif
}
}
else if (character_dungeon)
{
- if (!dun_level)
+ if (!current_floor_ptr->dun_level)
{
sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name());
}
else
{
#ifdef JP
- sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)dun_level);
+ sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)current_floor_ptr->dun_level);
#else
- sprintf(statmsg, "...Now, you are exploring level %d of %s.", dun_level, map_name());
+ sprintf(statmsg, "...Now, you are exploring level %d of %s.", current_floor_ptr->dun_level, map_name());
#endif
}
}
for (i = m_max - 1; i >= 1; i--)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
- if (!m_ptr->r_idx) continue;
+ 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;
*/
static void dump_aux_quest(FILE *fff)
{
- IDX i;
- IDX *quest_num;
+ QUEST_IDX i;
+ QUEST_IDX *quest_num;
int dummy;
fprintf(fff, _("\n\n [クエスト情報]\n", "\n\n [Quest Information]\n"));
/* Allocate Memory */
- C_MAKE(quest_num, max_q_idx, IDX);
+ C_MAKE(quest_num, max_q_idx, QUEST_IDX);
/* Sort by compete level */
for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
fputc('\n', fff);
/* Free Memory */
- C_KILL(quest_num, max_q_idx, IDX);
+ C_KILL(quest_num, max_q_idx, QUEST_IDX);
}
IDX k;
long uniq_total = 0;
long norm_total = 0;
- IDX *who;
+ MONRACE_IDX *who;
/* Sort by monster level */
u16b why = 2;
fprintf(fff, _("\n [倒したモンスター]\n\n", "\n [Defeated Monsters]\n\n"));
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Count monster kills */
for (k = 1; k < max_r_idx; k++)
else fprintf(fff, "Your current Life Rating is ???.\n\n");
fprintf(fff, "Limits of maximum stats\n");
#endif
- for (v_nr = 0; v_nr < 6; v_nr++)
+ for (v_nr = 0; v_nr < A_MAX; v_nr++)
{
if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
else fprintf(fff, "%s ???\n", stat_names[v_nr]);
store_type *st_ptr;
/* Do we need it?? */
- /* process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); */
+ /* process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x); */
/* Print the home */
- st_ptr = &town[1].store[STORE_HOME];
+ st_ptr = &town_info[1].store[STORE_HOME];
/* Home -- if anything there */
if (st_ptr->stock_num)
/* Print the home */
- st_ptr = &town[1].store[STORE_MUSEUM];
+ st_ptr = &town_info[1].store[STORE_MUSEUM];
/* Home -- if anything there */
if (st_ptr->stock_num)
* Allow the "full" flag to dump additional info,
* and trigger its usage from various places in the code.
*/
-errr file_character(cptr name)
+errr file_character(concptr name)
{
int fd = -1;
FILE *fff = NULL;
}
(void)make_character_dump(fff);
-
- /* Close it */
my_fclose(fff);
* You can use any single character in place of the "|".
* </pre>
*/
-static void show_file_aux_line(cptr str, int cy, cptr shower)
+static void show_file_aux_line(concptr str, int cy, concptr shower)
{
static const char tag_str[] = "[[[[";
byte color = TERM_WHITE;
int showercol = len + 1;
int bracketcol = len + 1;
int endcol = len;
- cptr ptr;
+ concptr ptr;
/* Search for a shower string in the line */
if (shower)
* Return FALSE on 'q' to exit from a deep, otherwise TRUE.
* </pre>
*/
-bool show_file(bool show_version, cptr name, cptr what, int line, BIT_FLAGS mode)
+bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode)
{
int i, n, skey;
FILE *fff = NULL;
/* Find this string (if any) */
- cptr find = NULL;
+ concptr find = NULL;
/* Jump to this tag */
- cptr tag = NULL;
+ concptr tag = NULL;
/* Hold strings to find/show */
char finder_str[81];
char back_str[81];
/* String to show */
- cptr shower = NULL;
+ concptr shower = NULL;
/* Filename */
char filename[1024];
/* Re-open the file if needed */
if (next > line)
{
- /* Close it */
my_fclose(fff);
/* Hack -- Re-Open the file */
/* Dump the next 20, or rows, lines of the file */
for (i = 0; i < rows; )
{
- cptr str = buf;
+ concptr str = buf;
/* Hack -- track the "first" line */
if (!i) line = next;
strcpy (xtmp, "");
if (!get_string(_("ファイル名: ", "File name: "), xtmp, 80)) continue;
-
- /* Close it */
my_fclose(fff);
/* Build the filename */
while (!my_fgets(fff, buff, sizeof(buff)))
my_fputs(ffp, buff, 80);
-
- /* Close it */
my_fclose(fff);
my_fclose(ffp);
#endif
if (!savefile_base[0] && savefile[0])
{
- cptr s;
+ concptr s;
s = savefile;
while (1)
{
- cptr t;
+ concptr t;
t = my_strstr(s, PATH_SEP);
if (!t)
break;
/* Kill the player */
p_ptr->is_dead = TRUE;
-
- /* Leaving */
p_ptr->leaving = TRUE;
if (!p_ptr->total_winner)
void do_cmd_save_and_exit(void)
{
p_ptr->playing = FALSE;
-
- /* Leaving */
p_ptr->leaving = TRUE;
do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
}
* @return なし
* @details
*/
-static void center_string(char *buf, cptr str)
+static void center_string(char *buf, concptr str)
{
int i, j;
if (!(p_ptr->noscore & 0x00FF))
{
/* Ignore people who die in town */
- if (dun_level)
+ if (current_floor_ptr->dun_level)
{
char tmp[128];
/* "Bones" name */
- sprintf(tmp, "bone.%03d", dun_level);
+ sprintf(tmp, "bone.%03d", current_floor_ptr->dun_level);
/* Build the filename */
path_build(str, sizeof(str), ANGBAND_DIR_BONE, tmp);
/* Print the text-tombstone */
if (!done)
{
- cptr p;
+ concptr p;
char tmp[160];
char buf[1024];
char dummy[80];
if (!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
{
- if (dun_level == 0)
+ if (current_floor_ptr->dun_level == 0)
{
- cptr field_name = p_ptr->town_num ? "街" : "荒野";
+ concptr field_name = p_ptr->town_num ? "街" : "荒野";
if (streq(p_ptr->died_from, "途中終了"))
{
sprintf(tmp, "%sで死んだ", field_name);
{
if (streq(p_ptr->died_from, "途中終了"))
{
- sprintf(tmp, "地下 %d 階で死んだ", (int)dun_level);
+ sprintf(tmp, "地下 %d 階で死んだ", (int)current_floor_ptr->dun_level);
}
else
{
- sprintf(tmp, "に地下 %d 階で殺された", (int)dun_level);
+ sprintf(tmp, "に地下 %d 階で殺された", (int)current_floor_ptr->dun_level);
}
}
center_string(buf, tmp);
put_str(buf, 15 + extra_line, 11);
}
#else
- (void)sprintf(tmp, "Killed on Level %d", dun_level);
+ (void)sprintf(tmp, "Killed on Level %d", current_floor_ptr->dun_level);
center_string(buf, tmp);
put_str(buf, 14, 11);
static void show_info(void)
{
int i, j, k, l;
- object_type *o_ptr;
+ object_type *o_ptr;
store_type *st_ptr;
/* Hack -- Know everything in the inven/equip */
for (i = 1; i < max_towns; i++)
{
- st_ptr = &town[i].store[STORE_HOME];
+ st_ptr = &town_info[i].store[STORE_HOME];
/* Hack -- Know everything in the home */
for (j = 0; j < st_ptr->stock_num; j++)
/* Homes in the different towns */
for (l = 1; l < max_towns; l++)
{
- st_ptr = &town[l].store[STORE_HOME];
+ st_ptr = &town_info[l].store[STORE_HOME];
/* Home -- if anything there */
if (st_ptr->stock_num)
char buf[1024];
bool do_send = TRUE;
-/* cptr p = "[i:キャラクタの情報, f:ファイル書き出し, t:スコア, x:*鑑定*, ESC:ゲーム終了]"; */
+/* concptr p = "[i:キャラクタの情報, f:ファイル書き出し, t:スコア, x:*鑑定*, ESC:ゲーム終了]"; */
handle_stuff();
/* Flush the messages */
/* Clear the top line */
prt("", 0, 0);
- /* Hack -- turn off some things */
+ /* Hack -- current_world_ptr->game_turn off some things */
disturb(TRUE, TRUE);
/* Mega-Hack -- Delay death */
* Based on the monster speech patch by Matt Graham,
* </pre>
*/
-errr get_rnd_line(cptr file_name, int entry, char *output)
+errr get_rnd_line(concptr file_name, int entry, char *output)
{
FILE *fp;
char buf[1024];
* @return エラーコード
* @details
*/
-errr get_rnd_line_jonly(cptr file_name, int entry, char *output, int count)
+errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count)
{
int i, j, kanji;
errr result = 1;
* @param name ファイル名
* @details
*/
-errr process_autopick_file(cptr name)
+errr process_autopick_file(concptr name)
{
char buf[1024];
* @return エラーコード
* @details
*/
-errr process_histpref_file(cptr name)
+errr process_histpref_file(concptr name)
{
char buf[1024];
errr err = 0;
/* Suicide */
p_ptr->is_dead = TRUE;
-
- /* Leaving */
p_ptr->leaving = TRUE;
/* Close stuff */