2 * @brief effect_monster_type構造体の初期化処理
7 #include "effect/effect-monster-util.h"
8 #include "floor/geometry.h"
9 #include "monster-floor/monster-death.h"
10 #include "monster-race/monster-race.h"
11 #include "monster/monster-info.h"
12 #include "monster/monster-status.h"
13 #include "system/floor-type-definition.h"
14 #include "system/grid-type-definition.h"
15 #include "system/monster-entity.h"
16 #include "system/monster-race-info.h"
17 #include "system/player-type-definition.h"
20 * @brief affect_monster() に亘ってきた引数をeffect_monster_type構造体に代入する
21 * @param em_ptr モンスター効果構造体への参照ポインタ
22 * @param who 魔法を発動したモンスター (0ならばプレイヤー)
23 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
24 * @param y 目標y座標 / Target y location (or location to travel "towards")
25 * @param x 目標x座標 / Target x location (or location to travel "towards")
26 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
27 * @param attribute 効果属性 / Type of damage to apply to monsters (and objects)
29 * @param see_s_msg TRUEならばメッセージを表示する
31 static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
38 em_ptr->attribute = attribute;
40 em_ptr->see_s_msg = see_s_msg;
44 * @brief effect_monster_type構造体を初期化する
45 * @param player_ptr プレイヤーへの参照ポインタ
46 * @param em_ptr モンスター効果構造体への参照ポインタ
47 * @param who 魔法を発動したモンスター (0ならばプレイヤー)
48 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
49 * @param y 目標y座標 / Target y location (or location to travel "towards")
50 * @param x 目標x座標 / Target x location (or location to travel "towards")
51 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
52 * @param attribute 効果属性 / Type of damage to apply to monsters (and objects)
54 * @param see_s_msg TRUEならばメッセージを表示する
56 effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
58 substitute_effect_monster(em_ptr, who, r, y, x, dam, attribute, flag, see_s_msg);
60 auto *floor_ptr = player_ptr->current_floor_ptr;
61 em_ptr->g_ptr = &floor_ptr->grid_array[em_ptr->y][em_ptr->x];
62 em_ptr->m_ptr = &floor_ptr->m_list[em_ptr->g_ptr->m_idx];
63 em_ptr->m_caster_ptr = (em_ptr->who > 0) ? &floor_ptr->m_list[em_ptr->who] : nullptr;
64 em_ptr->r_ptr = &monraces_info[em_ptr->m_ptr->r_idx];
65 em_ptr->seen = em_ptr->m_ptr->ml;
66 em_ptr->seen_msg = is_seen(player_ptr, em_ptr->m_ptr);
67 em_ptr->slept = em_ptr->m_ptr->is_asleep();
68 em_ptr->obvious = false;
69 em_ptr->known = ((em_ptr->m_ptr->cdis <= MAX_PLAYER_SIGHT) || player_ptr->phase_out);
70 em_ptr->skipped = false;
71 em_ptr->get_angry = false;
72 em_ptr->do_polymorph = false;
79 em_ptr->heal_leper = false;
81 em_ptr->note_dies = em_ptr->m_ptr->get_died_message();
82 em_ptr->caster_lev = (em_ptr->who > 0) ? monraces_info[em_ptr->m_caster_ptr->r_idx].level : (player_ptr->lev * 2);