OSDN Git Service

テレポート関数群のbool引数が増えているため, 今後のモード追加を行いや
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 28 Mar 2004 08:19:35 +0000 (08:19 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 28 Mar 2004 08:19:35 +0000 (08:19 +0000)
すいようにu32b mode引数でフラグを渡すように変更.

21 files changed:
src/artifact.c
src/cmd1.c
src/cmd5.c
src/cmd6.c
src/defines.h
src/do-spell.c
src/dungeon.c
src/externs.h
src/mane.c
src/melee1.c
src/melee2.c
src/mind.c
src/mspells1.c
src/mspells2.c
src/mspells3.c
src/mutation.c
src/racial.c
src/spells1.c
src/spells2.c
src/spells3.c
src/wizard2.c

index 1c8b38b..b574246 100644 (file)
@@ -2984,7 +2984,7 @@ bool activate_random_artifact(object_type * o_ptr)
                        msg_print("It twists space around you...");
 #endif
 
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        o_ptr->timeout = 45;
                        break;
                }
index 8bd007b..76910cf 100644 (file)
@@ -1335,7 +1335,7 @@ static void hit_trap(bool break_trap)
                        msg_print("You hit a teleport trap!");
 #endif
 
-                       teleport_player(100, TRUE);
+                       teleport_player(100, TELEPORT_PASSIVE);
                        break;
                }
 
@@ -2818,7 +2818,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
                                        msg_format("%^s disappears!", m_name);
 #endif
 
-                                       teleport_away(c_ptr->m_idx, 50, FALSE, TRUE);
+                                       teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
                                        num = num_blow + 1; /* Can't hit it anymore! */
                                        *mdeath = TRUE;
                                }
index f1e58a9..71a2a66 100644 (file)
@@ -998,16 +998,16 @@ static void wild_magic(int spell)
        case 1:
        case 2:
        case 3:
-               teleport_player(10, TRUE);
+               teleport_player(10, TELEPORT_PASSIVE);
                break;
        case 4:
        case 5:
        case 6:
-               teleport_player(100, TRUE);
+               teleport_player(100, TELEPORT_PASSIVE);
                break;
        case 7:
        case 8:
-               teleport_player(200, TRUE);
+               teleport_player(200, TELEPORT_PASSIVE);
                break;
        case 9:
        case 10:
index e8c40b8..f441992 100644 (file)
@@ -883,7 +883,7 @@ static void do_cmd_quaff_potion_aux(int item)
                                        ident = TRUE;
                                        if (one_in_(3)) lose_all_info();
                                        else wiz_dark();
