}
}
-
-/*
- * Sorting hook -- Comp function -- see below
- *
- * We use "u" to point to array of monster indexes,
- * and "v" to select the type of sorting to perform on "u".
- */
-static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
-{
- u16b *who = (u16b*)(u);
-
- u16b *why = (u16b*)(v);
-
- int w1 = who[a];
- int w2 = who[b];
-
- int z1, z2;
-
- /* Sort by total kills */
- if (*why >= 3)
- {
- /* Extract total kills */
- z1 = a_info[w1].tval;
- z2 = a_info[w2].tval;
-
- /* Compare total kills */
- if (z1 < z2) return (TRUE);
- if (z1 > z2) return (FALSE);
- }
-
-
- /* Sort by monster level */
- if (*why >= 2)
- {
- /* Extract levels */
- z1 = a_info[w1].sval;
- z2 = a_info[w2].sval;
-
- /* Compare levels */
- if (z1 < z2) return (TRUE);
- if (z1 > z2) return (FALSE);
- }
-
-
- /* Sort by monster experience */
- if (*why >= 1)
- {
- /* Extract experience */
- z1 = a_info[w1].level;
- z2 = a_info[w2].level;
-
- /* Compare experience */
- if (z1 < z2) return (TRUE);
- if (z1 > z2) return (FALSE);
- }
-
-
- /* Compare indexes */
- return (w1 <= w2);
-}
-
-
-/*
- * Sorting hook -- Swap function -- see below
- *
- * We use "u" to point to array of monster indexes,
- * and "v" to select the type of sorting to perform.
- */
-static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
-{
- u16b *who = (u16b*)(u);
-
- u16b holder;
-
- /* Unused */
- (void)v;
-
- /* Swap */
- holder = who[a];
- who[a] = who[b];
- who[b] = holder;
-}
-
-
/*
* Check the status of "artifacts"
*/
if (!total) fprintf(fff, _(" なし\n", " Nothing.\n"));
}
-
-bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
-{
- 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) ?
- (qa->comptime < qb->comptime) :
- (qa->level <= qb->level);
-}
-
-void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
-{
- QUEST_IDX *q_num = (QUEST_IDX *)u;
- QUEST_IDX tmp;
-
- /* Unused */
- (void)v;
-
- tmp = q_num[a];
- q_num[a] = q_num[b];
- q_num[b] = tmp;
-}
-
-
/*
* Print quest status of all active quests
*/
extern void do_cmd_save_screen(void);
extern void do_cmd_knowledge_quests_completed(FILE *fff, QUEST_IDX quest_num[]);
extern void do_cmd_knowledge_quests_failed(FILE *fff, QUEST_IDX quest_num[]);
-extern bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b);
-extern void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b);
extern void do_cmd_knowledge(void);
extern void plural_aux(char * Name);
extern void do_cmd_checkquest(void);
y[a] = y[b];
y[b] = temp;
}
+
+
+
+/*
+ * Sorting hook -- Comp function -- see below
+ *
+ * We use "u" to point to array of monster indexes,
+ * and "v" to select the type of sorting to perform on "u".
+ */
+bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
+{
+ u16b *who = (u16b*)(u);
+ u16b *why = (u16b*)(v);
+
+ int w1 = who[a];
+ int w2 = who[b];
+
+ int z1, z2;
+
+ /* Sort by total kills */
+ if (*why >= 3)
+ {
+ /* Extract total kills */
+ z1 = a_info[w1].tval;
+ z2 = a_info[w2].tval;
+
+ /* Compare total kills */
+ if (z1 < z2) return (TRUE);
+ if (z1 > z2) return (FALSE);
+ }
+
+
+ /* Sort by monster level */
+ if (*why >= 2)
+ {
+ /* Extract levels */
+ z1 = a_info[w1].sval;
+ z2 = a_info[w2].sval;
+
+ /* Compare levels */
+ if (z1 < z2) return (TRUE);
+ if (z1 > z2) return (FALSE);
+ }
+
+
+ /* Sort by monster experience */
+ if (*why >= 1)
+ {
+ /* Extract experience */
+ z1 = a_info[w1].level;
+ z2 = a_info[w2].level;
+
+ /* Compare experience */
+ if (z1 < z2) return (TRUE);
+ if (z1 > z2) return (FALSE);
+ }
+
+
+ /* Compare indexes */
+ return (w1 <= w2);
+}
+
+
+/*
+ * Sorting hook -- Swap function -- see below
+ *
+ * We use "u" to point to array of monster indexes,
+ * and "v" to select the type of sorting to perform.
+ */
+void ang_sort_art_swap(vptr u, vptr v, int a, int b)
+{
+ u16b *who = (u16b*)(u);
+
+ u16b holder;
+
+ /* Unused */
+ (void)v;
+
+ /* Swap */
+ holder = who[a];
+ who[a] = who[b];
+ who[b] = holder;
+}
+
+bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b)
+{
+ 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) ?
+ (qa->comptime < qb->comptime) :
+ (qa->level <= qb->level);
+}
+
+void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b)
+{
+ QUEST_IDX *q_num = (QUEST_IDX *)u;
+ QUEST_IDX tmp;
+
+ /* Unused */
+ (void)v;
+
+ tmp = q_num[a];
+ q_num[a] = q_num[b];
+ q_num[b] = tmp;
+}
+
extern bool ang_sort_comp_distance(vptr u, vptr v, int a, int b);
extern bool ang_sort_comp_importance(vptr u, vptr v, int a, int b);
extern void ang_sort_swap_distance(vptr u, vptr v, int a, int b);
+
+extern bool ang_sort_art_comp(vptr u, vptr v, int a, int b);
+extern void ang_sort_art_swap(vptr u, vptr v, int a, int b);
+
+extern bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b);
+extern void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b);
if (p_ptr->image) return (FALSE);
- /* Examine the grid */
g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Interesting memorized features */