2 * @brief 魔法によるモンスターへの効果まとめ
7 #include "effect/effect-monster.h"
8 #include "avatar/avatar.h"
9 #include "core/disturbance.h"
10 #include "core/player-redraw-types.h"
11 #include "core/stuff-handler.h"
12 #include "core/window-redrawer.h"
13 #include "effect/effect-characteristics.h"
14 #include "effect/effect-monster-switcher.h"
15 #include "effect/effect-monster-util.h"
16 #include "floor/cave.h"
17 #include "floor/floor-object.h"
18 #include "game-option/play-record-options.h"
19 #include "grid/grid.h"
20 #include "io/write-diary.h"
21 #include "main/sound-definitions-table.h"
22 #include "main/sound-of-music.h"
23 #include "monster-floor/monster-death.h"
24 #include "monster-floor/monster-move.h"
25 #include "monster-floor/monster-remover.h"
26 #include "monster-race/monster-race.h"
27 #include "monster-race/race-flags-resistance.h"
28 #include "monster-race/race-flags1.h"
29 #include "monster-race/race-flags3.h"
30 #include "monster-race/race-flags7.h"
31 #include "monster-race/race-indice-types.h"
32 #include "monster/monster-damage.h"
33 #include "monster/monster-describer.h"
34 #include "monster/monster-description-types.h"
35 #include "monster/monster-info.h"
36 #include "monster/monster-status-setter.h"
37 #include "monster/monster-status.h"
38 #include "monster/monster-update.h"
39 #include "object-enchant/special-object-flags.h"
40 #include "object/object-kind-hook.h"
41 #include "spell-kind/blood-curse.h"
42 #include "spell-kind/spells-polymorph.h"
43 #include "spell-kind/spells-teleport.h"
44 #include "effect/attribute-types.h"
45 #include "spells-effect-util.h"
46 #include "sv-definition/sv-other-types.h"
47 #include "system/floor-type-definition.h"
48 #include "system/grid-type-definition.h"
49 #include "system/monster-race-definition.h"
50 #include "system/monster-type-definition.h"
51 #include "system/object-type-definition.h"
52 #include "system/player-type-definition.h"
53 #include "util/bit-flags-calculator.h"
54 #include "view/display-messages.h"
57 * @brief ビーム/ボルト/ボール系魔法によるモンスターへの効果があるかないかを判定する
58 * @param player_ptr プレイヤーへの参照ポインタ
59 * @param em_ptr モンスター効果構造体への参照ポインタ
60 * @return 効果が何もないならFALSE、何かあるならTRUE
62 static process_result is_affective(player_type *player_ptr, effect_monster_type *em_ptr)
64 if (!em_ptr->g_ptr->m_idx)
66 if (em_ptr->who && (em_ptr->g_ptr->m_idx == em_ptr->who))
68 if (sukekaku && ((em_ptr->m_ptr->r_idx == MON_SUKE) || (em_ptr->m_ptr->r_idx == MON_KAKU)))
70 if (em_ptr->m_ptr->hp < 0)
72 if (em_ptr->who || em_ptr->g_ptr->m_idx != player_ptr->riding)
75 switch (em_ptr->attribute) {
76 case AttributeType::OLD_HEAL:
77 case AttributeType::OLD_SPEED:
78 case AttributeType::STAR_HEAL:
80 case AttributeType::OLD_SLOW:
81 case AttributeType::OLD_SLEEP:
82 case AttributeType::OLD_CLONE:
83 case AttributeType::OLD_CONF:
84 case AttributeType::OLD_POLY:
85 case AttributeType::GENOCIDE:
86 case AttributeType::E_GENOCIDE:
87 return PROCESS_CONTINUE;
96 * @brief 魔法の効果やモンスター種別(MAKE/FEMALE/なし)に応じて表示するメッセージを変更する
97 * @param player_ptr プレイヤーへの参照ポインタ
98 * @param em_ptr モンスター効果構造体への参照ポインタ
100 static void make_description_of_affecred_monster(player_type *player_ptr, effect_monster_type *em_ptr)
102 em_ptr->dam = (em_ptr->dam + em_ptr->r) / (em_ptr->r + 1);
103 monster_desc(player_ptr, em_ptr->m_name, em_ptr->m_ptr, 0);
104 monster_desc(player_ptr, em_ptr->m_poss, em_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
108 * @brief モンスターへの効果属性による耐性及び効果を処理する( / Proccess affecting to monster by effect.
109 * @param player_ptr プレイヤーへの参照ポインタ
110 * @param em_ptr モンスター効果構造体への参照ポインタ
111 * @return 完全な耐性が発動したらCONTINUE、そうでないなら効果処理の結果
113 * 完全な耐性を持っていたら、一部属性を除いて影響は及ぼさない
114 * 射撃属性 (デバッグ用)であれば貫通する
116 static process_result exe_affect_monster_by_effect(player_type *player_ptr, effect_monster_type *em_ptr)
118 process_result result = is_affective(player_ptr, em_ptr);
119 if (result != PROCESS_TRUE) {
120 if (result == PROCESS_CONTINUE) {
121 em_ptr->note = _("には効果がなかった。", " is unaffected.");
127 if (none_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) || em_ptr->attribute == AttributeType::OLD_CLONE
128 || em_ptr->attribute == AttributeType::STAR_HEAL || em_ptr->attribute == AttributeType::OLD_HEAL || em_ptr->attribute == AttributeType::OLD_SPEED
129 || em_ptr->attribute == AttributeType::CAPTURE || em_ptr->attribute == AttributeType::PHOTO)
130 return switch_effects_monster(player_ptr, em_ptr);
132 if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) && (em_ptr->attribute == AttributeType::ARROW))
133 return switch_effects_monster(player_ptr, em_ptr);
135 em_ptr->note = _("には完全な耐性がある!", " is immune.");
137 if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
138 em_ptr->r_ptr->r_flagsr |= (RFR_RES_ALL);
140 if (em_ptr->attribute == AttributeType::LITE_WEAK || em_ptr->attribute == AttributeType::KILL_WALL)
141 em_ptr->skipped = true;
143 return PROCESS_CONTINUE;
148 * @param player_ptr プレイヤーへの参照ポインタ
149 * @param em_ptr モンスター効果構造体への参照ポインタ
151 static void effect_damage_killed_pet(player_type *player_ptr, effect_monster_type *em_ptr)
153 bool sad = is_pet(em_ptr->m_ptr) && !(em_ptr->m_ptr->ml);
154 if (em_ptr->known && em_ptr->note) {
155 monster_desc(player_ptr, em_ptr->m_name, em_ptr->m_ptr, MD_TRUE_NAME);
156 if (em_ptr->see_s_msg)
157 msg_format("%^s%s", em_ptr->m_name, em_ptr->note);
159 player_ptr->current_floor_ptr->monster_noise = true;
163 monster_gain_exp(player_ptr, em_ptr->who, em_ptr->m_ptr->r_idx);
165 monster_death(player_ptr, em_ptr->g_ptr->m_idx, false, em_ptr->attribute);
166 delete_monster_idx(player_ptr, em_ptr->g_ptr->m_idx);
168 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
172 * @brief モンスターの睡眠を処理する
173 * @param player_ptr プレイヤーへの参照ポインタ
174 * @param em_ptr モンスター効果構造体への参照ポインタ
176 static void effect_damage_makes_sleep(player_type *player_ptr, effect_monster_type *em_ptr)
178 if (em_ptr->note && em_ptr->seen_msg)
179 msg_format("%^s%s", em_ptr->m_name, em_ptr->note);
180 else if (em_ptr->see_s_msg)
181 message_pain(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam);
183 player_ptr->current_floor_ptr->monster_noise = true;
185 if (em_ptr->do_sleep)
186 (void)set_monster_csleep(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_sleep);
190 * @brief モンスターからモンスターへのダメージを処理する / Hurt the monster by damages another monster did.
191 * @param player_ptr プレイヤーへの参照ポインタ
192 * @param em_ptr モンスター効果構造体への参照ポインタ
193 * @return ダメージを処理しなかった(モンスターIDがプレイヤー自身)場合はFALSE、処理した(モンスターだった)場合TRUE
195 * モンスターIDがプレイヤー(0)の場合は処理しない。
197 static bool deal_effect_damage_from_monster(player_type *player_ptr, effect_monster_type *em_ptr)
199 if (em_ptr->who <= 0)
202 if (player_ptr->health_who == em_ptr->g_ptr->m_idx)
203 player_ptr->redraw |= (PR_HEALTH);
204 if (player_ptr->riding == em_ptr->g_ptr->m_idx)
205 player_ptr->redraw |= (PR_UHEALTH);
207 (void)set_monster_csleep(player_ptr, em_ptr->g_ptr->m_idx, 0);
208 em_ptr->m_ptr->hp -= em_ptr->dam;
209 if (em_ptr->m_ptr->hp < 0)
210 effect_damage_killed_pet(player_ptr, em_ptr);
212 effect_damage_makes_sleep(player_ptr, em_ptr);
219 * @param player_ptr プレイヤーへの参照ポインタ
220 * @param em_ptr モンスター効果構造体への参照ポインタ
221 * @return 大賞モンスターが不潔な病人だった場合はTRUE、それ以外はFALSE
223 static bool heal_leaper(player_type *player_ptr, effect_monster_type *em_ptr)
225 if (!em_ptr->heal_leper)
228 if (em_ptr->seen_msg)
229 msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
231 if (record_named_pet && is_pet(em_ptr->m_ptr) && em_ptr->m_ptr->nickname) {
232 char m2_name[MAX_NLEN];
233 monster_desc(player_ptr, m2_name, em_ptr->m_ptr, MD_INDEF_VISIBLE);
234 exe_write_diary(player_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
237 delete_monster_idx(player_ptr, em_ptr->g_ptr->m_idx);
242 * @brief プレイヤー起因の効果によるダメージを処理 / Deal damages from player and fear by them.
243 * @param player_ptr プレイヤーへの参照ポインタ
244 * @param em_ptr モンスター効果構造体への参照ポインタ
245 * @return モンスターが死んだらTRUE、生きていたらFALSE
247 * em_ptr->do_fearによる恐怖メッセージもここで表示。
249 static bool deal_effect_damage_from_player(player_type *player_ptr, effect_monster_type *em_ptr)
252 MonsterDamageProcessor mdp(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, &fear, em_ptr->attribute);
253 if (mdp.mon_take_hit(em_ptr->note_dies))
256 if (em_ptr->do_sleep)
257 anger_monster(player_ptr, em_ptr->m_ptr);
259 if (em_ptr->note && em_ptr->seen)
260 msg_format(_("%s%s", "%^s%s"), em_ptr->m_name, em_ptr->note);
261 else if (em_ptr->known && (em_ptr->dam || !em_ptr->do_fear))
262 message_pain(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam);
264 if (((em_ptr->dam > 0) || em_ptr->get_angry) && !em_ptr->do_sleep)
265 anger_monster(player_ptr, em_ptr->m_ptr);
267 if ((fear || em_ptr->do_fear) && em_ptr->seen) {
269 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), em_ptr->m_name);
276 * @brief モンスターに効果のダメージを与える / Deal effect damage to monster.
277 * @param player_ptr プレイヤーへの参照ポインタ
278 * @param em_ptr モンスター効果構造体への参照ポインタ
281 * 1.モンスターによる効果ダメージの処理
283 * 3.プレイヤーによる効果ダメージの処理
286 static void deal_effect_damage_to_monster(player_type *player_ptr, effect_monster_type *em_ptr)
288 if (em_ptr->attribute == AttributeType::DRAIN_MANA)
292 if (deal_effect_damage_from_monster(player_ptr, em_ptr))
296 if (heal_leaper(player_ptr, em_ptr))
298 if (deal_effect_damage_from_player(player_ptr, em_ptr))
301 if (em_ptr->do_sleep)
302 (void)set_monster_csleep(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_sleep);
306 * @brief プレイヤーが眠っている敵に効果を及ぼした場合の徳の変化
307 * @param player_ptr プレイヤーへの参照ポインタ
308 * @param em_ptr モンスター効果構造体への参照ポインタ
310 static void effect_makes_change_virtues(player_type *player_ptr, effect_monster_type *em_ptr)
312 if ((em_ptr->who > 0) || !em_ptr->slept)
315 if (!(em_ptr->r_ptr->flags3 & RF3_EVIL) || one_in_(5))
316 chg_virtue(player_ptr, V_COMPASSION, -1);
317 if (!(em_ptr->r_ptr->flags3 & RF3_EVIL) || one_in_(5))
318 chg_virtue(player_ptr, V_HONOUR, -1);
322 * @brief 魔法効果に対する強制処理(変身の強制解除、死なない処理)
323 * @param player_ptr プレイヤーへの参照ポインタ
324 * @param em_ptr モンスター効果構造体への参照ポインタ
326 static void affected_monster_prevents_bad_status(player_type *player_ptr, effect_monster_type *em_ptr)
328 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) || (em_ptr->r_ptr->flags1 & RF1_QUESTOR) || (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding)))
329 em_ptr->do_polymorph = false;
331 if (((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (em_ptr->r_ptr->flags7 & RF7_NAZGUL)) && !player_ptr->phase_out && (em_ptr->who > 0) && (em_ptr->dam > em_ptr->m_ptr->hp))
332 em_ptr->dam = em_ptr->m_ptr->hp;
336 * @brief モンスターの朦朧値を蓄積させる
337 * @param player_ptr プレイヤーへの参照ポインタ
338 * @param em_ptr モンスター効果構造体への参照ポインタ
339 * @param stun_damage 朦朧値
341 static void effect_damage_piles_stun(player_type *player_ptr, effect_monster_type *em_ptr)
343 if ((em_ptr->do_stun == 0) || (em_ptr->r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) || (em_ptr->r_ptr->flags3 & RF3_NO_STUN))
347 em_ptr->obvious = true;
350 if (monster_stunned_remaining(em_ptr->m_ptr)) {
351 em_ptr->note = _("はひどくもうろうとした。", " is more dazed.");
352 turns = monster_stunned_remaining(em_ptr->m_ptr) + (em_ptr->do_stun / 2);
354 em_ptr->note = _("はもうろうとした。", " is dazed.");
355 turns = em_ptr->do_stun;
358 (void)set_monster_stunned(player_ptr, em_ptr->g_ptr->m_idx, turns);
359 em_ptr->get_angry = true;
363 * @brief モンスターの混乱値を蓄積させる
364 * @param player_ptr プレイヤーへの参照ポインタ
365 * @param em_ptr モンスター効果構造体への参照ポインタ
366 * @param stun_damage 混乱値
368 static void effect_damage_piles_confusion(player_type *player_ptr, effect_monster_type *em_ptr)
370 if ((em_ptr->do_conf == 0) || (em_ptr->r_ptr->flags3 & RF3_NO_CONF) || (em_ptr->r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
374 em_ptr->obvious = true;
377 if (monster_confused_remaining(em_ptr->m_ptr)) {
378 em_ptr->note = _("はさらに混乱したようだ。", " looks more confused.");
379 turns = monster_confused_remaining(em_ptr->m_ptr) + (em_ptr->do_conf / 2);
381 em_ptr->note = _("は混乱したようだ。", " looks confused.");
382 turns = em_ptr->do_conf;
385 (void)set_monster_confused(player_ptr, em_ptr->g_ptr->m_idx, turns);
386 em_ptr->get_angry = true;
390 * @brief モンスターの恐怖値を蓄積させる
391 * @param player_ptr プレイヤーへの参照ポインタ
392 * @param em_ptr モンスター効果構造体への参照ポインタ
393 * @param stun_damage 恐怖値
395 * 打撃ダメージによる恐怖もあるため、メッセージは後で表示。
397 static void effect_damage_piles_fear(player_type *player_ptr, effect_monster_type *em_ptr)
399 if (em_ptr->do_fear == 0 || any_bits(em_ptr->r_ptr->flags3, RF3_NO_FEAR))
402 (void)set_monster_monfear(player_ptr, em_ptr->g_ptr->m_idx, monster_fear_remaining(em_ptr->m_ptr) + em_ptr->do_fear);
403 em_ptr->get_angry = true;
408 * @param em_ptr モンスター効果構造体への参照ポインタ
410 static void effect_damage_makes_weak(effect_monster_type *em_ptr)
412 if (em_ptr->do_time == 0)
416 em_ptr->obvious = true;
418 if (em_ptr->do_time >= em_ptr->m_ptr->maxhp)
419 em_ptr->do_time = em_ptr->m_ptr->maxhp - 1;
421 if (em_ptr->do_time) {
422 em_ptr->note = _("は弱くなったようだ。", " seems weakened.");
423 em_ptr->m_ptr->maxhp -= em_ptr->do_time;
424 if ((em_ptr->m_ptr->hp - em_ptr->dam) > em_ptr->m_ptr->maxhp)
425 em_ptr->dam = em_ptr->m_ptr->hp - em_ptr->m_ptr->maxhp;
428 em_ptr->get_angry = true;
433 * @param player_ptr プレイヤーへの参照ポインタ
434 * @param em_ptr モンスター効果構造体への参照ポインタ
436 static void effect_damage_makes_polymorph(player_type *player_ptr, effect_monster_type *em_ptr)
438 if (!em_ptr->do_polymorph || (randint1(90) <= em_ptr->r_ptr->level))
441 if (polymorph_monster(player_ptr, em_ptr->y, em_ptr->x)) {
443 em_ptr->obvious = true;
445 em_ptr->note = _("が変身した!", " changes!");
449 em_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[em_ptr->g_ptr->m_idx];
450 em_ptr->r_ptr = &r_info[em_ptr->m_ptr->r_idx];
454 * @brief モンスターをテレポートさせる
455 * @param player_ptr プレイヤーへの参照ポインタ
456 * @param em_ptr モンスター効果構造体への参照ポインタ
458 static void effect_damage_makes_teleport(player_type *player_ptr, effect_monster_type *em_ptr)
460 if (em_ptr->do_dist == 0)
464 em_ptr->obvious = true;
466 em_ptr->note = _("が消え去った!", " disappears!");
469 chg_virtue(player_ptr, V_VALOUR, -1);
471 teleport_flags tflag = i2enum<teleport_flags>((!em_ptr->who ? TELEPORT_DEC_VALOUR : TELEPORT_SPONTANEOUS) | TELEPORT_PASSIVE);
472 teleport_away(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_dist, tflag);
474 em_ptr->y = em_ptr->m_ptr->fy;
475 em_ptr->x = em_ptr->m_ptr->fx;
476 em_ptr->g_ptr = &player_ptr->current_floor_ptr->grid_array[em_ptr->y][em_ptr->x];
480 * @brief モンスターへのダメージに応じたメッセージを表示させ、異常状態を与える
481 * @param player_ptr プレイヤーへの参照ポインタ
482 * @param em_ptr モンスター効果構造体への参照ポインタ
485 * 1.全耐性または無敵でダメージが通らなかった場合
489 static void effect_damage_gives_bad_status(player_type *player_ptr, effect_monster_type *em_ptr)
491 int tmp_damage = em_ptr->dam;
492 em_ptr->dam = mon_damage_mod(player_ptr, em_ptr->m_ptr, em_ptr->dam, (bool)(em_ptr->attribute == AttributeType::PSY_SPEAR));
493 if ((tmp_damage > 0) && (em_ptr->dam == 0) && em_ptr->seen)
494 em_ptr->note = _("はダメージを受けていない。", " is unharmed.");
496 if (em_ptr->dam > em_ptr->m_ptr->hp)
497 em_ptr->note = em_ptr->note_dies;
499 effect_damage_piles_stun(player_ptr, em_ptr);
500 effect_damage_piles_confusion(player_ptr, em_ptr);
501 effect_damage_piles_fear(player_ptr, em_ptr);
502 effect_damage_makes_weak(em_ptr);
503 effect_damage_makes_polymorph(player_ptr, em_ptr);
504 effect_damage_makes_teleport(player_ptr, em_ptr);
509 * @brief 効果によるモンスターへのダメージと付随効果を処理する
510 * @param player_ptr プレイヤーへの参照ポインタ
511 * @param em_ptr モンスター効果構造体への参照ポインタ
515 * 2.完全な耐性及び無敵によるダメージのカット
516 * 3.ダメージによる付随効果の処理(混乱/朦朧/恐怖/衰弱/変身/テレポート)
520 static void exe_affect_monster_by_damage(player_type *player_ptr, effect_monster_type *em_ptr)
522 effect_makes_change_virtues(player_ptr, em_ptr);
523 affected_monster_prevents_bad_status(player_ptr, em_ptr);
524 effect_damage_gives_bad_status(player_ptr, em_ptr);
525 deal_effect_damage_to_monster(player_ptr, em_ptr);
526 if ((em_ptr->attribute == AttributeType::BLOOD_CURSE) && one_in_(4))
527 blood_curse_to_enemy(player_ptr, em_ptr->who);
531 * @brief モンスター闘技場にいる場合の画面更新処理
532 * @param player_ptr プレイヤーへの参照ポインタ
533 * @param em_ptr モンスター効果構造体への参照ポインタ
535 static void update_phase_out_stat(player_type *player_ptr, effect_monster_type *em_ptr)
537 if (!player_ptr->phase_out)
540 player_ptr->health_who = em_ptr->g_ptr->m_idx;
541 player_ptr->redraw |= (PR_HEALTH);
542 handle_stuff(player_ptr);
546 * @brief 魔法効果がペットに及んだ時の処理
547 * @param player_ptr プレイヤーへの参照ポインタ
548 * @param em_ptr モンスター効果構造体への参照ポインタ
550 static void postprocess_by_effected_pet(player_type *player_ptr, effect_monster_type *em_ptr)
552 if ((em_ptr->dam <= 0) || is_pet(em_ptr->m_ptr) || is_friendly(em_ptr->m_ptr))
555 if (em_ptr->who == 0) {
556 if (!(em_ptr->flag & PROJECT_NO_HANGEKI))
557 set_target(em_ptr->m_ptr, monster_target_y, monster_target_x);
562 if ((em_ptr->who > 0) && is_pet(em_ptr->m_caster_ptr) && !player_bold(player_ptr, em_ptr->m_ptr->target_y, em_ptr->m_ptr->target_x))
563 set_target(em_ptr->m_ptr, em_ptr->m_caster_ptr->fy, em_ptr->m_caster_ptr->fx);
567 * @brief 魔法効果が騎乗モンスターに及んだ時の処理
568 * @param player_ptr プレイヤーへの参照ポインタ
569 * @param em_ptr モンスター効果構造体への参照ポインタ
571 static void postprocess_by_riding_pet_effected(player_type *player_ptr, effect_monster_type *em_ptr)
573 if (!player_ptr->riding || (player_ptr->riding != em_ptr->g_ptr->m_idx) || (em_ptr->dam <= 0))
576 if (em_ptr->m_ptr->hp > (em_ptr->m_ptr->maxhp / 3))
577 em_ptr->dam = (em_ptr->dam + 1) / 2;
579 rakubadam_m = (em_ptr->dam > 200) ? 200 : em_ptr->dam;
584 * @param player_ptr プレイヤーへの参照ポインタ
585 * @param em_ptr モンスター効果構造体への参照ポインタ
586 * @details 写真のフラッシュは弱閃光属性
588 static void postprocess_by_taking_photo(player_type *player_ptr, effect_monster_type *em_ptr)
590 if (em_ptr->photo == 0)
596 q_ptr->prep(lookup_kind(ItemKindType::STATUE, SV_PHOTO));
597 q_ptr->pval = em_ptr->photo;
598 q_ptr->ident |= (IDENT_FULL_KNOWN);
599 (void)drop_near(player_ptr, q_ptr, -1, player_ptr->y, player_ptr->x);
603 * @brief モンスター効果の後処理 (ペット関係、記念撮影、グローバル変数更新)
604 * @param player_ptr プレイヤーへの参照ポインタ
605 * @param em_ptr モンスター効果構造体への参照ポインタ
607 static void exe_affect_monster_postprocess(player_type *player_ptr, effect_monster_type *em_ptr)
609 postprocess_by_effected_pet(player_ptr, em_ptr);
610 postprocess_by_riding_pet_effected(player_ptr, em_ptr);
611 postprocess_by_taking_photo(player_ptr, em_ptr);
613 project_m_x = em_ptr->x;
614 project_m_y = em_ptr->y;
618 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
619 * @param player_ptr プレイヤーへの参照ポインタ
620 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
621 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
622 * @param y 目標y座標 / Target y location (or location to travel "towards")
623 * @param x 目標x座標 / Target x location (or location to travel "towards")
624 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
625 * @param attribute 効果属性 / Type of damage to apply to monsters (and objects)
627 * @param see_s_msg TRUEならばメッセージを表示する
628 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
631 * 1.魔法効果による効果に対する耐性による軽減計算及び効果の発動
632 * 2.魔法効果によるダメージの処理とダメージによる効果の発動
636 player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
638 effect_monster_type tmp_effect;
639 effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, attribute, flag, see_s_msg);
641 make_description_of_affecred_monster(player_ptr, em_ptr);
643 if (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding))
644 disturb(player_ptr, true, true);
646 process_result result = exe_affect_monster_by_effect(player_ptr, em_ptr);
647 if (result != PROCESS_CONTINUE)
653 exe_affect_monster_by_damage(player_ptr, em_ptr);
655 update_phase_out_stat(player_ptr, em_ptr);
656 if (em_ptr->m_ptr->r_idx)
657 update_monster(player_ptr, em_ptr->g_ptr->m_idx, false);
659 lite_spot(player_ptr, em_ptr->y, em_ptr->x);
660 if ((player_ptr->monster_race_idx == em_ptr->m_ptr->r_idx) && (em_ptr->seen || !em_ptr->m_ptr->r_idx))
661 player_ptr->window_flags |= (PW_MONSTER);
663 exe_affect_monster_postprocess(player_ptr, em_ptr);
664 return em_ptr->obvious;