-                                       (void)teleport_player_aux(100, TRUE, TRUE);
+                                       (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
                                        wiz_dark();
 #ifdef JP
                                        msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
@@ -1722,14 +1722,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_PHASE_DOOR:
                {
-                       teleport_player(10, FALSE);
+                       teleport_player(10, 0L);
                        ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_TELEPORT:
                {
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -2373,7 +2373,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_TELEPORTATION:
                {
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -4600,7 +4600,7 @@ msg_print("ŷ
                                msg_print("Your cloak twists space around you...");
 #endif
 
-                               teleport_player(100, FALSE);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = 45;
                                break;
                        }
@@ -4819,10 +4819,10 @@ msg_print("ŷ
                                switch (randint1(13))
                                {
                                case 1: case 2: case 3: case 4: case 5:
-                                       teleport_player(10, FALSE);
+                                       teleport_player(10, 0L);
                                        break;
                                case 6: case 7: case 8: case 9: case 10:
-                                       teleport_player(222, FALSE);
+                                       teleport_player(222, 0L);
                                        break;
                                case 11: case 12:
                                        (void)stair_creation();
@@ -4847,7 +4847,7 @@ if (get_check("
 
                        case ART_KAMUI:
                        {
-                               teleport_player(222, FALSE);
+                               teleport_player(222, 0L);
                                o_ptr->timeout = 25;
                                break;
                        }
@@ -5861,7 +5861,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_TRUMP)
        {
-               teleport_player(100, FALSE);
+               teleport_player(100, 0L);
                o_ptr->timeout = 50 + randint1(50);
 
                /* Window stuff */
@@ -5909,7 +5909,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_JUMP)
        {
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                o_ptr->timeout = 10 + randint1(10);
 
                /* Window stuff */
@@ -6333,11 +6333,11 @@ msg_print("
                                o_ptr->timeout = 200;
                                break;
                        case EGO_AMU_JUMP:
-                               teleport_player(10, FALSE);
+                               teleport_player(10, 0L);
                                o_ptr->timeout = randint0(10) + 10;
                                break;
                        case EGO_AMU_TELEPORT:
-                               teleport_player(100, FALSE);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = randint0(50) + 50;
                                break;
                        case EGO_AMU_D_DOOR:
@@ -6411,7 +6411,7 @@ msg_print("
                        for (i = 0; i < max_pet; i++)
                        {
                                pet_ctr = who[i];
-                               teleport_monster_to(pet_ctr, py, px, 100, TRUE);
+                               teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
                        }
 
                        /* Free the "who" array */
index b85605d..d37e9ef 100644 (file)
 #define FAF_NO_DROP 0x02
 
 
+/*
+ * Bit flags for teleportation
+ */
+#define TELEPORT_NONMAGICAL 0x00000001
+#define TELEPORT_PASSIVE    0x00000002
+#define TELEPORT_DEC_VALOUR 0x00000004
+
+
 /* Type of pattern tiles */
 #define NOT_PATTERN_TILE      -1
 #define PATTERN_TILE_START    0
index 3a49409..f26d909 100644 (file)
@@ -507,16 +507,16 @@ static void wild_magic(int spell)
        case 1:
        case 2:
        case 3:
-               teleport_player(10, TRUE);
+               teleport_player(10, TELEPORT_PASSIVE);
                break;
        case 4:
        case 5:
        case 6:
-               teleport_player(100, TRUE);
+               teleport_player(100, TELEPORT_PASSIVE);
                break;
        case 7:
        case 8:
-               teleport_player(200, TRUE);
+               teleport_player(200, TELEPORT_PASSIVE);
                break;
        case 9:
        case 10:
@@ -722,7 +722,7 @@ static void cast_shuffle(void)
                msg_print("It's a teleport trump card.");
 #endif
 
-               teleport_player(10, TRUE);
+               teleport_player(10, TELEPORT_PASSIVE);
        }
        else if (die < 42)
        {
@@ -742,7 +742,7 @@ static void cast_shuffle(void)
                msg_print("It's a teleport trump card.");
 #endif
 
-               teleport_player(100, TRUE);
+               teleport_player(100, TELEPORT_PASSIVE);
        }
        else if (die < 52)
        {
@@ -752,7 +752,7 @@ static void cast_shuffle(void)
                msg_print("It's a teleport trump card.");
 #endif
 
-               teleport_player(200, TRUE);
+               teleport_player(200, TELEPORT_PASSIVE);
        }
        else if (die < 60)
        {
@@ -1932,7 +1932,7 @@ static cptr do_sorcery_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -2022,7 +2022,7 @@ static cptr do_sorcery_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -3597,7 +3597,7 @@ static cptr do_chaos_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -5049,7 +5049,7 @@ static cptr do_trump_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -5139,7 +5139,7 @@ static cptr do_trump_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -6055,7 +6055,7 @@ static cptr do_arcane_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -6369,7 +6369,7 @@ static cptr do_arcane_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -8288,7 +8288,7 @@ static cptr do_crusade_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               teleport_player(range, FALSE);
+                               teleport_player(range, 0L);
                        }
                }
                break;
@@ -11176,7 +11176,7 @@ static cptr do_hissatsu_spell(int spell, int mode)
 
                        if (!tgt_pt(&x, &y)) return NULL;
 
-                       if (!cave_player_teleportable_bold(y, x, FALSE, FALSE) ||
+                       if (!cave_player_teleportable_bold(y, x, 0L) ||
                            (distance(y, x, py, px) > MAX_SIGHT / 2) ||
                            !projectable(py, px, y, x))
                        {
@@ -11198,7 +11198,7 @@ static cptr do_hissatsu_spell(int spell, int mode)
                                break;
                        }
                        project(0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL, -1);
-                       teleport_player_to(y, x, TRUE, FALSE);
+                       teleport_player_to(y, x, 0L);
                }
                break;
 
index 73f589a..e2d6476 100644 (file)
@@ -639,9 +639,8 @@ static void pattern_teleport(void)
 #else
        else if (get_check("Normal teleport? "))
 #endif
-
        {
-               teleport_player(200, FALSE);
+               teleport_player(200, 0L);
                return;
        }
        else
@@ -2264,7 +2263,7 @@ static void process_world_aux_mutation(void)
 #endif
 
                        msg_print(NULL);
-                       teleport_player(40, TRUE);
+                       teleport_player(40, TELEPORT_PASSIVE);
                }
        }
 
@@ -2294,7 +2293,7 @@ static void process_world_aux_mutation(void)
                                msg_print(NULL);
                                if (one_in_(3)) lose_all_info();
                                else wiz_dark();
-                               (void)teleport_player_aux(100, TRUE, TRUE);
+                               (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
                                wiz_dark();
 #ifdef JP
                                msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
@@ -2892,7 +2891,7 @@ static void process_world_aux_curse(void)
 #endif
                        {
                                disturb(0, 0);
-                               teleport_player(50, FALSE);
+                               teleport_player(50, 0L);
                        }
                        else
                        {
@@ -3059,7 +3058,7 @@ static void process_world_aux_curse(void)
                        disturb(0, 0);
 
                        /* Teleport player */
-                       teleport_player(40, TRUE);
+                       teleport_player(40, TELEPORT_PASSIVE);
                }
                /* Handle HP draining */
                if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
index d3b1b0c..3fd63b9 100644 (file)
@@ -1139,13 +1139,13 @@ extern bool rush_attack(bool *mdeath);
 extern void remove_all_mirrors(bool explode);
 
 /* spells3.c */
-extern bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive);
-extern void teleport_monster_to(int m_idx, int ty, int tx, int power, bool passive);
-extern bool cave_player_teleportable_bold(int y, int x, bool passive, bool nonmagical);
-extern bool teleport_player_aux(int dis, bool passive, bool nonmagical);
-extern void teleport_player(int dis, bool passive);
+extern bool teleport_away(int m_idx, int dis, u32b mode);
+extern void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode);
+extern bool cave_player_teleportable_bold(int y, int x, u32b mode);
+extern bool teleport_player_aux(int dis, u32b mode);
+extern void teleport_player(int dis, u32b mode);
 extern void teleport_player_away(int m_idx, int dis);
-extern void teleport_player_to(int ny, int nx, bool no_tele, bool passive);
+extern void teleport_player_to(int ny, int nx, u32b mode);
 extern void teleport_away_followable(int m_idx);
 extern void teleport_level(int m_idx);
 extern int choose_dungeon(cptr note, int y, int x);
index 5491bd3..649c6b9 100644 (file)
@@ -880,10 +880,10 @@ msg_print("̵
                (void)set_invuln(randint1(7) + 7, FALSE);
                break;
        case MS_BLINK:
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                break;
        case MS_TELEPORT:
-               teleport_player(plev * 5, FALSE);
+               teleport_player(plev * 5, 0L);
                break;
        case MS_WORLD:
                world_player = TRUE;
@@ -963,7 +963,7 @@ msg_format("%s
                msg_format("You command %s to return.", m_name);
 #endif
 
-               teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TRUE);
+               teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE);
                break;
        }
        case MS_TELE_AWAY:
index 0c0a2b2..c8c2858 100644 (file)
@@ -1969,7 +1969,7 @@ msg_format("%s
 
                                        if (is_mirror_grid(&cave[py][px]))
                                        {
-                                               teleport_player(10, FALSE);
+                                               teleport_player(10, 0L);
                                        }
                                }
 
@@ -2165,7 +2165,7 @@ msg_format("%^s
                msg_print("The thief flees laughing!");
 #endif
 
-               teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE, FALSE);
+               teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
        }
 
 
index 5165de4..ad80ae7 100644 (file)
@@ -2188,7 +2188,7 @@ msg_format("%s
                        mon_fight = TRUE;
                }
 
-               teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE, FALSE);
+               teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
        }
 
        return TRUE;
index cf9bda3..5f0a98d 100644 (file)
@@ -889,11 +889,11 @@ if (!b) msg_print("
                break;
        case 2:
                /* Minor displace */
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                break;
        case 3:
                /* Major displace */
-               teleport_player(plev * 5, FALSE);
+               teleport_player(plev * 5, 0L);
                break;
        case 4:
                /* Domination */
@@ -1290,7 +1290,7 @@ msg_format("There are too many mirrors to control!");
          break;
        /* warped mirror */
        case 3:
-         teleport_player(10, FALSE);
+         teleport_player(10, 0L);
          break;
        /* mirror of light */
        case 4:
@@ -1298,7 +1298,7 @@ msg_format("There are too many mirrors to control!");
          break;
        /* mirror of wandering */
        case 5:
-         teleport_player(plev * 5, FALSE);
+         teleport_player(plev * 5, 0L);
          break;
        /* robe of dust */
        case 6:
@@ -1549,7 +1549,7 @@ static bool cast_ninja_spell(int spell)
                break;
        case 2:
        {
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                break;
        }
        case 3:
@@ -1569,7 +1569,7 @@ static bool cast_ninja_spell(int spell)
        }
        case 4:
        {
-               teleport_player(p_ptr->lev * 5, FALSE);
+               teleport_player(p_ptr->lev * 5, 0L);
                break;
        }
        case 5:
@@ -1588,7 +1588,7 @@ msg_print("
 #endif
                        else
                        {
-                               teleport_player(30, FALSE);
+                               teleport_player(30, 0L);
                        }
                }
                else
@@ -1616,7 +1616,7 @@ msg_print("
                break;
        case 9:
                fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
-               teleport_player(30, FALSE);
+               teleport_player(30, 0L);
                set_oppose_fire(plev, FALSE);
                break;
        case 10:
@@ -1753,7 +1753,7 @@ msg_print("
                fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
                fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
                fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
-               teleport_player(30, FALSE);
+               teleport_player(30, 0L);
                break;
        case 18:
        {
@@ -2029,7 +2029,7 @@ msg_print("
 #else
                                        msg_print("Weird visions seem to dance before your eyes...");
 #endif
-                                       teleport_player(10, TRUE);
+                                       teleport_player(10, TELEPORT_PASSIVE);
                                }
                                else if (b < 96)
                                {
index 5525d74..2f6737e 100644 (file)
@@ -3399,7 +3399,7 @@ msg_format("%^s
                        msg_format("%^s blinks away.", m_name);
 #endif
 
-                       teleport_away(m_idx, 10, FALSE, FALSE);
+                       teleport_away(m_idx, 10, 0L);
                        p_ptr->update |= (PU_MONSTERS);
                        break;
                }
@@ -3538,7 +3538,7 @@ msg_format("%^s
 #else
                                                msg_format("%^s suddenly go out of your sight!", m_name);
 #endif
-                                               teleport_away(m_idx, 10, FALSE, FALSE);
+                                               teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
                                                p_ptr->update |= (PU_MONSTERS);
                                        }
                                        else
@@ -3552,7 +3552,7 @@ msg_format("%^s
                                                msg_format("%^s holds you, and drops from the sky.", m_name);
 #endif
                                                dam = damroll(4, 8);
-                                               teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE, TRUE);
+                                               teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
 
                                                sound(SOUND_FALL);
 
@@ -3616,7 +3616,7 @@ msg_format("%^s
                        msg_format("%^s commands you to return.", m_name);
 #endif
 
-                       teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, TRUE);
+                       teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
                        learn_spell(MS_TELE_TO);
                        break;
                }
index 520fcf1..a3e90ad 100644 (file)
@@ -3062,7 +3062,7 @@ bool monst_spell_monst(int m_idx)
 
                }
 
-               teleport_away(m_idx, 10, FALSE, FALSE);
+               teleport_away(m_idx, 10, 0L);
 
                break;
 
@@ -3145,7 +3145,7 @@ bool monst_spell_monst(int m_idx)
                                                msg_format("%^s suddenly go out of your sight!", m_name);
 #endif
                                        }
-                                       teleport_away(m_idx, 10, FALSE, FALSE);
+                                       teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
                                        p_ptr->update |= (PU_MONSTERS);
                                }
                                else
@@ -3169,8 +3169,8 @@ bool monst_spell_monst(int m_idx)
 
                                        dam = damroll(4, 8);
 
-                                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE, TRUE);
-                                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TRUE);
+                                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+                                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
 
                                        sound(SOUND_FALL);
 
