}
}
+
/*!
* @brief パターン終点到達時のテレポート処理を行う
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
static void pattern_teleport(player_type *creature_ptr)
wreck_the_pattern(creature_ptr);
}
- pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ pattern_type = f_info[floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
switch (pattern_type)
{
(void)restore_level(creature_ptr);
(void)cure_critical_wounds(creature_ptr, 1000);
- cave_set_feat(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
+ cave_set_feat(floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
/*
spell = SINGING_SONG_ID(caster_ptr);
s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
- need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
+ need_mana = mod_need_mana(caster_ptr, s_ptr->smana, spell, REALM_MUSIC);
need_mana_frac = 0;
/* Divide by 2 */
return (&p_ptr->inventory_list[choices[randint0(number)]]);
}
+
static void process_world_aux_digestion(player_type *creature_ptr)
{
if (!creature_ptr->phase_out)
flush();
msg_print(NULL);
- (void)get_hack_dir(&dire);
+ (void)get_hack_dir(creature_ptr, &dire);
fire_ball(creature_ptr, GF_MANA, dire, creature_ptr->lev * 2, 3);
}
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
- banish_monsters(100);
+ banish_monsters(creature_ptr, 100);
if (!creature_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
{
int n;
* Unlite the area (radius 10) around player and
* do 50 points damage to every affected monster
*/
- unlite_area(50, 10);
+ unlite_area(creature_ptr, 50, 10);
}
if ((creature_ptr->muta2 & MUT2_ATT_ANIMAL) && !creature_ptr->anti_magic && one_in_(7000))
if (slot && !object_is_cursed(o_ptr))
{
msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
- inven_drop(slot, 1);
+ drop_from_inventory(creature_ptr, slot, 1);
}
}
}
/* Process objects on floor */
- for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
+ for (i = 1; i < creature_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
+ object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
creature_ptr->reset_concent = TRUE;
/* Parse the command */
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
switch (command_cmd)
{
/* Ignore */
/* Enter store */
case SPECIAL_KEY_STORE:
{
- do_cmd_store();
+ do_cmd_store(creature_ptr);
break;
}
/* Go up staircase */
case '<':
{
- if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->current_floor_ptr->inside_arena && !creature_ptr->current_floor_ptr->inside_quest)
+ if (!creature_ptr->wild_mode && !floor_ptr->dun_level && !floor_ptr->inside_arena && !floor_ptr->inside_quest)
{
if (vanilla_town) break;
{
msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
}
- else if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
+ else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
{
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(NULL);
else if (creature_ptr->pclass == CLASS_SAMURAI)
do_cmd_hissatsu(creature_ptr);
else if (creature_ptr->pclass == CLASS_BLUE_MAGE)
- do_cmd_cast_learned();
+ do_cmd_cast_learned(creature_ptr);
else if (creature_ptr->pclass == CLASS_SMITH)
do_cmd_kaji(creature_ptr, FALSE);
else if (creature_ptr->pclass == CLASS_SNIPER)
/* Identify symbol */
case '/':
{
- do_cmd_query_symbol();
+ do_cmd_query_symbol(creature_ptr);
break;
}
*/
static void pack_overflow(player_type *owner_ptr)
{
- if (owner_ptr->inventory_list[INVEN_PACK].k_idx)
- {
- GAME_TEXT o_name[MAX_NLEN];
- object_type *o_ptr;
+ if (owner_ptr->inventory_list[INVEN_PACK].k_idx == 0) return;
+
+ GAME_TEXT o_name[MAX_NLEN];
+ object_type *o_ptr;
- /* Is auto-destroy done? */
- update_creature(owner_ptr);
- if (!owner_ptr->inventory_list[INVEN_PACK].k_idx) return;
+ /* Is auto-destroy done? */
+ update_creature(owner_ptr);
+ if (!owner_ptr->inventory_list[INVEN_PACK].k_idx) return;
- /* Access the slot to be dropped */
- o_ptr = &owner_ptr->inventory_list[INVEN_PACK];
+ /* Access the slot to be dropped */
+ o_ptr = &owner_ptr->inventory_list[INVEN_PACK];
- disturb(owner_ptr, FALSE, TRUE);
+ disturb(owner_ptr, FALSE, TRUE);
- /* Warning */
- msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
- object_desc(o_name, o_ptr, 0);
+ /* Warning */
+ msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
+ object_desc(o_name, o_ptr, 0);
- msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
+ msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
- /* Drop it (carefully) near the player */
- (void)drop_near(o_ptr, 0, owner_ptr->y, owner_ptr->x);
+ /* Drop it (carefully) near the player */
+ (void)drop_near(owner_ptr, o_ptr, 0, owner_ptr->y, owner_ptr->x);
- vary_item(INVEN_PACK, -255);
- handle_stuff();
- }
+ vary_item(owner_ptr, INVEN_PACK, -255);
+ handle_stuff(owner_ptr);
}
/*!
}
}
- handle_stuff();
+ handle_stuff(creature_ptr);
}
load = FALSE;
creature_ptr->counter = FALSE;
creature_ptr->now_damaged = FALSE;
- handle_stuff();
+ handle_stuff(creature_ptr);
/* Place the cursor on the player */
move_cursor_relative(creature_ptr->y, creature_ptr->x);
command_rep--;
creature_ptr->redraw |= (PR_STATE);
- handle_stuff();
+ handle_stuff(creature_ptr);
/* Hack -- Assume messages were seen */
msg_flag = FALSE;
creature_ptr->timewalk = FALSE;
creature_ptr->energy_need = ENERGY_NEED();
- handle_stuff();
+ handle_stuff(creature_ptr);
}
}
player_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH | PU_MONSTERS | PU_DISTANCE | PU_FLOW);
- handle_stuff();
+ handle_stuff(player_ptr);
/* Leave "xtra" mode */
current_world_ptr->character_xtra = FALSE;
player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
player_ptr->update |= (PU_COMBINE | PU_REORDER);
- handle_stuff();
+ handle_stuff(player_ptr);
Term_fresh();
if (quest_num && (is_fixed_quest_idx(quest_num) &&
process_player(player_ptr);
process_upkeep_with_speed(player_ptr);
- handle_stuff();
+ handle_stuff(player_ptr);
/* Hack -- Hilite the player */
move_cursor_relative(player_ptr->y, player_ptr->x);
if (!player_ptr->playing || player_ptr->is_dead) break;
/* Process all of the monsters */
- process_monsters();
+ process_monsters(player_ptr);
- handle_stuff();
+ handle_stuff(player_ptr);
/* Hack -- Hilite the player */
move_cursor_relative(player_ptr->y, player_ptr->x);
/* Process the world */
process_world(player_ptr);
- handle_stuff();
+ handle_stuff(player_ptr);
/* Hack -- Hilite the player */
move_cursor_relative(player_ptr->y, player_ptr->x);
autopick_load_pref(FALSE);
}
+
/*!
* @brief 1ゲームプレイの主要ルーチン / Actually play a game
* @return なし
highscore_fd = fd_open(buf, O_RDWR);
/* 町名消失バグ対策(#38205)のためここで世界マップ情報を読み出す */
- process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
+ process_dungeon_file(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
/* Handle score, show Top scores */
success = send_world_score(player_ptr, TRUE);
/* Initialize the town-buildings if necessary */
if (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_ptr->inside_quest)
{
- process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
+ process_dungeon_file(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
init_flags = INIT_ONLY_BUILDINGS;
- process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
+ process_dungeon_file(player_ptr, "t_info.txt", 0, 0, MAX_HGT, MAX_WID);
select_floor_music(player_ptr);
}
player_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
player_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
- handle_stuff();
+ handle_stuff(player_ptr);
/* Set or clear "rogue_like_commands" if requested */
if (arg_force_original) rogue_like_commands = FALSE;
/* Hack -- prevent "icky" message */
current_world_ptr->character_xtra = TRUE;
- handle_stuff();
+ handle_stuff(player_ptr);
current_world_ptr->character_xtra = FALSE;
}
}
+
/*!
* @brief ターンのオーバーフローに対する対処
* @details ターン及びターンを記録する変数をターンの限界の1日前まで巻き戻す.
}
}
+
/*!
* @brief ゲーム終了処理 /
* Close up the current game (player may or may not be dead)
bool do_send = TRUE;
/* concptr p = "[i:キャラクタの情報, f:ファイル書き出し, t:スコア, x:*鑑定*, ESC:ゲーム終了]"; */
- handle_stuff();
+ handle_stuff(player_ptr);
/* Flush the messages */
msg_print(NULL);
else do_send = FALSE;
/* You are dead */
- print_tomb();
+ print_tomb(player_ptr);
flush();
/* Forget the high score fd */
highscore_fd = -1;
- /* Kill all temporal files */
+ /* Kill all temporary files */
clear_saved_floor_files(player_ptr);
/* Allow suspending now */
* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window"
* @return なし
*/
-void handle_stuff(void)
+void handle_stuff(player_type *player_ptr)
{
- if (p_ptr->update) update_creature(p_ptr);
- if (p_ptr->redraw) redraw_stuff(p_ptr);
- if (p_ptr->window) window_stuff();
+ if (player_ptr->update) update_creature(player_ptr);
+ if (player_ptr->redraw) redraw_stuff(player_ptr);
+ if (player_ptr->window) window_stuff(player_ptr);
}
-void update_output(void)
+
+void update_output(player_type *player_ptr)
{
- if (p_ptr->redraw) redraw_stuff(p_ptr);
- if (p_ptr->window) window_stuff();
+ if (player_ptr->redraw) redraw_stuff(player_ptr);
+ if (player_ptr->window) window_stuff(player_ptr);
}
-