2 * @brief モンスター同士が乱闘を起こした時の攻撃種別をスイッチングする
7 #include "melee/melee-switcher.h"
8 #include "core/disturbance.h"
9 #include "melee/melee-util.h"
10 #include "monster-attack/monster-attack-effect.h"
11 #include "monster/monster-status-setter.h"
12 #include "spell-kind/earthquake.h"
13 #include "system/player-type-definition.h"
14 #include "view/display-messages.h"
16 void describe_melee_method(player_type *subject_ptr, mam_type *mam_ptr)
18 switch (mam_ptr->method) {
20 mam_ptr->act = _("%sを殴った。", "hits %s.");
21 mam_ptr->touched = TRUE;
25 mam_ptr->act = _("%sを触った。", "touches %s.");
26 mam_ptr->touched = TRUE;
30 mam_ptr->act = _("%sをパンチした。", "punches %s.");
31 mam_ptr->touched = TRUE;
35 mam_ptr->act = _("%sを蹴った。", "kicks %s.");
36 mam_ptr->touched = TRUE;
40 mam_ptr->act = _("%sをひっかいた。", "claws %s.");
41 mam_ptr->touched = TRUE;
45 mam_ptr->act = _("%sを噛んだ。", "bites %s.");
46 mam_ptr->touched = TRUE;
50 mam_ptr->act = _("%sを刺した。", "stings %s.");
51 mam_ptr->touched = TRUE;
55 mam_ptr->act = _("%sを斬った。", "slashes %s.");
59 mam_ptr->act = _("%sを角で突いた。", "butts %s.");
60 mam_ptr->touched = TRUE;
64 mam_ptr->act = _("%sに体当りした。", "crushes %s.");
65 mam_ptr->touched = TRUE;
69 mam_ptr->act = _("%sを飲み込んだ。", "engulfs %s.");
70 mam_ptr->touched = TRUE;
74 mam_ptr->act = _("%sに請求書をよこした。", "charges %s.");
75 mam_ptr->touched = TRUE;
79 mam_ptr->act = _("%sの体の上を這い回った。", "crawls on %s.");
80 mam_ptr->touched = TRUE;
84 mam_ptr->act = _("%sによだれをたらした。", "drools on %s.");
85 mam_ptr->touched = FALSE;
89 mam_ptr->act = _("%sに唾を吐いた。", "spits on %s.");
90 mam_ptr->touched = FALSE;
94 if (mam_ptr->see_either)
95 disturb(subject_ptr, TRUE, TRUE);
97 mam_ptr->act = _("爆発した。", "explodes.");
98 mam_ptr->explode = TRUE;
99 mam_ptr->touched = FALSE;
103 mam_ptr->act = _("%sをにらんだ。", "gazes at %s.");
104 mam_ptr->touched = FALSE;
108 mam_ptr->act = _("%sに泣きついた。", "wails at %s.");
109 mam_ptr->touched = FALSE;
113 mam_ptr->act = _("%sに胞子を飛ばした。", "releases spores at %s.");
114 mam_ptr->touched = FALSE;
118 mam_ptr->act = _("%sにXXX4を飛ばした。", "projects XXX4's at %s.");
119 mam_ptr->touched = FALSE;
123 mam_ptr->act = _("%sに金をせがんだ。", "begs %s for money.");
124 mam_ptr->touched = FALSE;
128 mam_ptr->act = _("%sを侮辱した。", "insults %s.");
129 mam_ptr->touched = FALSE;
133 mam_ptr->act = _("%sにむかってうめいた。", "moans at %s.");
134 mam_ptr->touched = FALSE;
138 mam_ptr->act = _("%sにむかって歌った。", "sings to %s.");
139 mam_ptr->touched = FALSE;
150 void decide_monster_attack_effect(player_type *subject_ptr, mam_type *mam_ptr)
152 switch (mam_ptr->effect) {
156 mam_ptr->pt = GF_NONE;
159 if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) {
160 int tmp_damage = mam_ptr->damage - (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
161 mam_ptr->damage = MAX(mam_ptr->damage, tmp_damage * 2);
167 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
171 mam_ptr->pt = GF_POIS;
175 mam_ptr->pt = GF_DISENCHANT;
179 if ((subject_ptr->riding != mam_ptr->m_idx) && one_in_(2))
180 mam_ptr->blinked = TRUE;
195 mam_ptr->pt = GF_ACID;
198 mam_ptr->pt = GF_ELEC;
201 mam_ptr->pt = GF_FIRE;
204 mam_ptr->pt = GF_COLD;
207 mam_ptr->pt = GF_CONFUSION;
210 mam_ptr->effect_type = BLOW_EFFECT_TYPE_FEAR;
213 mam_ptr->effect_type = BLOW_EFFECT_TYPE_SLEEP;
216 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
217 if (mam_ptr->damage > 23)
218 earthquake(subject_ptr, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, 8, mam_ptr->m_idx);
225 mam_ptr->pt = GF_NETHER;
228 mam_ptr->pt = GF_TIME;
231 mam_ptr->pt = GF_HYPODYNAMIA;
232 mam_ptr->effect_type = BLOW_EFFECT_TYPE_HEAL;
235 mam_ptr->pt = GF_INERTIAL;
238 mam_ptr->pt = GF_SOUND;
242 mam_ptr->pt = GF_NONE;
245 mam_ptr->pt = GF_NONE;
250 void describe_monster_missed_monster(player_type *subject_ptr, mam_type *mam_ptr)
252 switch (mam_ptr->method) {
265 (void)set_monster_csleep(subject_ptr, mam_ptr->t_idx, 0);
266 if (mam_ptr->see_m) {
268 msg_format("%sは%^sの攻撃をかわした。", mam_ptr->t_name, mam_ptr->m_name);
270 msg_format("%^s misses %s.", mam_ptr->m_name, mam_ptr->t_name);