@@ -3282,8 +3282,8 @@ bool monst_spell_monst(int m_idx)
 
                if (!resists_tele)
                {
-                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, TRUE);
-                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TRUE);
+                       if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
+                       else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
                }
 
                wake_up = TRUE;
@@ -3343,7 +3343,7 @@ bool monst_spell_monst(int m_idx)
                if (!resists_tele)
                {
                        if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
-                       else teleport_away(t_idx, MAX_SIGHT * 2 + 5, FALSE, TRUE);
+                       else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
                }
 
                wake_up = TRUE;
index 4979b76..d06cd0f 100644 (file)
@@ -1316,10 +1316,10 @@ msg_print("̵
                (void)set_invuln(randint1(4) + 4, FALSE);
                break;
        case MS_BLINK:
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                break;
        case MS_TELEPORT:
-               teleport_player(plev * 5, FALSE);
+               teleport_player(plev * 5, 0L);
                break;
        case MS_WORLD:
                world_player = TRUE;
@@ -1390,7 +1390,7 @@ msg_format("%s
                msg_format("You command %s to return.", m_name);
 #endif
 
-               teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TRUE);
+               teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE);
                break;
        }
        case MS_TELE_AWAY:
index ab7e59e..2ea3d92 100644 (file)
@@ -3360,7 +3360,7 @@ bool mutation_power_aux(u32b power)
                        msg_print("You concentrate...");
 #endif
 
