#include "cmd-pet.h"
#include "monsterrace-hook.h"
#include "monster-status.h"
+#include "projection.h"
+#include "monster.h"
+#include "spells-summon.h"
+#include "quest.h"
#define HORDE_NOGOOD 0x01 /*!< (未実装フラグ)HORDE生成でGOODなモンスターの生成を禁止する? */
#define HORDE_NOEVIL 0x02 /*!< (未実装フラグ)HORDE生成でEVILなモンスターの生成を禁止する? */
/* Monster is gone */
cave[y][x].m_idx = 0;
-
- /* Delete objects */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
*/
static bool restrict_monster_to_dungeon(MONRACE_IDX r_idx)
{
- dungeon_info_type *d_ptr = &d_info[dungeon_type];
+ dungeon_type *d_ptr = &d_info[p_ptr->dungeon_idx];
monster_race *r_ptr = &r_info[r_idx];
byte a;
if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && !restrict_monster_to_dungeon(entry->index) && !p_ptr->inside_battle)
{
- int hoge = entry->prob2 * d_info[dungeon_type].special_div;
+ int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div;
entry->prob2 = hoge / 64;
if (randint0(64) < (hoge & 0x3f)) entry->prob2++;
}
pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
- if (d_info[dungeon_type].flags1 & DF1_MAZE)
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
{
pls_kakuritu = MIN(pls_kakuritu / 2, pls_kakuritu - 10);
if (pls_kakuritu < 2) pls_kakuritu = 2;
}
/* Boost the level */
- if (!p_ptr->inside_battle && !(d_info[dungeon_type].flags1 & DF1_BEGINNER))
+ if (!p_ptr->inside_battle && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
{
/* Nightmare mode allows more out-of depth monsters */
if (ironman_nightmare && !randint0(pls_kakuritu))
bool easy = FALSE;
/* Non-Ninja player in the darkness */
- bool in_darkness = (d_info[dungeon_type].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
+ bool in_darkness = (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
/* Do disturb? */
if (disturb_high)
else
level = dun_level;
- if (d_info[dungeon_type].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
r_idx = get_mon_num(level);
r_ptr = &r_info[r_idx];
#define MON_SCAT_MAXD 10 /*!< mon_scatter()関数によるモンスター配置で許される中心からの最大距離 */
/*!
- * @brief モンスター1体を目標地点に可能ながり近い位置に生成する / improved version of scatter() for place monster
+ * @brief モンスター1体を目標地点に可能な限り近い位置に生成する / improved version of scatter() for place monster
* @param r_idx 生成モンスター種族
* @param yp 結果生成位置y座標
* @param xp 結果生成位置x座標
*/
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];
+ POSITION place_x[MON_SCAT_MAXD];
+ POSITION place_y[MON_SCAT_MAXD];
int num[MON_SCAT_MAXD];
int i;
- int nx, ny;
+ POSITION nx, ny;
if (max_dist >= MON_SCAT_MAXD)
return FALSE;
/* Require empty grids */
if (!cave_empty_bold2(ny, nx)) continue;
-
- /* Prepare allocation table */
get_mon_num_prep(place_monster_can_escort, get_monster_hook2(ny, nx));
/* Pick a random race */
bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
{
MONRACE_IDX r_idx;
-
- /* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
/* Pick a monster */
int attempts = 1000;
POSITION cy = y;
POSITION cx = x;
-
- /* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
while (--attempts)
*/
bool alloc_guardian(bool def_val)
{
- MONRACE_IDX guardian = d_info[dungeon_type].final_guardian;
+ MONRACE_IDX guardian = d_info[p_ptr->dungeon_idx].final_guardian;
- if (guardian && (d_info[dungeon_type].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
+ if (guardian && (d_info[p_ptr->dungeon_idx].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
{
int oy;
int ox;
monster_has_hostile_align(NULL, 10, -10, r_ptr))
return FALSE;
- if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[dungeon_type].flags1 & DF1_CHAMELEON)) return TRUE;
+ if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON)) return TRUE;
return (summon_specific_aux(r_idx));
}
summon_kin_type = symbol;
summon_unique_okay = (mode & PM_ALLOW_UNIQUE) ? TRUE : FALSE;
-
- /* Prepare allocation table */
get_mon_num_prep(summon_specific_okay, get_monster_hook2(y, x));
/* Pick a monster, using the level calculation */