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/monster-type-definition.h"
14 #include "system/player-type-definition.h"
15 #include "view/display-messages.h"
17 void describe_melee_method(player_type *player_ptr, mam_type *mam_ptr)
19 switch (mam_ptr->method) {
21 mam_ptr->act = _("%sを殴った。", "hits %s.");
22 mam_ptr->touched = true;
26 mam_ptr->act = _("%sを触った。", "touches %s.");
27 mam_ptr->touched = true;
31 mam_ptr->act = _("%sをパンチした。", "punches %s.");
32 mam_ptr->touched = true;
36 mam_ptr->act = _("%sを蹴った。", "kicks %s.");
37 mam_ptr->touched = true;
41 mam_ptr->act = _("%sをひっかいた。", "claws %s.");
42 mam_ptr->touched = true;
46 mam_ptr->act = _("%sを噛んだ。", "bites %s.");
47 mam_ptr->touched = true;
51 mam_ptr->act = _("%sを刺した。", "stings %s.");
52 mam_ptr->touched = true;
56 mam_ptr->act = _("%sを斬った。", "slashes %s.");
60 mam_ptr->act = _("%sを角で突いた。", "butts %s.");
61 mam_ptr->touched = true;
65 mam_ptr->act = _("%sに体当りした。", "crushes %s.");
66 mam_ptr->touched = true;
70 mam_ptr->act = _("%sを飲み込んだ。", "engulfs %s.");
71 mam_ptr->touched = true;
75 mam_ptr->act = _("%sに請求書をよこした。", "charges %s.");
76 mam_ptr->touched = true;
80 mam_ptr->act = _("%sの体の上を這い回った。", "crawls on %s.");
81 mam_ptr->touched = true;
85 mam_ptr->act = _("%sによだれをたらした。", "drools on %s.");
86 mam_ptr->touched = false;
90 mam_ptr->act = _("%sに唾を吐いた。", "spits on %s.");
91 mam_ptr->touched = false;
95 if (mam_ptr->see_either)
96 disturb(player_ptr, true, true);
98 mam_ptr->act = _("爆発した。", "explodes.");
99 mam_ptr->explode = true;
100 mam_ptr->touched = false;
104 mam_ptr->act = _("%sをにらんだ。", "gazes at %s.");
105 mam_ptr->touched = false;
109 mam_ptr->act = _("%sに泣きついた。", "wails at %s.");
110 mam_ptr->touched = false;
114 mam_ptr->act = _("%sに胞子を飛ばした。", "releases spores at %s.");
115 mam_ptr->touched = false;
119 mam_ptr->act = _("%sにXXX4を飛ばした。", "projects XXX4's at %s.");
120 mam_ptr->touched = false;
124 mam_ptr->act = _("%sに金をせがんだ。", "begs %s for money.");
125 mam_ptr->touched = false;
129 mam_ptr->act = _("%sを侮辱した。", "insults %s.");
130 mam_ptr->touched = false;
134 mam_ptr->act = _("%sにむかってうめいた。", "moans at %s.");
135 mam_ptr->touched = false;
139 mam_ptr->act = _("%sにむかって歌った。", "sings to %s.");
140 mam_ptr->touched = false;
151 void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr)
153 switch (mam_ptr->effect) {
157 mam_ptr->pt = GF_NONE;
160 if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) {
161 int tmp_damage = mam_ptr->damage - (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
162 mam_ptr->damage = std::max(mam_ptr->damage, tmp_damage * 2);
168 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
172 mam_ptr->pt = GF_POIS;
176 mam_ptr->pt = GF_DISENCHANT;
180 if ((player_ptr->riding != mam_ptr->m_idx) && one_in_(2))
181 mam_ptr->blinked = true;
196 mam_ptr->pt = GF_ACID;
199 mam_ptr->pt = GF_ELEC;
202 mam_ptr->pt = GF_FIRE;
205 mam_ptr->pt = GF_COLD;
208 mam_ptr->pt = GF_CONFUSION;
211 mam_ptr->effect_type = BLOW_EFFECT_TYPE_FEAR;
214 mam_ptr->effect_type = BLOW_EFFECT_TYPE_SLEEP;
217 mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250);
218 if (mam_ptr->damage > 23)
219 earthquake(player_ptr, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, 8, mam_ptr->m_idx);
226 mam_ptr->pt = GF_NETHER;
229 mam_ptr->pt = GF_TIME;
232 mam_ptr->pt = GF_HYPODYNAMIA;
233 mam_ptr->effect_type = BLOW_EFFECT_TYPE_HEAL;
236 mam_ptr->pt = GF_INERTIAL;
239 mam_ptr->pt = GF_SOUND;
242 mam_ptr->pt = GF_HUNGRY;
246 mam_ptr->pt = GF_NONE;
249 mam_ptr->pt = GF_NONE;
254 void describe_monster_missed_monster(player_type *player_ptr, mam_type *mam_ptr)
256 switch (mam_ptr->method) {
269 (void)set_monster_csleep(player_ptr, mam_ptr->t_idx, 0);
270 if (mam_ptr->see_m) {
272 msg_format("%sは%^sの攻撃をかわした。", mam_ptr->t_name, mam_ptr->m_name);
274 msg_format("%^s misses %s.", mam_ptr->m_name, mam_ptr->t_name);