-                       teleport_player(10 + 4 * lvl, FALSE);
+                       teleport_player(10 + 4 * lvl, 0L);
                        break;
 
                case MUT1_MIND_BLST:
@@ -3458,7 +3458,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_BLINK:
-                       teleport_player(10, FALSE);
+                       teleport_player(10, 0L);
                        break;
 
                case MUT1_EAT_ROCK:
@@ -3681,7 +3681,7 @@ bool mutation_power_aux(u32b power)
 #else
                                                msg_print("You failed to teleport.");
 #endif
-                                       else teleport_player(30, FALSE);
+                                       else teleport_player(30, 0L);
                                }
                                else
                                {
index 0d10f6e..0ba4a29 100644 (file)
@@ -907,7 +907,7 @@ static bool cmd_racial_power_aux(s32b command)
 #else
                                        msg_print("You are failed to run away.");
 #endif
-                               else teleport_player(30, FALSE);
+                               else teleport_player(30, 0L);
                        }
                        else
                        {
@@ -1483,7 +1483,7 @@ static bool cmd_racial_power_aux(s32b command)
                        msg_print("Blink!");
 #endif
 
-                       teleport_player(10, FALSE);
+                       teleport_player(10, 0L);
                        break;
 
                case RACE_HALF_ORC:
index 463422f..f0a87d9 100644 (file)
@@ -5919,7 +5919,8 @@ note = "
                        if (!who) chg_virtue(V_VALOUR, -1);
 
                        /* Teleport */
-                       teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
+                       teleport_away(c_ptr->m_idx, do_dist,
+                                               (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
 
                        /* Hack -- get new location */
                        y = m_ptr->fy;
@@ -6127,7 +6128,7 @@ msg_print("
                                        msg_print("Space warps about you!");
 #endif
 
-                                       if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
+                                       if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
                                        if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
                                        if (!one_in_(6)) break;
                                }
@@ -7091,7 +7092,7 @@ msg_print("
                        msg_print("Gravity warps around you.");
 #endif
 
-                       teleport_player(5, TRUE);
+                       teleport_player(5, TELEPORT_PASSIVE);
                        if (!p_ptr->levitation)
                                (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
                        if (!(p_ptr->resist_sound || p_ptr->levitation))
index 6caa944..e38fe29 100644 (file)
@@ -5129,7 +5129,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                                        m_ptr->hp = m_ptr->maxhp;
 
                                        /* Try to teleport away quest monsters */
-                                       if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TRUE, FALSE)) continue;
+                                       if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
                                }
                                else
                                {
@@ -6978,7 +6978,7 @@ msg_print("
                                msg_print("Space warps about you!");
 #endif
 
-                               teleport_player(damroll(10, 10), TRUE);
+                               teleport_player(damroll(10, 10), TELEPORT_PASSIVE);
                                if (randint0(13)) (*count) += activate_hi_summon(py, px, FALSE);
                                if (!one_in_(6)) break;
                        }
@@ -7381,7 +7381,7 @@ void kawarimi(bool success)
        y = py;
        x = px;
 
-       teleport_player(10 + randint1(90), FALSE);
+       teleport_player(10 + randint1(90), 0L);
 
        object_wipe(q_ptr);
 
@@ -7488,7 +7488,7 @@ bool rush_attack(bool *mdeath)
                }
 
                /* Move player before updating the monster */
-               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE, FALSE);
+               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
 
                /* Update the monster */
                update_mon(cave[ny][nx].m_idx, TRUE);
@@ -7519,14 +7519,14 @@ bool rush_attack(bool *mdeath)
 #endif
                }
 
