*/
#include "angband.h"
-
+#include "cmd-pet.h"
/*
cptr note_level = "";
bool do_level = TRUE;
char note_level_buf[40];
- int q_idx;
+ QUEST_IDX q_idx;
static bool disable_nikki = FALSE;
else if (!dun_level)
note_level = _("地上:", "Surface:");
else if (q_idx && (is_fixed_quest_idx(q_idx)
- && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
+ && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
note_level = _("クエスト:", "Quest:");
else
{
if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
- else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
+ else if (IS_WIZARD_CLASS())
strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
}
-
-/*!
- * チートオプションの最大数 / Number of cheating options
- */
-#define CHEAT_MAX 9
-
-/*!
- * チーとオプションの定義テーブル / Cheating options
- */
-static option_type cheat_info[CHEAT_MAX] =
-{
- { &cheat_peek, FALSE, 255, 0x01, 0x00,
- "cheat_peek", _("アイテムの生成をのぞき見る", "Peek into object creation")
- },
-
- { &cheat_hear, FALSE, 255, 0x02, 0x00,
- "cheat_hear", _("モンスターの生成をのぞき見る", "Peek into monster creation")
- },
-
- { &cheat_room, FALSE, 255, 0x04, 0x00,
- "cheat_room", _("ダンジョンの生成をのぞき見る", "Peek into dungeon creation")
- },
-
- { &cheat_xtra, FALSE, 255, 0x08, 0x00,
- "cheat_xtra", _("その他の事をのぞき見る", "Peek into something else")
- },
-
- { &cheat_know, FALSE, 255, 0x10, 0x00,
- "cheat_know", _("完全なモンスターの思い出を知る", "Know complete monster info")
- },
-
- { &cheat_live, FALSE, 255, 0x20, 0x00,
- "cheat_live", _("死を回避することを可能にする", "Allow player to avoid death")
- },
-
- { &cheat_save, FALSE, 255, 0x40, 0x00,
- "cheat_save", _("死んだ時セーブするか確認する", "Ask for saving death")
- },
-
- { &cheat_diary_output, FALSE, 255, 0x80, 0x00,
- "cheat_diary_output", _("ウィザードログを日記に出力する", "Output wizard log to diary.")
- },
-
- { &cheat_turn, FALSE, 255, 0x81, 0x00,
- "cheat_turn", _("ゲームメッセージにターン表示を行う", "Put turn to game message.")
- }
-
-
-};
-
/*!
* @brief チートオプションを変更するコマンドのメインルーチン
* Interact with some options for cheating
static void do_cmd_options_cheat(cptr info)
{
char ch;
-
int i, k = 0, n = CHEAT_MAX;
-
char buf[80];
-
/* Clear screen */
Term_clear();
/* Interact with the player */
while (TRUE)
{
- int dir;
+ DIRECTION dir;
/* Prompt XXX XXX XXX */
sprintf(buf, _("%s ( リターンで次へ, y/n でセット, ESC で決定 )", "%s (RET to advance, y/n to set, ESC to accept) "), info);
/*!
- * 自動セーブオプションテーブル
- */
-static option_type autosave_info[2] =
-{
- { &autosave_l, FALSE, 255, 0x01, 0x00,
- "autosave_l", _("新しい階に入る度に自動セーブする", "Autosave when entering new levels") },
-
- { &autosave_t, FALSE, 255, 0x02, 0x00,
- "autosave_t", _("一定ターン毎に自動セーブする", "Timed autosave") },
-};
-
-/*!
* @brief セーブ頻度ターンの次の値を返す
* @param current 現在のセーブ頻度ターン値
* @return 次のセーブ頻度ターン値
/* Interact with the player */
while (TRUE)
{
- int dir;
+ DIRECTION dir;
/* Prompt XXX XXX XXX */
sprintf(buf, _("%s (リターン:次, %sESC:終了, ?:ヘルプ) ", "%s (RET:next, %s, ?:help) "),
static void do_cmd_options_win(void)
{
int i, j, d;
- int y = 0;
- int x = 0;
+ TERM_LEN y = 0;
+ TERM_LEN x = 0;
char ch;
bool go = TRUE;
u32b old_flag[8];
char key[1024];
char buf[1024];
- int mode;
+ BIT_FLAGS mode;
/* Roguelike */
if (rogue_like_commands)
if (!act) continue;
/* Encode the key */
- buf[0] = i;
+ buf[0] = (char)i;
buf[1] = '\0';
ascii_to_text(key, buf);
char buf[1024];
- int mode;
+ BIT_FLAGS mode;
/* Roguelike */
* @param max ビジュアルIDの最大数
* @return 指定が実際に行われた場合TRUE、キャンセルされた場合FALSE
*/
-static bool cmd_visuals_aux(int i, int *num, int max)
+static bool cmd_visuals_aux(int i, IDX *num, IDX max)
{
if (iscntrl(i))
{
char str[10] = "";
- int tmp;
+ IDX tmp;
sprintf(str, "%d", *num);
if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
return FALSE;
- tmp = strtol(str, NULL, 0);
+ tmp = (IDX)strtol(str, NULL, 0);
if (tmp >= 0 && tmp < max)
*num = tmp;
}
static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, IDX direct_r_idx);
static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, IDX direct_k_idx);
-static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, int *lighting_level);
+static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level);
/*
* Interact with "visuals"
case '2':
{
static cptr mark = "Object attr/chars";
- IDX k_idx;
+ KIND_OBJECT_IDX k_idx;
/* Prompt */
prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
while (1)
{
monster_race *r_ptr = &r_info[r];
- char c;
- int t;
+ int c;
+ IDX t;
- byte da = r_ptr->d_attr;
+ TERM_COLOR da = r_ptr->d_attr;
byte dc = r_ptr->d_char;
- byte ca = r_ptr->x_attr;
+ TERM_COLOR ca = r_ptr->x_attr;
byte cc = r_ptr->x_char;
/* Label the object */
{
case 'n':
{
- int prev_r = r;
+ IDX prev_r = r;
do
{
if (!cmd_visuals_aux(i, &r, max_r_idx))
case '5':
{
static cptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
- static int k = 0;
+ static IDX k = 0;
prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
/* Hack -- query until done */
while (1)
{
object_kind *k_ptr = &k_info[k];
- char c;
- int t;
+ int c;
+ IDX t;
- byte da = k_ptr->d_attr;
- byte dc = k_ptr->d_char;
- byte ca = k_ptr->x_attr;
- byte cc = k_ptr->x_char;
+ TERM_COLOR da = k_ptr->d_attr;
+ SYMBOL_CODE dc = k_ptr->d_char;
+ TERM_COLOR ca = k_ptr->x_attr;
+ SYMBOL_CODE cc = k_ptr->x_char;
/* Label the object */
Term_putstr(5, 17, -1, TERM_WHITE,
{
case 'n':
{
- int prev_k = k;
+ IDX prev_k = k;
do
{
if (!cmd_visuals_aux(i, &k, max_k_idx))
case '6':
{
static cptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
- static int f = 0;
- static int lighting_level = F_LIT_STANDARD;
+ static IDX f = 0;
+ static IDX lighting_level = F_LIT_STANDARD;
prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
/* Hack -- query until done */
while (1)
{
feature_type *f_ptr = &f_info[f];
- char c;
- int t;
+ int c;
+ IDX t;
- byte da = f_ptr->d_attr[lighting_level];
+ TERM_COLOR da = f_ptr->d_attr[lighting_level];
byte dc = f_ptr->d_char[lighting_level];
- byte ca = f_ptr->x_attr[lighting_level];
+ TERM_COLOR ca = f_ptr->x_attr[lighting_level];
byte cc = f_ptr->x_char[lighting_level];
/* Label the object */
{
case 'n':
{
- int prev_f = f;
+ IDX prev_f = f;
do
{
if (!cmd_visuals_aux(i, &f, max_f_idx))
/* Modify feature attr/chars (visual mode) */
case '9':
{
- int lighting_level = F_LIT_STANDARD;
+ IDX lighting_level = F_LIT_STANDARD;
do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
break;
}
* mode & 0x01 : check for non-empty group
* mode & 0x02 : visual operation only
*/
-static int collect_monsters(int grp_cur, s16b mon_idx[], BIT_FLAGS8 mode)
+static IDX collect_monsters(IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
{
- int i, mon_cnt = 0;
+ IDX i;
+ IDX mon_cnt = 0;
int dummy_why;
/* Get a list of x_char in this group */
{
int i, y, x;
- byte a = 0;
+ TERM_COLOR a = 0;
char c = ' ';
bool okay = TRUE;
for (i = 0; i < 16; i++)
{
/* Use attr matches */
- if (hack[i] == buf[x]) a = i;
+ if (hack[i] == buf[x]) a = (byte_hack)i;
}
/* Put the attr/char */
/* XTRA HACK RESLIST */
-static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, byte tval, char *where)
+static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where)
{
char o_name[MAX_NLEN];
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
if (!o_ptr->k_idx) return;
if (o_ptr->tval != tval) return;
store_type *st_ptr;
- byte tval;
+ OBJECT_TYPE_VALUE tval;
int i = 0;
int j = 0;
{
int y, x, i;
- byte a = 0, old_a = 0;
+ TERM_COLOR a = 0, old_a = 0;
char c = ' ';
FILE *fff, *tmpfff;
{
int y, x;
- byte a = 0;
+ TERM_COLOR a = 0;
char c = ' ';
FILE *fff;
*/
static void do_cmd_knowledge_artifacts(void)
{
- int i, k, x, y, n = 0;
+ IDX i;
+ IDX k;
+ POSITION x, y;
+ int n = 0;
IDX z;
u16b why = 3;
- s16b *who;
+ IDX *who;
FILE *fff;
*/
static void do_cmd_knowledge_uniques(void)
{
- int i, k, n = 0;
+ IDX i;
+ int k, n = 0;
u16b why = 2;
- s16b *who;
+ IDX *who;
FILE *fff;
*/
static void do_cmd_knowledge_weapon_exp(void)
{
- int i, j, num, weapon_exp;
+ int i, num, weapon_exp;
+ KIND_OBJECT_IDX j;
FILE *fff;
*/
static void do_cmd_knowledge_spell_exp(void)
{
- int i = 0, spell_exp, exp_level;
+ SPELL_IDX i = 0;
+ int spell_exp, exp_level;
FILE *fff;
const magic_type *s_ptr;
*/
static void do_cmd_knowledge_kill_count(void)
{
- int i, k, n = 0;
+ IDX i;
+ int k, n = 0;
u16b why = 2;
- s16b *who;
+ IDX *who;
FILE *fff;
}
else
{
- s16b This = r_ptr->r_pkills;
+ MONSTER_NUMBER This = r_ptr->r_pkills;
if (This > 0)
{
}
else
{
- s16b This = r_ptr->r_pkills;
+ MONSTER_NUMBER This = r_ptr->r_pkills;
if (This > 0)
{
#ifdef JP
/* p,tは人と数える by ita */
if (my_strchr("pt", r_ptr->d_char))
- fprintf(fff, " %3d 人の %s\n", This, r_name + r_ptr->name);
+ fprintf(fff, " %3d 人の %s\n", (int)This, r_name + r_ptr->name);
else
- fprintf(fff, " %3d 体の %s\n", This, r_name + r_ptr->name);
+ fprintf(fff, " %3d 体の %s\n", (int)This, r_name + r_ptr->name);
#else
if (This < 2)
{
/*
* Display visuals.
*/
-static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
+static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
{
int i, j;
{
byte a;
char c;
- int x = col + j;
- int y = row + i;
+ TERM_LEN x = col + j;
+ TERM_LEN y = row + i;
int ia, ic;
/* Bigtile mode uses double width */
/*
* Place the cursor at the collect position for visual mode
*/
-static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
+static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, byte c, TERM_COLOR attr_top, byte char_left)
{
int i = (a & 0x7f) - attr_top;
int j = c - char_left;
- int x = col + j;
- int y = row + i;
+ TERM_LEN x = col + j;
+ TERM_LEN y = row + i;
/* Bigtile mode uses double width */
if (use_bigtile) x += j;
/*
* Clipboard variables for copy&paste in visual mode
*/
-static byte attr_idx = 0;
+static TERM_COLOR attr_idx = 0;
static byte char_idx = 0;
/* Hack -- for feature lighting */
-static byte attr_idx_feat[F_LIT_MAX];
+static TERM_COLOR attr_idx_feat[F_LIT_MAX];
static byte char_idx_feat[F_LIT_MAX];
/*
*/
static bool visual_mode_command(char ch, bool *visual_list_ptr,
int height, int width,
- byte *attr_top_ptr, byte *char_left_ptr,
- byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
+ TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
+ TERM_COLOR *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
{
- static byte attr_old = 0, char_old = 0;
+ static TERM_COLOR attr_old = 0;
+ static byte char_old = 0;
switch (ch)
{
byte attr;
/* Get the race index */
- int r_idx = mon_idx[mon_top + i] ;
+ MONRACE_IDX r_idx = mon_idx[mon_top + i] ;
/* Access the race */
monster_race *r_ptr = &r_info[r_idx];
bool redraw;
bool visual_list = FALSE;
- byte attr_top = 0, char_left = 0;
+ TERM_COLOR attr_top = 0;
+ byte char_left = 0;
int browser_rows;
- POSITION wid, hgt;
+ TERM_LEN wid, hgt;
BIT_FLAGS8 mode;
for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
{
char o_name[80];
- byte a, c;
+ TERM_COLOR a;
+ byte c;
object_kind *flavor_k_ptr;
/* Get the object index */
- int k_idx = object_idx[object_top + i];
+ KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
/* Access the object */
object_kind *k_ptr = &k_info[k_idx];
/*
* Describe fake object
*/
-static void desc_obj_fake(IDX k_idx)
+static void desc_obj_fake(KIND_OBJECT_IDX k_idx)
{
object_type *o_ptr;
object_type object_type_body;
bool redraw;
bool visual_list = FALSE;
- byte attr_top = 0, char_left = 0;
+ TERM_COLOR attr_top = 0;
+ byte char_left = 0;
int browser_rows;
int wid, hgt;
/*
* Display the features in a group.
*/
-static void display_feature_list(int col, int row, int per_page, int *feat_idx,
- int feat_cur, int feat_top, bool visual_only, int lighting_level)
+static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_idx,
+ FEAT_IDX feat_cur, FEAT_IDX feat_top, bool visual_only, int lighting_level)
{
int lit_col[F_LIT_MAX], i, j;
int f_idx_col = use_bigtile ? 62 : 64;
byte attr;
/* Get the index */
- int f_idx = feat_idx[feat_top + i];
+ FEAT_IDX f_idx = feat_idx[feat_top + i];
/* Access the index */
feature_type *f_ptr = &f_info[f_idx];
/*
* Interact with feature visuals.
*/
-static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
+static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level)
{
IDX i;
int len, max;
bool redraw;
bool visual_list = FALSE;
- byte attr_top = 0, char_left = 0;
+ TERM_COLOR attr_top = 0;
+ byte char_left = 0;
int browser_rows;
int wid, hgt;
- byte attr_old[F_LIT_MAX];
+ TERM_COLOR attr_old[F_LIT_MAX];
byte char_old[F_LIT_MAX];
- byte *cur_attr_ptr, *cur_char_ptr;
+ TERM_COLOR *cur_attr_ptr;
+ byte *cur_char_ptr;
(void)C_WIPE(attr_old, F_LIT_MAX, byte);
(void)C_WIPE(char_old, F_LIT_MAX, byte);
browser_rows = hgt - 8;
/* Allocate the "feat_idx" array */
- C_MAKE(feat_idx, max_f_idx, int);
+ C_MAKE(feat_idx, max_f_idx, IDX);
max = 0;
grp_cnt = 0;
else if ((ch == 'D') || (ch == 'd'))
{
- byte prev_x_attr = f_ptr->x_attr[*lighting_level];
+ TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level];
byte prev_x_char = f_ptr->x_char[*lighting_level];
apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
}
/* Free the "feat_idx" array */
- C_KILL(feat_idx, max_f_idx, int);
+ C_KILL(feat_idx, max_f_idx, IDX);
}
fprintf(fff, _("《遂行中のクエスト》\n", "< Current Quest >\n"));
- for (i = 1; i < max_quests; i++)
+ for (i = 1; i < max_q_idx; i++)
{
if ((quest[i].status == QUEST_STATUS_TAKEN) ||
((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
{
#ifdef JP
sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
- quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
+ (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
#else
plural_aux(name);
sprintf(note," - kill %d %s, have killed %d.",
- quest[i].max_num, name, quest[i].cur_num);
+ (int)quest[i].max_num, name, (int)quest[i].cur_num);
#endif
}
else
artifact_type *a_ptr = &a_info[quest[i].k_idx];
object_type forge;
object_type *q_ptr = &forge;
- IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
+ KIND_OBJECT_IDX k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
object_prep(q_ptr, k_idx);
q_ptr->name1 = quest[i].k_idx;
q_ptr->ident = IDENT_STORE;
case QUEST_TYPE_KILL_NUMBER:
#ifdef JP
sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
- quest[i].max_num, quest[i].max_num - quest[i].cur_num);
+ (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
#else
sprintf(note," - Kill %d monsters, have killed %d.",
- quest[i].max_num, quest[i].cur_num);
+ (int)quest[i].max_num, (int)quest[i].cur_num);
#endif
break;
#ifdef JP
sprintf(rand_tmp_str," %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
quest[i].name, (int)quest[i].level,
- quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
+ (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
#else
plural_aux(name);
sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
- quest[i].name, (idx)quest[i].level,
- quest[i].max_num, name, quest[i].cur_num);
+ quest[i].name, (int)quest[i].level,
+ (int)quest[i].max_num, name, (int)quest[i].cur_num);
#endif
}
else
{
-#ifdef JP
- sprintf(rand_tmp_str," %s (%d 階) - %sを倒す。\n",
- quest[i].name, quest[i].level, name);
-#else
- sprintf(rand_tmp_str," %s (Dungeon level: %d)\n Kill %s.\n",
- quest[i].name, quest[i].level, name);
-#endif
+ sprintf(rand_tmp_str,_(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"),
+ quest[i].name, (int)quest[i].level, name);
}
}
}
if (is_fixed_quest_idx(q_idx))
{
/* Set the quest number temporary */
- int old_quest = p_ptr->inside_quest;
+ IDX old_quest = p_ptr->inside_quest;
p_ptr->inside_quest = q_idx;
int total = 0;
fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n"));
- for (i = 1; i < max_quests; i++)
+ for (i = 1; i < max_q_idx; i++)
{
IDX q_idx = quest_num[i];
quest_type* const q_ptr = &quest[q_idx];
*/
void do_cmd_knowledge_quests_failed(FILE *fff, IDX quest_num[])
{
- int i;
+ IDX i;
int total = 0;
fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n"));
- for (i = 1; i < max_quests; i++)
+ for (i = 1; i < max_q_idx; i++)
{
- int q_idx = quest_num[i];
+ IDX q_idx = quest_num[i];
quest_type* const q_ptr = &quest[q_idx];
if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
int total = 0;
fprintf(fff, _("《残りのランダムクエスト》\n", "< Remaining Random Quest >\n"));
- for (i = 1; i < max_quests; i++)
+ for (i = 1; i < max_q_idx; i++)
{
/* No info from "silent" quests */
if (quest[i].flags & QUEST_FLAG_SILENT) continue;
total++;
/* Print the quest info */
-#ifdef JP
- sprintf(tmp_str, " %s (%d階, %s)\n",
- quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
-#else
- sprintf(tmp_str, " %s (%d, %s)\n",
- quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
-#endif
+ sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
+ quest[i].name, (int)quest[i].level, r_name+r_info[quest[i].r_idx].name);
fputs(tmp_str, fff);
}
}
bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
{
- int *q_num = (int *)u;
+ QUEST_IDX *q_num = (QUEST_IDX *)u;
quest_type *qa = &quest[q_num[a]];
quest_type *qb = &quest[q_num[b]];
/* Unused */
(void)v;
- return (qa->comptime <= qb->comptime);
+ return (qa->comptime != qb->comptime) ?
+ (qa->comptime < qb->comptime) :
+ (qa->level <= qb->level);
}
void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
{
- int *q_num = (int *)u;
- int tmp;
+ QUEST_IDX *q_num = (QUEST_IDX *)u;
+ QUEST_IDX tmp;
/* Unused */
(void)v;
FILE *fff;
char file_name[1024];
IDX *quest_num;
- int dummy, i;
+ int dummy;
+ IDX i;
/* Open a new file */
fff = my_fopen_temp(file_name, 1024);
}
/* Allocate Memory */
- C_MAKE(quest_num, max_quests, int);
+ C_MAKE(quest_num, max_q_idx, IDX);
/* Sort by compete level */
- for (i = 1; i < max_quests; i++) quest_num[i] = i;
+ for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
ang_sort_comp = ang_sort_comp_quest_num;
ang_sort_swap = ang_sort_swap_quest_num;
- ang_sort(quest_num, &dummy, max_quests);
+ ang_sort(quest_num, &dummy, max_q_idx);
/* Dump Quest Information */
do_cmd_knowledge_quests_current(fff);
fd_kill(file_name);
/* Free Memory */
- C_KILL(quest_num, max_quests, int);
+ C_KILL(quest_num, max_q_idx, IDX);
}
if (st_ptr->stock_num)
{
#ifdef JP
- int x = 1;
+ TERM_LEN x = 1;
#endif
/* Header with name of the town */
fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
break;
case '0': /* Feature list */
{
- int lighting_level = F_LIT_STANDARD;
+ IDX lighting_level = F_LIT_STANDARD;
do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
}
break;