OSDN Git Service

[Refactor] #39963 Moved TELEPORT_* from spells.h to spells-util.h and made them enum...
authorHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 14:03:00 +0000 (23:03 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 14:03:00 +0000 (23:03 +0900)
25 files changed:
src/cmd/cmd-activate.c
src/cmd/cmd-basic.c
src/cmd/cmd-mane.c
src/cmd/cmd-read.c
src/combat/melee.c
src/core.c
src/grid.c
src/grid.h
src/mind.c
src/mspells3.c
src/mspells4.c
src/mutation.c
src/racial.c
src/realm/realm-arcane.c
src/realm/realm-chaos.c
src/realm/realm-crusade.c
src/realm/realm-hex.c
src/realm/realm-hissatsu.c
src/realm/realm-sorcery.c
src/realm/realm-trump.c
src/spell/spells-util.h
src/spells.h
src/spells2.c
src/spells3.c
src/wizard2.c

index b9702be..56ef3d7 100644 (file)
@@ -1533,7 +1533,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_TELEPORT:
        {
                msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
-               teleport_player(user_ptr, 100, 0L);
+               teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
                break;
        }
 
@@ -1603,10 +1603,10 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                switch (randint1(13))
                {
                case 1: case 2: case 3: case 4: case 5:
-                       teleport_player(user_ptr, 10, 0L);
+                       teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
                        break;
                case 6: case 7: case 8: case 9: case 10:
-                       teleport_player(user_ptr, 222, 0L);
+                       teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
                        break;
                case 11: case 12:
                        (void)stair_creation(user_ptr);
@@ -1659,7 +1659,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_PHASE_DOOR:
        {
-               teleport_player(user_ptr, 10, 0L);
+               teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
        }
 
index 03d4011..48a2884 100644 (file)
@@ -2267,7 +2267,7 @@ void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
        /* Sniper actions after some shootings */
        if (snipe_type == SP_AWAY)
        {
-               teleport_player(creature_ptr, 10 + (creature_ptr->concent * 2), 0L);
+               teleport_player(creature_ptr, 10 + (creature_ptr->concent * 2), TELEPORT_SPONTANEOUS);
        }
 
        if (snipe_type == SP_FINAL)
index aff34cb..5ca49ad 100644 (file)
@@ -665,10 +665,10 @@ static bool use_mane(player_type *caster_ptr, int spell)
                (void)set_invuln(caster_ptr, randint1(7) + 7, FALSE);
                break;
        case MS_BLINK:
-               teleport_player(caster_ptr, 10, 0L);
+               teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
        case MS_TELEPORT:
-               teleport_player(caster_ptr, plev * 5, 0L);
+               teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
                break;
        case MS_WORLD:
                (void)time_walk(caster_ptr);
index 407b194..943b3a3 100644 (file)
@@ -169,14 +169,14 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_PHASE_DOOR:
                {
-                       teleport_player(creature_ptr, 10, 0L);
+                       teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
                        ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_TELEPORT:
                {
-                       teleport_player(creature_ptr, 100, 0L);
+                       teleport_player(creature_ptr, 100, TELEPORT_SPONTANEOUS);
                        ident = TRUE;
                        break;
                }
index 91489a5..f2649e3 100644 (file)
@@ -3838,7 +3838,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
 
                                        if (is_mirror_grid(&floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
                                        {
-                                               teleport_player(target_ptr, 10, 0L);
+                                               teleport_player(target_ptr, 10, TELEPORT_SPONTANEOUS);
                                        }
                                }
 
@@ -4088,7 +4088,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
                else
                {
                        msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!"));
-                       teleport_away(target_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
+                       teleport_away(target_ptr, m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS);
                }
        }
 
@@ -4719,7 +4719,7 @@ bool monst_attack_monst(player_type *subject_ptr, MONSTER_IDX m_idx, MONSTER_IDX
                        subject_ptr->current_floor_ptr->monster_noise = TRUE;
                }
 
-               teleport_away(subject_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
+               teleport_away(subject_ptr, m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS);
        }
 
        return TRUE;
index 84b2f8c..c38ed07 100644 (file)
@@ -572,7 +572,7 @@ static void pattern_teleport(player_type *creature_ptr)
        }
        else if (get_check(_("通常テレポート?", "Normal teleport? ")))
        {
-               teleport_player(creature_ptr, 200, 0L);
+               teleport_player(creature_ptr, 200, TELEPORT_SPONTANEOUS);
                return;
        }
        else
@@ -2294,7 +2294,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                        if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
                        {
                                disturb(creature_ptr, FALSE, TRUE);
-                               teleport_player(creature_ptr, 50, 0L);
+                               teleport_player(creature_ptr, 50, TELEPORT_SPONTANEOUS);
                        }
                        else
                        {
index e8c5bdd..256d4b2 100644 (file)
@@ -34,7 +34,6 @@
 #include "player-status.h"
 #include "player-effects.h"
 #include "player-class.h"
-#include "spells.h"
 #include "view/display-main-window.h"
 #include "realm/realm-song.h"
 
@@ -1103,7 +1102,7 @@ bool is_explosive_rune_grid(grid_type *g_ptr)
 * @param mode オプション
 * @return テレポート先として妥当ならばtrue
 */
-bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
+bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode)
 {
        monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
        grid_type    *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
@@ -1135,7 +1134,7 @@ bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx,
 * @param mode オプション
 * @return テレポート先として妥当ならばtrue
 */
-bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
+bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, teleport_flags mode)
 {
        grid_type    *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
        feature_type *f_ptr = &f_info[g_ptr->feat];
index 29da5e3..27b14a1 100644 (file)
@@ -14,6 +14,7 @@
  * included in all such copies.
  */
 
+#include "spell/spells-util.h"
 
  /*
   * A single "grid" in a Cave
@@ -199,8 +200,8 @@ extern void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x);
 extern bool is_open(player_type *player_ptr, FEAT_IDX feat);
 extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
 
-extern bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
-extern bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+extern bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode);
+extern bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, teleport_flags mode);
 
 typedef enum
 {
index e19d4e0..0d102da 100644 (file)
@@ -1077,11 +1077,11 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                break;
        case 2:
                /* Minor displace */
-               teleport_player(caster_ptr, 10, 0L);
+               teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
        case 3:
                /* Major displace */
-               teleport_player(caster_ptr, plev * 5, 0L);
+               teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
                break;
        case 4:
                /* Domination */
@@ -1357,7 +1357,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                break;
                /* warped mirror */
        case 3:
-               teleport_player(caster_ptr, 10, 0L);
+               teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
                /* mirror of light */
        case 4:
@@ -1365,7 +1365,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                break;
                /* mirror of wandering */
        case 5:
-               teleport_player(caster_ptr, plev * 5, 0L);
+               teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
                break;
                /* robe of dust */
        case 6:
@@ -1570,7 +1570,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                break;
        case 2:
        {
-               teleport_player(caster_ptr, 10, 0L);
+               teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
        }
        case 3:
@@ -1585,7 +1585,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
        }
        case 4:
        {
-               teleport_player(caster_ptr, caster_ptr->lev * 5, 0L);
+               teleport_player(caster_ptr, caster_ptr->lev * 5, TELEPORT_SPONTANEOUS);
                break;
        }
        case 5:
@@ -1606,7 +1606,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                break;
        case 9:
                fire_ball(caster_ptr, GF_FIRE, 0, 50+plev, plev/10+2);
-               teleport_player(caster_ptr, 30, 0L);
+               teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
                set_oppose_fire(caster_ptr, (TIME_EFFECT)plev, FALSE);
                break;
        case 10:
@@ -1665,7 +1665,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                fire_ball(caster_ptr, GF_POIS, 0, 75+plev*2/3, plev/5+2);
                fire_ball(caster_ptr, GF_HYPODYNAMIA, 0, 75+plev*2/3, plev/5+2);
                fire_ball(caster_ptr, GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
-               teleport_player(caster_ptr, 30, 0L);
+               teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
                break;
        case 18:
        {
index a4f26ae..4eedab3 100644 (file)
@@ -1301,10 +1301,10 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                (void)set_invuln(caster_ptr, randint1(4) + 4, FALSE);
                break;
        case MS_BLINK:
-               teleport_player(caster_ptr, 10, 0L);
+               teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
        case MS_TELEPORT:
-               teleport_player(caster_ptr, plev * 5, 0L);
+               teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
                break;
        case MS_WORLD:
                (void)time_walk(caster_ptr);
index cd7af9e..a9923cc 100644 (file)
@@ -2013,7 +2013,7 @@ void spell_RF6_BLINK(player_type *target_ptr, MONSTER_IDX m_idx, int TARGET_TYPE
        if (see_monster(floor_ptr, m_idx))
                msg_format(_("%^sが瞬時に消えた。", "%^s blinks away."), m_name);
 
-       teleport_away(target_ptr, m_idx, 10, 0L);
+       teleport_away(target_ptr, m_idx, 10, TELEPORT_SPONTANEOUS);
 
        if (TARGET_TYPE == MONSTER_TO_PLAYER)
                target_ptr->update |= (PU_MONSTERS);
@@ -2079,7 +2079,6 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
        floor_type *floor_ptr = target_ptr->current_floor_ptr;
        monster_type *m_ptr = &floor_ptr->m_list[m_idx];
        HIT_POINT dummy_hp, dummy_maxhp;
-       MONSTER_IDX k;
        POSITION dummy_y = m_ptr->fy;
        POSITION dummy_x = m_ptr->fx;
        BIT_FLAGS mode = 0L;
@@ -2112,7 +2111,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num)
                        return -1;
 
-               for (k = 1; k < floor_ptr->m_max; k++)
+               for (MONSTER_IDX k = 1; k < floor_ptr->m_max; k++)
                {
                        if (floor_ptr->m_list[k].r_idx == MON_BANOR || floor_ptr->m_list[k].r_idx == MON_LUPART)
                        {
index af3819d..25d07b6 100644 (file)
@@ -1604,7 +1604,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
 
                case MUT1_VTELEPORT:
                        msg_print(_("集中している...", "You concentrate..."));
-                       teleport_player(creature_ptr, 10 + 4 * lvl, 0L);
+                       teleport_player(creature_ptr, 10 + 4 * lvl, TELEPORT_SPONTANEOUS);
                        break;
 
                case MUT1_MIND_BLST:
@@ -1633,7 +1633,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_BLINK:
-                       teleport_player(creature_ptr, 10, 0L);
+                       teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
                        break;
 
                case MUT1_EAT_ROCK:
index 7c4e6af..715c3d7 100644 (file)
@@ -657,7 +657,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_GNOME:
                        msg_print(_("パッ!", "Blink!"));
-                       teleport_player(creature_ptr, 10, 0L);
+                       teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
                        break;
 
                case RACE_HALF_ORC:
index 8276a45..bf876dd 100644 (file)
@@ -111,7 +111,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mod
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
@@ -343,7 +343,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mod
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
index 9c3f615..5af2484 100644 (file)
@@ -186,7 +186,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
index a23b7a4..451a8f1 100644 (file)
@@ -102,7 +102,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mo
                {
                        POSITION range = 25 + plev / 2;
                        if (info) return info_range(range);
-                       if (cast) teleport_player(caster_ptr, range, 0L);
+                       if (cast) teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                }
                break;
 
index 3839082..0b66146 100644 (file)
@@ -1040,12 +1040,12 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
 
                        if (flag && randint0(plev * plev / 2))
                        {
-                               teleport_player_to(caster_ptr, y, x, 0L);
+                               teleport_player_to(caster_ptr, y, x, TELEPORT_SPONTANEOUS);
                        }
                        else
                        {
                                msg_print(_("おっと!", "Oops!"));
-                               teleport_player(caster_ptr, 30, 0L);
+                               teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
                        }
 
                        add = FALSE;
index d1d2f20..681f62a 100644 (file)
@@ -803,7 +803,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
 
                        if (!tgt_pt(caster_ptr, &x, &y)) return NULL;
 
-                       if (!cave_player_teleportable_bold(caster_ptr, y, x, 0L) ||
+                       if (!cave_player_teleportable_bold(caster_ptr, y, x, TELEPORT_SPONTANEOUS) ||
                                (distance(y, x, caster_ptr->y, caster_ptr->x) > MAX_SIGHT / 2) ||
                                !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                        {
@@ -816,7 +816,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                                break;
                        }
                        project(caster_ptr, 0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL, -1);
-                       teleport_player_to(caster_ptr, y, x, 0L);
+                       teleport_player_to(caster_ptr, y, x, TELEPORT_SPONTANEOUS);
                }
                break;
 
index 59591e4..1e31154 100644 (file)
@@ -58,7 +58,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mo
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
@@ -128,7 +128,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mo
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
index f4b259f..77bf41f 100644 (file)
@@ -44,7 +44,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
@@ -105,7 +105,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode
 
                        if (cast)
                        {
-                               teleport_player(caster_ptr, range, 0L);
+                               teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
                        }
                }
                break;
index 15b92d5..787b287 100644 (file)
@@ -1,6 +1,10 @@
 #pragma once
 
-typedef enum
+#define DETECT_RAD_DEFAULT 30
+#define DETECT_RAD_MAP     30
+#define DETECT_RAD_ALL     255
+
+typedef enum spell_type
 {
        SPELL_NAME = 0,
        SPELL_DESC = 1,
@@ -11,9 +15,17 @@ typedef enum
        SPELL_CONT = 6
 } spell_type;
 
-typedef enum
+typedef enum spell_operation
 {
-       SPOP_DISPLAY_MES = 0x0001,              // !< スペル処理オプション … メッセージを表示する
-       SPOP_NO_UPDATE = 0x0002,                // !< スペル処理オプション … ステータス更新を解決後行う
-       SPOP_DEBUG = 0x8000,                    // !< スペル処理オプション … デバッグ処理あり
+       SPOP_DISPLAY_MES = 0x0001,      // !< スペル処理オプション … メッセージを表示する
+       SPOP_NO_UPDATE = 0x0002,        // !< スペル処理オプション … ステータス更新を解決後行う
+       SPOP_DEBUG = 0x8000                     // !< スペル処理オプション … デバッグ処理あり
 } spell_operation;
+
+typedef enum teleport_flags
+{
+       TELEPORT_SPONTANEOUS    = 0x0000,
+       TELEPORT_NONMAGICAL             = 0x0001,
+       TELEPORT_PASSIVE                = 0x0002,
+       TELEPORT_DEC_VALOUR             = 0x0004
+} teleport_flags;
index eb75f0c..1c306c5 100644 (file)
@@ -1,10 +1,6 @@
 #pragma once
 #include "realm/realm.h"
 
-#define DETECT_RAD_DEFAULT 30
-#define DETECT_RAD_MAP     30
-#define DETECT_RAD_ALL     255
-
 /* spells1.c */
 extern bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern void breath_shape(player_type *caster_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
@@ -137,20 +133,13 @@ extern bool clear_mind(player_type *creature_ptr);
 extern bool concentration(player_type *creature_ptr);
 extern bool vanish_dungeon(player_type *caster_ptr);
 
-/*
- * Bit flags for teleportation
- */
-#define TELEPORT_NONMAGICAL 0x00000001
-#define TELEPORT_PASSIVE    0x00000002
-#define TELEPORT_DEC_VALOUR 0x00000004
-
 /* spells3.c */
-extern bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
-extern void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode);
-extern bool teleport_player_aux(player_type *creature_ptr, POSITION dis, bool is_quantum_effect, BIT_FLAGS mode);
+extern bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode);
+extern void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode);
+extern bool teleport_player_aux(player_type *creature_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode);
 extern void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode);
 extern void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION dis, bool is_quantum_effect);
-extern void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mode);
+extern void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, teleport_flags mode);
 extern void teleport_away_followable(player_type *creature_ptr, MONSTER_IDX m_idx);
 extern bool teleport_level_other(player_type *caster_ptr);
 extern void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx);
