* Used to allocate proper treasure when "Creeping coins" die
* XXX XXX XXX Note the use of actual "monster names"
*/
-static int get_coin_type(int r_idx)
+static int get_coin_type(MONRACE_IDX r_idx)
{
/* Analyze monsters */
switch (r_idx)
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトがクロークならばTRUEを返す
*/
-static bool kind_is_cloak(int k_idx)
+static bool kind_is_cloak(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトが竿状武器ならばTRUEを返す
*/
-static bool kind_is_polearm(int k_idx)
+static bool kind_is_polearm(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトが剣ならばTRUEを返す
*/
-static bool kind_is_sword(int k_idx)
+static bool kind_is_sword(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトが魔法書ならばTRUEを返す
*/
-static bool kind_is_book(int k_idx)
+static bool kind_is_book(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトがベースアイテム時点でGOODなアイテムならばTRUEを返す
*/
-static bool kind_is_good_book(int k_idx)
+static bool kind_is_good_book(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトが鎧ならばTRUEを返す
*/
-static bool kind_is_armor(int k_idx)
+static bool kind_is_armor(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
* @param k_idx 判定したいオブジェクトのベースアイテムID
* @return オブジェクトが打撃武器ならばTRUEを返す
*/
-static bool kind_is_hafted(int k_idx)
+static bool kind_is_hafted(KIND_OBJECT_IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
{
for (y = 0; y < cur_hgt; ++ y)
{
- int m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = cave[y][x].m_idx;
if (m_idx > 0 && is_hostile(&m_list[m_idx]))
{
/* Create a magical staircase */
if (create_stairs)
{
- int ny, nx;
+ POSITION ny, nx;
/* Stagger around */
while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT) )
* it drops all of its objects, which may disappear in crowded rooms.
* </pre>
*/
-void monster_death(int m_idx, bool drop_item)
+void monster_death(MONSTER_IDX m_idx, bool drop_item)
{
int i, j, y, x;
if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[dungeon_type].final_guardian == m_ptr->r_idx))
{
- int k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
+ IDX k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
: lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
if (d_info[dungeon_type].final_artifact)
* experience point of a monster later.
* </pre>
*/
-static void get_exp_from_mon(int dam, monster_type *m_ptr)
+static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
* to induce changes in the monster recall code.
* </pre>
*/
-bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
+bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
* Future versions may restrict the ability to target "trappers"
* and "mimics", but the semantics is a little bit weird.
*/
-bool target_able(int m_idx)
+bool target_able(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
/*
* Hack -- help "select" a location (see below)
*/
-static s16b target_pick(int y1, int x1, int dy, int dx)
+static s16b target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION dx)
{
int i, v;
if (p_ptr->riding && target_pet && (temp_n > 1) && (mode & (TARGET_KILL)))
{
- byte tmp;
+ POSITION tmp;
tmp = temp_y[0];
temp_y[0] = temp_y[1];
/* Continue scrolling list if requested */
while (1)
{
- int i, o_idx;
+ int i;
+ IDX o_idx;
/* Save screen */
screen_save();
if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
{
/* Set the quest number temporary */
- int old_quest = p_ptr->inside_quest;
+ IDX old_quest = p_ptr->inside_quest;
int j;
/* Clear the text */
bool target_set(int mode)
{
int i, d, m, t, bd;
- int y = p_ptr->y;
- int x = p_ptr->x;
+ POSITION y = p_ptr->y;
+ POSITION x = p_ptr->x;
bool done = FALSE;
*
* Note that confusion over-rides any (explicit?) user choice.
*/
-bool get_aim_dir(int *dp)
+bool get_aim_dir(DIRECTION *dp)
{
- int dir;
-
+ DIRECTION dir;
char command;
-
cptr p;
/* Initialize */
object_type forge;
char wrath_reason[32] = "";
int nasty_chance = 6;
- int dummy = 0, dummy2 = 0;
+ OBJECT_TYPE_VALUE dummy = 0;
+ OBJECT_SUBTYPE_VALUE dummy2 = 0;
int type, effect;
cptr reward = NULL;
char o_name[MAX_NLEN];
* XAngband: determine if a given location is "interesting"
* based on target_set_accept function.
*/
-static bool tgt_pt_accept(int y, int x)
+static bool tgt_pt_accept(POSITION y, POSITION x)
{
cave_type *c_ptr;
*/
static void tgt_pt_prepare(void)
{
- int y, x;
+ POSITION y, x;
/* Reset "temp" array */
temp_n = 0;
/*
* old -- from PsiAngband.
*/
-bool tgt_pt(int *x_ptr, int *y_ptr)
+bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr)
{
char ch = 0;
- int d, x, y, n = 0;
+ int d, n = 0;
+ POSITION x, y;
bool success = FALSE;
int wid, hgt;
/*
* Return bow energy
*/
-s16b bow_energy(int sval)
+s16b bow_energy(OBJECT_SUBTYPE_VALUE sval)
{
int energy = 100;
/*
* Return bow tmul
*/
-int bow_tmul(int sval)
+int bow_tmul(OBJECT_SUBTYPE_VALUE sval)
{
int tmul = 0;
* Display a rumor and apply its effects
*/
-int rumor_num(char *zz, int max_idx)
+IDX rumor_num(char *zz, IDX max_idx)
{
if (strcmp(zz, "*") == 0) return randint1(max_idx - 1);
- return atoi(zz);
+ return (IDX)atoi(zz);
}
cptr rumor_bind_name(char *base, cptr fullname)
{
if (strcmp(zz[0], "ARTIFACT") == 0)
{
- int a_idx, k_idx;
+ IDX a_idx, k_idx;
object_type forge;
object_type *q_ptr = &forge;
artifact_type *a_ptr;
}
else if (strcmp(zz[0], "MONSTER") == 0)
{
- int r_idx;
+ MONRACE_IDX r_idx;
monster_race *r_ptr;
while(1)
}
else if (strcmp(zz[0], "TOWN") == 0)
{
- int t_idx;
+ IDX t_idx;
s32b visit;
while(1)