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-hobbit.h"
35 #include "mind/mind-mage.h"
36 #include "mind/mind-magic-eater.h"
37 #include "mind/mind-mirror-master.h"
38 #include "mind/mind-monk.h"
39 #include "mind/mind-ninja.h"
40 #include "mind/mind-priest.h"
41 #include "mind/mind-samurai.h"
42 #include "mind/mind-warrior-mage.h"
43 #include "mind/mind-warrior.h"
44 #include "mind/monk-attack.h"
45 #include "mind/stances-table.h"
46 #include "mutation/mutation-flag-types.h"
47 #include "object/item-tester-hooker.h"
48 #include "player/attack-defense-types.h"
49 #include "player/player-class.h"
50 #include "player/player-damage.h"
51 #include "player/player-race-types.h"
52 #include "player/player-race.h"
53 #include "player/player-status.h"
54 #include "racial/racial-android.h"
55 #include "racial/racial-balrog.h"
56 #include "racial/racial-draconian.h"
57 #include "racial/racial-kutar.h"
58 #include "racial/racial-vampire.h"
59 #include "realm/realm-names-table.h"
60 #include "spell-kind/spells-beam.h"
61 #include "spell-kind/spells-detection.h"
62 #include "spell-kind/spells-grid.h"
63 #include "spell-kind/spells-launcher.h"
64 #include "spell-kind/spells-neighbor.h"
65 #include "spell-kind/spells-perception.h"
66 #include "spell-kind/spells-sight.h"
67 #include "spell-kind/spells-teleport.h"
68 #include "spell-kind/spells-world.h"
69 #include "spell-realm/spells-hex.h"
70 #include "spell/spell-types.h"
71 #include "spell/spells-status.h"
72 #include "status/action-setter.h"
73 #include "status/bad-status-setter.h"
74 #include "status/buff-setter.h"
75 #include "status/experience.h"
76 #include "target/target-getter.h"
77 #include "util/int-char-converter.h"
78 #include "view/display-messages.h"
80 bool switch_class_racial_execution(player_type *creature_ptr, const s32b command)
83 switch (creature_ptr->pclass) {
85 return sword_dancing(creature_ptr);
87 if (creature_ptr->realm1 == REALM_HEX) {
88 bool retval = stop_hex_spell(creature_ptr);
90 creature_ptr->energy_use = 10;
98 return eat_magic(creature_ptr, creature_ptr->lev * 2);
100 if (!is_good_realm(creature_ptr->realm1)) {
101 (void)dispel_monsters(creature_ptr, creature_ptr->lev * 4);
102 turn_monsters(creature_ptr, creature_ptr->lev * 4);
103 banish_monsters(creature_ptr, creature_ptr->lev * 4);
107 return bless_weapon(creature_ptr);
109 return hit_and_away(creature_ptr);
112 msg_print(_("敵を調査した...", "You examine your foes..."));
113 probing(creature_ptr);
116 if (!get_aim_dir(creature_ptr, &dir))
119 fire_beam(creature_ptr, is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE, dir, creature_ptr->lev * 3);
121 case CLASS_WARRIOR_MAGE:
123 return comvert_hp_to_mp(creature_ptr);
124 else if (command == -4)
125 return comvert_mp_to_hp(creature_ptr);
128 case CLASS_CHAOS_WARRIOR:
129 return confusing_light(creature_ptr);
131 if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN)) {
132 msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
136 if (creature_ptr->riding) {
137 msg_print(_("乗馬中はできません。", "You need to get off a pet."));
142 if (!choose_monk_stance(creature_ptr))
145 creature_ptr->update |= PU_BONUS;
150 return double_attack(creature_ptr);
153 case CLASS_MINDCRAFTER:
154 case CLASS_FORCETRAINER:
155 return clear_mind(creature_ptr);
158 if (!get_aim_dir(creature_ptr, &dir))
162 fire_beam(creature_ptr, GF_PHOTO, dir, 1);
166 return (command != -4) || identify_fully(creature_ptr, FALSE, 0);
168 handle_stuff(creature_ptr);
169 return do_cmd_mane(creature_ptr, TRUE);
170 case CLASS_BEASTMASTER:
172 if (!get_aim_dir(creature_ptr, &dir))
175 (void)fire_ball_hide(creature_ptr, GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
180 project_all_los(creature_ptr, GF_CHARM_LIVING, creature_ptr->lev);
184 return create_ammo(creature_ptr);
185 case CLASS_MAGIC_EATER:
187 return import_magic_device(creature_ptr);
189 return (command != -4) || (!cmd_limit_cast(creature_ptr) && do_cmd_magic_eater(creature_ptr, FALSE, TRUE));
191 if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr))
194 stop_singing(creature_ptr);
195 creature_ptr->energy_use = 10;
198 if (cmd_limit_cast(creature_ptr))
201 handle_stuff(creature_ptr);
202 do_cmd_cast(creature_ptr);
203 handle_stuff(creature_ptr);
204 if (!creature_ptr->paralyzed && !cmd_limit_cast(creature_ptr))
205 do_cmd_cast(creature_ptr);
210 concentration(creature_ptr);
217 if (!has_melee_weapon(creature_ptr, INVEN_MAIN_HAND) && !has_melee_weapon(creature_ptr, INVEN_SUB_HAND)) {
218 msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
222 if (!choose_kata(creature_ptr))
225 creature_ptr->update |= PU_BONUS;
227 case CLASS_BLUE_MAGE:
228 set_action(creature_ptr, creature_ptr->action == ACTION_LEARN ? ACTION_NONE : ACTION_LEARN);
229 free_turn(creature_ptr);
232 return rodeo(creature_ptr);
233 case CLASS_BERSERKER:
234 return recall_player(creature_ptr, randint0(21) + 15);
236 if (creature_ptr->lev <= 29)
237 return ident_spell(creature_ptr, TRUE, 0);
239 return identify_fully(creature_ptr, TRUE, 0);
240 case CLASS_MIRROR_MASTER:
242 remove_all_mirrors(creature_ptr, TRUE);
247 return mirror_concentration(creature_ptr);
251 return hayagake(creature_ptr);
257 bool switch_mimic_racial_execution(player_type *creature_ptr)
259 switch (creature_ptr->mimic_form) {
261 case MIMIC_DEMON_LORD: {
262 return demonic_breath(creature_ptr);
265 vampirism(creature_ptr);
272 bool switch_race_racial_execution(player_type *creature_ptr, const s32b command)
275 switch (creature_ptr->prace) {
277 msg_print(_("周囲を調べた。", "You examine your surroundings."));
278 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
279 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
280 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
283 return create_ration(creature_ptr);
285 msg_print(_("パッ!", "Blink!"));
286 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
289 msg_print(_("勇気を出した。", "You play tough."));
290 (void)set_afraid(creature_ptr, 0);
292 case RACE_HALF_TROLL:
293 msg_print(_("うがぁぁ!", "RAAAGH!"));
294 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
298 msg_print(_("あなたは歩き周り始めた。", "You start walking around. "));
299 reserve_alter_reality(creature_ptr, randint0(21) + 15);
306 msg_print(_("あなたは「パターン」を心に描いてその上を歩いた...", "You picture the Pattern in your mind and walk it..."));
307 (void)true_healing(creature_ptr, 0);
308 (void)restore_all_status(creature_ptr);
309 (void)restore_level(creature_ptr);
312 msg_print(_("うぉぉおお!", "Raaagh!"));
313 (void)berserk(creature_ptr, 10 + randint1(creature_ptr->lev));
316 msg_print(_("爆発のルーンを慎重に仕掛けた...", "You carefully set an explosive rune..."));
317 (void)explosive_rune(creature_ptr, creature_ptr->y, creature_ptr->x);
319 case RACE_HALF_GIANT:
320 if (!get_aim_dir(creature_ptr, &dir))
323 (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
325 case RACE_HALF_TITAN:
326 msg_print(_("敵を調査した...", "You examine your foes..."));
327 (void)probing(creature_ptr);
330 if (!get_aim_dir(creature_ptr, &dir))
333 msg_print(_("巨大な岩を投げた。", "You throw a huge boulder."));
334 (void)fire_bolt(creature_ptr, GF_MISSILE, dir, (3 * creature_ptr->lev) / 2);
337 if (!get_aim_dir(creature_ptr, &dir))
340 stop_mouth(creature_ptr);
341 msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
342 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
345 if (!get_aim_dir(creature_ptr, &dir))
348 stop_mouth(creature_ptr);
349 msg_print(_("酸を吐いた。", "You spit acid."));
350 if (creature_ptr->lev < 25)
351 (void)fire_bolt(creature_ptr, GF_ACID, dir, creature_ptr->lev);
353 (void)fire_ball(creature_ptr, GF_ACID, dir, creature_ptr->lev, 2);
357 if (!get_aim_dir(creature_ptr, &dir))
360 msg_print(_("毒のダーツを投げた。", "You throw a poisoned dart."));
361 (void)fire_bolt(creature_ptr, GF_POIS, dir, creature_ptr->lev);
364 msg_print(_("周囲を調査した。", "You examine your surroundings."));
365 (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
366 (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
367 (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
370 if (!get_aim_dir(creature_ptr, &dir))
373 msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
374 (void)fire_bolt_or_beam(creature_ptr, 10, GF_MISSILE, dir, damroll(3 + ((creature_ptr->lev - 1) / 5), 4));
377 return draconian_breath(creature_ptr);
378 case RACE_MIND_FLAYER:
379 if (!get_aim_dir(creature_ptr, &dir))
382 msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red..."));
383 (void)fire_bolt(creature_ptr, GF_PSI, dir, creature_ptr->lev);
386 if (!get_aim_dir(creature_ptr, &dir))
389 if (creature_ptr->lev >= 30) {
390 msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire."));
391 (void)fire_ball(creature_ptr, GF_FIRE, dir, creature_ptr->lev, 2);
393 msg_print(_("ファイア・ボルトを放った。", "You cast a bolt of fire."));
394 (void)fire_bolt(creature_ptr, GF_FIRE, dir, creature_ptr->lev);
399 (void)set_shield(creature_ptr, randint1(20) + 30, FALSE);
403 msg_print(_("あなたは失ったエネルギーを取り戻そうと試みた。", "You attempt to restore your lost energies."));
404 (void)restore_level(creature_ptr);
407 (void)vampirism(creature_ptr);
410 if (!get_aim_dir(creature_ptr, &dir))
413 stop_mouth(creature_ptr);
414 msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
415 (void)fear_monster(creature_ptr, dir, creature_ptr->lev);
418 msg_print(_("あなたは魔法の粉を投げつけた...", "You throw some magic dust..."));
419 if (creature_ptr->lev < 25)
420 (void)sleep_monsters_touch(creature_ptr);
422 (void)sleep_monsters(creature_ptr, creature_ptr->lev);
426 return demonic_breath(creature_ptr);
428 (void)set_leveling(creature_ptr, randint1(20) + 30, FALSE);
431 return android_inside_weapon(creature_ptr);
433 msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
434 free_turn(creature_ptr);