-               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE, FALSE);
+               if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
                moved = TRUE;
                tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN);
 
                break;
        }
 
-       if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, FALSE, FALSE);
+       if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
 
        if (mdeath) *mdeath = tmp_mdeath;
        return TRUE;
index 6c98221..5850529 100644 (file)
@@ -19,7 +19,7 @@
 #define HURT_CHANCE 16
 
 
-static bool cave_monster_teleportable_bold(int m_idx, int y, int x, bool passive)
+static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode)
 {
        monster_type *m_ptr = &m_list[m_idx];
        cave_type    *c_ptr = &cave[y][x];
@@ -35,7 +35,7 @@ static bool cave_monster_teleportable_bold(int m_idx, int y, int x, bool passive
        if (is_glyph_grid(c_ptr)) return FALSE;
        if (is_explosive_rune_grid(c_ptr)) return FALSE;
 
-       if (!passive)
+       if (!(mode & TELEPORT_PASSIVE))
        {
                if (!monster_can_cross_terrain(c_ptr->feat, &r_info[m_ptr->r_idx], 0)) return FALSE;
        }
@@ -51,7 +51,7 @@ static bool cave_monster_teleportable_bold(int m_idx, int y, int x, bool passive
  *
  * But allow variation to prevent infinite loops.
  */
-bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive)
+bool teleport_away(int m_idx, int dis, u32b mode)
 {
        int oy, ox, d, i, min;
        int tries = 0;
@@ -71,7 +71,7 @@ bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive)
        /* Minimum distance */
        min = dis / 2;
 
-       if (dec_valour &&
+       if ((mode & TELEPORT_DEC_VALOUR) &&
            (((p_ptr->chp * 10) / p_ptr->mhp) > 5) &&
                (4+randint1(5) < ((p_ptr->chp * 10) / p_ptr->mhp)))
        {
@@ -101,7 +101,7 @@ bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive)
                        /* Ignore illegal locations */
                        if (!in_bounds(ny, nx)) continue;
 
-                       if (!cave_monster_teleportable_bold(m_idx, ny, nx, passive)) continue;
+                       if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
                        /* No teleporting into vaults and such */
                        if (!(p_ptr->inside_quest || p_ptr->inside_arena))
@@ -160,7 +160,7 @@ bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive)
 /*
  * Teleport monster next to a grid near the given location
  */
-void teleport_monster_to(int m_idx, int ty, int tx, int power, bool passive)
+void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode)
 {
        int ny, nx, oy, ox, d, i, min;
        int attempts = 500;
@@ -206,7 +206,7 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power, bool passive)
                        /* Ignore illegal locations */
                        if (!in_bounds(ny, nx)) continue;
 
-                       if (!cave_monster_teleportable_bold(m_idx, ny, nx, passive)) continue;
+                       if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
                        /* No teleporting into vaults and such */
                        /* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
@@ -254,7 +254,7 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power, bool passive)
 }
 
 
-bool cave_player_teleportable_bold(int y, int x, bool passive, bool nonmagical)
+bool cave_player_teleportable_bold(int y, int x, u32b mode)
 {
        cave_type    *c_ptr = &cave[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -263,11 +263,11 @@ bool cave_player_teleportable_bold(int y, int x, bool passive, bool nonmagical)
        if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) return FALSE;
 
        /* No magical teleporting into vaults and such */
-       if (!nonmagical && (c_ptr->info & CAVE_ICKY)) return FALSE;
+       if (!(mode & TELEPORT_NONMAGICAL) && (c_ptr->info & CAVE_ICKY)) return FALSE;
 
        if (c_ptr->m_idx && (c_ptr->m_idx != p_ptr->riding)) return FALSE;
 
-       if (!passive)
+       if (!(mode & TELEPORT_PASSIVE))
        {
                if (!player_can_enter(c_ptr->feat, 0)) return FALSE;
 
@@ -314,7 +314,7 @@ bool cave_player_teleportable_bold(int y, int x, bool passive, bool nonmagical)
 
 #define MAX_TELEPORT_DISTANCE 200
 
-bool teleport_player_aux(int dis, bool passive, bool nonmagical)
+bool teleport_player_aux(int dis, u32b mode)
 {
        int candidates_at[MAX_TELEPORT_DISTANCE + 1];
        int total_candidates, cur_candidates;
@@ -327,7 +327,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
 
        if (p_ptr->wild_mode) return FALSE;
 
-       if (p_ptr->anti_tele && !nonmagical)
+       if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
 #ifdef JP
                msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
@@ -354,7 +354,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
                        int d;
 
                        /* Skip illegal locations */
-                       if (!cave_player_teleportable_bold(y, x, passive, nonmagical)) continue;
+                       if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
                        d = distance(py, px, y, x);
@@ -393,7 +393,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
                        int d;
 
                        /* Skip illegal locations */
-                       if (!cave_player_teleportable_bold(y, x, passive, nonmagical)) continue;
+                       if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
                        d = distance(py, px, y, x);
@@ -429,7 +429,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
        return TRUE;
 }
 
-void teleport_player(int dis, bool passive)
+void teleport_player(int dis, u32b mode)
 {
        int yy, xx;
 
@@ -437,7 +437,7 @@ void teleport_player(int dis, bool passive)
        int oy = py;
        int ox = px;
 
-       if (!teleport_player_aux(dis, passive, FALSE)) return;
+       if (!teleport_player_aux(dis, mode)) return;
 
        /* Monsters with teleport ability may follow the player */
        for (xx = -1; xx < 2; xx++)
@@ -459,7 +459,7 @@ void teleport_player(int dis, bool passive)
                                if ((r_ptr->flags6 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, FALSE);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
                                }
                        }
                }
@@ -475,7 +475,7 @@ void teleport_player_away(int m_idx, int dis)
        int oy = py;
        int ox = px;
 
-       if (!teleport_player_aux(dis, TRUE, FALSE)) return;
+       if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
 
        /* Monsters with teleport ability may follow the player */
        for (xx = -1; xx < 2; xx++)
@@ -497,7 +497,7 @@ void teleport_player_away(int m_idx, int dis)
                                if ((r_ptr->flags6 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, FALSE);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
                                }
                        }
                }
