*/
#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
-/*
- * The spoiler file being created
- */
+ /*
+ * The spoiler file being created
+ */
static FILE *fff = NULL;
* @param r_ptr モンスター種族の構造体ポインタ
* @return シンボル職の記述名
*/
-static cptr attr_to_text(monster_race *r_ptr)
+static concptr attr_to_text(monster_race *r_ptr)
{
#ifdef JP000
if (r_ptr->flags1 & RF1_ATTR_CLEAR) return "透明な";
#endif
}
- /* Oops */
#ifdef JP000
return "変な";
#else
*/
typedef struct
{
- byte tval;
- cptr name;
+ OBJECT_TYPE_VALUE tval;
+ concptr name;
} grouper;
*/
-/*
- * The basic items categorized by type
- */
+ /*
+ * The basic items categorized by type
+ */
static grouper group_item[] =
{
{ TV_SHOT, _("射撃物", "Ammo") },
{ TV_SHIELD, NULL },
{ TV_CLOAK, NULL },
-#ifdef JP
- { TV_LITE, "光源" },
- { TV_AMULET, "アミュレット" },
- { TV_RING, "指輪" },
-#else
- { TV_LITE, "Light Sources" },
- { TV_AMULET, "Amulets" },
- { TV_RING, "Rings" },
-#endif
-
-#ifdef JP
- { TV_STAFF, "杖" },
- { TV_WAND, "魔法棒" },
- { TV_ROD, "ロッド" },
-#else
- { TV_STAFF, "Staffs" },
- { TV_WAND, "Wands" },
- { TV_ROD, "Rods" },
-#endif
-
-#ifdef JP
- { TV_SCROLL, "巻物" },
- { TV_POTION, "薬" },
- { TV_FOOD, "食料" },
-#else
- { TV_SCROLL, "Scrolls" },
- { TV_POTION, "Potions" },
- { TV_FOOD, "Food" },
-#endif
-
-#ifdef JP
- { TV_LIFE_BOOK, "魔法書 (生命)" },
- { TV_SORCERY_BOOK, "魔法書 (仙術)" },
- { TV_NATURE_BOOK, "魔法書 (自然)" },
- { TV_CHAOS_BOOK, "魔法書 (カオス)" },
- { TV_DEATH_BOOK, "魔法書 (暗黒)" },
- { TV_TRUMP_BOOK, "魔法書 (トランプ)" },
- { TV_ARCANE_BOOK, "魔法書 (秘術)" },
- { TV_CRAFT_BOOK, "魔法書 (匠)" },
- { TV_DAEMON_BOOK, "魔法書 (悪魔)" },
- { TV_CRUSADE_BOOK, "魔法書 (破邪)" },
- { TV_MUSIC_BOOK, "歌集" },
- { TV_HISSATSU_BOOK, "武芸の書" },
- { TV_HEX_BOOK, "魔法書 (呪術)" },
-#else
- { TV_LIFE_BOOK, "Books (Life)" },
- { TV_SORCERY_BOOK, "Books (Sorcery)" },
- { TV_NATURE_BOOK, "Books (Nature)" },
- { TV_CHAOS_BOOK, "Books (Chaos)" },
- { TV_DEATH_BOOK, "Books (Death)" },
- { TV_TRUMP_BOOK, "Books (Trump)" },
- { TV_ARCANE_BOOK, "Books (Arcane)" },
- { TV_CRAFT_BOOK, "Books (Craft)" },
- { TV_DAEMON_BOOK, "Books (Daemon)" },
- { TV_CRUSADE_BOOK, "Books (Crusade)" },
- { TV_MUSIC_BOOK, "Song Books" },
- { TV_HISSATSU_BOOK, "Books (Kendo)" },
- { TV_HEX_BOOK, "Books (Hex)" },
-#endif
-
-#ifdef JP
- { TV_WHISTLE, "笛" },
- { TV_CAPTURE, "キャプチャー・ボール" },
- { TV_CARD, "エクスプレスカード" },
-#else
- { TV_WHISTLE, "Whistle" },
- { TV_CAPTURE, "Capture Ball" },
- { TV_CARD, "Express Card" },
-#endif
+ { TV_LITE, _("光源", "Light Sources") },
+ { TV_AMULET, _("アミュレット", "Amulets")},
+ { TV_RING, _("指輪", "Rings") },
+ { TV_STAFF, _("杖", "Staffs") },
+ { TV_WAND, _("魔法棒", "Wands") },
+ { TV_ROD, _("ロッド", "Rods") },
+ { TV_SCROLL, _("巻物", "Scrolls") },
+ { TV_POTION, _("薬", "Potions") },
+ { TV_FOOD, _("食料", "Food") },
+
+ { TV_LIFE_BOOK, _("魔法書 (生命)", "Books (Life)") },
+ { TV_SORCERY_BOOK, _("魔法書 (仙術)", "Books (Sorcery)") },
+ { TV_NATURE_BOOK, _("魔法書 (自然)", "Books (Nature)") },
+ { TV_CHAOS_BOOK, _("魔法書 (カオス)", "Books (Chaos)") },
+ { TV_DEATH_BOOK, _("魔法書 (暗黒)", "Books (Death)") },
+ { TV_TRUMP_BOOK, _("魔法書 (トランプ)", "Books (Trump)") },
+ { TV_ARCANE_BOOK, _("魔法書 (秘術)", "Books (Arcane)") },
+ { TV_CRAFT_BOOK, _("魔法書 (匠)", "Books (Craft)") },
+ { TV_DAEMON_BOOK, _("魔法書 (悪魔)", "Books (Daemon)") },
+ { TV_CRUSADE_BOOK, _("魔法書 (破邪)", "Books (Crusade)") },
+ { TV_MUSIC_BOOK, _("歌集", "Song Books") },
+ { TV_HISSATSU_BOOK, _("武芸の書", "Books (Kendo)") },
+ { TV_HEX_BOOK, _("魔法書 (呪術)", "Books (Hex)") },
+
+ { TV_WHISTLE, _("笛", "Whistle") },
+ { TV_CAPTURE, _("キャプチャー・ボール", "Capture Ball") },
+ { TV_CARD, _("エクスプレスカード", "Express Card") },
{ TV_CHEST, _("箱", "Chests") },
-#ifdef JP
- { TV_FIGURINE, "人形" },
- { TV_STATUE, "像" },
- { TV_CORPSE, "死体" },
-#else
- { TV_FIGURINE, "Magical Figurines" },
- { TV_STATUE, "Statues" },
- { TV_CORPSE, "Corpses" },
-#endif
+ { TV_FIGURINE, _("人形", "Magical Figurines") },
+ { TV_STATUE, _("像", "Statues") },
+ { TV_CORPSE, _("死体", "Corpses") },
{ TV_SKELETON, _("その他", "Misc") },
{ TV_BOTTLE, NULL },
* @param k ベースアイテムID
* @return なし
*/
-static void kind_info(char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, s32b *val, IDX k)
+static void kind_info(char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, PRICE *val, OBJECT_IDX k)
{
object_type forge;
object_type *q_ptr;
int i;
-
- /* Get local object */
q_ptr = &forge;
/* Prepare a fake item */
q_ptr->to_h = 0;
q_ptr->to_d = 0;
-
- /* Level */
(*lev) = k_info[q_ptr->k_idx].level;
-
- /* Value */
(*val) = object_value(q_ptr);
-
- /* Hack */
if (!buf || !dam || !chance || !wgt) return;
-
/* Description (too brief) */
object_desc(buf, q_ptr, (OD_NAME_ONLY | OD_STORE));
-
/* Misc info */
strcpy(dam, "");
switch (q_ptr->tval)
{
/* Bows */
- case TV_BOW:
- {
- break;
- }
+ case TV_BOW:
+ {
+ break;
+ }
- /* Ammo */
- case TV_SHOT:
- case TV_BOLT:
- case TV_ARROW:
- {
- sprintf(dam, "%dd%d", q_ptr->dd, q_ptr->ds);
- break;
- }
+ /* Ammo */
+ case TV_SHOT:
+ case TV_BOLT:
+ case TV_ARROW:
+ {
+ sprintf(dam, "%dd%d", q_ptr->dd, q_ptr->ds);
+ break;
+ }
- /* Weapons */
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_SWORD:
- case TV_DIGGING:
- {
- sprintf(dam, "%dd%d", q_ptr->dd, q_ptr->ds);
- break;
- }
+ /* Weapons */
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ case TV_DIGGING:
+ {
+ sprintf(dam, "%dd%d", q_ptr->dd, q_ptr->ds);
+ break;
+ }
- /* Armour */
- case TV_BOOTS:
- case TV_GLOVES:
- case TV_CLOAK:
- case TV_CROWN:
- case TV_HELM:
- case TV_SHIELD:
- case TV_SOFT_ARMOR:
- case TV_HARD_ARMOR:
- case TV_DRAG_ARMOR:
- {
- sprintf(dam, "%d", q_ptr->ac);
- break;
- }
+ /* Armour */
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_CLOAK:
+ case TV_CROWN:
+ case TV_HELM:
+ case TV_SHIELD:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ {
+ sprintf(dam, "%d", q_ptr->ac);
+ break;
+ }
}
/* Chance */
strcpy(chance, "");
- for(i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
{
char chance_aux[20] = "";
- if(k_info[q_ptr->k_idx].chance[i] > 0)
+ if (k_info[q_ptr->k_idx].chance[i] > 0)
{
- sprintf(chance_aux, "%s%3dF:%+4d", (i != 0 ? "/" : ""), k_info[q_ptr->k_idx].locale[i], 100/k_info[q_ptr->k_idx].chance[i]);
+ sprintf(chance_aux, "%s%3dF:%+4d", (i != 0 ? "/" : ""),
+ (int)k_info[q_ptr->k_idx].locale[i], 100 / k_info[q_ptr->k_idx].chance[i]);
strcat(chance, chance_aux);
}
}
/* Weight */
- sprintf(wgt, "%3d.%d", q_ptr->weight / 10, q_ptr->weight % 10);
+ sprintf(wgt, "%3d.%d", (int)(q_ptr->weight / 10), (int)(q_ptr->weight % 10));
}
* @param fname ファイル名
* @return なし
*/
-static void spoil_obj_desc(cptr fname)
+static void spoil_obj_desc(concptr fname)
{
int i, k, s, t, n = 0, group_start = 0;
- u16b who[200];
+ OBJECT_IDX who[200];
char buf[1024];
char chance[80];
char dam[80];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* Header */
fprintf(fff, "Spoiler File -- Basic Items (Hengband %d.%d.%d.%d)\n\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
/* More Header */
fprintf(fff, "%-37s%8s%7s%5s %40s%9s\n",
int i1 = t;
int i2 = t + 1;
- int e1;
- int e2;
+ DEPTH e1;
+ DEPTH e2;
- DEPTH t1;
- DEPTH t2;
+ PRICE t1;
+ PRICE t2;
kind_info(NULL, NULL, NULL, NULL, &e1, &t1, who[i1]);
kind_info(NULL, NULL, NULL, NULL, &e2, &t2, who[i2]);
/* Spoil each item */
for (s = 0; s < n; s++)
{
- int e;
- DEPTH v;
+ DEPTH e;
+ PRICE v;
/* Describe the kind */
kind_info(buf, dam, wgt, chance, &e, &v, who[s]);
/* Dump it */
fprintf(fff, " %-35s%8s%7s%5d %-40s%9ld\n",
- buf, dam, wgt, e, chance, (long)(v));
+ buf, dam, wgt, (int)e, chance, (long)(v));
}
/* Start a new set */
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
*/
-/*
- * Returns a "+" string if a number is non-negative and an empty
- * string if negative
- */
+ /*
+ * Returns a "+" string if a number is non-negative and an empty
+ * string if negative
+ */
#define POSITIZE(v) (((v) >= 0) ? "+" : "")
-/*
- * These are used to format the artifact spoiler file. INDENT1 is used
- * to indent all but the first line of an artifact spoiler. INDENT2 is
- * used when a line "wraps". (Bladeturner's resistances cause this.)
- */
+ /*
+ * These are used to format the artifact spoiler file. INDENT1 is used
+ * to indent all but the first line of an artifact spoiler. INDENT2 is
+ * used when a line "wraps". (Bladeturner's resistances cause this.)
+ */
#define INDENT1 " "
#define INDENT2 " "
-/*
- * MAX_LINE_LEN specifies when a line should wrap.
- */
+ /*
+ * MAX_LINE_LEN specifies when a line should wrap.
+ */
#define MAX_LINE_LEN 75
-/*
- * Given an array, determine how many elements are in the array
- */
+ /*
+ * Given an array, determine how many elements are in the array
+ */
#define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0]))
-/*
- * The artifacts categorized by type
- */
+ /*
+ * The artifacts categorized by type
+ */
static grouper group_artifact[] =
{
#ifdef JP
struct flag_desc
{
const int flag;
- const char *const desc;
+ concptr const desc;
};
{ TR_SLOW_DIGEST, "遅消化" },
{ TR_REGEN, "急速回復" },
{ TR_WARNING, "警告" },
-/* { TR_XTRA_MIGHT, "強力射撃" }, */
- { TR_XTRA_SHOTS, "追加射撃" }, /* always +1? */
- { TR_DRAIN_EXP, "経験値吸収" },
- { TR_AGGRAVATE, "反感" },
- { TR_BLESSED, "祝福" },
- { TR_DEC_MANA, "消費魔力減少" },
-#else
- { TR_SH_FIRE, "Fiery Aura" },
- { TR_SH_ELEC, "Electric Aura" },
- { TR_SH_COLD, "Coldly Aura" },
- { TR_NO_TELE, "Prevent Teleportation" },
- { TR_NO_MAGIC, "Anti-Magic" },
- { TR_LEVITATION, "Levitation" },
- { TR_SEE_INVIS, "See Invisible" },
- { TR_TELEPATHY, "ESP" },
- { TR_ESP_ANIMAL, "Sense Animal" },
- { TR_ESP_UNDEAD, "Sense Undead" },
- { TR_ESP_DEMON, "Sense Demon" },
- { TR_ESP_ORC, "Sense Orc" },
- { TR_ESP_TROLL, "Sense Troll" },
- { TR_ESP_GIANT, "Sense Giant" },
- { TR_ESP_DRAGON, "Sense Dragon" },
- { TR_ESP_HUMAN, "Sense Human" },
- { TR_ESP_EVIL, "Sense Evil" },
- { TR_ESP_GOOD, "Sense Good" },
- { TR_ESP_NONLIVING, "Sense Nonliving" },
- { TR_ESP_UNIQUE, "Sense Unique" },
- { TR_SLOW_DIGEST, "Slow Digestion" },
- { TR_REGEN, "Regeneration" },
- { TR_WARNING, "Warning" },
-/* { TR_XTRA_MIGHT, "Extra Might" }, */
- { TR_XTRA_SHOTS, "+1 Extra Shot" }, /* always +1? */
- { TR_DRAIN_EXP, "Drains Experience" },
- { TR_AGGRAVATE, "Aggravates" },
- { TR_BLESSED, "Blessed Blade" },
- { TR_DEC_MANA, "Decrease Mana Consumption Rate" },
-#endif
+ /* { TR_XTRA_MIGHT, "強力射撃" }, */
+ { TR_XTRA_SHOTS, "追加射撃" }, /* always +1? */
+ { TR_DRAIN_EXP, "経験値吸収" },
+ { TR_AGGRAVATE, "反感" },
+ { TR_BLESSED, "祝福" },
+ { TR_DEC_MANA, "消費魔力減少" },
+ #else
+ { TR_SH_FIRE, "Fiery Aura" },
+ { TR_SH_ELEC, "Electric Aura" },
+ { TR_SH_COLD, "Coldly Aura" },
+ { TR_NO_TELE, "Prevent Teleportation" },
+ { TR_NO_MAGIC, "Anti-Magic" },
+ { TR_LEVITATION, "Levitation" },
+ { TR_SEE_INVIS, "See Invisible" },
+ { TR_TELEPATHY, "ESP" },
+ { TR_ESP_ANIMAL, "Sense Animal" },
+ { TR_ESP_UNDEAD, "Sense Undead" },
+ { TR_ESP_DEMON, "Sense Demon" },
+ { TR_ESP_ORC, "Sense Orc" },
+ { TR_ESP_TROLL, "Sense Troll" },
+ { TR_ESP_GIANT, "Sense Giant" },
+ { TR_ESP_DRAGON, "Sense Dragon" },
+ { TR_ESP_HUMAN, "Sense Human" },
+ { TR_ESP_EVIL, "Sense Evil" },
+ { TR_ESP_GOOD, "Sense Good" },
+ { TR_ESP_NONLIVING, "Sense Nonliving" },
+ { TR_ESP_UNIQUE, "Sense Unique" },
+ { TR_SLOW_DIGEST, "Slow Digestion" },
+ { TR_REGEN, "Regeneration" },
+ { TR_WARNING, "Warning" },
+ /* { TR_XTRA_MIGHT, "Extra Might" }, */
+ { TR_XTRA_SHOTS, "+1 Extra Shot" }, /* always +1? */
+ { TR_DRAIN_EXP, "Drains Experience" },
+ { TR_AGGRAVATE, "Aggravates" },
+ { TR_BLESSED, "Blessed Blade" },
+ { TR_DEC_MANA, "Decrease Mana Consumption Rate" },
+ #endif
};
*
* This list includes extra attacks, for simplicity.
*/
- cptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 +
- N_ELEMENTS(pval_flags1_desc) + 1];
+ concptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 +
+ N_ELEMENTS(pval_flags1_desc) + 1];
} pval_info_type;
pval_info_type pval_info;
/* A list of an object's slaying preferences */
- cptr slays[N_ELEMENTS(slay_flags_desc) + 1];
+ concptr slays[N_ELEMENTS(slay_flags_desc) + 1];
/* A list if an object's elemental brands */
- cptr brands[N_ELEMENTS(brand_flags_desc) + 1];
+ concptr brands[N_ELEMENTS(brand_flags_desc) + 1];
/* A list of immunities granted by an object */
- cptr immunities[N_ELEMENTS(immune_flags_desc) + 1];
+ concptr immunities[N_ELEMENTS(immune_flags_desc) + 1];
/* A list of resistances granted by an object */
- cptr resistances[N_ELEMENTS(resist_flags_desc) + 1];
+ concptr resistances[N_ELEMENTS(resist_flags_desc) + 1];
/* A list of stats sustained by an object */
- cptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1];
+ concptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1];
/* A list of various magical qualities an object may have */
- cptr misc_magic[N_ELEMENTS(misc_flags2_desc) + N_ELEMENTS(misc_flags3_desc)
- + 1 /* Permanent Light */
- + 1 /* TY curse */
- + 1 /* type of curse */
- + 1]; /* sentinel NULL */
+ concptr misc_magic[N_ELEMENTS(misc_flags2_desc) + N_ELEMENTS(misc_flags3_desc)
+ + 1 /* Permanent Light */
+ + 1 /* TY curse */
+ + 1 /* type of curse */
+ + 1]; /* sentinel NULL */
- /* Additional ability or resistance */
+/* Additional ability or resistance */
char addition[80];
/* A string describing an artifact's activation */
- cptr activation;
+ concptr activation;
/* "Level 20, Rarity 30, 3.0 lbs, 20000 Gold" */
char misc_desc[80];
* @param str 出力したい文字列
* @return なし
*/
-static void spoiler_underline(cptr str)
+static void spoiler_underline(concptr str)
{
fprintf(fff, "%s\n", str);
spoiler_out_n_chars(strlen(str), '-');
* The possibly updated description pointer is returned.
* </pre>
*/
-static cptr *spoiler_flag_aux(const u32b art_flags[TR_FLAG_SIZE],
- const flag_desc *flag_ptr,
- cptr *desc_ptr, const int n_elmnts)
+static concptr *spoiler_flag_aux(const BIT_FLAGS art_flags[TR_FLAG_SIZE],
+ const flag_desc *flag_ptr,
+ concptr *desc_ptr, const int n_elmnts)
{
int i;
* List "player traits" altered by an artifact's pval. These include stats,
* speed, infravision, tunneling, stealth, searching, and extra attacks.
* @param o_ptr オブジェクト構造体の参照ポインタ
- * @param p_ptr pval修正構造体の参照ポインタ
+ * @param pi_ptr pval修正構造体の参照ポインタ
* @return なし
*/
static void analyze_pval(object_type *o_ptr, pval_info_type *pi_ptr)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
- cptr *affects_list;
+ concptr *affects_list;
/* If pval == 0, there is nothing to do. */
if (!o_ptr->pval)
pi_ptr->pval_desc[0] = '\0';
return;
}
-
- /* Extract the flags */
object_flags(o_ptr, flgs);
affects_list = pi_ptr->pval_affects;
/* First, check to see if the pval affects all stats */
if (have_flag(flgs, TR_STR) && have_flag(flgs, TR_INT) &&
- have_flag(flgs, TR_WIS) && have_flag(flgs, TR_DEX) &&
- have_flag(flgs, TR_CON) && have_flag(flgs, TR_CHR))
+ have_flag(flgs, TR_WIS) && have_flag(flgs, TR_DEX) &&
+ have_flag(flgs, TR_CON) && have_flag(flgs, TR_CHR))
{
*affects_list++ = _("全能力", "All stats");
}
/* Are any stats affected? */
else if (have_flag(flgs, TR_STR) || have_flag(flgs, TR_INT) ||
- have_flag(flgs, TR_WIS) || have_flag(flgs, TR_DEX) ||
- have_flag(flgs, TR_CON) || have_flag(flgs, TR_CHR))
+ have_flag(flgs, TR_WIS) || have_flag(flgs, TR_DEX) ||
+ have_flag(flgs, TR_CON) || have_flag(flgs, TR_CHR))
{
affects_list = spoiler_flag_aux(flgs, stat_flags_desc,
- affects_list,
- N_ELEMENTS(stat_flags_desc));
+ affects_list,
+ N_ELEMENTS(stat_flags_desc));
}
/* And now the "rest" */
affects_list = spoiler_flag_aux(flgs, pval_flags1_desc,
- affects_list,
- N_ELEMENTS(pval_flags1_desc));
+ affects_list,
+ N_ELEMENTS(pval_flags1_desc));
/* Terminate the description list */
*affects_list = NULL;
* @param slay_list 種族スレイ構造体の参照ポインタ
* @return なし
*/
-static void analyze_slay(object_type *o_ptr, cptr *slay_list)
+static void analyze_slay(object_type *o_ptr, concptr *slay_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
slay_list = spoiler_flag_aux(flgs, slay_flags_desc, slay_list,
- N_ELEMENTS(slay_flags_desc));
+ N_ELEMENTS(slay_flags_desc));
/* Terminate the description list */
*slay_list = NULL;
* @param brand_list 属性ブランド構造体の参照ポインタ
* @return なし
*/
-static void analyze_brand(object_type *o_ptr, cptr *brand_list)
+static void analyze_brand(object_type *o_ptr, concptr *brand_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
brand_list = spoiler_flag_aux(flgs, brand_flags_desc, brand_list,
- N_ELEMENTS(brand_flags_desc));
+ N_ELEMENTS(brand_flags_desc));
/* Terminate the description list */
*brand_list = NULL;
* @param resist_list 通常耐性構造体の参照ポインタ
* @return なし
*/
-static void analyze_resist(object_type *o_ptr, cptr *resist_list)
+static void analyze_resist(object_type *o_ptr, concptr *resist_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
resist_list = spoiler_flag_aux(flgs, resist_flags_desc,
- resist_list, N_ELEMENTS(resist_flags_desc));
+ resist_list, N_ELEMENTS(resist_flags_desc));
/* Terminate the description list */
*resist_list = NULL;
* @param immune_list 免疫構造体の参照ポインタ
* @return なし
*/
-static void analyze_immune(object_type *o_ptr, cptr *immune_list)
+static void analyze_immune(object_type *o_ptr, concptr *immune_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
immune_list = spoiler_flag_aux(flgs, immune_flags_desc,
- immune_list, N_ELEMENTS(immune_flags_desc));
+ immune_list, N_ELEMENTS(immune_flags_desc));
/* Terminate the description list */
*immune_list = NULL;
* @param sustain_list 維持特性構造体の参照ポインタ
* @return なし
*/
-static void analyze_sustains(object_type *o_ptr, cptr *sustain_list)
+static void analyze_sustains(object_type *o_ptr, concptr *sustain_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
/* Simplify things if an item sustains all stats */
if (have_flag(flgs, TR_SUST_STR) && have_flag(flgs, TR_SUST_INT) &&
- have_flag(flgs, TR_SUST_WIS) && have_flag(flgs, TR_SUST_DEX) &&
- have_flag(flgs, TR_SUST_CON) && have_flag(flgs, TR_SUST_CHR))
+ have_flag(flgs, TR_SUST_WIS) && have_flag(flgs, TR_SUST_DEX) &&
+ have_flag(flgs, TR_SUST_CON) && have_flag(flgs, TR_SUST_CHR))
{
*sustain_list++ = _("全能力", "All stats");
}
/* Should we bother? */
else if (have_flag(flgs, TR_SUST_STR) || have_flag(flgs, TR_SUST_INT) ||
- have_flag(flgs, TR_SUST_WIS) || have_flag(flgs, TR_SUST_DEX) ||
- have_flag(flgs, TR_SUST_CON) || have_flag(flgs, TR_SUST_CHR))
+ have_flag(flgs, TR_SUST_WIS) || have_flag(flgs, TR_SUST_DEX) ||
+ have_flag(flgs, TR_SUST_CON) || have_flag(flgs, TR_SUST_CHR))
{
sustain_list = spoiler_flag_aux(flgs, sustain_flags_desc,
- sustain_list,
- N_ELEMENTS(sustain_flags_desc));
+ sustain_list,
+ N_ELEMENTS(sustain_flags_desc));
}
/* Terminate the description list */
* @param misc_list その他の特性構造体の参照ポインタ
* @return なし
*/
-static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
+static void analyze_misc_magic(object_type *o_ptr, concptr *misc_list)
{
- u32b flgs[TR_FLAG_SIZE];
- int rad;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ POSITION rad;
char desc[256];
object_flags(o_ptr, flgs);
misc_list = spoiler_flag_aux(flgs, misc_flags2_desc, misc_list,
- N_ELEMENTS(misc_flags2_desc));
+ N_ELEMENTS(misc_flags2_desc));
- misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list,
- N_ELEMENTS(misc_flags3_desc));
+ misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list, N_ELEMENTS(misc_flags3_desc));
/*
* Glowing artifacts -- small radius light.
- */
+ */
rad = 0;
if (have_flag(flgs, TR_LITE_1)) rad += 1;
if (have_flag(flgs, TR_LITE_2)) rad += 2;
if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
-
- if(o_ptr->name2 == EGO_LITE_SHINE) rad++;
+
+ if (o_ptr->name2 == EGO_LITE_SHINE) rad++;
if (have_flag(flgs, TR_LITE_FUEL))
{
- if(rad > 0) sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), rad);
+ if (rad > 0) sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), (int)rad);
}
else
{
- if(rad > 0) sprintf(desc, _("永久光源(半径 %d)", "Permanent Light(radius %d)"), rad);
- if(rad < 0) sprintf(desc, _("永久光源(半径-%d)。", "Permanent Light(radius -%d)"), -rad);
+ if (rad > 0) sprintf(desc, _("永久光源(半径 %d)", "Permanent Light(radius %d)"), (int)rad);
+ if (rad < 0) sprintf(desc, _("永久光源(半径-%d)。", "Permanent Light(radius -%d)"), (int)-rad);
}
- if(rad != 0) *misc_list++ = quark_str(quark_add(desc));
+ if (rad != 0) *misc_list++ = quark_str(quark_add(desc));
/*
* Handle cursed objects here to avoid redundancies such as noting
* being "lightly cursed".
*/
-/* if (object_is_cursed(o_ptr)) */
+ /* if (object_is_cursed(o_ptr)) */
{
if (have_flag(flgs, TR_TY_CURSE))
{
{
*misc_list++ = _("強力な呪い", "Heavily Cursed");
}
-/* else */
+ /* else */
else if (o_ptr->curse_flags & TRC_CURSED)
{
*misc_list++ = _("呪い", "Cursed");
/* Init */
strcpy(addition, "");
-#ifdef JP
- if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, "能力and耐性");
+ if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, _("能力and耐性", "Ability and Resistance"));
else if (a_ptr->gen_flags & TRG_XTRA_POWER)
{
- strcat(addition, "能力");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(1/2でand耐性)");
+ strcat(addition, _("能力", "Ability"));
+ if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("(1/2でand耐性)", "(plus Resistance about 1/2)"));
}
else if (a_ptr->gen_flags & TRG_XTRA_H_RES)
{
- strcat(addition, "耐性");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(1/2でand能力)");
- }
- else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "能力or耐性");
-#else
- if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, "Ability and Resistance");
- else if (a_ptr->gen_flags & TRG_XTRA_POWER)
- {
- strcat(addition, "Ability");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(plus Resistance about 1/2)");
+ strcat(addition, _("耐性", "Resistance"));
+ if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("(1/2でand能力)", "(plus Ability about 1/2)"));
}
- else if (a_ptr->gen_flags & TRG_XTRA_H_RES)
- {
- strcat(addition, "Resistance");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(plus Ability about 1/2)");
- }
- else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "Ability or Resistance");
-#endif
+ else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("能力or耐性", "Ability or Resistance"));
}
{
artifact_type *a_ptr = &a_info[o_ptr->name1];
+ sprintf(misc_desc, _("レベル %d, 希少度 %u, %d.%d kg, $%ld", "Level %d, Rarity %u, %d.%d lbs, %ld Gold"), (int)a_ptr->level, a_ptr->rarity,
#ifdef JP
- sprintf(misc_desc, "レベル %u, 希少度 %u, %d.%d kg, $%ld",
- a_ptr->level, a_ptr->rarity,
lbtokg1(a_ptr->weight), lbtokg2(a_ptr->weight), (long int)a_ptr->cost);
#else
- sprintf(misc_desc, "Level %u, Rarity %u, %d.%d lbs, %ld Gold",
- a_ptr->level, a_ptr->rarity,
- a_ptr->weight / 10, a_ptr->weight % 10, a_ptr->cost);
+ a_ptr->weight / 10, a_ptr->weight % 10, (long int)a_ptr->cost);
#endif
}
{
char buf[80];
- sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d", FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
spoiler_underline(buf);
}
* but that's not relevant to line wrapping and indention.)
*/
-/* ITEM_SEP separates items within a list */
+ /* ITEM_SEP separates items within a list */
#define ITEM_SEP ','
* @param separator フラグ表示の区切り記号
* @return なし
*/
-static void spoiler_outlist(cptr header, cptr *list, char separator)
+static void spoiler_outlist(concptr header, concptr *list, char separator)
{
int line_len, buf_len;
- char line[MAX_LINE_LEN+1], buf[80];
+ char line[MAX_LINE_LEN + 1], buf[80];
/* Ignore an empty list */
if (*list == NULL) return;
line_len = strlen(line);
/* Now begin the tedious task */
- while (1)
+ while (TRUE)
{
/* Copy the current item to a buffer */
strcpy(buf, *list);
* item separator.
*/
if (line_len > 1 && line[line_len - 1] == ' '
- && line[line_len - 2] == LIST_SEP)
+ && line[line_len - 2] == LIST_SEP)
{
/* Ignore space and separator */
line[line_len - 2] = '\0';
static void spoiler_print_art(obj_desc_list *art_ptr)
{
pval_info_type *pval_ptr = &art_ptr->pval_info;
-
char buf[80];
/* Don't indent the first line */
}
/* Now deal with the description lists */
-
-#ifdef JP
- spoiler_outlist("対:", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("武器属性:", art_ptr->brands, LIST_SEP);
- spoiler_outlist("免疫:", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("耐性:", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("維持:", art_ptr->sustains, ITEM_SEP);
-#else
- spoiler_outlist("Slay", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("", art_ptr->brands, LIST_SEP);
- spoiler_outlist("Immunity to", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("Resist", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("Sustain", art_ptr->sustains, ITEM_SEP);
-#endif
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, ITEM_SEP);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, LIST_SEP);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, ITEM_SEP);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, ITEM_SEP);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
if (art_ptr->addition[0])
*/
static bool make_fake_artifact(object_type *o_ptr, IDX name1)
{
- IDX i;
-
+ OBJECT_IDX i;
artifact_type *a_ptr = &a_info[name1];
-
/* Ignore "empty" artifacts */
if (!a_ptr->name) return FALSE;
/* Acquire the "kind" index */
i = lookup_kind(a_ptr->tval, a_ptr->sval);
- /* Oops */
- if (!i) return (FALSE);
+ if (!i) return FALSE;
- /* Create the artifact */
object_prep(o_ptr, i);
/* Save the name */
o_ptr->weight = a_ptr->weight;
/* Success */
- return (TRUE);
+ return TRUE;
}
* @param fname 生成ファイル名
* @return なし
*/
-static void spoil_artifact(cptr fname)
+static void spoil_artifact(concptr fname)
{
int i;
IDX j;
object_type forge;
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" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* We only want objects in the current group */
if (a_ptr->tval != group_artifact[i].tval) continue;
-
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Attempt to "forge" the artifact */
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
* @param fname 生成ファイル名
* @return なし
*/
-static void spoil_mon_desc(cptr fname)
+static void spoil_mon_desc(concptr fname)
{
int i, n = 0;
u16b why = 2;
- s16b *who;
+ MONRACE_IDX *who;
char buf[1024];
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" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
}
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Dump the header */
fprintf(fff, "Monster Spoilers for Hengband Version %d.%d.%d\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
fprintf(fff, "------------------------------------------\n\n");
/* Dump the header */
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++)
{
monster_race *r_ptr = &r_info[who[i]];
- cptr name = (r_name + r_ptr->name);
+ concptr name = (r_name + r_ptr->name);
if (r_ptr->flags7 & (RF7_KAGE)) continue;
/* Get the "name" */
/*
- else if (r_ptr->flags1 & (RF1_QUESTOR))
+ else if (r_ptr->flags3 & (RF3_NO_CONF))
{
- sprintf(nam, "[Q] %s", name);
+ sprintf(nam, "[*] %s", name);
}
*/
else if (r_ptr->flags1 & (RF1_UNIQUE))
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));
-/*!
- * @brief 文字列をファイルポインタに出力する /
- * Buffer text to the given file. (-SHAWN-)
- * This is basically c_roff() from mon-desc.c with a few changes.
- * @param str 文字列参照ポインタ
- * @return なし
- */
-static void spoil_out(cptr str)
+ /*!
+ * @brief 文字列をファイルポインタに出力する /
+ * Buffer text to the given file. (-SHAWN-)
+ * This is basically c_roff() from mon-desc.c with a few changes.
+ * @param str 文字列参照ポインタ
+ * @return なし
+ */
+static void spoil_out(concptr str)
{
- cptr r;
+ concptr r;
/* Line buffer */
static char roff_buf[256];
#ifdef JP
bool k_flag_local;
bool iskanji_flag_local = FALSE;
- cptr tail = str + (k_flag ? 2 : 1);
+ concptr tail = str + (k_flag ? 2 : 1);
#else
- cptr tail = str + 1;
+ concptr tail = str + 1;
#endif
for (; *tail; tail++)
else
{
if (iskanji_flag &&
- strncmp(str, "。", 2) != 0 &&
- strncmp(str, "、", 2) != 0 &&
- strncmp(str, "ィ", 2) != 0 &&
- strncmp(str, "ー", 2) != 0) roff_s = roff_p;
+ strncmp(str, "。", 2) != 0 &&
+ strncmp(str, "、", 2) != 0 &&
+ strncmp(str, "ィ", 2) != 0 &&
+ strncmp(str, "ー", 2) != 0) roff_s = roff_p;
}
#else
if (ch == ' ') roff_s = roff_p;
* @param str 文字列参照ポインタ
* @return なし
*/
-static void roff_func(byte attr, cptr str)
+static void roff_func(TERM_COLOR attr, concptr str)
{
/* Unused */
(void)attr;
* @param fname ファイル名
* @return なし
*/
-static void spoil_mon_info(cptr fname)
+static void spoil_mon_info(player_type *player_ptr, concptr fname)
{
char buf[1024];
int i, l, n = 0;
- u32b flags1;
+ BIT_FLAGS flags1;
u16b why = 2;
- s16b *who;
-
- /* Build the filename */
+ MONRACE_IDX *who;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* Dump the header */
sprintf(buf, "Monster Spoilers for Hengband Version %d.%d.%d\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
spoil_out(buf);
spoil_out("------------------------------------------\n\n");
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Scan the monsters */
for (i = 1; i < max_r_idx; i++)
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
for (l = 0; l < n; l++)
{
monster_race *r_ptr = &r_info[who[l]];
-
- /* Extract the flags */
flags1 = r_ptr->flags1;
/* Prefix */
}
else
{
-#ifndef JP
+#ifdef JP
+#else
spoil_out("The ");
#endif
}
/* Name */
- sprintf(buf, _("%s/%s (", "%s ("), (r_name + r_ptr->name), _(r_name+r_ptr->E_name, "")); /* ---)--- */
+ sprintf(buf, _("%s/%s (", "%s%s ("), (r_name + r_ptr->name), _(r_name + r_ptr->E_name, "")); /* ---)--- */
spoil_out(buf);
sprintf(buf, "Rar:%d ", r_ptr->rarity);
spoil_out(buf);
- /* Speed */
if (r_ptr->speed >= 110)
{
sprintf(buf, "Spd:+%d ", (r_ptr->speed - 110));
spoil_out(buf);
/* Reuse the code of monster recall. */
- output_monster_spoiler(who[l], roff_func);
+ output_monster_spoiler(player_ptr, who[l], roff_func);
spoil_out(NULL);
}
/*!
- * @brief int配列でstrncmp()と似た比較処理を行う /
+ * @brief int配列でstrncmp()と似た比較処理を行う /
* Compare two int-type array like strncmp() and return TRUE if equals
* @param a 比較するint配列1
* @param b 比較するint配列2
- * @param length
+ * @param length
* @return 両者の値が等しければTRUEを返す
*/
static bool int_n_cmp(int *a, int *b, int length)
{
if (*a != *(b++)) return FALSE;
if (!(*(a++))) break;
- }
- while (--length);
+ } while (--length);
return TRUE;
}
/*!
- * @brief ある木が指定された木の部分木かどうかを返す /
+ * @brief ある木が指定された木の部分木かどうかを返す /
* Returns TRUE if an evolution tree is "partial tree"
* @param tree 元となる木構造リスト
* @param partial_tree 部分木かどうか判定したい木構造リスト
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 進化ツリーをスポイラー出力するメインルーチン /
+ * @brief 進化ツリーをスポイラー出力するメインルーチン /
* Print monsters' evolution information to file
* @param fname 出力ファイル名
* @return なし
*/
-static void spoil_mon_evol(cptr fname)
+static void spoil_mon_evol(concptr fname)
{
char buf[1024];
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" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
- return;
+ return;
}
/* Dump the header */
sprintf(buf, "Monster Spoilers for Hengband Version %d.%d.%d\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
spoil_out(buf);
spoil_out("------------------------------------------\n\n");
{
evol_tree[i][n++] = r_ptr->next_r_idx;
r_ptr = &r_info[r_ptr->next_r_idx];
- }
- while (r_ptr->next_exp && (n < MAX_EVOL_DEPTH));
+ } while (r_ptr->next_exp && (n < MAX_EVOL_DEPTH));
}
/* Step 2: Scan the evolution trees and remove "partial tree" */
}
/* 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++)
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
-
-/*
- * Forward declare
- */
-extern void do_cmd_spoilers(void);
-
/*!
- * @brief スポイラー出力を行うコマンドのメインルーチン /
+ * @brief スポイラー出力を行うコマンドのメインルーチン /
* Create Spoiler files -BEN-
* @return なし
*/
-void do_cmd_spoilers(void)
+void do_cmd_spoilers(player_type *player_ptr)
{
- /* Save the screen */
screen_save();
/* Interact */
- while (1)
+ while (TRUE)
{
- /* Clear screen */
Term_clear();
/* Info */
/* Get a choice */
switch (inkey())
{
- /* Escape */
+ /* Escape */
case ESCAPE:
- /* Restore the screen */
screen_load();
return;
- /* Option (1) */
+ /* Option (1) */
case '1':
spoil_obj_desc("obj-desc.txt");
break;
- /* Option (2) */
+ /* Option (2) */
case '2':
spoil_artifact("artifact.txt");
break;
- /* Option (3) */
+ /* Option (3) */
case '3':
spoil_mon_desc("mon-desc.txt");
break;
- /* Option (4) */
+ /* Option (4) */
case '4':
- spoil_mon_info("mon-info.txt");
+ spoil_mon_info(player_ptr, "mon-info.txt");
break;
- /* Option (5) */
+ /* Option (5) */
case '5':
spoil_mon_evol("mon-evol.txt");
break;
- /* Oops */
default:
bell();
break;
}
- /* Flush messages */
- msg_print(NULL);
+ msg_erase();
}
}
/*!
- * @brief ランダムアーティファクト1件を解析する /
+ * @brief ランダムアーティファクト1件を解析する /
* Fill in an object description structure for a given object
* @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ
* @param desc_ptr 記述内容を収める構造体参照ポインタ
}
/*!
- * @brief ランダムアーティファクト1件をスポイラー出力する /
+ * @brief ランダムアーティファクト1件をスポイラー出力する /
* Create a spoiler file entry for an artifact
* @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ
* @param art_ptr 記述内容を収めた構造体参照ポインタ
/* Don't indent the first line */
fprintf(fff, "%s\n", art_ptr->description);
-
+
/* unidentified */
if (!(o_ptr->ident & (IDENT_MENTAL)))
{
- fprintf(fff, _("%s不明\n", "%sUnknown\n"),INDENT1);
+ fprintf(fff, _("%s不明\n", "%sUnknown\n"), INDENT1);
}
else {
/* An "empty" pval description indicates that the pval affects nothing */
/* Now deal with the description lists */
-#ifdef JP
- spoiler_outlist("対:", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("武器属性:", art_ptr->brands, LIST_SEP);
- spoiler_outlist("免疫:", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("耐性:", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("維持:", art_ptr->sustains, ITEM_SEP);
-#else
- spoiler_outlist("Slay", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("", art_ptr->brands, LIST_SEP);
- spoiler_outlist("Immunity to", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("Resist", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("Sustain", art_ptr->sustains, ITEM_SEP);
-#endif
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, ITEM_SEP);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, LIST_SEP);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, ITEM_SEP);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, ITEM_SEP);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
/* Write out the possible activation at the primary indention level */
/*!
- * @brief ランダムアーティファクト内容をスポイラー出力するサブルーチン /
+ * @brief ランダムアーティファクト内容をスポイラー出力するサブルーチン /
* @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ
* @param i 出力したい記録ランダムアーティファクトID
* @return なし
}
/*!
- * @brief ランダムアーティファクト内容をスポイラー出力するメインルーチン /
+ * @brief ランダムアーティファクト内容をスポイラー出力するメインルーチン /
* Create a list file for random artifacts
* @param fname 出力ファイル名
* @return なし
*/
-void spoil_random_artifact(cptr fname)
+void spoil_random_artifact(player_type *creature_ptr, concptr fname)
{
- int i,j;
+ int i, j;
store_type *st_ptr;
object_type *q_ptr;
char buf[1024];
-
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
-
- /* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create list file.");
/* random artifacts wielding */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &creature_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}
- /* random artifacts in inventory */
for (i = 0; i < INVEN_PACK; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &creature_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}
/* random artifacts in home */
- st_ptr = &town[1].store[STORE_HOME];
+ st_ptr = &town_info[1].store[STORE_HOME];
for (i = 0; i < st_ptr->stock_num; i++)
{
q_ptr = &st_ptr->stock[i];
}
/* random artifacts in museum */
- st_ptr = &town[1].store[STORE_MUSEUM];
+ st_ptr = &town_info[1].store[STORE_MUSEUM];
for (i = 0; i < st_ptr->stock_num; i++)
{
q_ptr = &st_ptr->stock[i];
return;
}
- /* Message */
msg_print("Successfully created a list file.");
}