1 #include "mspell/mspell-breath.h"
2 #include "core/disturbance.h"
3 #include "main/sound-definitions-table.h"
4 #include "main/sound-of-music.h"
5 #include "mind/drs-types.h"
6 #include "monster-race/race-indice-types.h"
7 #include "monster/monster-info.h"
8 #include "monster/monster-update.h"
9 #include "mspell/mspell-checker.h"
10 #include "mspell/mspell-damage-calculator.h"
11 #include "mspell/mspell-util.h"
12 #include "spell/spell-types.h"
13 #include "system/floor-type-definition.h"
14 #include "view/display-messages.h"
17 * @brief RF4_BR_*の処理。各種ブレス。 /
18 * @param target_ptr プレーヤーへの参照ポインタ
19 * @param GF_TYPE ブレスの属性
22 * @param m_idx 呪文を唱えるモンスターID
23 * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
24 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
27 HIT_POINT spell_RF4_BREATH(player_type *target_ptr, int GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
29 HIT_POINT dam, ms_type, drs_type = 0;
31 bool smart_learn_aux = TRUE;
32 floor_type *floor_ptr = target_ptr->current_floor_ptr;
33 monster_type *m_ptr = &floor_ptr->m_list[m_idx];
34 bool known = monster_near_player(floor_ptr, m_idx, t_idx);
35 bool see_either = see_monster(target_ptr, m_idx) || see_monster(target_ptr, t_idx);
36 bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
37 bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
38 GAME_TEXT m_name[MAX_NLEN], t_name[MAX_NLEN];
39 monster_name(target_ptr, m_idx, m_name);
40 monster_name(target_ptr, t_idx, t_name);
44 dam = monspell_damage(target_ptr, (MS_BR_ACID), m_idx, DAM_ROLL);
45 type_s = _("酸", "acid");
50 dam = monspell_damage(target_ptr, (MS_BR_ELEC), m_idx, DAM_ROLL);
51 type_s = _("稲妻", "lightning");
56 dam = monspell_damage(target_ptr, (MS_BR_FIRE), m_idx, DAM_ROLL);
57 type_s = _("火炎", "fire");
62 dam = monspell_damage(target_ptr, (MS_BR_COLD), m_idx, DAM_ROLL);
63 type_s = _("冷気", "frost");
68 dam = monspell_damage(target_ptr, (MS_BR_POIS), m_idx, DAM_ROLL);
69 type_s = _("ガス", "gas");
74 dam = monspell_damage(target_ptr, (MS_BR_NETHER), m_idx, DAM_ROLL);
75 type_s = _("地獄", "nether");
76 ms_type = MS_BR_NETHER;
80 dam = monspell_damage(target_ptr, (MS_BR_LITE), m_idx, DAM_ROLL);
81 type_s = _("閃光", "light");
86 dam = monspell_damage(target_ptr, (MS_BR_DARK), m_idx, DAM_ROLL);
87 type_s = _("暗黒", "darkness");
92 dam = monspell_damage(target_ptr, (MS_BR_CONF), m_idx, DAM_ROLL);
93 type_s = _("混乱", "confusion");
98 dam = monspell_damage(target_ptr, (MS_BR_SOUND), m_idx, DAM_ROLL);
99 type_s = _("轟音", "sound");
100 ms_type = MS_BR_SOUND;
101 drs_type = DRS_SOUND;
104 dam = monspell_damage(target_ptr, (MS_BR_CHAOS), m_idx, DAM_ROLL);
105 type_s = _("カオス", "chaos");
106 ms_type = MS_BR_CHAOS;
107 drs_type = DRS_CHAOS;
110 dam = monspell_damage(target_ptr, (MS_BR_DISEN), m_idx, DAM_ROLL);
111 type_s = _("劣化", "disenchantment");
112 ms_type = MS_BR_DISEN;
113 drs_type = DRS_DISEN;
116 dam = monspell_damage(target_ptr, (MS_BR_NEXUS), m_idx, DAM_ROLL);
117 type_s = _("因果混乱", "nexus");
118 ms_type = MS_BR_NEXUS;
119 drs_type = DRS_NEXUS;
122 dam = monspell_damage(target_ptr, (MS_BR_TIME), m_idx, DAM_ROLL);
123 type_s = _("時間逆転", "time");
124 ms_type = MS_BR_TIME;
125 smart_learn_aux = FALSE;
128 dam = monspell_damage(target_ptr, (MS_BR_INERTIA), m_idx, DAM_ROLL);
129 type_s = _("遅鈍", "inertia");
130 ms_type = MS_BR_INERTIA;
131 smart_learn_aux = FALSE;
134 dam = monspell_damage(target_ptr, (MS_BR_GRAVITY), m_idx, DAM_ROLL);
135 type_s = _("重力", "gravity");
136 ms_type = MS_BR_GRAVITY;
137 smart_learn_aux = FALSE;
140 dam = monspell_damage(target_ptr, (MS_BR_SHARDS), m_idx, DAM_ROLL);
141 type_s = _("破片", "shards");
142 ms_type = MS_BR_SHARDS;
143 drs_type = DRS_SHARD;
146 dam = monspell_damage(target_ptr, (MS_BR_PLASMA), m_idx, DAM_ROLL);
147 type_s = _("プラズマ", "plasma");
148 ms_type = MS_BR_PLASMA;
149 smart_learn_aux = FALSE;
152 dam = monspell_damage(target_ptr, (MS_BR_FORCE), m_idx, DAM_ROLL);
153 type_s = _("フォース", "force");
154 ms_type = MS_BR_FORCE;
155 smart_learn_aux = FALSE;
158 dam = monspell_damage(target_ptr, (MS_BR_MANA), m_idx, DAM_ROLL);
159 type_s = _("魔力", "mana");
160 ms_type = MS_BR_MANA;
161 smart_learn_aux = FALSE;
164 dam = monspell_damage(target_ptr, (MS_BR_NUKE), m_idx, DAM_ROLL);
165 type_s = _("放射性廃棄物", "toxic waste");
166 ms_type = MS_BR_NUKE;
169 case GF_DISINTEGRATE:
170 dam = monspell_damage(target_ptr, (MS_BR_DISI), m_idx, DAM_ROLL);
171 type_s = _("分解", "disintegration");
172 ms_type = MS_BR_DISI;
173 smart_learn_aux = FALSE;
176 /* Do not reach here */
178 type_s = _("不明", "Unknown");
179 ms_type = MS_BR_ACID;
180 smart_learn_aux = FALSE;
184 if (mon_to_player || (mon_to_mon && known && see_either))
185 disturb(target_ptr, TRUE, TRUE);
187 if (m_ptr->r_idx == MON_JAIAN && GF_TYPE == GF_SOUND) {
188 msg_format(_("「ボォエ~~~~~~」", "'Booooeeeeee'"));
189 } else if (m_ptr->r_idx == MON_BOTEI && GF_TYPE == GF_SHARDS) {
190 msg_format(_("「ボ帝ビルカッター!!!」", "'Boty-Build cutter!!!'"));
191 } else if (target_ptr->blind) {
192 if (mon_to_player || (mon_to_mon && known && see_either))
193 msg_format(_("%^sが何かのブレスを吐いた。", "%^s breathes."), m_name);
196 msg_format(_("%^sが%^sのブレスを吐いた。", "%^s breathes %^s."), m_name, type_s);
197 } else if (mon_to_mon && known && see_either) {
198 _(msg_format("%^sが%^sに%^sのブレスを吐いた。", m_name, t_name, type_s), msg_format("%^s breathes %^s at %^s.", m_name, type_s, t_name));
202 if (mon_to_mon && known && !see_either)
203 floor_ptr->monster_noise = TRUE;
206 breath(target_ptr, y, x, m_idx, GF_TYPE, dam, 0, TRUE, ms_type, TARGET_TYPE);
207 if (smart_learn_aux && mon_to_player)
208 update_smart_learn(target_ptr, m_idx, drs_type);