@@ -511,11 +511,11 @@ void teleport_player_away(int m_idx, int dis)
  * This function is slightly obsessive about correctness.
  * This function allows teleporting into vaults (!)
  */
-void teleport_player_to(int ny, int nx, bool no_tele, bool passive)
+void teleport_player_to(int ny, int nx, u32b mode)
 {
        int y, x, dis = 0, ctr = 0;
 
-       if (p_ptr->anti_tele && no_tele)
+       if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
 #ifdef JP
                msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
@@ -538,10 +538,10 @@ void teleport_player_to(int ny, int nx, bool no_tele, bool passive)
                }
 
                /* Accept any grid when wizard mode */
-               if (p_ptr->wizard && !passive && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
+               if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
 
                /* Accept teleportable floor grids */
-               if (cave_player_teleportable_bold(y, x, passive, !no_tele)) break;
+               if (cave_player_teleportable_bold(y, x, mode)) break;
 
                /* Occasionally advance the distance */
                if (++ctr > (4 * dis * dis + 4 * dis + 1))
@@ -567,7 +567,7 @@ void teleport_away_followable(int m_idx)
        bool         old_ml = m_ptr->ml;
        int          old_cdis = m_ptr->cdis;
 
-       teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE, FALSE);
+       teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
 
        if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && los(py, px, oldfy, oldfx))
        {
@@ -605,14 +605,14 @@ void teleport_away_followable(int m_idx)
                        {
                                if (one_in_(3))
                                {
-                                       teleport_player(200, TRUE);
+                                       teleport_player(200, TELEPORT_PASSIVE);
 #ifdef JP
                                        msg_print("¼ºÇÔ¡ª");
 #else
                                        msg_print("Failed!");
 #endif
                                }
-                               else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, FALSE);
+                               else teleport_player_to(m_ptr->fy, m_ptr->fx, 0L);
                                p_ptr->energy_need += ENERGY_NEED();
                        }
                }
