/*!
* @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_wield(player_type *creature_ptr)
{
object_desc(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));
#endif
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(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->current_floor_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);
calc_android_exp(creature_ptr);
}
+
/*!
* @brief 持ち替え処理
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param item 持ち替えを行いたい装備部位ID
* @return なし
*/
if (item == INVEN_RARM)
{
- if (has_melee_weapon(owner_ptr, INVEN_LARM))
- {
- o_ptr = &owner_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 = &owner_ptr->inventory_list[INVEN_RARM];
- object_copy(new_o_ptr, o_ptr);
- owner_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 = &owner_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(o_name, o_ptr, 0);
- if (has_melee_weapon(owner_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(owner_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
- {
- 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(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(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);
+ (void)inven_takeoff(creature_ptr, item, 255);
verify_equip_slot(creature_ptr, item);
calc_android_exp(creature_ptr);
creature_ptr->redraw |= (PR_EQUIPPY);
/*!
* @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_destroy(player_type *creature_ptr)
/* 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. */
/* Reduce the charges of rods/wands */
reduce_charges(o_ptr, amt);
- vary_item(item, -amt);
+ vary_item(creature_ptr, item, -amt);
if (item_tester_high_level_book(q_ptr))
{
msg_print(_("ランプの油は一杯だ。", "Your lamp is full."));
}
- vary_item(item, -1);
+ vary_item(user_ptr, item, -1);
user_ptr->update |= (PU_TORCH);
}
msg_print(_("松明はいっそう明るく輝いた。", "Your torch glows more brightly."));
}
- vary_item(item, -1);
+ vary_item(creature_ptr, item, -1);
creature_ptr->update |= (PU_TORCH);
}
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
void do_cmd_look(player_type *creature_ptr)
{
creature_ptr->window |= PW_MONSTER_LIST;
- handle_stuff();
+ 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))
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();
+ handle_stuff(creature_ptr);
/* Interact */
- while (1)
+ while (TRUE)
{
if (recall)
{