#include "angband.h"
#include "util.h"
+#include "core.h"
#include "birth.h"
#include "bldg.h"
#include "cmd-activate.h"
+#include "cmd-dump.h"
#include "cmd-eat.h"
#include "cmd-hissatsu.h"
#include "cmd-item.h"
#include "cmd-basic.h"
#include "snipe.h"
#include "dungeon.h"
+#include "feature.h"
#include "floor.h"
#include "floor-events.h"
+#include "floor-town.h"
#include "grid.h"
#include "object-curse.h"
#include "object-flavor.h"
#include "avatar.h"
#include "player-move.h"
#include "player-status.h"
+#include "player-class.h"
+#include "player-race.h"
#include "cmd-spell.h"
#include "realm-hex.h"
+#include "objectkind.h"
#include "object-hook.h"
#include "wild.h"
#include "monster-process.h"
#include "files.h"
#include "player-effects.h"
#include "scores.h"
+#include "autopick.h"
+#include "save.h"
+
+concptr ANGBAND_SYS = "xxx"; //!< Hack -- The special Angband "System Suffix" This variable is used to choose an appropriate "pref-xxx" file
+
+#ifdef JP
+concptr ANGBAND_KEYBOARD = "JAPAN"; //!< Hack -- The special Angband "Keyboard Suffix" This variable is used to choose an appropriate macro-trigger definition
+#else
+concptr ANGBAND_KEYBOARD = "0";
+#endif
+
+concptr ANGBAND_GRAF = "ascii"; //!< Hack -- The special Angband "Graphics Suffix" This variable is used to choose an appropriate "graf-xxx" file
static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
{
byte feel;
- object_type *o_ptr = &inventory[slot];
+ object_type *o_ptr = &p_ptr->inventory_list[slot];
GAME_TEXT o_name[MAX_NLEN];
/* We know about it already, do not tell us again */
}
- /* Message (inventory) */
+ /* Message (p_ptr->inventory_list) */
else
{
#ifdef JP
* @brief 1プレイヤーターン毎に武器、防具の擬似鑑定が行われるかを判定する。
* @return なし
* @details
- * Sense the inventory\n
+ * Sense the p_ptr->inventory_list\n
*\n
* Class 0 = Warrior --> fast and heavy\n
* Class 1 = Mage --> slow and light\n
{
bool okay = FALSE;
- o_ptr = &inventory[i];
+ o_ptr = &p_ptr->inventory_list[i];
/* Skip empty slots */
if (!o_ptr->k_idx) continue;
/* Skip non-sense machines */
if (!okay) continue;
- /* Occasional failure on inventory items */
+ /* Occasional failure on p_ptr->inventory_list items */
if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
/* Good luck */
{
bool okay = FALSE;
- o_ptr = &inventory[i];
+ o_ptr = &p_ptr->inventory_list[i];
/* Skip empty slots */
if (!o_ptr->k_idx) continue;
/* Skip non-sense machines */
if (!okay) continue;
- /* Occasional failure on inventory items */
+ /* Occasional failure on p_ptr->inventory_list items */
if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
sense_inventory_aux(i, TRUE);
/* Regenerate everyone */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
/* Check the i'th monster */
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
for (i = 0; i < INVEN_TOTAL; i++)
{
monster_race *r_ptr;
- object_type *o_ptr = &inventory[i];
+ object_type *o_ptr = &p_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
if (o_ptr->tval != TV_CAPTURE) continue;
/* Search Inventry */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &inventory[i];
+ object_type *o_ptr = &p_ptr->inventory_list[i];
if (o_ptr->curse_flags & flag)
{
}
/* Choice one of them */
- return (&inventory[choices[randint0(number)]]);
+ return (&p_ptr->inventory_list[choices[randint0(number)]]);
}
static void process_world_aux_digestion(void)
}
}
- if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
+ if (p_ptr->inventory_list[INVEN_LITE].tval && (p_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
!p_ptr->resist_lite)
{
- object_type * o_ptr = &inventory[INVEN_LITE];
+ object_type * o_ptr = &p_ptr->inventory_list[INVEN_LITE];
GAME_TEXT o_name [MAX_NLEN];
char ouch [MAX_NLEN+40];
static void process_world_aux_light(void)
{
/* Check for light being wielded */
- object_type *o_ptr = &inventory[INVEN_LITE];
+ object_type *o_ptr = &p_ptr->inventory_list[INVEN_LITE];
/* Burn some fuel in the current lite */
if (o_ptr->tval == TV_LITE)
hp_player(10);
}
- o_ptr = &inventory[INVEN_LITE];
+ o_ptr = &p_ptr->inventory_list[INVEN_LITE];
/* Absorb some fuel in the current lite */
if (o_ptr->tval == TV_LITE)
int danger_amount = 0;
MONSTER_IDX monster;
- for (monster = 0; monster < m_max; monster++)
+ for (monster = 0; monster < current_floor_ptr->m_max; monster++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[monster];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (has_melee_weapon(INVEN_RARM))
{
slot = INVEN_RARM;
- o_ptr = &inventory[INVEN_RARM];
+ o_ptr = &p_ptr->inventory_list[INVEN_RARM];
if (has_melee_weapon(INVEN_LARM) && one_in_(2))
{
- o_ptr = &inventory[INVEN_LARM];
+ o_ptr = &p_ptr->inventory_list[INVEN_LARM];
slot = INVEN_LARM;
}
}
else if (has_melee_weapon(INVEN_LARM))
{
- o_ptr = &inventory[INVEN_LARM];
+ o_ptr = &p_ptr->inventory_list[INVEN_LARM];
slot = INVEN_LARM;
}
if (slot && !object_is_cursed(o_ptr))
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
BIT_FLAGS flgs[TR_FLAG_SIZE];
- o_ptr = &inventory[i];
+ o_ptr = &p_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
object_flags(o_ptr, flgs);
}
}
- o_ptr = &inventory[i_keep];
+ o_ptr = &p_ptr->inventory_list[i_keep];
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name);
if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
/* Rarely, take damage from the Jewel of Judgement */
if (one_in_(999) && !p_ptr->anti_magic)
{
- object_type *o_ptr = &inventory[INVEN_LITE];
+ object_type *o_ptr = &p_ptr->inventory_list[INVEN_LITE];
if (o_ptr->name1 == ART_JUDGE)
{
for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
/* Get the object */
- object_type *o_ptr = &inventory[i];
+ object_type *o_ptr = &p_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
/* Recharge activatable objects */
*/
for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
{
- object_type *o_ptr = &inventory[i];
+ object_type *o_ptr = &p_ptr->inventory_list[i];
object_kind *k_ptr = &k_info[o_ptr->k_idx];
if (!o_ptr->k_idx) continue;
}
/* Process objects on floor */
- for (i = 1; i < o_max; i++)
+ for (i = 1; i < current_floor_ptr->o_max; i++)
{
object_type *o_ptr = ¤t_floor_ptr->o_list[i];
/* Every 10 game turns */
if (current_world_ptr->game_turn % TURNS_PER_TICK) return;
- /*** Check the Time and Load ***/
-
- if (!(current_world_ptr->game_turn % (50*TURNS_PER_TICK)))
- {
- /* Check time and load */
- if ((0 != check_time()) || (0 != check_load()))
- {
- /* Warning */
- if (closing_flag <= 2)
- {
- disturb(FALSE, TRUE);
-
- /* Count warnings */
- closing_flag++;
-
- msg_print(_("アングバンドへの門が閉じかかっています...", "The gates to ANGBAND are closing..."));
- msg_print(_("ゲームを終了するかセーブするかして下さい。", "Please finish up and/or save your game."));
-
- }
-
- /* Slam the gate */
- else
- {
- msg_print(_("今、アングバンドへの門が閉ざされました。", "The gates to ANGBAND are now closed."));
-
- /* Stop playing */
- p_ptr->playing = FALSE;
- p_ptr->leaving = TRUE;
- }
- }
- }
-
/*** Attempt timed autosave ***/
if (autosave_t && autosave_freq && !p_ptr->inside_battle)
{
/* Process recharging */
process_world_aux_recharge();
- /* Feel the inventory */
+ /* Feel the p_ptr->inventory_list */
sense_inventory1();
sense_inventory2();
*/
static void pack_overflow(void)
{
- if (inventory[INVEN_PACK].k_idx)
+ if (p_ptr->inventory_list[INVEN_PACK].k_idx)
{
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
/* Is auto-destroy done? */
update_creature(p_ptr);
- if (!inventory[INVEN_PACK].k_idx) return;
+ if (!p_ptr->inventory_list[INVEN_PACK].k_idx) return;
/* Access the slot to be dropped */
- o_ptr = &inventory[INVEN_PACK];
+ o_ptr = &p_ptr->inventory_list[INVEN_PACK];
disturb(FALSE, TRUE);
/*** Apply energy ***/
- if (hack_mutation)
+ if (p_ptr->hack_mutation)
{
msg_print(_("何か変わった気がする!", "You feel different!"));
(void)gain_mutation(p_ptr, 0);
- hack_mutation = FALSE;
+ p_ptr->hack_mutation = FALSE;
}
if (invoking_midnight_curse)
if (p_ptr->inside_battle)
{
- for(m_idx = 1; m_idx < m_max; m_idx++)
+ for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
shimmer_monsters = FALSE;
/* Shimmer multi-hued monsters */
- for (m_idx = 1; m_idx < m_max; m_idx++)
+ for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
monster_race *r_ptr;
repair_monsters = FALSE;
/* Rotate detection flags */
- for (m_idx = 1; m_idx < m_max; m_idx++)
+ for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
m_ptr = ¤t_floor_ptr->m_list[m_idx];
while (TRUE)
{
/* Hack -- Compact the monster list occasionally */
- if ((m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
+ if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
/* Hack -- Compress the monster list occasionally */
- if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
+ if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->inside_battle) compact_monsters(0);
/* Hack -- Compact the object list occasionally */
- if (o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
+ if (current_floor_ptr->o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
/* Hack -- Compress the object list occasionally */
- if (o_cnt + 32 < o_max) compact_objects(0);
+ if (current_floor_ptr->o_cnt + 32 < current_floor_ptr->o_max) compact_objects(0);
/* Process the player */
process_player();
autopick_load_pref(FALSE);
}
-
-/*!
- * @brief ビットセットからゲームオプションを展開する / Extract option variables from bit sets
- * @return なし
- */
-void extract_option_vars(void)
-{
- int i;
-
- for (i = 0; option_info[i].o_desc; i++)
- {
- int os = option_info[i].o_set;
- int ob = option_info[i].o_bit;
-
- /* Set the "default" options */
- if (option_info[i].o_var)
- {
- /* Set */
- if (option_flag[os] & (1L << ob))
- {
- /* Set */
- (*option_info[i].o_var) = TRUE;
- }
-
- /* Clear */
- else
- {
- /* Clear */
- (*option_info[i].o_var) = FALSE;
- }
- }
- }
-}
-
-
-/*!
- * @brief 賞金首となるユニークを確定する / Determine bounty uniques
- * @return なし
- */
-void determine_bounty_uniques(void)
-{
- int i, j;
- MONRACE_IDX tmp;
- monster_race *r_ptr;
-
- get_mon_num_prep(NULL, NULL);
- for (i = 0; i < MAX_KUBI; i++)
- {
- while (1)
- {
- current_world_ptr->bounty_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
- r_ptr = &r_info[current_world_ptr->bounty_r_idx[i]];
-
- if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
-
- if (!(r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON))) continue;
-
- if (r_ptr->rarity > 100) continue;
-
- if (no_questor_or_bounty_uniques(current_world_ptr->bounty_r_idx[i])) continue;
-
- for (j = 0; j < i; j++)
- if (current_world_ptr->bounty_r_idx[i] == current_world_ptr->bounty_r_idx[j]) break;
-
- if (j == i) break;
- }
- }
-
- /* Sort them */
- for (i = 0; i < MAX_KUBI - 1; i++)
- {
- for (j = i; j < MAX_KUBI; j++)
- {
- if (r_info[current_world_ptr->bounty_r_idx[i]].level > r_info[current_world_ptr->bounty_r_idx[j]].level)
- {
- tmp = current_world_ptr->bounty_r_idx[i];
- current_world_ptr->bounty_r_idx[i] = current_world_ptr->bounty_r_idx[j];
- current_world_ptr->bounty_r_idx[j] = tmp;
- }
- }
- }
-}
-
/*!
* @brief 1ゲームプレイの主要ルーチン / Actually play a game
* @return なし
return;
}
- hack_mutation = FALSE;
+ p_ptr->hack_mutation = FALSE;
/* Hack -- Character is "icky" */
character_icky = TRUE;
write_level = TRUE;
/* Hack -- seed for flavors */
- seed_flavor = randint0(0x10000000);
+ current_world_ptr->seed_flavor = randint0(0x10000000);
/* Hack -- seed for town layout */
- seed_town = randint0(0x10000000);
+ current_world_ptr->seed_town = randint0(0x10000000);
/* Roll up a new character */
player_birth();
if (p_ptr->riding == -1)
{
p_ptr->riding = 0;
- for (i = m_max; i > 0; i--)
+ for (i = current_floor_ptr->m_max; i > 0; i--)
{
if (player_bold(current_floor_ptr->m_list[i].fy, current_floor_ptr->m_list[i].fx))
{