* モンスターを削除するとそのモンスターが拾っていたアイテムも同時に削除される。 /
* When a monster is deleted, all of its objects are deleted.
*/
-void delete_monster_idx(int i)
+void delete_monster_idx(MONSTER_IDX i)
{
int x, y;
* @param y 削除位置y座標
* @return なし
*/
-void delete_monster(int y, int x)
+void delete_monster(POSITION y, POSITION x)
{
cave_type *c_ptr;
*/
void compact_monsters(int size)
{
- int i, num, cnt;
- int cur_lev, cur_dis, chance;
+ MONSTER_IDX i;
+ int num, cnt;
+ int cur_lev, cur_dis, chance;
/* Message (only if compacting) */
if (size) msg_print(_("モンスター情報を圧縮しています...", "Compacting monsters..."));
* @details
* This routine should almost never fail, but it *can* happen.
*/
-s16b m_pop(void)
+MONSTER_IDX m_pop(void)
{
- int i;
+ MONSTER_IDX i;
/* Normal allocation */
* @return 召喚条件が一致するならtrue
* @details
*/
-static bool summon_specific_aux(int r_idx)
+static bool summon_specific_aux(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
int okay = FALSE;
* @param r_idx チェックするモンスター種族ID
* @return 召喚条件が一致するならtrue / Return TRUE is the monster is OK and FALSE otherwise
*/
-static bool restrict_monster_to_dungeon(int r_idx)
+static bool restrict_monster_to_dungeon(MONRACE_IDX r_idx)
{
dungeon_info_type *d_ptr = &d_info[dungeon_type];
monster_race *r_ptr = &r_info[r_idx];
* Note that if no monsters are "appropriate", then this function will
* fail, and return zero, but this should *almost* never happen.
*/
-s16b get_mon_num(int level)
+MONRACE_IDX get_mon_num(DEPTH level)
{
int i, j, p;
int r_idx;
* @details
* Return the number of new flags learnt. -Mogami-
*/
-int lore_do_probe(int r_idx)
+int lore_do_probe(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
int i, n = 0;
* gold and items are dropped, and remembers that information to be
* described later by the monster recall code.
*/
-void lore_treasure(int m_idx, int num_item, int num_gold)
+void lore_treasure(MONSTER_IDX m_idx, int num_item, int num_gold)
{
monster_type *m_ptr = &m_list[m_idx];
* "disturb_near" (monster which is "easily" viewable moves in some
* way). Note that "moves" includes "appears" and "disappears".
*/
-void update_mon(int m_idx, bool full)
+void update_mon(MONSTER_IDX m_idx, bool full)
{
monster_type *m_ptr = &m_list[m_idx];
*/
void update_monsters(bool full)
{
- int i;
+ IDX i;
/* Update each (live) monster */
for (i = 1; i < m_max; i++)
* @param r_idx モンスター種族ID
* @return 対象にできるならtrueを返す
*/
-static bool monster_hook_chameleon_lord(int r_idx)
+static bool monster_hook_chameleon_lord(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
monster_type *m_ptr = &m_list[chameleon_change_m_idx];
* @param r_idx モンスター種族ID
* @return 対象にできるならtrueを返す
*/
-static bool monster_hook_chameleon(int r_idx)
+static bool monster_hook_chameleon(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
monster_type *m_ptr = &m_list[chameleon_change_m_idx];
* @param r_idx 旧モンスター種族のID
* @return なし
*/
-void choose_new_monster(IDX m_idx, bool born, IDX r_idx)
+void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx)
{
int oldmaxhp;
monster_type *m_ptr = &m_list[m_idx];
* @param r_idx モンスター種族ID
* @return 対象にできるならtrueを返す
*/
-static bool monster_hook_tanuki(int r_idx)
+static bool monster_hook_tanuki(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
* @param r_idx モンスター種族ID
* @return モンスター種族の表層ID
*/
-static int initial_r_appearance(int r_idx)
+static IDX initial_r_appearance(MONRACE_IDX r_idx)
{
int attempts = 1000;
- int ap_r_idx;
- int min = MIN(base_level-5, 50);
+ IDX ap_r_idx;
+ DEPTH min = MIN(base_level-5, 50);
if (!(r_info[r_idx].flags7 & RF7_TANUKI))
return r_idx;
* This is the only function which may place a monster in the dungeon,
* except for the savefile loading code.
*/
-static bool place_monster_one(int who, int y, int x, int r_idx, u32b mode)
+static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
/* Access the location */
cave_type *c_ptr = &cave[y][x];
* @return 成功したらtrue
*
*/
-static bool mon_scatter(int r_idx, int *yp, int *xp, int y, int x, int max_dist)
+static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist)
{
int place_x[MON_SCAT_MAXD];
int place_y[MON_SCAT_MAXD];
* @param mode 生成オプション
* @return 成功したらtrue
*/
-static bool place_monster_group(int who, int y, int x, int r_idx, u32b mode)
+static bool place_monster_group(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, u32b mode)
{
monster_race *r_ptr = &r_info[r_idx];
* @brief 護衛対象となるモンスター種族IDを渡すグローバル変数 / Hack -- help pick an escort type
* @todo 関数ポインタの都合を配慮しながら、グローバル変数place_monster_idxを除去し、関数引数化する
*/
-static int place_monster_idx = 0;
+static IDX place_monster_idx = 0;
/*!
* @var place_monster_m_idx
* @brief 護衛対象となるモンスターIDを渡すグローバル変数 / Hack -- help pick an escort type
* @todo 関数ポインタの都合を配慮しながら、グローバル変数place_monster_m_idxを除去し、関数引数化する
*/
-static int place_monster_m_idx = 0;
+static IDX place_monster_m_idx = 0;
/*!
* @brief モンスター種族が召喚主の護衛となれるかどうかをチェックする / Hack -- help pick an escort type
* @param r_idx チェックするモンスター種族のID
* @return 護衛にできるならばtrue
*/
-static bool place_monster_can_escort(int r_idx)
+static bool place_monster_can_escort(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[place_monster_idx];
monster_type *m_ptr = &m_list[place_monster_m_idx];
* Note the use of the new "monster allocation table" code to restrict
* the "get_mon_num()" function to "legal" escort types.
*/
-bool place_monster_aux(int who, int y, int x, int r_idx, u32b mode)
+bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
int i, j, n;
monster_race *r_ptr = &r_info[r_idx];
for (i = 0; i < 32; i++)
{
POSITION nx, ny, d = 3;
- int z;
+ MONRACE_IDX z;
/* Pick a location */
scatter(&ny, &nx, y, x, d, 0);
* @param mode 生成オプション
* @return 生成に成功したらtrue
*/
-bool place_monster(int y, int x, u32b mode)
+bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
{
- int r_idx;
+ MONRACE_IDX r_idx;
/* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
bool alloc_horde(POSITION y, POSITION x)
{
monster_race *r_ptr = NULL;
- IDX r_idx = 0;
- IDX m_idx;
+ MONRACE_IDX r_idx = 0;
+ MONSTER_IDX m_idx;
int attempts = 1000;
POSITION cy = y;
POSITION cx = x;
*/
bool alloc_guardian(bool def_val)
{
- int guardian = d_info[dungeon_type].final_guardian;
+ MONRACE_IDX guardian = d_info[dungeon_type].final_guardian;
if (guardian && (d_info[dungeon_type].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
{
* @param r_idx チェックするモンスター種族ID
* @return 召喚対象にできるならばTRUE
*/
-static bool summon_specific_okay(int r_idx)
+static bool summon_specific_okay(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
*
* Note that this function may not succeed, though this is very rare.
*/
-bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode)
+bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
{
- int x, y, r_idx;
+ POSITION x, y;
+ MONRACE_IDX r_idx;
if (p_ptr->inside_arena) return (FALSE);
* @param mode 生成オプション
* @return 召喚できたらtrueを返す
*/
-bool summon_named_creature (int who, int oy, int ox, int r_idx, u32b mode)
+bool summon_named_creature (MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
- int x, y;
+ POSITION x, y;
/* Paranoia */
/* if (!r_idx) return; */
* @details
* Note that "reproduction" REQUIRES empty space.
*/
-bool multiply_monster(int m_idx, bool clone, u32b mode)
+bool multiply_monster(MONSTER_IDX m_idx, bool clone, u32b mode)
{
monster_type *m_ptr = &m_list[m_idx];
- int y, x;
+ POSITION y, x;
if (!mon_scatter(m_ptr->r_idx, &y, &x, m_ptr->fy, m_ptr->fx, 1))
return FALSE;
* @details
* Technically should attempt to treat "Beholder"'s as jelly's
*/
-void message_pain(int m_idx, int dam)
+void message_pain(MONSTER_IDX m_idx, HIT_POINT dam)
{
long oldhp, newhp, tmp;
int percentage;
* @param what 学習対象ID
* @return なし
*/
-void update_smart_learn(int m_idx, int what)
+void update_smart_learn(MONSTER_IDX m_idx, int what)
{
monster_type *m_ptr = &m_list[m_idx];