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;
143 void decide_monster_attack_effect(player_type *subject_ptr, mam_type *mam_ptr)
145 switch (mam_ptr->effect) {
149 mam_ptr->pt = GF_NONE;
152 if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) {
153 int tmp_damage = mam_ptr->damage - (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
154 mam_ptr->damage = MAX(mam_ptr->damage, tmp_damage * 2);
160 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
164 mam_ptr->pt = GF_POIS;
168 mam_ptr->pt = GF_DISENCHANT;
172 if ((subject_ptr->riding != mam_ptr->m_idx) && one_in_(2))
173 mam_ptr->blinked = TRUE;
188 mam_ptr->pt = GF_ACID;
191 mam_ptr->pt = GF_ELEC;
194 mam_ptr->pt = GF_FIRE;
197 mam_ptr->pt = GF_COLD;
200 mam_ptr->pt = GF_CONFUSION;
203 mam_ptr->effect_type = BLOW_EFFECT_TYPE_FEAR;
206 mam_ptr->effect_type = BLOW_EFFECT_TYPE_SLEEP;
209 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
210 if (mam_ptr->damage > 23)
211 earthquake(subject_ptr, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, 8, mam_ptr->m_idx);
218 mam_ptr->pt = GF_NETHER;
221 mam_ptr->pt = GF_TIME;
224 mam_ptr->pt = GF_HYPODYNAMIA;
225 mam_ptr->effect_type = BLOW_EFFECT_TYPE_HEAL;
228 mam_ptr->pt = GF_INERTIAL;
231 mam_ptr->pt = GF_SOUND;
235 mam_ptr->pt = GF_NONE;
238 mam_ptr->pt = GF_NONE;
243 void describe_monster_missed_monster(player_type *subject_ptr, mam_type *mam_ptr)
245 switch (mam_ptr->method) {
258 (void)set_monster_csleep(subject_ptr, mam_ptr->t_idx, 0);
259 if (mam_ptr->see_m) {
261 msg_format("%sは%^sの攻撃をかわした。", mam_ptr->t_name, mam_ptr->m_name);
263 msg_format("%^s misses %s.", mam_ptr->m_name, mam_ptr->t_name);