<ClCompile Include="..\..\src\spell-kind\spells-equipment.c" />\r
<ClCompile Include="..\..\src\spell-kind\spells-fetcher.c" />\r
<ClCompile Include="..\..\src\spell-kind\spells-polymorph.c" />\r
+ <ClCompile Include="..\..\src\spell-kind\spells-world.c" />\r
<ClCompile Include="..\..\src\spell-realm\spells-craft.c" />\r
<ClCompile Include="..\..\src\spell-realm\spells-demon.c" />\r
<ClCompile Include="..\..\src\spell-realm\spells-sorcery.c" />\r
<ClInclude Include="..\..\src\spell-kind\spells-equipment.h" />\r
<ClInclude Include="..\..\src\spell-kind\spells-fetcher.h" />\r
<ClInclude Include="..\..\src\spell-kind\spells-polymorph.h" />\r
+ <ClInclude Include="..\..\src\spell-kind\spells-world.h" />\r
<ClInclude Include="..\..\src\spell-realm\spells-craft.h" />\r
<ClInclude Include="..\..\src\spell-realm\spells-demon.h" />\r
<ClInclude Include="..\..\src\spell-realm\spells-sorcery.h" />\r
<ClCompile Include="..\..\src\spell-kind\blood-curse.c">
<Filter>spell-kind</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\spell-kind\spells-world.c">
+ <Filter>spell-kind</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\spell-kind\blood-curse.h">
<Filter>spell-kind</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\spell-kind\spells-world.h">
+ <Filter>spell-kind</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
spell-kind/spells-sight.c spell-kind/spells-sight.h \
spell-kind/spells-specific-bolt.c spell-kind/spells-specific-bolt.h \
spell-kind/spells-teleport.c spell-kind/spells-teleport.h \
+ spell-kind/spells-world.c spell-kind/spells-world.h \
\
spell-realm/spells-chaos.c spell-realm/spells-chaos.h \
spell-realm/spells-craft.c spell-realm/spells-craft.h \
#include "spell-kind/spells-lite.h"
#include "spell-kind/spells-neighbor.h"
#include "spell-kind/spells-sight.h"
+#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spells-status.h"
#include "spell/spells-summon.h"
-#include "spell-kind/spells-teleport.h"
#include "spell/spell-types.h"
#include "status/bad-status-setter.h"
#include "status/body-improvement.h"
#include "player/player-status.h"
#include "spell-kind/spells-perception.h"
#include "spell-kind/spells-recall.h"
-#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spells-status.h"
#include "system/building-type-definition.h"
#include "term/screen-processor.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-specific-bolt.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell-realm/spells-sorcery.h"
#include "spell/process-effect.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell/spell-types.h"
#include "spell/spells-object.h"
#include "spell/spells-status.h"
#include "spell/spells-summon.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-types.h"
#include "spell/spells3.h"
#include "status/bad-status-setter.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell/spells-object.h"
#include "spell/spells-status.h"
#include "spell/spell-types.h"
-#include "spell/spells3.h"
#include "status/experience.h"
#include "term/screen-processor.h"
#include "util/int-char-converter.h"
#include "spell-kind/spells-neighbor.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-types.h"
#include "view/display-messages.h"
#include "player/player-race.h"
#include "player/special-defense-types.h"
#include "realm/realm-song-numbers.h"
-#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell/process-effect.h"
#include "spell/range-calc.h"
#include "pet/pet-util.h"
#include "player/player-class.h"
#include "player/player-move.h"
-#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell/range-calc.h"
#include "spell/spell-types.h"
#include "spell-kind/spells-neighbor.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-info.h"
#include "spell/spell-types.h"
#include "spell/spells-status.h"
#include "spell-kind/spells-lite.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-hex.h"
#include "spell/spell-types.h"
#include "spell/spells-summon.h"
-#include "spell/spells3.h"
#include "status/bad-status-setter.h"
#include "status/base-status.h"
#include "status/body-improvement.h"
#include "spell-kind/spells-perception.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-types.h"
#include "spell/spells-diceroll.h"
#include "spell/spells-object.h"
#include "spell-kind/spells-lite.h"
#include "spell-kind/spells-neighbor.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-chaos.h"
#include "spell/spells-object.h"
#include "spell/spells-status.h"
#include "spell-kind/spells-perception.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-sight.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-types.h"
#include "spell/spells-status.h"
-#include "spell/spells3.h"
#include "status/bad-status-setter.h"
#include "status/buff-setter.h"
#include "status/element-resistance.h"
#include "spell-kind/spells-lite.h"
#include "spell-kind/spells-neighbor.h"
#include "spell-kind/spells-sight.h"
+#include "spell-kind/spells-world.h"
#include "spell/spells-status.h"
#include "spell/spell-types.h"
-#include "spell/spells3.h"
#include "status/experience.h"
#include "view/display-messages.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-sorcery.h"
#include "spell/spells-status.h"
#include "spell/spell-types.h"
#include "spell-kind/spells-recall.h"
#include "spell-kind/spells-sight.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell-realm/spells-trump.h"
#include "spell/spell-types.h"
#include "spell/spells-object.h"
/*!
- * todo 少し長いかも
* @brief テレポート魔法全般
* @date 2020/06/04
* @author Hourier
*/
#include "spell-kind/spells-teleport.h"
-#include "cmd-io/cmd-save.h"
#include "core/asking-player.h"
#include "core/speed-table.h"
-#include "dungeon/dungeon.h"
-#include "dungeon/quest.h"
#include "effect/effect-characteristics.h"
-#include "game-option/birth-options.h"
-#include "game-option/play-record-options.h"
-#include "game-option/special-options.h"
#include "grid/grid.h"
#include "inventory/inventory-slot-types.h"
#include "io/targeting.h"
-#include "io/write-diary.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
#include "monster-floor/monster-move.h"
-#include "monster-floor/monster-remover.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags-ability2.h"
#include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
#include "monster-race/race-flags7.h"
-#include "monster/monster-describer.h"
-#include "monster/monster-description-types.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/smart-learn-types.h"
#include "mutation/mutation-flag-types.h"
#include "object-enchant/tr-types.h"
#include "object-hook/hook-checker.h"
tracer_ptr->energy_need += ENERGY_NEED();
}
-bool teleport_level_other(player_type *caster_ptr)
-{
- if (!target_set(caster_ptr, TARGET_KILL))
- return FALSE;
- MONSTER_IDX target_m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
- if (!target_m_idx)
- return TRUE;
- if (!player_has_los_bold(caster_ptr, target_row, target_col))
- return TRUE;
- if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col))
- return TRUE;
-
- monster_type *m_ptr;
- monster_race *r_ptr;
- m_ptr = &caster_ptr->current_floor_ptr->m_list[target_m_idx];
- r_ptr = &r_info[m_ptr->r_idx];
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(caster_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
-
- if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) || (r_ptr->flags1 & RF1_QUESTOR)
- || (r_ptr->level + randint1(50) > caster_ptr->lev + randint1(60))) {
- msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
- } else {
- teleport_level(caster_ptr, target_m_idx);
- }
-
- return TRUE;
-}
-
-/*!
- * todo cmd-save.h への依存あり。コールバックで何とかしたい
- * @brief プレイヤー及びモンスターをレベルテレポートさせる /
- * Teleport the player one level up or down (random when legal)
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
- * @return なし
- */
-void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
-{
- GAME_TEXT m_name[160];
- bool see_m = TRUE;
- if (m_idx <= 0) {
- strcpy(m_name, _("あなた", "you"));
- } else {
- monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
- monster_desc(creature_ptr, m_name, m_ptr, 0);
- see_m = is_seen(creature_ptr, m_ptr);
- }
-
- if (is_teleport_level_ineffective(creature_ptr, m_idx)) {
- if (see_m)
- msg_print(_("効果がなかった。", "There is no effect."));
- return;
- }
-
- if ((m_idx <= 0) && creature_ptr->anti_tele) {
- msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
- return;
- }
-
- bool go_up;
- if (randint0(100) < 50)
- go_up = TRUE;
- else
- go_up = FALSE;
-
- if ((m_idx <= 0) && current_world_ptr->wizard) {
- if (get_check("Force to go up? "))
- go_up = TRUE;
- else if (get_check("Force to go down? "))
- go_up = FALSE;
- }
-
- if ((ironman_downward && (m_idx <= 0)) || (creature_ptr->current_floor_ptr->dun_level <= d_info[creature_ptr->dungeon_idx].mindepth)) {
-#ifdef JP
- if (see_m)
- msg_format("%^sは床を突き破って沈んでいく。", m_name);
-#else
- if (see_m)
- msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
-#endif
- if (m_idx <= 0) {
- if (!creature_ptr->current_floor_ptr->dun_level) {
- creature_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : creature_ptr->recall_dungeon;
- creature_ptr->oldpy = creature_ptr->y;
- creature_ptr->oldpx = creature_ptr->x;
- }
-
- if (record_stair)
- exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, 1, NULL);
-
- if (autosave_l)
- do_cmd_save_game(creature_ptr, TRUE);
-
- if (!creature_ptr->current_floor_ptr->dun_level) {
- creature_ptr->current_floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].mindepth;
- prepare_change_floor_mode(creature_ptr, CFM_RAND_PLACE);
- } else {
- prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
- }
-
- creature_ptr->leaving = TRUE;
- }
- } else if (quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level)
- || (creature_ptr->current_floor_ptr->dun_level >= d_info[creature_ptr->dungeon_idx].maxdepth)) {
-#ifdef JP
- if (see_m)
- msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
-#else
- if (see_m)
- msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
-#endif
-
- if (m_idx <= 0) {
- if (record_stair)
- exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
-
- if (autosave_l)
- do_cmd_save_game(creature_ptr, TRUE);
-
- prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-
- leave_quest_check(creature_ptr);
- creature_ptr->current_floor_ptr->inside_quest = 0;
- creature_ptr->leaving = TRUE;
- }
- } else if (go_up) {
-#ifdef JP
- if (see_m)
- msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
-#else
- if (see_m)
- msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
-#endif
-
- if (m_idx <= 0) {
- if (record_stair)
- exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
-
- if (autosave_l)
- do_cmd_save_game(creature_ptr, TRUE);
-
- prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
- creature_ptr->leaving = TRUE;
- }
- } else {
-#ifdef JP
- if (see_m)
- msg_format("%^sは床を突き破って沈んでいく。", m_name);
-#else
- if (see_m)
- msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
-#endif
-
- if (m_idx <= 0) {
- if (record_stair)
- exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, 1, NULL);
- if (autosave_l)
- do_cmd_save_game(creature_ptr, TRUE);
-
- prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
- creature_ptr->leaving = TRUE;
- }
- }
-
- if (m_idx <= 0) {
- sound(SOUND_TPLEVEL);
- return;
- }
-
- monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
- check_quest_completion(creature_ptr, m_ptr);
- if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) {
- char m2_name[MAX_NLEN];
-
- monster_desc(creature_ptr, m2_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
- }
-
- delete_monster_idx(creature_ptr, m_idx);
- sound(SOUND_TPLEVEL);
-}
-
-/*!
- * todo 変数名が実態と合っているかどうかは要確認
- * テレポート・レベルが効かないモンスターであるかどうかを判定する
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @param idx テレポート・レベル対象のモンスター
- */
-bool is_teleport_level_ineffective(player_type *caster_ptr, MONSTER_IDX idx)
-{
- floor_type *floor_ptr = caster_ptr->current_floor_ptr;
- bool is_special_floor
- = floor_ptr->inside_arena || caster_ptr->phase_out || (floor_ptr->inside_quest && !random_quest_number(caster_ptr, floor_ptr->dun_level));
- bool is_invalid_floor = idx <= 0;
- is_invalid_floor &= quest_number(caster_ptr, floor_ptr->dun_level) || (floor_ptr->dun_level >= d_info[caster_ptr->dungeon_idx].maxdepth);
- is_invalid_floor &= caster_ptr->current_floor_ptr->dun_level >= 1;
- is_invalid_floor &= ironman_downward;
- return is_special_floor || is_invalid_floor;
-}
-
/*!
* @brief 次元の扉処理 /
* Dimension Door
void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION dis, bool is_quantum_effect);
void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, teleport_flags mode);
void teleport_away_followable(player_type *creature_ptr, MONSTER_IDX m_idx);
-bool teleport_level_other(player_type *caster_ptr);
-void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx);
-bool tele_town(player_type *caster_ptr);
-bool is_teleport_level_ineffective(player_type *caster_ptr, MONSTER_IDX idx);
bool dimension_door(player_type *caster_ptr);
bool exe_dimension_door(player_type *caster_ptr, POSITION x, POSITION y);
--- /dev/null
+#include "spell-kind/spells-world.h"
+#include "cmd-io/cmd-save.h"
+#include "core/asking-player.h"
+#include "dungeon/dungeon.h"
+#include "dungeon/quest.h"
+#include "floor/floor-town.h"
+#include "floor/floor.h"
+#include "floor/geometry.h"
+#include "floor/wild.h"
+#include "game-option/birth-options.h"
+#include "game-option/play-record-options.h"
+#include "game-option/special-options.h"
+#include "grid/grid.h"
+#include "io/input-key-acceptor.h"
+#include "io/targeting.h"
+#include "io/write-diary.h"
+#include "main/sound-definitions-table.h"
+#include "main/sound-of-music.h"
+#include "market/building-util.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags-resistance.h"
+#include "monster-race/race-flags1.h"
+#include "monster/monster-describer.h"
+#include "monster/monster-description-types.h"
+#include "monster/monster-info.h"
+#include "monster-floor/monster-remover.h"
+#include "system/monster-type-definition.h"
+#include "term/screen-processor.h"
+#include "util/int-char-converter.h"
+#include "view/display-messages.h"
+#include "world/world.h"
+
+/*!
+ * todo 変数名が実態と合っているかどうかは要確認
+ * テレポート・レベルが効かないモンスターであるかどうかを判定する
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param idx テレポート・レベル対象のモンスター
+ */
+bool is_teleport_level_ineffective(player_type *caster_ptr, MONSTER_IDX idx)
+{
+ floor_type *floor_ptr = caster_ptr->current_floor_ptr;
+ bool is_special_floor
+ = floor_ptr->inside_arena || caster_ptr->phase_out || (floor_ptr->inside_quest && !random_quest_number(caster_ptr, floor_ptr->dun_level));
+ bool is_invalid_floor = idx <= 0;
+ is_invalid_floor &= quest_number(caster_ptr, floor_ptr->dun_level) || (floor_ptr->dun_level >= d_info[caster_ptr->dungeon_idx].maxdepth);
+ is_invalid_floor &= caster_ptr->current_floor_ptr->dun_level >= 1;
+ is_invalid_floor &= ironman_downward;
+ return is_special_floor || is_invalid_floor;
+}
+
+/*!
+ * todo cmd-save.h への依存あり。コールバックで何とかしたい
+ * @brief プレイヤー及びモンスターをレベルテレポートさせる /
+ * Teleport the player one level up or down (random when legal)
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
+ * @return なし
+ */
+void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
+{
+ GAME_TEXT m_name[160];
+ bool see_m = TRUE;
+ if (m_idx <= 0) {
+ strcpy(m_name, _("あなた", "you"));
+ } else {
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
+ monster_desc(creature_ptr, m_name, m_ptr, 0);
+ see_m = is_seen(creature_ptr, m_ptr);
+ }
+
+ if (is_teleport_level_ineffective(creature_ptr, m_idx)) {
+ if (see_m)
+ msg_print(_("効果がなかった。", "There is no effect."));
+ return;
+ }
+
+ if ((m_idx <= 0) && creature_ptr->anti_tele) {
+ msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
+ return;
+ }
+
+ bool go_up;
+ if (randint0(100) < 50)
+ go_up = TRUE;
+ else
+ go_up = FALSE;
+
+ if ((m_idx <= 0) && current_world_ptr->wizard) {
+ if (get_check("Force to go up? "))
+ go_up = TRUE;
+ else if (get_check("Force to go down? "))
+ go_up = FALSE;
+ }
+
+ if ((ironman_downward && (m_idx <= 0)) || (creature_ptr->current_floor_ptr->dun_level <= d_info[creature_ptr->dungeon_idx].mindepth)) {
+#ifdef JP
+ if (see_m)
+ msg_format("%^sは床を突き破って沈んでいく。", m_name);
+#else
+ if (see_m)
+ msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
+#endif
+ if (m_idx <= 0) {
+ if (!creature_ptr->current_floor_ptr->dun_level) {
+ creature_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : creature_ptr->recall_dungeon;
+ creature_ptr->oldpy = creature_ptr->y;
+ creature_ptr->oldpx = creature_ptr->x;
+ }
+
+ if (record_stair)
+ exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, 1, NULL);
+
+ if (autosave_l)
+ do_cmd_save_game(creature_ptr, TRUE);
+
+ if (!creature_ptr->current_floor_ptr->dun_level) {
+ creature_ptr->current_floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].mindepth;
+ prepare_change_floor_mode(creature_ptr, CFM_RAND_PLACE);
+ } else {
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+ }
+
+ creature_ptr->leaving = TRUE;
+ }
+ } else if (quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level)
+ || (creature_ptr->current_floor_ptr->dun_level >= d_info[creature_ptr->dungeon_idx].maxdepth)) {
+#ifdef JP
+ if (see_m)
+ msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
+#else
+ if (see_m)
+ msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
+#endif
+
+ if (m_idx <= 0) {
+ if (record_stair)
+ exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
+
+ if (autosave_l)
+ do_cmd_save_game(creature_ptr, TRUE);
+
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+
+ leave_quest_check(creature_ptr);
+ creature_ptr->current_floor_ptr->inside_quest = 0;
+ creature_ptr->leaving = TRUE;
+ }
+ } else if (go_up) {
+#ifdef JP
+ if (see_m)
+ msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
+#else
+ if (see_m)
+ msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
+#endif
+
+ if (m_idx <= 0) {
+ if (record_stair)
+ exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
+
+ if (autosave_l)
+ do_cmd_save_game(creature_ptr, TRUE);
+
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+ creature_ptr->leaving = TRUE;
+ }
+ } else {
+#ifdef JP
+ if (see_m)
+ msg_format("%^sは床を突き破って沈んでいく。", m_name);
+#else
+ if (see_m)
+ msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
+#endif
+
+ if (m_idx <= 0) {
+ if (record_stair)
+ exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, 1, NULL);
+ if (autosave_l)
+ do_cmd_save_game(creature_ptr, TRUE);
+
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+ creature_ptr->leaving = TRUE;
+ }
+ }
+
+ if (m_idx <= 0) {
+ sound(SOUND_TPLEVEL);
+ return;
+ }
+
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
+ check_quest_completion(creature_ptr, m_ptr);
+ if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) {
+ char m2_name[MAX_NLEN];
+
+ monster_desc(creature_ptr, m2_name, m_ptr, MD_INDEF_VISIBLE);
+ exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
+ }
+
+ delete_monster_idx(creature_ptr, m_idx);
+ sound(SOUND_TPLEVEL);
+}
+
+bool teleport_level_other(player_type *caster_ptr)
+{
+ if (!target_set(caster_ptr, TARGET_KILL))
+ return FALSE;
+ MONSTER_IDX target_m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ if (!target_m_idx)
+ return TRUE;
+ if (!player_has_los_bold(caster_ptr, target_row, target_col))
+ return TRUE;
+ if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col))
+ return TRUE;
+
+ monster_type *m_ptr;
+ monster_race *r_ptr;
+ m_ptr = &caster_ptr->current_floor_ptr->m_list[target_m_idx];
+ r_ptr = &r_info[m_ptr->r_idx];
+ GAME_TEXT m_name[MAX_NLEN];
+ monster_desc(caster_ptr, m_name, m_ptr, 0);
+ msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
+
+ if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) || (r_ptr->flags1 & RF1_QUESTOR)
+ || (r_ptr->level + randint1(50) > caster_ptr->lev + randint1(60))) {
+ msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
+ } else {
+ teleport_level(caster_ptr, target_m_idx);
+ }
+
+ return TRUE;
+}
+
+/*!
+ * @brief 町間のテレポートを行うメインルーチン
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @return テレポート処理を決定したか否か
+ */
+bool tele_town(player_type *caster_ptr)
+{
+ if (caster_ptr->current_floor_ptr->dun_level) {
+ msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!"));
+ return FALSE;
+ }
+
+ if (caster_ptr->current_floor_ptr->inside_arena || caster_ptr->phase_out) {
+ msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!"));
+ return FALSE;
+ }
+
+ screen_save();
+ clear_bldg(4, 10);
+
+ int i;
+ int num = 0;
+ for (i = 1; i < max_towns; i++) {
+ char buf[80];
+
+ if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == caster_ptr->town_num) || !(caster_ptr->visit & (1L << (i - 1))))
+ continue;
+
+ sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
+ prt(buf, 5 + i, 5);
+ num++;
+ }
+
+ if (num == 0) {
+ msg_print(_("まだ行けるところがない。", "You have not yet visited any town."));
+ msg_print(NULL);
+ screen_load();
+ return FALSE;
+ }
+
+ prt(_("どこに行きますか:", "Where do you want to go: "), 0, 0);
+ while (TRUE) {
+ i = inkey();
+
+ if (i == ESCAPE) {
+ screen_load();
+ return FALSE;
+ }
+
+ else if ((i < 'a') || (i > ('a' + max_towns - 2)))
+ continue;
+ else if (((i - 'a' + 1) == caster_ptr->town_num) || ((i - 'a' + 1) == NO_TOWN) || ((i - 'a' + 1) == SECRET_TOWN)
+ || !(caster_ptr->visit & (1L << (i - 'a'))))
+ continue;
+ break;
+ }
+
+ for (POSITION y = 0; y < current_world_ptr->max_wild_y; y++) {
+ for (POSITION x = 0; x < current_world_ptr->max_wild_x; x++) {
+ if (wilderness[y][x].town == (i - 'a' + 1)) {
+ caster_ptr->wilderness_y = y;
+ caster_ptr->wilderness_x = x;
+ }
+ }
+ }
+
+ caster_ptr->leaving = TRUE;
+ caster_ptr->leave_bldg = TRUE;
+ caster_ptr->teleport_town = TRUE;
+ screen_load();
+ return TRUE;
+}
+
+/*!
+ * @brief 現実変容処理
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @return なし
+ */
+void reserve_alter_reality(player_type *caster_ptr)
+{
+ if (caster_ptr->current_floor_ptr->inside_arena || ironman_downward) {
+ msg_print(_("何も起こらなかった。", "Nothing happens."));
+ return;
+ }
+
+ if (caster_ptr->alter_reality) {
+ caster_ptr->alter_reality = 0;
+ msg_print(_("景色が元に戻った...", "The view around you returns to normal..."));
+ caster_ptr->redraw |= PR_STATUS;
+ return;
+ }
+
+ TIME_EFFECT turns = randint0(21) + 15;
+ caster_ptr->alter_reality = turns;
+ msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
+ caster_ptr->redraw |= PR_STATUS;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx);
+bool teleport_level_other(player_type *caster_ptr);
+bool tele_town(player_type *caster_ptr);
+void reserve_alter_reality(player_type *caster_ptr);
+bool is_teleport_level_ineffective(player_type *caster_ptr, MONSTER_IDX idx);
#include "player/player-status.h"
#include "spell-kind/spells-launcher.h"
#include "spell-kind/spells-teleport.h"
+#include "spell-kind/spells-world.h"
#include "spell/spell-types.h"
#include "status/bad-status-setter.h"
#include "status/base-status.h"
#include "world/world.h"
/*!
- * @brief 現実変容処理
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void reserve_alter_reality(player_type *caster_ptr)
-{
- if (caster_ptr->current_floor_ptr->inside_arena || ironman_downward) {
- msg_print(_("何も起こらなかった。", "Nothing happens."));
- return;
- }
-
- if (caster_ptr->alter_reality) {
- caster_ptr->alter_reality = 0;
- msg_print(_("景色が元に戻った...", "The view around you returns to normal..."));
- caster_ptr->redraw |= PR_STATUS;
- return;
- }
-
- TIME_EFFECT turns = randint0(21) + 15;
- caster_ptr->alter_reality = turns;
- msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
- caster_ptr->redraw |= PR_STATUS;
-}
-
-/*!
* @brief アーティファクト生成の巻物処理 /
* @param caster_ptr プレーヤーへの参照ポインタ
* @return 生成が実際に試みられたらTRUEを返す
caster_ptr->update |= (PU_MON_LITE);
return TRUE;
}
-
-/*!
- * @brief 町間のテレポートを行うメインルーチン
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @return テレポート処理を決定したか否か
- */
-bool tele_town(player_type *caster_ptr)
-{
- if (caster_ptr->current_floor_ptr->dun_level) {
- msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!"));
- return FALSE;
- }
-
- if (caster_ptr->current_floor_ptr->inside_arena || caster_ptr->phase_out) {
- msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!"));
- return FALSE;
- }
-
- screen_save();
- clear_bldg(4, 10);
-
- int i;
- int num = 0;
- for (i = 1; i < max_towns; i++) {
- char buf[80];
-
- if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == caster_ptr->town_num) || !(caster_ptr->visit & (1L << (i - 1))))
- continue;
-
- sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
- prt(buf, 5 + i, 5);
- num++;
- }
-
- if (num == 0) {
- msg_print(_("まだ行けるところがない。", "You have not yet visited any town."));
- msg_print(NULL);
- screen_load();
- return FALSE;
- }
-
- prt(_("どこに行きますか:", "Where do you want to go: "), 0, 0);
- while (TRUE) {
- i = inkey();
-
- if (i == ESCAPE) {
- screen_load();
- return FALSE;
- }
-
- else if ((i < 'a') || (i > ('a' + max_towns - 2)))
- continue;
- else if (((i - 'a' + 1) == caster_ptr->town_num) || ((i - 'a' + 1) == NO_TOWN) || ((i - 'a' + 1) == SECRET_TOWN)
- || !(caster_ptr->visit & (1L << (i - 'a'))))
- continue;
- break;
- }
-
- for (POSITION y = 0; y < current_world_ptr->max_wild_y; y++) {
- for (POSITION x = 0; x < current_world_ptr->max_wild_x; x++) {
- if (wilderness[y][x].town == (i - 'a' + 1)) {
- caster_ptr->wilderness_y = y;
- caster_ptr->wilderness_x = x;
- }
- }
- }
-
- caster_ptr->leaving = TRUE;
- caster_ptr->leave_bldg = TRUE;
- caster_ptr->teleport_town = TRUE;
- screen_load();
- return TRUE;
-}
#include "system/angband.h"
-void reserve_alter_reality(player_type* caster_ptr);
bool artifact_scroll(player_type* caster_ptr);
bool mundane_spell(player_type* ownner_ptr, bool only_equip);
bool recharge(player_type* caster_ptr, int power);