* 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)
{
- case MON_COPPER_COINS: return 2;
- case MON_SILVER_COINS: return 5;
- case MON_GOLD_COINS: return 10;
- case MON_MITHRIL_COINS:
- case MON_MITHRIL_GOLEM: return 16;
- case MON_ADAMANT_COINS: return 17;
+ case MON_COPPER_COINS: return 2;
+ case MON_SILVER_COINS: return 5;
+ case MON_GOLD_COINS: return 10;
+ case MON_MITHRIL_COINS:
+ case MON_MITHRIL_GOLEM: return 16;
+ case MON_ADAMANT_COINS: return 17;
}
/* Assume nothing */
{
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]))
{
*/
void check_quest_completion(monster_type *m_ptr)
{
- int y, x;
+ POSITION y, x;
int quest_num;
/* 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;
{
int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
int typ = mbe_info[r_ptr->blow[i].effect].explode_type;
- int d_dice = r_ptr->blow[i].d_dice;
- int d_side = r_ptr->blow[i].d_side;
- int damage = damroll(d_dice, d_side);
+ DICE_NUMBER d_dice = r_ptr->blow[i].d_dice;
+ DICE_SID d_side = r_ptr->blow[i].d_side;
+ HIT_POINT damage = damroll(d_dice, d_side);
project(m_idx, 3, y, x, damage, typ, flg, -1);
break;
{
if (!one_in_(7))
{
- int wy = y, wx = x;
+ POSITION wy = y, wx = x;
int attempts = 100;
bool pet = is_pet(m_ptr);
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)
* "type" is not yet used and should be 0.
* </pre>
*/
-int mon_damage_mod(monster_type *m_ptr, int dam, bool is_psy_spear)
+HIT_POINT mon_damage_mod(monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear)
{
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, int dam, bool *fear, cptr note)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
chg_virtue (V_JUSTICE, -1);
}
- if ((r_ptr->flags3 & RF3_ANIMAL) && !(r_ptr->flags3 & RF3_EVIL) && !(r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) && !(r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) && !(r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
+ if ((r_ptr->flags3 & RF3_ANIMAL) && !(r_ptr->flags3 & RF3_EVIL) && !(r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) && !(r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) && !(r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
{
if (one_in_(4)) chg_virtue(V_NATURE, -1);
}
* 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];
temp_x[1] = tmp;
}
}
-void target_set_prepare_look(){
+
+void target_set_prepare_look(void){
target_set_prepare(TARGET_LOOK);
}
/* 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;
char info[80];
+ char same_key;
+
cave_type *c_ptr;
int wid, hgt;
/* Cancel tracking */
/* health_track(0); */
+ if (rogue_like_commands)
+ {
+ same_key = 'x';
+ }
+ else
+ {
+ same_key = 'l';
+ }
/* Prepare the "temp" array */
target_set_prepare(mode);
default:
{
- /* Extract the action (if any) */
- d = get_keymap_dir(query);
+ if(query == same_key)
+ {
+ if (++m == temp_n)
+ {
+ m = 0;
+ if (!expand_list) done = TRUE;
+ }
+ }
+ else
+ {
+ /* Extract the action (if any) */
+ d = get_keymap_dir(query);
- if (!d) bell();
- break;
+ if (!d) bell();
+ break;
+ }
}
}
-
/* Hack -- move around */
if (d)
{
*
* 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)