2 * @brief モンスター同士が乱闘を起こした時の攻撃種別をスイッチングする
7 #include "melee/melee-switcher.h"
8 #include "core/disturbance.h"
9 #include "monster-attack/monster-attack-effect.h"
10 #include "monster/monster-status-setter.h"
11 #include "spell-kind/earthquake.h"
12 #include "view/display-messages.h"
14 void describe_melee_method(player_type *subject_ptr, mam_type *mam_ptr)
16 switch (mam_ptr->method) {
18 mam_ptr->act = _("%sを殴った。", "hits %s.");
19 mam_ptr->touched = TRUE;
23 mam_ptr->act = _("%sを触った。", "touches %s.");
24 mam_ptr->touched = TRUE;
28 mam_ptr->act = _("%sをパンチした。", "punches %s.");
29 mam_ptr->touched = TRUE;
33 mam_ptr->act = _("%sを蹴った。", "kicks %s.");
34 mam_ptr->touched = TRUE;
38 mam_ptr->act = _("%sをひっかいた。", "claws %s.");
39 mam_ptr->touched = TRUE;
43 mam_ptr->act = _("%sを噛んだ。", "bites %s.");
44 mam_ptr->touched = TRUE;
48 mam_ptr->act = _("%sを刺した。", "stings %s.");
49 mam_ptr->touched = TRUE;
53 mam_ptr->act = _("%sを斬った。", "slashes %s.");
57 mam_ptr->act = _("%sを角で突いた。", "butts %s.");
58 mam_ptr->touched = TRUE;
62 mam_ptr->act = _("%sに体当りした。", "crushes %s.");
63 mam_ptr->touched = TRUE;
67 mam_ptr->act = _("%sを飲み込んだ。", "engulfs %s.");
68 mam_ptr->touched = TRUE;
72 mam_ptr->act = _("%sに請求書をよこした。", "charges %s.");
73 mam_ptr->touched = TRUE;
77 mam_ptr->act = _("%sの体の上を這い回った。", "crawls on %s.");
78 mam_ptr->touched = TRUE;
82 mam_ptr->act = _("%sによだれをたらした。", "drools on %s.");
83 mam_ptr->touched = FALSE;
87 mam_ptr->act = _("%sに唾を吐いた。", "spits on %s.");
88 mam_ptr->touched = FALSE;
92 if (mam_ptr->see_either)
93 disturb(subject_ptr, TRUE, TRUE);
95 mam_ptr->act = _("爆発した。", "explodes.");
96 mam_ptr->explode = TRUE;
97 mam_ptr->touched = FALSE;
101 mam_ptr->act = _("%sをにらんだ。", "gazes at %s.");
102 mam_ptr->touched = FALSE;
106 mam_ptr->act = _("%sに泣きついた。", "wails at %s.");
107 mam_ptr->touched = FALSE;
111 mam_ptr->act = _("%sに胞子を飛ばした。", "releases spores at %s.");
112 mam_ptr->touched = FALSE;
116 mam_ptr->act = _("%sにXXX4を飛ばした。", "projects XXX4's at %s.");
117 mam_ptr->touched = FALSE;
121 mam_ptr->act = _("%sに金をせがんだ。", "begs %s for money.");
122 mam_ptr->touched = FALSE;
126 mam_ptr->act = _("%sを侮辱した。", "insults %s.");
127 mam_ptr->touched = FALSE;
131 mam_ptr->act = _("%sにむかってうめいた。", "moans at %s.");
132 mam_ptr->touched = FALSE;
136 mam_ptr->act = _("%sにむかって歌った。", "sings to %s.");
137 mam_ptr->touched = FALSE;
148 void decide_monster_attack_effect(player_type *subject_ptr, mam_type *mam_ptr)
150 switch (mam_ptr->effect) {
154 mam_ptr->pt = GF_NONE;
157 if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) {
158 int tmp_damage = mam_ptr->damage - (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
159 mam_ptr->damage = MAX(mam_ptr->damage, tmp_damage * 2);
165 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
169 mam_ptr->pt = GF_POIS;
173 mam_ptr->pt = GF_DISENCHANT;
177 if ((subject_ptr->riding != mam_ptr->m_idx) && one_in_(2))
178 mam_ptr->blinked = TRUE;
193 mam_ptr->pt = GF_ACID;
196 mam_ptr->pt = GF_ELEC;
199 mam_ptr->pt = GF_FIRE;
202 mam_ptr->pt = GF_COLD;
205 mam_ptr->pt = GF_CONFUSION;
208 mam_ptr->effect_type = BLOW_EFFECT_TYPE_FEAR;
211 mam_ptr->effect_type = BLOW_EFFECT_TYPE_SLEEP;
214 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
215 if (mam_ptr->damage > 23)
216 earthquake(subject_ptr, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, 8, mam_ptr->m_idx);
223 mam_ptr->pt = GF_NETHER;
226 mam_ptr->pt = GF_TIME;
229 mam_ptr->pt = GF_HYPODYNAMIA;
230 mam_ptr->effect_type = BLOW_EFFECT_TYPE_HEAL;
233 mam_ptr->pt = GF_INERTIAL;
236 mam_ptr->pt = GF_SOUND;
240 mam_ptr->pt = GF_NONE;
243 mam_ptr->pt = GF_NONE;
248 void describe_monster_missed_monster(player_type *subject_ptr, mam_type *mam_ptr)
250 switch (mam_ptr->method) {
263 (void)set_monster_csleep(subject_ptr, mam_ptr->t_idx, 0);
264 if (mam_ptr->see_m) {
266 msg_format("%sは%^sの攻撃をかわした。", mam_ptr->t_name, mam_ptr->m_name);
268 msg_format("%^s misses %s.", mam_ptr->m_name, mam_ptr->t_name);