get_name();
/* Process the player name */
- process_player_name(creating_savefile);
+ process_player_name(current_world_ptr->creating_savefile);
/*** Edit character background ***/
edit_history();
concptr q, s;
TERM_LEN row = 2;
TERM_LEN wid = 38, mgn = 2;
- bool old_character_xtra = character_xtra;
+ bool old_character_xtra = current_world_ptr->character_xtra;
char ch;
PRICE total = 0;
PRICE cost = 0; /* First time no price */
item_tester_hook = item_tester_hook_orthodox_melee_weapons;
/* Hack -- prevent "icky" message */
- character_xtra = TRUE;
+ current_world_ptr->character_xtra = TRUE;
/* Diaplay selected weapon's infomation */
for (i = 0; i < n; i++)
p_ptr->update |= PU_BONUS;
handle_stuff();
- character_xtra = old_character_xtra;
+ current_world_ptr->character_xtra = old_character_xtra;
#ifdef JP
put_str(format("[ 比較対象: 's'で変更 ($%d) ]", cost), 1, (wid + mgn));
forget_view();
/* Hack -- Increase "icky" depth */
- character_icky++;
+ current_world_ptr->character_icky++;
command_arg = 0;
command_rep = 0;
}
/* Hack -- Decrease "icky" depth */
- character_icky--;
+ current_world_ptr->character_icky--;
Term_clear();
int i, k = 0, n = 0, l;
int opt[24];
char buf[80];
- bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
+ bool browse_only = (page == OPT_PAGE_BIRTH) && current_world_ptr->character_generated &&
(!p_ptr->wizard || !allow_debug_opts);
#include "cmd-basic.h"
#include "view-mainwindow.h"
#include "targeting.h"
+#include "world.h"
/*!
* @brief プレイヤーの騎乗/下馬処理判定
bool player_can_ride_aux(grid_type *g_ptr, bool now_riding)
{
bool p_can_enter;
- bool old_character_xtra = character_xtra;
+ bool old_character_xtra = current_world_ptr->character_xtra;
MONSTER_IDX old_riding = p_ptr->riding;
bool old_riding_ryoute = p_ptr->riding_ryoute;
bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
/* Hack -- prevent "icky" message */
- character_xtra = TRUE;
+ current_world_ptr->character_xtra = TRUE;
if (now_riding) p_ptr->riding = g_ptr->m_idx;
else
p_ptr->update |= PU_BONUS;
handle_stuff();
- character_xtra = old_character_xtra;
+ current_world_ptr->character_xtra = old_character_xtra;
return p_can_enter;
}
/* Enter "xtra" mode */
- character_xtra = TRUE;
+ current_world_ptr->character_xtra = TRUE;
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
handle_stuff();
/* Leave "xtra" mode */
- character_xtra = FALSE;
+ current_world_ptr->character_xtra = FALSE;
p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->hack_mutation = FALSE;
/* Hack -- Character is "icky" */
- character_icky = TRUE;
+ current_world_ptr->character_icky = TRUE;
/* Make sure main term is active */
Term_activate(angband_term[0]);
signals_ignore_tstp();
/* Hack -- Character is now "icky" */
- character_icky = TRUE;
+ current_world_ptr->character_icky = TRUE;
/* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
quit(0);
}
- creating_savefile = new_game;
+ current_world_ptr->creating_savefile = new_game;
/* Nothing loaded */
- if (!character_loaded)
+ if (!current_world_ptr->character_loaded)
{
/* Make new player */
new_game = TRUE;
/* The dungeon is not ready */
- character_dungeon = FALSE;
+ current_world_ptr->character_dungeon = FALSE;
/* Prepare to init the RNG */
init_random_seed = TRUE;
if (new_game)
{
/* The dungeon is not ready */
- character_dungeon = FALSE;
+ current_world_ptr->character_dungeon = FALSE;
/* Start in town */
current_floor_ptr->dun_level = 0;
}
}
- creating_savefile = FALSE;
+ current_world_ptr->creating_savefile = FALSE;
p_ptr->teleport_town = FALSE;
p_ptr->sutemi = FALSE;
/* Generate a dungeon level if needed */
- if (!character_dungeon)
+ if (!current_world_ptr->character_dungeon)
{
change_floor();
}
}
/* Character is now "complete" */
- character_generated = TRUE;
+ current_world_ptr->character_generated = TRUE;
/* Hack -- Character is no longer "icky" */
- character_icky = FALSE;
+ current_world_ptr->character_icky = FALSE;
if (new_game)
dungeon(load_game);
/* Hack -- prevent "icky" message */
- character_xtra = TRUE;
+ current_world_ptr->character_xtra = TRUE;
handle_stuff();
- character_xtra = FALSE;
+ current_world_ptr->character_xtra = FALSE;
/* Cancel the target */
target_who = 0;
/* Hack -- Character is now "icky" */
- character_icky = TRUE;
+ current_world_ptr->character_icky = TRUE;
/* Build the filename */
/* variable.c */
-extern bool character_generated;
-extern bool character_dungeon;
-extern bool character_loaded;
-extern bool character_saved;
-extern bool character_icky;
-extern bool character_xtra;
-extern bool creating_savefile;
extern COMMAND_CODE command_cmd;
extern COMMAND_ARG command_arg;
extern s16b command_rep;
int os = option_info[i].o_set;
int ob = option_info[i].o_bit;
- if ((p_ptr->playing || character_xtra) &&
+ if ((p_ptr->playing || current_world_ptr->character_xtra) &&
(OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard)
{
msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf);
#endif
}
}
- else if (character_dungeon)
+ else if (current_world_ptr->character_dungeon)
{
if (!current_floor_ptr->dun_level)
{
int i, k = 0;
char old_player_base[32] = "";
- if (character_generated) strcpy(old_player_base, player_base);
+ if (current_world_ptr->character_generated) strcpy(old_player_base, player_base);
/* Cannot be too long */
#if defined(MACINTOSH) || defined(ACORN)
}
/* Load an autopick preference file */
- if (character_generated)
+ if (current_world_ptr->character_generated)
{
if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE);
}
void exit_game_panic(void)
{
/* If nothing important has happened, just quit */
- if (!character_generated || character_saved) quit(_("緊急事態", "panic"));
+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(_("緊急事態", "panic"));
/* Mega-Hack -- see "msg_print()" */
msg_flag = FALSE;
{
char buf[1024];
errr err = 0;
- bool old_character_xtra = character_xtra;
+ bool old_character_xtra = current_world_ptr->character_xtra;
/* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
/* Hack -- prevent modification birth options in this file */
- character_xtra = TRUE;
+ current_world_ptr->character_xtra = TRUE;
err = process_pref_file_aux(buf, PREF_TYPE_HISTPREF);
- character_xtra = old_character_xtra;
+ current_world_ptr->character_xtra = old_character_xtra;
return (err);
}
/* Nothing to save, just quit */
- if (!character_generated || character_saved) quit(NULL);
+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
/* Count the signals */
/* Nothing to save, just quit */
- if (!character_generated || character_saved) quit(NULL);
+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
forget_lite();
bool loaded = FALSE;
/* The dungeon is not ready */
- character_dungeon = FALSE;
+ current_world_ptr->character_dungeon = FALSE;
/* No longer in the trap detecteded region */
p_ptr->dtrap = FALSE;
p_ptr->floor_id = new_floor_id;
/* The dungeon is ready */
- character_dungeon = TRUE;
+ current_world_ptr->character_dungeon = TRUE;
/* Hack -- Munchkin characters always get whole map */
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
*/
#define cave_empty_bold2(Y,X) \
(cave_empty_bold(Y,X) && \
- (character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
+ (current_world_ptr->character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
/*
feature_type *f_ptr = &f_info[feat];
bool old_los, old_mirror;
- if (!character_dungeon)
+ if (!current_world_ptr->character_dungeon)
{
/* Clear mimic type */
g_ptr->mimic = 0;
found = TRUE;
}
- if (found && character_dungeon && player_can_see_bold(y, x))
+ if (found && current_world_ptr->character_dungeon && player_can_see_bold(y, x))
{
msg_print(_("何かを発見した!", "You have found something!"));
}
{
feature_type *old_f_ptr = &f_info[oldfeat];
- if (have_flag(old_f_ptr->flags, FF_GLASS) && character_dungeon)
+ if (have_flag(old_f_ptr->flags, FF_GLASS) && current_world_ptr->character_dungeon)
{
project(PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
/* The dungeon is ready */
if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena)
- character_dungeon = FALSE;
+ current_world_ptr->character_dungeon = FALSE;
else
- character_dungeon = TRUE;
+ current_world_ptr->character_dungeon = TRUE;
/* Success */
return (0);
}
/* The dungeon is ready */
- character_dungeon = TRUE;
+ current_world_ptr->character_dungeon = TRUE;
/* Success or Error */
return err;
#include "quest.h"
#include "files.h"
#include "core.h"
+#include "world.h"
#ifdef WINDOWS
#include <windows.h>
/* No character available */
- if (!character_generated)
+ if (!current_world_ptr->character_generated)
{
/* Menu "File", Item "New" */
EnableMenuItem(hm, IDM_FILE_NEW, MF_BYCOMMAND | MF_ENABLED);
}
/* A character available */
- if (character_generated)
+ if (current_world_ptr->character_generated)
{
/* Menu "File", Item "Save" */
EnableMenuItem(hm, IDM_FILE_SAVE,
/* Save game */
case IDM_FILE_SAVE:
{
- if (game_in_progress && character_generated)
+ if (game_in_progress && current_world_ptr->character_generated)
{
if (!can_save)
{
/* Exit */
case IDM_FILE_EXIT:
{
- if (game_in_progress && character_generated)
+ if (game_in_progress && current_world_ptr->character_generated)
{
if (!can_save)
{
case WM_CLOSE:
{
- if (game_in_progress && character_generated)
+ if (game_in_progress && current_world_ptr->character_generated)
{
if (!can_save)
{
case WM_QUERYENDSESSION:
{
- if (game_in_progress && character_generated)
+ if (game_in_progress && current_world_ptr->character_generated)
{
/* Hack -- Forget messages */
msg_flag = FALSE;
a_ptr->cur_num = 1;
/* Hack -- Memorize location of artifact in saved floors */
- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
}
else if (!preserve_mode) a_ptr->cur_num = 1;
}
a_ptr->cur_num = 1;
/* Hack -- Memorize location of artifact in saved floors */
- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
}
else if (!preserve_mode) a_ptr->cur_num = 1;
}
a_ptr->cur_num = 1;
/* Hack -- Memorize location of artifact in saved floors */
- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
}
else if (!preserve_mode) a_ptr->cur_num = 1;
}
/* Warn the player (except during dungeon creation) */
- if (character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
+ if (current_world_ptr->character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
/* Try not to crash */
return (0);
* Memorize location of the unique monster in saved floors.
* A unique monster move from old saved floor.
*/
- if (character_dungeon &&
+ if (current_world_ptr->character_dungeon &&
((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
/* Hack -- Count the number of "reproducers" */
if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
- if (p_ptr->warning && character_dungeon)
+ if (p_ptr->warning && current_world_ptr->character_dungeon)
{
if (r_ptr->flags1 & RF1_UNIQUE)
{
#include "angband.h"
#include "util.h"
+#include "world.h"
#include "object.h"
if (!o_ptr->k_idx) continue;
/* Mega-Hack -- preserve artifacts */
- if (!character_dungeon || preserve_mode)
+ if (!current_world_ptr->character_dungeon || preserve_mode)
{
/* Hack -- Preserve unknown artifacts */
if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr))
/* Warn the player (except during dungeon creation) */
- if (character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
+ if (current_world_ptr->character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
return (0);
}
a_ptr->cur_num = 1;
/* Hack -- Memorize location of artifact in saved floors */
- if (character_dungeon)
+ if (current_world_ptr->character_dungeon)
a_ptr->floor_id = p_ptr->floor_id;
/* Extract the other fields */
/* Hack -- handle "xtra" mode */
- if (character_xtra) return;
+ if (current_world_ptr->character_xtra) return;
/* Take note when "heavy bow" changes */
if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot)
if (!mp_ptr->spell_book) return;
/* Hack -- wait for creation */
- if (!character_generated) return;
+ if (!current_world_ptr->character_generated) return;
/* Hack -- handle "xtra" mode */
- if (character_xtra) return;
+ if (current_world_ptr->character_xtra) return;
if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
{
/* Hack -- handle "xtra" mode */
- if (character_xtra) return;
+ if (current_world_ptr->character_xtra) return;
/* Take note when "glove state" changes */
if (p_ptr->old_cumber_glove != p_ptr->cumber_glove)
}
/* Character is not ready yet, no screen updates */
- if (!character_generated) return;
+ if (!current_world_ptr->character_generated) return;
/* Character is in "icky" mode, no screen updates */
- if (character_icky) return;
+ if (current_world_ptr->character_icky) return;
if (creature_ptr->update & (PU_UN_LITE))
{
{
int power = 100;
- if (p_ptr->inside_battle || !character_dungeon) return;
+ if (p_ptr->inside_battle || !current_world_ptr->character_dungeon) return;
if (!necro && m_ptr)
{
#include "angband.h"
#include "util.h"
+#include "world.h"
#include "cmd-spell.h"
#include "floor.h"
#include "spells.h"
counts_write(0, current_world_ptr->play_time);
/* Successful save */
- character_saved = TRUE;
+ current_world_ptr->character_saved = TRUE;
/* Success */
return (TRUE);
safe_setuid_drop();
/* Hack -- Pretend the character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
#ifdef VERIFY_SAVEFILE
* allowed to save his game when he quits.
*
* We return "TRUE" if the savefile was usable, and we set the global
- * flag "character_loaded" if a real, living, character was loaded.
+ * flag "current_world_ptr->character_loaded" if a real, living, character was loaded.
*
* Note that we always try to load the "current" savefile, even if
* there is no such file, so we must check for "empty" savefile names.
if (arg_wizard)
{
/* A character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
return (TRUE);
}
}
/* A character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
{
u32b tmp = counts_read(2);
forget_view();
/* Hack -- Character is in "icky" mode */
- character_icky = TRUE;
+ current_world_ptr->character_icky = TRUE;
/* command reset */
command_arg = 0;
need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
/* Hack -- Character is still in "icky" mode */
- character_icky = TRUE;
+ current_world_ptr->character_icky = TRUE;
handle_stuff();
take_turn(p_ptr, 100);
/* Hack -- Character is no longer in "icky" mode */
- character_icky = FALSE;
+ current_world_ptr->character_icky = FALSE;
/* Hack -- Cancel automatic command */
command_new = 0;
* is only requested (via "Term_inkey()") when "angband_term[0]" is active.
*
* Mega-Hack -- This function is used as the entry point for clearing the
- * "signal_count" variable, and of the "character_saved" variable.
+ * "signal_count" variable, and of the "current_world_ptr->character_saved" variable.
*
* Hack -- Note the use of "inkey_next" to allow "keymaps" to be processed.
*
(void)Term_get_cursor(&v);
/* Show the cursor if waiting, except sometimes in "command" mode */
- if (!inkey_scan && (!inkey_flag || hilite_player || character_icky))
+ if (!inkey_scan && (!inkey_flag || hilite_player || current_world_ptr->character_icky))
{
/* Show the cursor */
(void)Term_set_cursor(1);
Term_activate(angband_term[0]);
/* Mega-Hack -- reset saved flag */
- character_saved = FALSE;
+ current_world_ptr->character_saved = FALSE;
/* Mega-Hack -- reset signal counter */
signal_count = 0;
n = strlen(buf);
/* Memorize the message */
- if (character_generated) message_add(buf);
+ if (current_world_ptr->character_generated) message_add(buf);
/* Analyze the buffer */
t = buf;
msg_flush(split + 1);
/* Memorize the piece */
- /* if (character_generated) message_add(t); */
+ /* if (current_world_ptr->character_generated) message_add(t); */
/* Restore the split character */
t[split] = oops;
Term_putstr(p, 0, n, TERM_WHITE, t);
/* Memorize the tail */
- /* if (character_generated) message_add(t); */
+ /* if (current_world_ptr->character_generated) message_add(t); */
p_ptr->window |= (PW_MESSAGE);
update_output();
if (screen_depth++ == 0) Term_save();
/* Increase "icky" depth */
- character_icky++;
+ current_world_ptr->character_icky++;
}
if (--screen_depth == 0) Term_load();
/* Decrease "icky" depth */
- character_icky--;
+ current_world_ptr->character_icky--;
}
int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
-/*
- * Various things
- */
-bool character_generated; /* The character exists */
-bool character_dungeon; /* The character has a dungeon */
-bool character_loaded; /* The character was loaded from a savefile */
-bool character_saved; /* The character was just saved to a savefile */
-
-bool character_icky; /* The game is in an icky full screen mode */
-bool character_xtra; /* The game is in an icky startup mode */
-
-bool creating_savefile; /* New savefile is currently created */
s16b command_cmd; /* Current "Angband Command" */
if (!p_ptr->redraw) return;
/* Character is not ready yet, no screen updates */
- if (!character_generated) return;
+ if (!current_world_ptr->character_generated) return;
/* Character is in "icky" mode, no screen updates */
- if (character_icky) return;
+ if (current_world_ptr->character_icky) return;
/* Hack -- clear the screen */
if (p_ptr->redraw & (PR_WIPE))
void resize_map(void)
{
/* Only if the dungeon exists */
- if (!character_dungeon) return;
+ if (!current_world_ptr->character_dungeon) return;
/* Mega-Hack -- no panel yet */
panel_row_max = 0;
void redraw_window(void)
{
/* Only if the dungeon exists */
- if (!character_dungeon) return;
+ if (!current_world_ptr->character_dungeon) return;
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
u16b sf_lives; /* Number of past "lives" with this file */
u16b sf_saves; /* Number of "saves" during this life */
+ bool character_generated; /* The character exists */
+ bool character_dungeon; /* The character has a dungeon */
+ bool character_loaded; /* The character was loaded from a savefile */
+ bool character_saved; /* The character was just saved to a savefile */
+
+ bool character_icky; /* The game is in an icky full screen mode */
+ bool character_xtra; /* The game is in an icky startup mode */
+
+ bool creating_savefile; /* New savefile is currently created */
+
} world_type;
extern bool is_daytime(void);