index a019d60..038a135 100644 (file)
@@ -2862,7 +2862,7 @@ bool kawarimi(player_type *caster_ptr, bool success)
        POSITION y = caster_ptr->y;
        POSITION x = caster_ptr->x;
 
-       teleport_player(caster_ptr, 10 + randint1(90), 0L);
+       teleport_player(caster_ptr, 10 + randint1(90), TELEPORT_SPONTANEOUS);
        object_wipe(q_ptr);
        object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
 
@@ -3909,7 +3909,7 @@ bool hit_and_away(player_type *caster_ptr)
                if (randint0(caster_ptr->skill_dis) < 7)
                        msg_print(_("うまく逃げられなかった。", "You failed to run away."));
                else
-                       teleport_player(caster_ptr, 30, 0L);
+                       teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
                return TRUE;
        }
 
index c787d63..b6969e7 100644 (file)
@@ -85,7 +85,7 @@ static bool redraw_player(player_type *caster_ptr);
  * Attempt to move the monster at least "dis/2" grids away.
  * But allow variation to prevent infinite loops.
  */
-bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
+bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode)
 {
        monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
        if (!monster_is_valid(m_ptr)) return FALSE;
@@ -162,7 +162,7 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT
  * @param mode オプション
  * @return なし
  */
-void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode)
+void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode)
 {
        monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
        if(!m_ptr->r_idx) return;
@@ -244,7 +244,7 @@ void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty
  * of candidates has equal possibility to be choosen as a destination.
  * </pre>
  */
-bool teleport_player_aux(player_type *creature_ptr, POSITION dis, bool is_quantum_effect, BIT_FLAGS mode)
+bool teleport_player_aux(player_type *creature_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode)
 {
        if (creature_ptr->wild_mode) return FALSE;
        if (!is_quantum_effect && creature_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
@@ -353,7 +353,7 @@ void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode)
                        is_resistible &= MON_CSLEEP(m_ptr) == 0;
                        if (is_resistible)
                        {
-                               teleport_monster_to(creature_ptr, tmp_m_idx, creature_ptr->y, creature_ptr->x, r_ptr->level, 0L);
+                               teleport_monster_to(creature_ptr, tmp_m_idx, creature_ptr->y, creature_ptr->x, r_ptr->level, TELEPORT_SPONTANEOUS);
                        }
                }
        }
