command_wrk = FALSE;
if (easy_floor) command_wrk = (USE_INVEN);
screen_save();
- (void)show_inven(0, USE_FULL, 0);
+ (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
#ifdef JP
sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
(int)lbtokg1(creature_ptr->total_weight) , (int)lbtokg2(creature_ptr->total_weight) ,
- (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
#else
sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
(int)(creature_ptr->total_weight / 10), (int)(creature_ptr->total_weight % 10),
- (creature_ptr->total_weight * 100) / weight_limit(creature_ptr));
#endif
+ (long int)(creature_ptr->total_weight * 100) / weight_limit(creature_ptr));
prt(out_val, 0, 0);
command_new = inkey();
if (easy_floor) command_wrk = (USE_EQUIP);
screen_save();
- (void)show_equip(0, USE_FULL, 0);
+ (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
#ifdef JP
sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
/*!
* @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_wield(player_type *creature_ptr)
if (!o_ptr) return;
/* Check the slot */
- slot = wield_slot(o_ptr);
+ slot = wield_slot(creature_ptr, o_ptr);
switch (o_ptr->tval)
{
/* Prevent wielding into a cursed slot */
if (object_is_cursed(&creature_ptr->inventory_list[slot]))
{
- object_desc(o_name, &creature_ptr->inventory_list[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(creature_ptr, o_name, &creature_ptr->inventory_list[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
- msg_format("%s%sは呪われているようだ。", describe_use(slot) , o_name );
+ msg_format("%s%sは呪われているようだ。", describe_use(creature_ptr, slot), o_name);
#else
- msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(slot));
+ msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(creature_ptr, slot));
#endif
return;
}
{
char dummy[MAX_NLEN+80];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name);
if (!get_check(dummy)) return;
{
char dummy[MAX_NLEN+100];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
sprintf(dummy, _("%sを装備すると吸血鬼になります。よろしいですか?",
"%s will transforms you into a vampire permanently when equiped. Do you become a vampire?"), o_name);
object_type *otmp_ptr = &object_tmp;
GAME_TEXT switch_name[MAX_NLEN];
- object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(creature_ptr, switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
object_copy(otmp_ptr, switch_o_ptr);
object_copy(switch_o_ptr, slot_o_ptr);
slot = need_switch_wielding;
}
- check_find_art_quest_completion(o_ptr);
+ check_find_art_quest_completion(creature_ptr, o_ptr);
if (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)
{
- identify_item(o_ptr);
+ identify_item(creature_ptr, o_ptr);
/* Auto-inscription */
- autopick_alter_item(item, FALSE);
+ autopick_alter_item(creature_ptr, item, FALSE);
}
take_turn(creature_ptr, 100);
/* Decrease the item (from the pack) */
if (item >= 0)
{
- inven_item_increase(item, -1);
- inven_item_optimize(item);
+ inven_item_increase(creature_ptr, item, -1);
+ inven_item_optimize(creature_ptr, item);
}
-
/* Decrease the item (from the floor) */
else
{
- floor_item_increase(0 - item, -1);
- floor_item_optimize(0 - item);
+ floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+ floor_item_optimize(creature_ptr, 0 - item);
}
/* Access the wield slot */
if (o_ptr->k_idx)
{
/* Take off existing item */
- (void)inven_takeoff(slot, 255);
+ (void)inven_takeoff(creature_ptr, slot, 255);
}
/* Wear the new stuff */
switch (slot)
{
case INVEN_RARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && can_two_hands_wielding(creature_ptr))
act = STR_WIELD_ARMS;
else
act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
break;
case INVEN_LARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && can_two_hands_wielding(creature_ptr))
act = STR_WIELD_ARMS;
else
act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
break;
}
- object_desc(o_name, o_ptr, 0);
+ object_desc(creature_ptr, o_name, o_ptr, 0);
msg_format(act, o_name, index_to_label(slot));
/* Cursed! */
o_ptr->ident |= (IDENT_SENSE);
}
- /* The Stone Mask make the player current_world_ptr->game_turn into a vampire! */
+ /* The Stone Mask make the player turn into a vampire! */
if ((o_ptr->name1 == ART_STONEMASK) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID))
{
/* Turn into a vampire */
calc_android_exp(creature_ptr);
}
+
/*!
* @brief 持ち替え処理
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param item 持ち替えを行いたい装備部位ID
* @return なし
*/
-void verify_equip_slot(INVENTORY_IDX item)
+void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
{
object_type *o_ptr, *new_o_ptr;
GAME_TEXT o_name[MAX_NLEN];
if (item == INVEN_RARM)
{
- if (has_melee_weapon(p_ptr, INVEN_LARM))
- {
- o_ptr = &p_ptr->inventory_list[INVEN_LARM];
- object_desc(o_name, o_ptr, 0);
+ if (!has_melee_weapon(owner_ptr, INVEN_LARM)) return;
- if (!object_is_cursed(o_ptr))
- {
- new_o_ptr = &p_ptr->inventory_list[INVEN_RARM];
- object_copy(new_o_ptr, o_ptr);
- p_ptr->total_weight += o_ptr->weight;
- inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
- inven_item_optimize(INVEN_LARM);
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
- msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
- else
- msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
- (left_hander ? _("左手", "left") : _("右手", "right")));
- }
- else
- {
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
- msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
- }
- }
- }
- else if (item == INVEN_LARM)
- {
- o_ptr = &p_ptr->inventory_list[INVEN_RARM];
- if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
+ o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
+ object_desc(owner_ptr, o_name, o_ptr, 0);
- if (has_melee_weapon(p_ptr, INVEN_RARM))
+ if (object_is_cursed(o_ptr))
{
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ return;
}
- else if (!(empty_hands(p_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
- {
- new_o_ptr = &p_ptr->inventory_list[INVEN_LARM];
- object_copy(new_o_ptr, o_ptr);
- p_ptr->total_weight += o_ptr->weight;
- inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
- inven_item_optimize(INVEN_RARM);
- msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
- }
+
+ new_o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
+ object_copy(new_o_ptr, o_ptr);
+ owner_ptr->total_weight += o_ptr->weight;
+ inven_item_increase(owner_ptr, INVEN_LARM, -((int)o_ptr->number));
+ inven_item_optimize(owner_ptr, INVEN_LARM);
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
+ msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ else
+ msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
+ (left_hander ? _("左手", "left") : _("右手", "right")));
+ return;
}
+
+ if (item != INVEN_LARM) return;
+
+ o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
+ if (o_ptr->k_idx) object_desc(owner_ptr, o_name, o_ptr, 0);
+
+ if (has_melee_weapon(owner_ptr, INVEN_RARM))
+ {
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
+ msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ return;
+ }
+
+ if ((empty_hands(owner_ptr, FALSE) & EMPTY_HAND_RARM) || object_is_cursed(o_ptr)) return;
+
+ new_o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
+ object_copy(new_o_ptr, o_ptr);
+ owner_ptr->total_weight += o_ptr->weight;
+ inven_item_increase(owner_ptr, INVEN_RARM, -((int)o_ptr->number));
+ inven_item_optimize(owner_ptr, INVEN_RARM);
+ msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
}
take_turn(creature_ptr, 50);
/* Take off the item */
- (void)inven_takeoff(item, 255);
- verify_equip_slot(item);
+ (void)inven_takeoff(creature_ptr, item, 255);
+ verify_equip_slot(creature_ptr, item);
calc_android_exp(creature_ptr);
creature_ptr->redraw |= (PR_EQUIPPY);
}
q = _("どのアイテムを落としますか? ", "Drop which item? ");
s = _("落とせるアイテムを持っていない。", "You have nothing to drop.");
- o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
if (!o_ptr) return;
/* Hack -- Cannot remove cursed items */
take_turn(creature_ptr, 50);
/* Drop (some of) the item */
- inven_drop(item, amt);
+ drop_from_inventory(creature_ptr, item, amt);
if (item >= INVEN_RARM)
{
- verify_equip_slot(item);
+ verify_equip_slot(creature_ptr, item);
calc_android_exp(creature_ptr);
}
/*!
* @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_destroy(player_type *creature_ptr)
/* Verify unless quantity given beforehand */
if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
{
- object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
+ object_desc(creature_ptr, o_name, o_ptr, OD_OMIT_PREFIX);
/* Make a verification */
sprintf(out_val, _("本当に%sを壊しますか? [y/n/Auto]", "Really destroy %s? [y/n/Auto]"), o_name);
/* HACK : Add the line to message buffer */
message_add(out_val);
creature_ptr->window |= (PW_MESSAGE);
- handle_stuff();
+ handle_stuff(creature_ptr);
/* Get an acceptable answer */
while (TRUE)
if (i == 'A')
{
/* Add an auto-destroy preference line */
- if (autopick_autoregister(o_ptr))
+ if (autopick_autoregister(creature_ptr, o_ptr))
{
/* Auto-destroy it */
- autopick_alter_item(item, TRUE);
+ autopick_alter_item(creature_ptr, item, TRUE);
}
/* The object is already destroyed. */
old_number = o_ptr->number;
o_ptr->number = amt;
- object_desc(o_name, o_ptr, 0);
+ object_desc(creature_ptr, o_name, o_ptr, 0);
o_ptr->number = old_number;
take_turn(creature_ptr, 100);
/* Reduce the charges of rods/wands */
reduce_charges(o_ptr, amt);
- /* Eliminate the item (from the pack) */
- if (item >= 0)
- {
- inven_item_increase(item, -amt);
- inven_item_describe(item);
- inven_item_optimize(item);
- }
-
- /* Eliminate the item (from the floor) */
- else
- {
- floor_item_increase(0 - item, -amt);
- floor_item_describe(0 - item);
- floor_item_optimize(0 - item);
- }
+ vary_item(creature_ptr, item, -amt);
if (item_tester_high_level_book(q_ptr))
{
return;
}
- object_desc(o_name, o_ptr, 0);
+ object_desc(creature_ptr, o_name, o_ptr, 0);
msg_format(_("%sを調べている...", "Examining %s..."), o_name);
- if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
+ if (!screen_object(creature_ptr, o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
}
if (!o_ptr) return;
/* Describe the activity */
- object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
+ object_desc(creature_ptr, o_name, o_ptr, OD_OMIT_INSCRIPTION);
msg_format(_("%sに銘を刻む。", "Inscribing %s."), o_name);
msg_print(NULL);
* Refill the players lamp (from the pack or floor)
* @return なし
*/
-static void do_cmd_refill_lamp(void)
+static void do_cmd_refill_lamp(player_type *user_ptr)
{
OBJECT_IDX item;
object_type *o_ptr;
q = _("どの油つぼから注ぎますか? ", "Refill with which flask? ");
s = _("油つぼがない。", "You have no flasks of oil.");
- o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(user_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
if (!o_ptr) return;
- take_turn(p_ptr, 50);
+ take_turn(user_ptr, 50);
/* Access the lantern */
- j_ptr = &p_ptr->inventory_list[INVEN_LITE];
+ j_ptr = &user_ptr->inventory_list[INVEN_LITE];
/* Refuel */
j_ptr->xtra4 += o_ptr->xtra4;
msg_print(_("ランプの油は一杯だ。", "Your lamp is full."));
}
- /* Decrease the item (from the pack) */
- if (item >= 0)
- {
- inven_item_increase(item, -1);
- inven_item_describe(item);
- inven_item_optimize(item);
- }
-
- /* Decrease the item (from the floor) */
- else
- {
- floor_item_increase(0 - item, -1);
- floor_item_describe(0 - item);
- floor_item_optimize(0 - item);
- }
+ vary_item(user_ptr, item, -1);
- p_ptr->update |= (PU_TORCH);
+ user_ptr->update |= (PU_TORCH);
}
/*!
* Refuel the players torch (from the pack or floor)
* @return なし
*/
-static void do_cmd_refill_torch(void)
+static void do_cmd_refill_torch(player_type *creature_ptr)
{
OBJECT_IDX item;
q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
s = _("他に松明がない。", "You have no extra torches.");
- o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
if (!o_ptr) return;
- take_turn(p_ptr, 50);
+ take_turn(creature_ptr, 50);
/* Access the primary torch */
- j_ptr = &p_ptr->inventory_list[INVEN_LITE];
+ j_ptr = &creature_ptr->inventory_list[INVEN_LITE];
/* Refuel */
j_ptr->xtra4 += o_ptr->xtra4 + 5;
msg_print(_("松明はいっそう明るく輝いた。", "Your torch glows more brightly."));
}
- /* Decrease the item (from the pack) */
- if (item >= 0)
- {
- inven_item_increase(item, -1);
- inven_item_describe(item);
- inven_item_optimize(item);
- }
+ vary_item(creature_ptr, item, -1);
- /* Decrease the item (from the floor) */
- else
- {
- floor_item_increase(0 - item, -1);
- floor_item_describe(0 - item);
- floor_item_optimize(0 - item);
- }
-
- p_ptr->update |= (PU_TORCH);
+ creature_ptr->update |= (PU_TORCH);
}
/* It's a lamp */
else if (o_ptr->sval == SV_LITE_LANTERN)
{
- do_cmd_refill_lamp();
+ do_cmd_refill_lamp(creature_ptr);
}
/* It's a torch */
else if (o_ptr->sval == SV_LITE_TORCH)
{
- do_cmd_refill_torch();
+ do_cmd_refill_torch(creature_ptr);
}
/* No torch to refill */
* Target command
* @return なし
*/
-void do_cmd_target(void)
+void do_cmd_target(player_type *creature_ptr)
{
- if (p_ptr->wild_mode) return;
+ if (creature_ptr->wild_mode) return;
/* Target set */
- if (target_set(TARGET_KILL))
+ if (target_set(creature_ptr, TARGET_KILL))
{
msg_print(_("ターゲット決定。", "Target Selected."));
}
}
-
/*!
* @brief 周囲を見渡すコマンドのメインルーチン
* Look command
* @return なし
*/
-void do_cmd_look(void)
+void do_cmd_look(player_type *creature_ptr)
{
- p_ptr->window |= PW_MONSTER_LIST;
- handle_stuff();
+ creature_ptr->window |= PW_MONSTER_LIST;
+ handle_stuff(creature_ptr);
/* Look around */
- if (target_set(TARGET_LOOK))
+ if (target_set(creature_ptr, TARGET_LOOK))
{
msg_print(_("ターゲット決定。", "Target Selected."));
}
x2 = x1 = panel_col_min;
/* Show panels until done */
- while (1)
+ while (TRUE)
{
/* Describe the location */
if ((y2 == y1) && (x2 == x1))
if (!dir) break;
/* Apply the motion */
- if (change_panel(ddy[dir], ddx[dir]))
+ if (change_panel(creature_ptr, ddy[dir], ddx[dir]))
{
y2 = panel_row_min;
x2 = panel_col_min;
/* Recenter the map around the player */
- verify_panel();
+ verify_panel(creature_ptr);
creature_ptr->update |= (PU_MONSTERS);
creature_ptr->redraw |= (PR_MAP);
creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
- handle_stuff();
+ handle_stuff(creature_ptr);
}
/*!
* @brief モンスターの思い出を見るコマンドのメインルーチン
* Identify a character, allow recall of monsters
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* <pre>
* Note that the player ghosts are ignored.
* </pre>
*/
-void do_cmd_query_symbol(void)
+void do_cmd_query_symbol(player_type *creature_ptr)
{
IDX i;
int n;
ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
}
-
/* Start at the end */
i = n - 1;
/* Scan the monster memory */
- while (1)
+ while (TRUE)
{
r_idx = who[i];
/* Hack -- Auto-recall */
- monster_race_track(r_idx);
- handle_stuff();
+ monster_race_track(creature_ptr, r_idx);
+ handle_stuff(creature_ptr);
/* Interact */
- while (1)
+ while (TRUE)
{
if (recall)
{
screen_save();
/* Recall on screen */
- screen_roff(who[i], 0);
+ screen_roff(creature_ptr, who[i], 0);
}
/* Hack -- Begin the prompt */
case TV_SHOT:
case TV_ARROW:
case TV_BOLT:
- exe_fire(item, &creature_ptr->inventory_list[INVEN_BOW], SP_NONE);
+ exe_fire(creature_ptr, item, &creature_ptr->inventory_list[INVEN_BOW], SP_NONE);
break;
default: