*/
#include "angband.h"
+#include "util.h"
+#include "term.h"
+
+#include "core.h"
+#include "artifact.h"
#include "sort.h"
#include "store.h"
+#include "monster.h"
+#include "object-flavor.h"
+#include "object-hook.h"
+#include "object-ego.h"
+#include "objectkind.h"
+#include "floor-town.h"
+#include "files.h"
#ifdef ALLOW_SPOILERS
(*lev) = k_info[q_ptr->k_idx].level;
(*val) = object_value(q_ptr);
- /* Hack */
if (!buf || !dam || !chance || !wgt) return;
/* Description (too brief) */
char chance[80];
char dam[80];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
if (!i) return (FALSE);
- /* Create the artifact */
object_prep(o_ptr, i);
/* Save the name */
object_type *q_ptr;
obj_desc_list artifact;
char buf[1024];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
char ac[80];
char hp[80];
char exp[80];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
if (r_ptr->name) who[n++] = (s16b)i;
}
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_hook;
- ang_sort_swap = ang_sort_swap_hook;
-
/* Sort the array by dungeon depth of monsters */
- ang_sort(who, &why, n);
+ ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
/* Scan again */
for (i = 0; i < n; i++)
sprintf(nam, _(" %s", "The %s"), name);
}
-
/* Level */
sprintf(lev, "%d", (int)r_ptr->level);
/* Rarity */
sprintf(rar, "%d", (int)r_ptr->rarity);
- /* Speed */
if (r_ptr->speed >= 110)
{
sprintf(spd, "+%d", (r_ptr->speed - 110));
u16b why = 2;
MONRACE_IDX *who;
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
if (r_ptr->name) who[n++] = (s16b)i;
}
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_hook;
- ang_sort_swap = ang_sort_swap_hook;
-
- /* Sort the array by dungeon depth of monsters */
- ang_sort(who, &why, n);
-
+ ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
/*
* List all monsters in order
sprintf(buf, "Rar:%d ", r_ptr->rarity);
spoil_out(buf);
- /* Speed */
if (r_ptr->speed >= 110)
{
sprintf(buf, "Spd:+%d ", (r_ptr->speed - 110));
return FALSE;
}
-
-/*!
- * @brief 進化ツリーをソートするためモンスター種族の判定関数 /
- * Sorting hook -- Comp function
- * @param u 進化木構造データ
- * @param v 未使用
- * @param a 比較したいモンスター種族ID1
- * @param b 比較したいモンスター種族ID2
- * @return 2が大きければTRUEを返す
- */
-static bool ang_sort_comp_evol_tree(vptr u, vptr v, int a, int b)
-{
- int **evol_tree = (int **)u;
-
- int w1 = evol_tree[a][0];
- int w2 = evol_tree[b][0];
- monster_race *r1_ptr = &r_info[w1];
- monster_race *r2_ptr = &r_info[w2];
-
- /* Unused */
- (void)v;
-
- /* Used tree first */
- if (w1 && !w2) return TRUE;
- if (!w1 && w2) return FALSE;
-
- /* Sort by monster level */
- if (r1_ptr->level < r2_ptr->level) return TRUE;
- if (r1_ptr->level > r2_ptr->level) return FALSE;
-
- /* Sort by monster experience */
- if (r1_ptr->mexp < r2_ptr->mexp) return TRUE;
- if (r1_ptr->mexp > r2_ptr->mexp) return FALSE;
-
- /* Compare indexes */
- return w1 <= w2;
-}
-
-/*!
- * @brief 進化ツリーをソートするため木構造のスワップ関数 /
- * Sorting hook -- Swap function
- * @param u 進化木構造データ
- * @param v 未使用
- * @param a スワップしたい木構造1
- * @param b スワップしたい木構造2
- * @return 2が大きければTRUEを返す
- */
-static void ang_sort_swap_evol_tree(vptr u, vptr v, int a, int b)
-{
- int **evol_tree = (int **)u;
- int *holder;
-
- /* Unused */
- (void)v;
-
- /* Swap */
- holder = evol_tree[a];
- evol_tree[a] = evol_tree[b];
- evol_tree[b] = holder;
-}
-
/*!
* @brief 進化ツリーをスポイラー出力するメインルーチン /
* Print monsters' evolution information to file
monster_race *r_ptr;
int **evol_tree, i, j, n, r_idx;
int *evol_tree_zero; /* For C_KILL() */
-
- /* Build the filename */
path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
}
/* Step 3: Sort the evolution trees */
-
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_evol_tree;
- ang_sort_swap = ang_sort_swap_evol_tree;
-
- /* Sort the array */
- ang_sort(evol_tree, NULL, max_r_idx);
+ ang_sort(evol_tree, NULL, max_r_idx, ang_sort_comp_evol_tree, ang_sort_swap_evol_tree);
/* Step 4: Print the evolution trees */
for (i = 0; i < max_r_idx; i++)
}
-
-/*
- * Forward declare
- */
-extern void do_cmd_spoilers(void);
-
/*!
* @brief スポイラー出力を行うコマンドのメインルーチン /
* Create Spoiler files -BEN-
object_type *q_ptr;
char buf[1024];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* random artifacts wielding */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &p_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}
- /* random artifacts in inventory */
+ /* random artifacts in p_ptr->inventory_list */
for (i = 0; i < INVEN_PACK; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &p_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}