OSDN Git Service

Merge branch 'unix-debug-save-purge' into feature/Debug-save-for-non-Windows
[hengband/hengband.git] / src / object-activation / activation-teleport.c
1 #include "object-activation/activation-teleport.h"
2 #include "cmd-io/cmd-save.h"
3 #include "core/asking-player.h"
4 #include "game-option/special-options.h"
5 #include "spell-kind/spells-grid.h"
6 #include "spell-kind/spells-launcher.h"
7 #include "spell-kind/spells-teleport.h"
8 #include "spell-kind/spells-world.h"
9 #include "spell/spell-types.h"
10 #include "target/target-getter.h"
11 #include "view/display-messages.h"
12
13 bool activate_teleport_away(player_type *user_ptr)
14 {
15     DIRECTION dir;
16     if (!get_aim_dir(user_ptr, &dir))
17         return FALSE;
18
19     (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, user_ptr->lev);
20     return TRUE;
21 }
22
23 bool activate_escape(player_type *user_ptr)
24 {
25     switch (randint1(13)) {
26     case 1:
27     case 2:
28     case 3:
29     case 4:
30     case 5:
31         teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
32         return TRUE;
33     case 6:
34     case 7:
35     case 8:
36     case 9:
37     case 10:
38         teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
39         return TRUE;
40     case 11:
41     case 12:
42         (void)stair_creation(user_ptr);
43         return TRUE;
44     default:
45         if (!get_check(_("この階を去りますか?", "Leave this level? ")))
46             return TRUE;
47
48         if (autosave_l)
49             do_cmd_save_game(user_ptr, TRUE);
50
51         user_ptr->leaving = TRUE;
52         return TRUE;
53     }
54 }
55
56 bool activate_teleport_level(player_type *user_ptr)
57 {
58     if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
59         return FALSE;
60
61     teleport_level(user_ptr, 0);
62     return TRUE;
63 }
64
65 bool activate_dimension_door(player_type *user_ptr)
66 {
67     msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
68     return dimension_door(user_ptr);
69 }
70
71 bool activate_teleport(player_type *user_ptr)
72 {
73     msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
74     teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
75     return TRUE;
76 }
77
78 bool activate_phase_door(player_type *user_ptr)
79 {
80     teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
81     return TRUE;
82 }