2 * @brief レイシャルと突然変異の技能処理 / Racial powers (and mutations)
5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
6 * This software may be copied and distributed for educational, research,\n
7 * and not for profit purposes provided that this copyright and statement\n
8 * are included in all such copies. Other copyrights may also apply.\n
9 * 2014 Deskull rearranged comment for Doxygen. \n
12 #include "racial/racial-switcher.h"
13 #include "action/action-limited.h"
14 #include "action/mutation-execution.h"
15 #include "cmd-action/cmd-mane.h"
16 #include "cmd-action/cmd-spell.h"
17 #include "cmd-item/cmd-magiceat.h"
18 #include "cmd-item/cmd-zapwand.h"
19 #include "core/player-redraw-types.h"
20 #include "core/player-update-types.h"
21 #include "core/stuff-handler.h"
22 #include "core/window-redrawer.h"
23 #include "effect/spells-effect-util.h"
24 #include "game-option/text-display-options.h"
25 #include "inventory/inventory-slot-types.h"
26 #include "io/command-repeater.h"
27 #include "io/input-key-acceptor.h"
28 #include "io/input-key-requester.h"
29 #include "main/sound-of-music.h"
30 #include "melee/melee-postprocess.h"
31 #include "mind/mind-cavalry.h"
32 #include "mind/mind-force-trainer.h"
33 #include "mind/mind-mage.h"
34 #include "mind/mind-mirror-master.h"
35 #include "mind/mind-monk.h"
36 #include "mind/mind-ninja.h"
37 #include "mind/mind-samurai.h"
38 #include "mind/mind-warrior-mage.h"
39 #include "mind/mind-warrior.h"
40 #include "mind/monk-attack.h"
41 #include "mind/stances-table.h"
42 #include "mutation/mutation-flag-types.h"
43 #include "object/item-tester-hooker.h"
44 #include "player/attack-defense-types.h"
45 #include "player/player-class.h"
46 #include "player/player-damage.h"
47 #include "player/player-race-types.h"
48 #include "player/player-race.h"
49 #include "player/player-status.h"
50 #include "racial/racial-android.h"
51 #include "racial/racial-balrog.h"
52 #include "racial/racial-draconian.h"
53 #include "racial/racial-kutar.h"
54 #include "racial/racial-vampire.h"
55 #include "realm/realm-names-table.h"
56 #include "spell-kind/spells-beam.h"
57 #include "spell-kind/spells-detection.h"
58 #include "spell-kind/spells-grid.h"
59 #include "spell-kind/spells-launcher.h"
60 #include "spell-kind/spells-neighbor.h"
61 #include "spell-kind/spells-perception.h"
62 #include "spell-kind/spells-sight.h"
63 #include "spell-kind/spells-teleport.h"
64 #include "spell-kind/spells-world.h"
65 #include "spell-realm/spells-hex.h"
66 #include "spell/spell-types.h"
67 #include "spell/spells-object.h"
68 #include "spell/spells-status.h"
69 #include "status/action-setter.h"
70 #include "status/bad-status-setter.h"
71 #include "status/buff-setter.h"
72 #include "status/experience.h"
73 #include "target/target-getter.h"
74 #include "util/int-char-converter.h"
75 #include "view/display-messages.h"
77 bool switch_class_racial_execution(player_type *creature_ptr, const s32b command)
80 switch (creature_ptr->pclass) {
82 return sword_dancing(creature_ptr);
84 if (creature_ptr->realm1 == REALM_HEX) {
85 bool retval = stop_hex_spell(creature_ptr);
87 creature_ptr->energy_use = 10;
95 return eat_magic(creature_ptr, creature_ptr->lev * 2);
97 if (!is_good_realm(creature_ptr->realm1)) {
98 (void)dispel_monsters(creature_ptr, creature_ptr->lev * 4);
99 turn_monsters(creature_ptr, creature_ptr->lev * 4);
100 banish_monsters(creature_ptr, creature_ptr->lev * 4);
104 return bless_weapon(creature_ptr);
106 return hit_and_away(creature_ptr);
109 msg_print(_("敵を調査した...", "You examine your foes..."));
110 probing(creature_ptr);
113 if (!get_aim_dir(creature_ptr, &dir))
116 fire_beam(creature_ptr, is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE, dir, creature_ptr->lev * 3);
118 case CLASS_WARRIOR_MAGE:
120 return comvert_hp_to_mp(creature_ptr);
121 else if (command == -4)
122 return comvert_mp_to_hp(creature_ptr);
125 case CLASS_CHAOS_WARRIOR:
126 return confusing_light(creature_ptr);
128 if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM)) {
129 msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
133 if (creature_ptr->riding) {
134 msg_print(_("乗馬中はできません。", "You need to get off a pet."));
139 if (!choose_monk_stance(creature_ptr))
142 creature_ptr->update |= PU_BONUS;
147 return double_attack(creature_ptr);
150 case CLASS_MINDCRAFTER:
151 case CLASS_FORCETRAINER:
152 return clear_mind(creature_ptr);
155 if (!get_aim_dir(creature_ptr, &dir))
159 fire_beam(creature_ptr, GF_PHOTO, dir, 1);
163 return (command != -4) || identify_fully(creature_ptr, FALSE, 0);
165 handle_stuff(creature_ptr);
166 return do_cmd_mane(creature_ptr, TRUE);
167 case CLASS_BEASTMASTER:
169 if (!get_aim_dir(creature_ptr, &dir))
172 (void)fire_ball_hide(creature_ptr, GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
177 project_all_los(creature_ptr, GF_CHARM_LIVING, creature_ptr->lev);
181 return create_ammo(creature_ptr);
182 case CLASS_MAGIC_EATER:
184 return import_magic_device(creature_ptr);
186 return (command != -4) || (!cmd_limit_cast(creature_ptr) && do_cmd_magic_eater(creature_ptr, FALSE, TRUE));
188 if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr))
191 stop_singing(creature_ptr);
192 creature_ptr->energy_use = 10;
195 if (cmd_limit_cast(creature_ptr))
198 handle_stuff(creature_ptr);
199 do_cmd_cast(creature_ptr);
200 handle_stuff(creature_ptr);
201 if (!creature_ptr->paralyzed && !cmd_limit_cast(creature_ptr))
202 do_cmd_cast(creature_ptr);
207 concentration(creature_ptr);
214 if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
215 msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
219 if (!choose_kata(creature_ptr))
222 creature_ptr->update |= PU_BONUS;
224 case CLASS_BLUE_MAGE:
225 set_action(creature_ptr, creature_ptr->action == ACTION_LEARN ? ACTION_NONE : ACTION_LEARN);
226 free_turn(creature_ptr);
229 return rodeo(creature_ptr);
230 case CLASS_BERSERKER:
231 return recall_player(creature_ptr, randint0(21) + 15);
233 if (creature_ptr->lev <= 29)
234 return ident_spell(creature_ptr, TRUE, 0);
236 return identify_fully(creature_ptr, TRUE, 0);
237 case CLASS_MIRROR_MASTER:
239 remove_all_mirrors(creature_ptr, TRUE);
244 return mirror_concentration(creature_ptr);
248 return hayagake(creature_ptr);
254 bool switch_mimic_racial_execution(player_type *creature_ptr)
256 switch (creature_ptr->mimic_form) {
258 case MIMIC_DEMON_LORD: {
259 return demonic_breath(creature_ptr);
262 vampirism(creature_ptr);
269 bool switch_race_racial_execution(player_type *creature_ptr, const s32b command)
272 switch (creature_ptr->prace) {
274 msg_print(_("周囲を調べた。", "You examine your surroundings."));
275 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
276 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
277 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
280 return create_ration(creature_ptr);
282 msg_print(_("パッ!", "Blink!"));
283 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
286 msg_print(_("勇気を出した。", "You play tough."));
287 (void)set_afraid(creature_ptr, 0);
289 case RACE_HALF_TROLL:
290 msg_print(_("うがぁぁ!", "RAAAGH!"));
291 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
295 msg_print(_("あなたは歩き周り始めた。", "You start walking around. "));
296 reserve_alter_reality(creature_ptr);
303 msg_print(_("あなたは「パターン」を心に描いてその上を歩いた...", "You picture the Pattern in your mind and walk it..."));
304 (void)true_healing(creature_ptr, 0);
305 (void)restore_all_status(creature_ptr);
306 (void)restore_level(creature_ptr);
309 msg_print(_("うぉぉおお!", "Raaagh!"));
310 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
313 msg_print(_("爆発のルーンを慎重に仕掛けた...", "You carefully set an explosive rune..."));
314 (void)explosive_rune(creature_ptr, creature_ptr->y, creature_ptr->x);
316 case RACE_HALF_GIANT:
317 if (!get_aim_dir(creature_ptr, &dir))
320 (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
322 case RACE_HALF_TITAN:
323 msg_print(_("敵を調査した...", "You examine your foes..."));
324 (void)probing(creature_ptr);
327 if (!get_aim_dir(creature_ptr, &dir))
330 msg_print(_("巨大な岩を投げた。", "You throw a huge boulder."));
331 (void)fire_bolt(creature_ptr, GF_MISSILE, dir, (3 * creature_ptr->lev) / 2);
334 if (!get_aim_dir(creature_ptr, &dir))
337 stop_mouth(creature_ptr);
338 msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
339 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
342 if (!get_aim_dir(creature_ptr, &dir))
345 stop_mouth(creature_ptr);
346 msg_print(_("酸を吐いた。", "You spit acid."));
347 if (creature_ptr->lev < 25)
348 (void)fire_bolt(creature_ptr, GF_ACID, dir, creature_ptr->lev);
350 (void)fire_ball(creature_ptr, GF_ACID, dir, creature_ptr->lev, 2);
354 if (!get_aim_dir(creature_ptr, &dir))
357 msg_print(_("毒のダーツを投げた。", "You throw a dart of poison."));
358 (void)fire_bolt(creature_ptr, GF_POIS, dir, creature_ptr->lev);
361 msg_print(_("周囲を調査した。", "You examine your surroundings."));
362 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
363 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
364 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
367 if (!get_aim_dir(creature_ptr, &dir))
370 msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
371 (void)fire_bolt_or_beam(creature_ptr, 10, GF_MISSILE, dir, damroll(3 + ((creature_ptr->lev - 1) / 5), 4));
374 return draconian_breath(creature_ptr);
375 case RACE_MIND_FLAYER:
376 if (!get_aim_dir(creature_ptr, &dir))
379 msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red..."));
380 (void)fire_bolt(creature_ptr, GF_PSI, dir, creature_ptr->lev);
383 if (!get_aim_dir(creature_ptr, &dir))
386 if (creature_ptr->lev >= 30) {
387 msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire."));
388 (void)fire_ball(creature_ptr, GF_FIRE, dir, creature_ptr->lev, 2);
390 msg_print(_("ファイア・ボルトを放った。", "You cast a bolt of fire."));
391 (void)fire_bolt(creature_ptr, GF_FIRE, dir, creature_ptr->lev);
396 (void)set_shield(creature_ptr, randint1(20) + 30, FALSE);
400 msg_print(_("あなたは失ったエネルギーを取り戻そうと試みた。", "You attempt to restore your lost energies."));
401 (void)restore_level(creature_ptr);
404 (void)vampirism(creature_ptr);
407 if (!get_aim_dir(creature_ptr, &dir))
410 stop_mouth(creature_ptr);
411 msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
412 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
415 msg_print(_("あなたは魔法の粉を投げつけた...", "You throw some magic dust..."));
416 if (creature_ptr->lev < 25)
417 (void)sleep_monsters_touch(creature_ptr);
419 (void)sleep_monsters(creature_ptr, creature_ptr->lev);
423 return demonic_breath(creature_ptr);
425 (void)set_leveling(creature_ptr, randint1(20) + 30, FALSE);
428 return android_inside_weapon(creature_ptr);
430 msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
431 free_turn(creature_ptr);