2 * @brief effect_monster_type構造体の初期化処理
7 #include "effect/effect-monster-util.h"
8 #include "monster-floor/monster-death.h"
9 #include "monster-race/monster-race.h"
10 #include "monster/monster-info.h"
11 #include "monster/monster-status.h"
12 #include "system/floor-type-definition.h"
15 * @brief affect_monster() に亘ってきた引数をeffect_monster_type構造体に代入する
16 * @param em_ptr モンスター効果構造体への参照ポインタ
17 * @param who 魔法を発動したモンスター (0ならばプレーヤー)
18 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
19 * @param y 目標y座標 / Target y location (or location to travel "towards")
20 * @param x 目標x座標 / Target x location (or location to travel "towards")
21 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
22 * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects)
24 * @param see_s_msg TRUEならばメッセージを表示する
27 static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
34 em_ptr->effect_type = effect_type;
36 em_ptr->see_s_msg = see_s_msg;
41 * @brief effect_monster_type構造体を初期化する
42 * @param caster_ptr プレーヤーへの参照ポインタ
43 * @param em_ptr モンスター効果構造体への参照ポインタ
44 * @param who 魔法を発動したモンスター (0ならばプレーヤー)
45 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
46 * @param y 目標y座標 / Target y location (or location to travel "towards")
47 * @param x 目標x座標 / Target x location (or location to travel "towards")
48 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
49 * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects)
51 * @param see_s_msg TRUEならばメッセージを表示する
54 effect_monster_type *initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
56 substitute_effect_monster(em_ptr, who, r, y, x, dam, effect_type, flag, see_s_msg);
58 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
59 em_ptr->g_ptr = &floor_ptr->grid_array[em_ptr->y][em_ptr->x];
60 em_ptr->m_ptr = &floor_ptr->m_list[em_ptr->g_ptr->m_idx];
61 em_ptr->m_caster_ptr = (em_ptr->who > 0) ? &floor_ptr->m_list[em_ptr->who] : NULL;
62 em_ptr->r_ptr = &r_info[em_ptr->m_ptr->r_idx];
63 em_ptr->seen = em_ptr->m_ptr->ml;
64 em_ptr->seen_msg = is_seen(caster_ptr, em_ptr->m_ptr);
65 em_ptr->slept = (bool)monster_csleep_remaining(em_ptr->m_ptr);
66 em_ptr->obvious = FALSE;
67 em_ptr->known = ((em_ptr->m_ptr->cdis <= MAX_SIGHT) || caster_ptr->phase_out);
68 em_ptr->skipped = FALSE;
69 em_ptr->get_angry = FALSE;
70 em_ptr->do_polymorph = FALSE;
77 em_ptr->heal_leper = FALSE;
80 em_ptr->note_dies = extract_note_dies(real_r_idx(em_ptr->m_ptr));
81 em_ptr->caster_lev = (em_ptr->who > 0) ? r_info[em_ptr->m_caster_ptr->r_idx].level : (caster_ptr->lev * 2);