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 "player-attack/player-attack.h"
9 #include "player/player-move.h"
10 #include "spell-kind/earthquake.h"
11 #include "system/floor-type-definition.h"
12 #include "spell-kind/spells-detection.h"
13 #include "target/target-getter.h"
14 #include "view/display-messages.h"
18 * do_cmd_cast calls this function if the player's class is 'berserker'.
19 * @param spell 発動する特殊技能のID
20 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
22 bool cast_berserk_spell(player_type *caster_ptr, int spell)
30 detect_monsters_mind(caster_ptr, DETECT_RAD_DEFAULT);
33 if (caster_ptr->riding) {
34 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
38 if (!get_direction(caster_ptr, &dir, FALSE, FALSE) || (dir == 5))
41 y = caster_ptr->y + ddy[dir];
42 x = caster_ptr->x + ddx[dir];
43 if (!caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
44 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
48 do_cmd_attack(caster_ptr, y, x, 0);
49 if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
50 || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
55 if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
56 && !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) {
58 (void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
64 if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
67 y = caster_ptr->y + ddy[dir];
68 x = caster_ptr->x + ddx[dir];
69 exe_movement(caster_ptr, dir, easy_disarm, TRUE);
73 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 8 + randint0(5), 0);
79 msg_print(_("なに?", "Zap?"));