@@ -1204,13 +1204,13 @@ void apply_nexus(monster_type *m_ptr)
        {
                case 1: case 2: case 3:
                {
-                       teleport_player(200, TRUE);
+                       teleport_player(200, TELEPORT_PASSIVE);
                        break;
                }
 
                case 4: case 5:
                {
-                       teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, TRUE);
+                       teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
                        break;
                }
 
@@ -5506,19 +5506,19 @@ static bool dimension_door_aux(int x, int y)
 
        p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
 
-       if (!cave_player_teleportable_bold(y, x, FALSE, FALSE) ||
+       if (!cave_player_teleportable_bold(y, x, 0L) ||
            (distance(y, x, py, px) > plev / 2 + 10) ||
            (!randint0(plev / 10 + 10)))
        {
                p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
-               teleport_player((plev + 2) * 2, TRUE);
+               teleport_player((plev + 2) * 2, TELEPORT_PASSIVE);
 
                /* Failed */
                return FALSE;
        }
        else
        {
-               teleport_player_to(y, x, TRUE, FALSE);
+               teleport_player_to(y, x, 0L);
 
                /* Success */
                return TRUE;
index 627b5af..b998c35 100644 (file)
@@ -108,7 +108,7 @@ static bool wiz_dimension_door(void)
 
        if (!tgt_pt(&x, &y)) return FALSE;
 
-       teleport_player_to(y, x, FALSE, FALSE);
+       teleport_player_to(y, x, TELEPORT_NONMAGICAL);
 
        return (TRUE);
 }
@@ -339,7 +339,7 @@ static void do_cmd_wiz_bamf(void)
        if (!target_who) return;
 
        /* Teleport to the target */
-       teleport_player_to(target_row, target_col, FALSE, FALSE);
+       teleport_player_to(target_row, target_col, TELEPORT_NONMAGICAL);
 }
 
 
@@ -2021,7 +2021,7 @@ void do_cmd_debug(void)
 
        /* Phase Door */
        case 'p':
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                break;
 
 #if 0
@@ -2065,7 +2065,7 @@ void do_cmd_debug(void)
 
        /* Teleport */
        case 't':
-               teleport_player(100, FALSE);
+               teleport_player(100, 0L);
                break;
 
        /* Very Good Objects */