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-archer.h"
32 #include "mind/mind-cavalry.h"
33 #include "mind/mind-force-trainer.h"
34 #include "mind/mind-mage.h"
35 #include "mind/mind-mirror-master.h"
36 #include "mind/mind-monk.h"
37 #include "mind/mind-ninja.h"
38 #include "mind/mind-samurai.h"
39 #include "mind/mind-warrior-mage.h"
40 #include "mind/mind-warrior.h"
41 #include "mind/monk-attack.h"
42 #include "mind/stances-table.h"
43 #include "mutation/mutation-flag-types.h"
44 #include "object/item-tester-hooker.h"
45 #include "player/attack-defense-types.h"
46 #include "player/player-class.h"
47 #include "player/player-damage.h"
48 #include "player/player-race-types.h"
49 #include "player/player-race.h"
50 #include "player/player-status.h"
51 #include "racial/racial-android.h"
52 #include "racial/racial-balrog.h"
53 #include "racial/racial-draconian.h"
54 #include "racial/racial-kutar.h"
55 #include "racial/racial-vampire.h"
56 #include "realm/realm-names-table.h"
57 #include "spell-kind/spells-beam.h"
58 #include "spell-kind/spells-detection.h"
59 #include "spell-kind/spells-grid.h"
60 #include "spell-kind/spells-launcher.h"
61 #include "spell-kind/spells-neighbor.h"
62 #include "spell-kind/spells-perception.h"
63 #include "spell-kind/spells-sight.h"
64 #include "spell-kind/spells-teleport.h"
65 #include "spell-kind/spells-world.h"
66 #include "spell-realm/spells-hex.h"
67 #include "spell/spell-types.h"
68 #include "spell/spells-object.h"
69 #include "spell/spells-status.h"
70 #include "status/action-setter.h"
71 #include "status/bad-status-setter.h"
72 #include "status/buff-setter.h"
73 #include "status/experience.h"
74 #include "target/target-getter.h"
75 #include "util/int-char-converter.h"
76 #include "view/display-messages.h"
78 bool switch_class_racial_execution(player_type *creature_ptr, const s32b command)
81 switch (creature_ptr->pclass) {
83 return sword_dancing(creature_ptr);
85 if (creature_ptr->realm1 == REALM_HEX) {
86 bool retval = stop_hex_spell(creature_ptr);
88 creature_ptr->energy_use = 10;
96 return eat_magic(creature_ptr, creature_ptr->lev * 2);
98 if (!is_good_realm(creature_ptr->realm1)) {
99 (void)dispel_monsters(creature_ptr, creature_ptr->lev * 4);
100 turn_monsters(creature_ptr, creature_ptr->lev * 4);
101 banish_monsters(creature_ptr, creature_ptr->lev * 4);
105 return bless_weapon(creature_ptr);
107 return hit_and_away(creature_ptr);
110 msg_print(_("敵を調査した...", "You examine your foes..."));
111 probing(creature_ptr);
114 if (!get_aim_dir(creature_ptr, &dir))
117 fire_beam(creature_ptr, is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE, dir, creature_ptr->lev * 3);
119 case CLASS_WARRIOR_MAGE:
121 return comvert_hp_to_mp(creature_ptr);
122 else if (command == -4)
123 return comvert_mp_to_hp(creature_ptr);
126 case CLASS_CHAOS_WARRIOR:
127 return confusing_light(creature_ptr);
129 if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM)) {
130 msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
134 if (creature_ptr->riding) {
135 msg_print(_("乗馬中はできません。", "You need to get off a pet."));
140 if (!choose_monk_stance(creature_ptr))
143 creature_ptr->update |= PU_BONUS;
148 return double_attack(creature_ptr);
151 case CLASS_MINDCRAFTER:
152 case CLASS_FORCETRAINER:
153 return clear_mind(creature_ptr);
156 if (!get_aim_dir(creature_ptr, &dir))
160 fire_beam(creature_ptr, GF_PHOTO, dir, 1);
164 return (command != -4) || identify_fully(creature_ptr, FALSE, 0);
166 handle_stuff(creature_ptr);
167 return do_cmd_mane(creature_ptr, TRUE);
168 case CLASS_BEASTMASTER:
170 if (!get_aim_dir(creature_ptr, &dir))
173 (void)fire_ball_hide(creature_ptr, GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
178 project_all_los(creature_ptr, GF_CHARM_LIVING, creature_ptr->lev);
182 return create_ammo(creature_ptr);
183 case CLASS_MAGIC_EATER:
185 return import_magic_device(creature_ptr);
187 return (command != -4) || (!cmd_limit_cast(creature_ptr) && do_cmd_magic_eater(creature_ptr, FALSE, TRUE));
189 if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr))
192 stop_singing(creature_ptr);
193 creature_ptr->energy_use = 10;
196 if (cmd_limit_cast(creature_ptr))
199 handle_stuff(creature_ptr);
200 do_cmd_cast(creature_ptr);
201 handle_stuff(creature_ptr);
202 if (!creature_ptr->paralyzed && !cmd_limit_cast(creature_ptr))
203 do_cmd_cast(creature_ptr);
208 concentration(creature_ptr);
215 if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
216 msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
220 if (!choose_kata(creature_ptr))
223 creature_ptr->update |= PU_BONUS;
225 case CLASS_BLUE_MAGE:
226 set_action(creature_ptr, creature_ptr->action == ACTION_LEARN ? ACTION_NONE : ACTION_LEARN);
227 free_turn(creature_ptr);
230 return rodeo(creature_ptr);
231 case CLASS_BERSERKER:
232 return recall_player(creature_ptr, randint0(21) + 15);
234 if (creature_ptr->lev <= 29)
235 return ident_spell(creature_ptr, TRUE, 0);
237 return identify_fully(creature_ptr, TRUE, 0);
238 case CLASS_MIRROR_MASTER:
240 remove_all_mirrors(creature_ptr, TRUE);
245 return mirror_concentration(creature_ptr);
249 return hayagake(creature_ptr);
255 bool switch_mimic_racial_execution(player_type *creature_ptr)
257 switch (creature_ptr->mimic_form) {
259 case MIMIC_DEMON_LORD: {
260 return demonic_breath(creature_ptr);
263 vampirism(creature_ptr);
270 bool switch_race_racial_execution(player_type *creature_ptr, const s32b command)
273 switch (creature_ptr->prace) {
275 msg_print(_("周囲を調べた。", "You examine your surroundings."));
276 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
277 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
278 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
281 return create_ration(creature_ptr);
283 msg_print(_("パッ!", "Blink!"));
284 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
287 msg_print(_("勇気を出した。", "You play tough."));
288 (void)set_afraid(creature_ptr, 0);
290 case RACE_HALF_TROLL:
291 msg_print(_("うがぁぁ!", "RAAAGH!"));
292 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
296 msg_print(_("あなたは歩き周り始めた。", "You start walking around. "));
297 reserve_alter_reality(creature_ptr);
304 msg_print(_("あなたは「パターン」を心に描いてその上を歩いた...", "You picture the Pattern in your mind and walk it..."));
305 (void)true_healing(creature_ptr, 0);
306 (void)restore_all_status(creature_ptr);
307 (void)restore_level(creature_ptr);
310 msg_print(_("うぉぉおお!", "Raaagh!"));
311 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
314 msg_print(_("爆発のルーンを慎重に仕掛けた...", "You carefully set an explosive rune..."));
315 (void)explosive_rune(creature_ptr, creature_ptr->y, creature_ptr->x);
317 case RACE_HALF_GIANT:
318 if (!get_aim_dir(creature_ptr, &dir))
321 (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
323 case RACE_HALF_TITAN:
324 msg_print(_("敵を調査した...", "You examine your foes..."));
325 (void)probing(creature_ptr);
328 if (!get_aim_dir(creature_ptr, &dir))
331 msg_print(_("巨大な岩を投げた。", "You throw a huge boulder."));
332 (void)fire_bolt(creature_ptr, GF_MISSILE, dir, (3 * creature_ptr->lev) / 2);
335 if (!get_aim_dir(creature_ptr, &dir))
338 stop_mouth(creature_ptr);
339 msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
340 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
343 if (!get_aim_dir(creature_ptr, &dir))
346 stop_mouth(creature_ptr);
347 msg_print(_("酸を吐いた。", "You spit acid."));
348 if (creature_ptr->lev < 25)
349 (void)fire_bolt(creature_ptr, GF_ACID, dir, creature_ptr->lev);
351 (void)fire_ball(creature_ptr, GF_ACID, dir, creature_ptr->lev, 2);
355 if (!get_aim_dir(creature_ptr, &dir))
358 msg_print(_("毒のダーツを投げた。", "You throw a dart of poison."));
359 (void)fire_bolt(creature_ptr, GF_POIS, dir, creature_ptr->lev);
362 msg_print(_("周囲を調査した。", "You examine your surroundings."));
363 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
364 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
365 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
368 if (!get_aim_dir(creature_ptr, &dir))
371 msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
372 (void)fire_bolt_or_beam(creature_ptr, 10, GF_MISSILE, dir, damroll(3 + ((creature_ptr->lev - 1) / 5), 4));
375 return draconian_breath(creature_ptr);
376 case RACE_MIND_FLAYER:
377 if (!get_aim_dir(creature_ptr, &dir))
380 msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red..."));
381 (void)fire_bolt(creature_ptr, GF_PSI, dir, creature_ptr->lev);
384 if (!get_aim_dir(creature_ptr, &dir))
387 if (creature_ptr->lev >= 30) {
388 msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire."));
389 (void)fire_ball(creature_ptr, GF_FIRE, dir, creature_ptr->lev, 2);
391 msg_print(_("ファイア・ボルトを放った。", "You cast a bolt of fire."));
392 (void)fire_bolt(creature_ptr, GF_FIRE, dir, creature_ptr->lev);
397 (void)set_shield(creature_ptr, randint1(20) + 30, FALSE);
401 msg_print(_("あなたは失ったエネルギーを取り戻そうと試みた。", "You attempt to restore your lost energies."));
402 (void)restore_level(creature_ptr);
405 (void)vampirism(creature_ptr);
408 if (!get_aim_dir(creature_ptr, &dir))
411 stop_mouth(creature_ptr);
412 msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
413 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
416 msg_print(_("あなたは魔法の粉を投げつけた...", "You throw some magic dust..."));
417 if (creature_ptr->lev < 25)
418 (void)sleep_monsters_touch(creature_ptr);
420 (void)sleep_monsters(creature_ptr, creature_ptr->lev);
424 return demonic_breath(creature_ptr);
426 (void)set_leveling(creature_ptr, randint1(20) + 30, FALSE);
429 return android_inside_weapon(creature_ptr);
431 msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
432 free_turn(creature_ptr);