すいようにu32b mode引数でフラグを渡すように変更.
msg_print("It twists space around you...");
#endif
- teleport_player(100, FALSE);
+ teleport_player(100, 0L);
o_ptr->timeout = 45;
break;
}
msg_print("You hit a teleport trap!");
#endif
- teleport_player(100, TRUE);
+ teleport_player(100, TELEPORT_PASSIVE);
break;
}
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;
}
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:
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("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
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;
}
case SV_STAFF_TELEPORTATION:
{
- teleport_player(100, FALSE);
+ teleport_player(100, 0L);
ident = TRUE;
break;
}
msg_print("Your cloak twists space around you...");
#endif
- teleport_player(100, FALSE);
+ teleport_player(100, 0L);
o_ptr->timeout = 45;
break;
}
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();
case ART_KAMUI:
{
- teleport_player(222, FALSE);
+ teleport_player(222, 0L);
o_ptr->timeout = 25;
break;
}
if (o_ptr->name2 == EGO_TRUMP)
{
- teleport_player(100, FALSE);
+ teleport_player(100, 0L);
o_ptr->timeout = 50 + randint1(50);
/* Window stuff */
if (o_ptr->name2 == EGO_JUMP)
{
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
o_ptr->timeout = 10 + randint1(10);
/* Window stuff */
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:
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 */
#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
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:
msg_print("It's a teleport trump card.");
#endif
- teleport_player(10, TRUE);
+ teleport_player(10, TELEPORT_PASSIVE);
}
else if (die < 42)
{
msg_print("It's a teleport trump card.");
#endif
- teleport_player(100, TRUE);
+ teleport_player(100, TELEPORT_PASSIVE);
}
else if (die < 52)
{
msg_print("It's a teleport trump card.");
#endif
- teleport_player(200, TRUE);
+ teleport_player(200, TELEPORT_PASSIVE);
}
else if (die < 60)
{
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
if (cast)
{
- teleport_player(range, FALSE);
+ teleport_player(range, 0L);
}
}
break;
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))
{
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;
#else
else if (get_check("Normal teleport? "))
#endif
-
{
- teleport_player(200, FALSE);
+ teleport_player(200, 0L);
return;
}
else
#endif
msg_print(NULL);
- teleport_player(40, TRUE);
+ teleport_player(40, TELEPORT_PASSIVE);
}
}
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("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
#endif
{
disturb(0, 0);
- teleport_player(50, FALSE);
+ teleport_player(50, 0L);
}
else
{
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))
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);
(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;
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:
if (is_mirror_grid(&cave[py][px]))
{
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
}
}
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);
}
mon_fight = TRUE;
}
- teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE, FALSE);
+ teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
}
return TRUE;
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 */
break;
/* warped mirror */
case 3:
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
break;
/* mirror of light */
case 4:
break;
/* mirror of wandering */
case 5:
- teleport_player(plev * 5, FALSE);
+ teleport_player(plev * 5, 0L);
break;
/* robe of dust */
case 6:
break;
case 2:
{
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
break;
}
case 3:
}
case 4:
{
- teleport_player(p_ptr->lev * 5, FALSE);
+ teleport_player(p_ptr->lev * 5, 0L);
break;
}
case 5:
#endif
else
{
- teleport_player(30, FALSE);
+ teleport_player(30, 0L);
}
}
else
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:
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:
{
#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)
{
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;
}
#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
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);
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;
}
}
- teleport_away(m_idx, 10, FALSE, FALSE);
+ teleport_away(m_idx, 10, 0L);
break;
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
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);
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;
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;
(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;
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:
msg_print("You concentrate...");
#endif
- teleport_player(10 + 4 * lvl, FALSE);
+ teleport_player(10 + 4 * lvl, 0L);
break;
case MUT1_MIND_BLST:
break;
case MUT1_BLINK:
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
break;
case MUT1_EAT_ROCK:
#else
msg_print("You failed to teleport.");
#endif
- else teleport_player(30, FALSE);
+ else teleport_player(30, 0L);
}
else
{
#else
msg_print("You are failed to run away.");
#endif
- else teleport_player(30, FALSE);
+ else teleport_player(30, 0L);
}
else
{
msg_print("Blink!");
#endif
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
break;
case RACE_HALF_ORC:
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;
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;
}
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))
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
{
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;
}
y = py;
x = px;
- teleport_player(10 + randint1(90), FALSE);
+ teleport_player(10 + randint1(90), 0L);
object_wipe(q_ptr);
}
/* 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);
#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;
#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];
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;
}
*
* 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;
/* 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)))
{
/* 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))
/*
* 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;
/* 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; */
}
-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];
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;
#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;
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("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
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);
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);
return TRUE;
}
-void teleport_player(int dis, bool passive)
+void teleport_player(int dis, u32b mode)
{
int yy, xx;
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++)
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);
}
}
}
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++)
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);
}
}
}
* 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("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
}
/* 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))
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))
{
{
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();
}
}
{
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;
}
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;
if (!tgt_pt(&x, &y)) return FALSE;
- teleport_player_to(y, x, FALSE, FALSE);
+ teleport_player_to(y, x, TELEPORT_NONMAGICAL);
return (TRUE);
}
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);
}
/* Phase Door */
case 'p':
- teleport_player(10, FALSE);
+ teleport_player(10, 0L);
break;
#if 0
/* Teleport */
case 't':
- teleport_player(100, FALSE);
+ teleport_player(100, 0L);
break;
/* Very Good Objects */