@@ -396,7 +396,7 @@ void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION d
                        is_resistible &= MON_CSLEEP(m_ptr) == 0;
                        if (is_resistible)
                        {
-                               teleport_monster_to(target_ptr, tmp_m_idx, target_ptr->y, target_ptr->x, r_ptr->level, 0L);
+                               teleport_monster_to(target_ptr, tmp_m_idx, target_ptr->y, target_ptr->x, r_ptr->level, TELEPORT_SPONTANEOUS);
                        }
                }
        }
@@ -417,7 +417,7 @@ void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION d
  * This function allows teleporting into vaults (!)
  * </pre>
  */
-void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mode)
+void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, teleport_flags mode)
 {
        if (creature_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
@@ -465,7 +465,7 @@ void teleport_away_followable(player_type *tracer_ptr, MONSTER_IDX m_idx)
        bool old_ml = m_ptr->ml;
        POSITION old_cdis = m_ptr->cdis;
 
-       teleport_away(tracer_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
+       teleport_away(tracer_ptr, m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS);
 
        bool is_followable = old_ml;
        is_followable &= old_cdis <= MAX_SIGHT;
@@ -508,7 +508,7 @@ void teleport_away_followable(player_type *tracer_ptr, MONSTER_IDX m_idx)
        }
        else
        {
-               teleport_player_to(tracer_ptr, m_ptr->fy, m_ptr->fx, 0L);
+               teleport_player_to(tracer_ptr, m_ptr->fy, m_ptr->fx, TELEPORT_SPONTANEOUS);
        }
 
        tracer_ptr->energy_need += ENERGY_NEED();
@@ -2507,7 +2507,7 @@ static bool dimension_door_aux(player_type *caster_ptr, POSITION x, POSITION y)
 
        caster_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
 
-       if (!cave_player_teleportable_bold(caster_ptr, y, x, 0L) ||
+       if (!cave_player_teleportable_bold(caster_ptr, y, x, TELEPORT_SPONTANEOUS) ||
            (distance(y, x, caster_ptr->y, caster_ptr->x) > plev / 2 + 10) ||
            (!randint0(plev / 10 + 10)))
        {
@@ -2516,7 +2516,7 @@ static bool dimension_door_aux(player_type *caster_ptr, POSITION x, POSITION y)
                return FALSE;
        }
 
-       teleport_player_to(caster_ptr, y, x, 0L);
+       teleport_player_to(caster_ptr, y, x, TELEPORT_SPONTANEOUS);
        return TRUE;
 }
 
index 2b1ea61..3084774 100644 (file)
@@ -1850,7 +1850,7 @@ void do_cmd_debug(player_type *creature_ptr)
 
                /* Phase Door */
        case 'p':
-               teleport_player(creature_ptr, 10, 0L);
+               teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
                break;
 
                /* Take a Quests */
@@ -1921,7 +1921,7 @@ void do_cmd_debug(player_type *creature_ptr)
 
                /* Teleport */
        case 't':
-               teleport_player(creature_ptr, 100, 0L);
+               teleport_player(creature_ptr, 100, TELEPORT_SPONTANEOUS);
                break;
 
                /* Game Time Setting */