1 #include "mind/mind-berserker.h"
2 #include "action/movement-execution.h"
3 #include "cmd-action/cmd-attack.h"
4 #include "floor/geometry.h"
5 #include "game-option/input-options.h"
6 #include "grid/feature.h"
8 #include "mind/mind-numbers.h"
9 #include "player-attack/player-attack.h"
10 #include "player/player-move.h"
11 #include "spell-kind/earthquake.h"
12 #include "system/floor-type-definition.h"
13 #include "spell-kind/spells-detection.h"
14 #include "target/target-getter.h"
15 #include "view/display-messages.h"
19 * do_cmd_cast calls this function if the player's class is 'berserker'.
20 * @param spell 発動する特殊技能のID
21 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
23 bool cast_berserk_spell(player_type *caster_ptr, mind_berserker_type spell)
29 detect_monsters_mind(caster_ptr, DETECT_RAD_DEFAULT);
32 if (caster_ptr->riding) {
33 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
37 if (!get_direction(caster_ptr, &dir, FALSE, FALSE) || (dir == 5))
40 y = caster_ptr->y + ddy[dir];
41 x = caster_ptr->x + ddx[dir];
42 if (!caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
43 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
47 do_cmd_attack(caster_ptr, y, x, 0);
48 if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
49 || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
54 if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
55 && !is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
57 (void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
63 if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
66 y = caster_ptr->y + ddy[dir];
67 x = caster_ptr->x + ddx[dir];
68 exe_movement(caster_ptr, dir, easy_disarm, TRUE);
72 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 8 + randint0(5), 0);
78 msg_print(_("なに?", "Zap?"));