#include "dungeon/quest-completion-checker.h"
#include "core/player-update-types.h"
#include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
#include "floor/floor-util.h"
if (create_stairs) {
POSITION ny, nx;
while (cave_have_flag_bold(floor_ptr, y, x, FF_PERMANENT) || floor_ptr->grid_array[y][x].o_idx || (floor_ptr->grid_array[y][x].info & CAVE_OBJECT)) {
- scatter(player_ptr, &ny, &nx, y, x, 1, 0);
+ scatter(player_ptr, &ny, &nx, y, x, 1, PROJECT_NONE);
y = ny;
x = nx;
}
* project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
*/
typedef enum effect_characteristics {
+ PROJECT_NONE = 0x0000,
PROJECT_JUMP = 0x0001, /*!< 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */
PROJECT_BEAM = 0x0002, /*!< ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */
PROJECT_THRU = 0x0004, /*!< 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */
#include "dungeon/dungeon.h"
#include "dungeon/quest-monster-placer.h"
#include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
#include "floor/floor-generator.h"
#include "floor/floor-mode-changer.h"
#include "floor/floor-object.h"
for (d = 1; d < A_MAX; d++) {
int j;
for (j = 1000; j > 0; j--) {
- scatter(master_ptr, cy, cx, master_ptr->y, master_ptr->x, d, 0);
+ scatter(master_ptr, cy, cx, master_ptr->y, master_ptr->x, d, PROJECT_NONE);
if (monster_can_enter(master_ptr, *cy, *cx, &r_info[party_mon[current_monster].r_idx], 0))
break;
}
EFFECT_ID typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
int attempts = 1000;
while (attempts--) {
- scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
+ scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, PROJECT_NONE);
if (!player_bold(caster_ptr, y, x))
break;
}
#include "monster-floor/monster-generator.h"
#include "dungeon/dungeon.h"
+#include "effect/effect-characteristics.h"
#include "floor/cave.h"
#include "floor/floor-util.h"
#include "game-option/cheat-options.h"
POSITION hy = hack_y[n];
for (int i = 0; (i < 8) && (hack_n < total); i++) {
POSITION mx, my;
- scatter(player_ptr, &my, &mx, hy, hx, 4, 0);
+ scatter(player_ptr, &my, &mx, hy, hx, 4, PROJECT_NONE);
if (!is_cave_empty_bold2(player_ptr, my, mx))
continue;
int n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]);
for (int j = 0; j < n; j++) {
POSITION nx, ny, d = 7;
- scatter(player_ptr, &ny, &nx, y, x, d, 0);
+ scatter(player_ptr, &ny, &nx, y, x, d, PROJECT_NONE);
(void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
}
}
for (int i = 0; i < 32; i++) {
POSITION nx, ny, d = 3;
MONRACE_IDX z;
- scatter(player_ptr, &ny, &nx, y, x, d, 0);
+ scatter(player_ptr, &ny, &nx, y, x, d, PROJECT_NONE);
if (!is_cave_empty_bold2(player_ptr, ny, nx))
continue;
POSITION cy = y;
POSITION cx = x;
for (attempts = randint1(10) + 5; attempts; attempts--) {
- scatter(player_ptr, &cy, &cx, y, x, 5, 0);
+ scatter(player_ptr, &cy, &cx, y, x, 5, PROJECT_NONE);
(void)(*summon_specific)(player_ptr, m_idx, cy, cx, floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
y = cy;
x = cx;
#include "system/angband.h"
-typedef bool (*summon_specific_pf)(player_type *, MONSTER_IDX, POSITION, POSITION, DEPTH, int, BIT_FLAGS);
+typedef enum summon_type summon_type;
+typedef bool (*summon_specific_pf)(player_type *, MONSTER_IDX, POSITION, POSITION, DEPTH, summon_type, BIT_FLAGS);
bool mon_scatter(player_type *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist);
bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
}
/*!
+ * @brief モンスター死亡時に召喚されうるモンスターかどうかの判定
+ * @param type モンスター種族ID
+ * @return 召喚されうるならばTRUE (あやしい影として生成されない)
+ */
+static bool is_dead_summoning(summon_type type)
+{
+ bool summoning = type == SUMMON_BLUE_HORROR;
+ summoning |= type == SUMMON_DAWN;
+ summoning |= type == SUMMON_TOTEM_MOAI;
+ return summoning;
+}
+
+/*!
* @brief モンスターを召喚により配置する / Place a monster (of the specified "type") near the given location. Return TRUE if a monster was actually summoned.
* @param player_ptr プレーヤーへの参照ポインタ
* @param who 召喚主のモンスター情報ID
* @param mode 生成オプション
* @return 召喚できたらtrueを返す
*/
-bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
+bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode)
{
floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (floor_ptr->inside_arena)
return FALSE;
}
- if ((type == SUMMON_BLUE_HORROR) || (type == SUMMON_DAWN))
+ if (is_dead_summoning(type))
mode |= PM_NO_KAGE;
if (!place_monster_aux(player_ptr, who, y, x, r_idx, mode)) {
extern int summon_specific_who;
extern bool summon_unique_okay;
-bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
+typedef enum summon_type summon_type;
+bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode);
bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
#include "view/display-messages.h"
#include "world/world.h"
+/*!
+ * @brief \8e\80\96S\8e\9e\8f¢\8a«\8f\88\97\9d (\8d¡\82Ì\82Æ\82±\82ë\8e©\95ª\8e©\90g\82Ì\82Ý)
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param md_ptr \83\82\83\93\83X\83^\81[\8c\82\94j\8d\\91¢\91Ì\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param type \8f¢\8a«\83^\83C\83v
+ * @param probability \8f¢\8a«\8am\97¦ (\8cv\8eZ\8e®\81F1 - 1/probability)
+ * @param radius \8f¢\8a«\94¼\8ca (\83\82\83\93\83X\83^\81[\82ª\8e\80\96S\82µ\82½\8dÀ\95W\82©\82ç\94¼\8ca\89½\83}\83X\88È\93à\82É\8f¢\8a«\82³\82¹\82é\82©)
+ * @param message \8f¢\8a«\8e\9e\82Ì\83\81\83b\83Z\81[\83W
+ * @return \82È\82µ
+ */
+static void summon_self(player_type *player_ptr, monster_death_type *md_ptr, summon_type type, int probability, POSITION radius, concptr message)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (floor_ptr->inside_arena || player_ptr->phase_out || one_in_(probability))
+ return;
+
+ POSITION wy = md_ptr->md_y;
+ POSITION wx = md_ptr->md_x;
+ int attempts = 100;
+ bool pet = is_pet(md_ptr->m_ptr);
+ do {
+ scatter(player_ptr, &wy, &wx, md_ptr->md_y, md_ptr->md_x, radius, PROJECT_NONE);
+ } while (!(in_bounds(floor_ptr, wy, wx) && is_cave_empty_bold2(player_ptr, wy, wx)) && --attempts);
+
+ if (attempts <= 0)
+ return;
+
+ BIT_FLAGS mode = pet ? PM_FORCE_PET : PM_NONE;
+ if (summon_specific(player_ptr, (pet ? -1 : md_ptr->m_idx), wy, wx, 100, type, mode) && player_can_see_bold(player_ptr, wy, wx))
+ msg_print(message);
+}
+
static void on_dead_pink_horror(player_type *player_ptr, monster_death_type *md_ptr)
{
if (player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out)
return;
bool notice = FALSE;
- for (int i = 0; i < 2; i++) {
+ const int blue_horrors = 2;
+ for (int i = 0; i < blue_horrors; i++) {
POSITION wy = md_ptr->md_y;
POSITION wx = md_ptr->md_x;
bool pet = is_pet(md_ptr->m_ptr);
(void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x);
}
+/*!
+ * @brief 6/7\82Ì\8am\97¦\82Å\81A20\83}\83X\88È\93à\82É\8bÅ\82Ì\90í\8em\8e©\90g\82ð\8f¢\8a«\82·\82é
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param md_ptr \83\82\83\93\83X\83^\81[\8c\82\94j\8d\\91¢\91Ì\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \82È\82µ
+ */
static void on_dead_dawn(player_type *player_ptr, monster_death_type *md_ptr)
{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (floor_ptr->inside_arena || player_ptr->phase_out || one_in_(7))
- return;
-
- POSITION wy = md_ptr->md_y;
- POSITION wx = md_ptr->md_x;
- int attempts = 100;
- bool pet = is_pet(md_ptr->m_ptr);
- do {
- scatter(player_ptr, &wy, &wx, md_ptr->md_y, md_ptr->md_x, 20, 0);
- } while (!(in_bounds(floor_ptr, wy, wx) && is_cave_empty_bold2(player_ptr, wy, wx)) && --attempts);
-
- if (attempts <= 0)
- return;
-
- BIT_FLAGS mode = pet ? PM_FORCE_PET : PM_NONE;
- if (summon_specific(player_ptr, (pet ? -1 : md_ptr->m_idx), wy, wx, 100, SUMMON_DAWN, mode) && player_can_see_bold(player_ptr, wy, wx))
- msg_print(_("\90V\82½\82È\90í\8em\82ª\8c»\82ê\82½\81I", "A new warrior steps forth!"));
+ summon_self(player_ptr, md_ptr, SUMMON_DAWN, 7, 20, _("\90V\82½\82È\90í\8em\82ª\8c»\82ê\82½\81I", "A new warrior steps forth!"));
}
static void on_dead_unmaker(player_type *player_ptr, monster_death_type *md_ptr)
msg_print(_("\96A\82ª\92e\82¯\82½\81I", "The bubble pops!"));
}
+/*!
+ * @brief 7/8\82Ì\8am\97¦\82Å\81A5\83}\83X\88È\93à\82É\83g\81[\83e\83\80\83\82\83A\83C\8e©\90g\82ð\8f¢\8a«\82·\82é
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param md_ptr \83\82\83\93\83X\83^\81[\8c\82\94j\8d\\91¢\91Ì\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \82È\82µ
+ */
static void on_dead_totem_moai(player_type *player_ptr, monster_death_type *md_ptr)
{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (floor_ptr->inside_arena || player_ptr->phase_out || one_in_(8))
- return;
-
- POSITION wy = md_ptr->md_y;
- POSITION wx = md_ptr->md_x;
- int attempts = 100;
- bool pet = is_pet(md_ptr->m_ptr);
- do {
- scatter(player_ptr, &wy, &wx, md_ptr->md_y, md_ptr->md_x, 20, 0);
- } while (!(in_bounds(floor_ptr, wy, wx) && is_cave_empty_bold2(player_ptr, wy, wx)) && --attempts);
-
- if (attempts <= 0)
- return;
-
- BIT_FLAGS mode = pet ? PM_FORCE_PET : PM_NONE;
- if (summon_named_creature(player_ptr, (pet ? -1 : md_ptr->m_idx), wy, wx, MON_TOTEM_MOAI, mode) && player_can_see_bold(player_ptr, wy, wx))
- msg_print(_("\90V\82½\82È\83\82\83A\83C\82ª\8c»\82ê\82½\81I", "A new moai steps forth!"));
+ summon_self(player_ptr, md_ptr, SUMMON_TOTEM_MOAI, 8, 5, _("\90V\82½\82È\83\82\83A\83C\82ª\8c»\82ê\82½\81I", "A new moai steps forth!"));
}
static void on_dead_mimics(player_type *player_ptr, monster_death_type *md_ptr)
if (!summon_possible(target_ptr, cy, cx) || !is_cave_empty_bold(target_ptr, cy, cx)) {
int j;
for (j = 100; j > 0; j--) {
- scatter(target_ptr, &cy, &cx, y, x, 2, 0);
+ scatter(target_ptr, &cy, &cx, y, x, 2, PROJECT_NONE);
if (is_cave_empty_bold(target_ptr, cy, cx))
break;
}
for (int k = 0; k < num; k++) {
int attempts = 1000;
while (attempts--) {
- scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
+ scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, PROJECT_NONE);
if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT))
continue;
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
#include "floor/cave.h"
#include "floor/floor-events.h"
#include "floor/floor-leaver.h"
int to_ruin = randint1(45) + 35;
while (to_ruin--) {
POSITION r_y, r_x;
- scatter(creature_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
+ scatter(creature_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, PROJECT_NONE);
if (pattern_tile(floor_ptr, r_y, r_x) && (f_info[floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED)) {
cave_set_feat(creature_ptr, r_y, r_x, feat_pattern_corrupted);
POSITION my = 0, mx = 0;
while (attempt--) {
- scatter(caster_ptr, &my, &mx, caster_ptr->y, caster_ptr->x, 4, 0);
+ scatter(caster_ptr, &my, &mx, caster_ptr->y, caster_ptr->x, 4, PROJECT_NONE);
/* Require empty grids */
if (is_cave_empty_bold2(caster_ptr, my, mx))
int attempts = 1000;
if (randint1(80 + caster_ptr->lev) < 70) {
while (attempts--) {
- scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
+ scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, PROJECT_NONE);
if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT))
continue;
int num = damroll(5, 3);
for (int i = 0; i < num; i++) {
while (TRUE) {
- scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, 0);
+ scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, PROJECT_NONE);
if (!player_bold(caster_ptr, y, x))
break;
SUMMON_ANIMAL = 42, /*!< \8f¢\8a«\83^\83C\83v: \8e©\91R\8aE\82Ì\93®\95¨ */
SUMMON_ANIMAL_RANGER = 43, /*!< \8f¢\8a«\83^\83C\83v: \83\8c\83\93\83W\83\83\81[\8cü\82¯\8e©\91R\8aE\82Ì\93®\95¨ */
SUMMON_PHANTOM = 47, /*!< \8f¢\8a«\83^\83C\83v: \83S\81[\83X\83g */
- SUMMON_BLUE_HORROR = 49, /*!< \8f¢\8a«\83^\83C\83v: \83u\83\8b\81[\81E\83z\83\89\81[ */
SUMMON_TOTEM_MOAI = 48, /*!< \8f¢\8a«\83^\83C\83v: \83g\81[\83e\83\80\83\82\83A\83C */
+ SUMMON_BLUE_HORROR = 49, /*!< \8f¢\8a«\83^\83C\83v: \83u\83\8b\81[\81E\83z\83\89\81[ */
SUMMON_LIVING = 50, /*!< \8f¢\8a«\83^\83C\83v: \90¶\96½\82Ì\82 \82é\83\82\83\93\83X\83^\81[ */
SUMMON_HI_DRAGON_LIVING = 51, /*!< \8f¢\8a«\83^\83C\83v: \90¶\96½\82Ì\82 \82é\8cÃ\91ã\83h\83\89\83S\83\93 */
SUMMON_GOLEM = 52, /*!< \8f¢\8a«\83^\83C\83v: \83S\81[\83\8c\83\80 */
#include "wizard/wizard-spells.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/asking-player.h"
+#include "effect/effect-characteristics.h"
#include "floor/cave.h"
#include "floor/floor-util.h"
#include "mind/mind-blue-mage.h"
int attempts = 1000;
while (--attempts) {
- scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
+ scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, PROJECT_NONE);
if (is_cave_empty_bold(caster_ptr, wy, wx))
break;
}