OSDN Git Service

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