case ACT_TELEPORT:
{
msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
- teleport_player(user_ptr, 100, 0L);
+ teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
break;
}
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);
case ACT_PHASE_DOOR:
{
- teleport_player(user_ptr, 10, 0L);
+ teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
break;
}
/* 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)
(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);
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;
}
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);
}
}
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);
}
}
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;
}
else if (get_check(_("通常テレポート?", "Normal teleport? ")))
{
- teleport_player(creature_ptr, 200, 0L);
+ teleport_player(creature_ptr, 200, TELEPORT_SPONTANEOUS);
return;
}
else
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
{
#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"
* @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];
* @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];
* included in all such copies.
*/
+#include "spell/spells-util.h"
/*
* A single "grid" in a Cave
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
{
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 */
break;
/* warped mirror */
case 3:
- teleport_player(caster_ptr, 10, 0L);
+ teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
break;
/* mirror of light */
case 4:
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:
break;
case 2:
{
- teleport_player(caster_ptr, 10, 0L);
+ teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
break;
}
case 3:
}
case 4:
{
- teleport_player(caster_ptr, caster_ptr->lev * 5, 0L);
+ teleport_player(caster_ptr, caster_ptr->lev * 5, TELEPORT_SPONTANEOUS);
break;
}
case 5:
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:
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:
{
(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);
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);
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;
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)
{
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:
break;
case MUT1_BLINK:
- teleport_player(creature_ptr, 10, 0L);
+ teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
break;
case MUT1_EAT_ROCK:
case RACE_GNOME:
msg_print(_("パッ!", "Blink!"));
- teleport_player(creature_ptr, 10, 0L);
+ teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
break;
case RACE_HALF_ORC:
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
{
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;
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;
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))
{
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;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
if (cast)
{
- teleport_player(caster_ptr, range, 0L);
+ teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
#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,
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;
#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);
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);
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));
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;
}
* 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;
* @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;
* 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))
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);
}
}
}
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);
}
}
}
* 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))
{
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;
}
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();
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)))
{
return FALSE;
}
- teleport_player_to(caster_ptr, y, x, 0L);
+ teleport_player_to(caster_ptr, y, x, TELEPORT_SPONTANEOUS);
return TRUE;
}
/* Phase Door */
case 'p':
- teleport_player(creature_ptr, 10, 0L);
+ teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
break;
/* Take a Quests */
/* Teleport */
case 't':
- teleport_player(creature_ptr, 100, 0L);
+ teleport_player(creature_ptr, 100, TELEPORT_SPONTANEOUS);
break;
/* Game Time Setting */