-/*!
+/*!
* @file cmd3.c
* @brief プレイヤーのアイテムに関するコマンドの実装1 / Inventory commands
* @date 2014/01/02
*/
void do_cmd_wield(void)
{
- int item, slot;
+ OBJECT_IDX item, slot;
object_type forge;
object_type *q_ptr;
cptr q, s;
- int need_switch_wielding = 0;
+ OBJECT_IDX need_switch_wielding = 0;
if (p_ptr->special_defense & KATA_MUSOU)
{
}
/* Take a turn */
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Get local object */
q_ptr = &forge;
*/
void do_cmd_takeoff(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
else
{
msg_print(_("装備を外せなかった。", "You couldn't remove the equipment."));
- energy_use = 50;
+ p_ptr->energy_use = 50;
return;
}
}
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Take off the item */
(void)inven_takeoff(item, 255);
*/
void do_cmd_drop(void)
{
- int item, amt = 1;
+ OBJECT_IDX item;
+ int amt = 1;
object_type *o_ptr;
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Drop (some of) the item */
inven_drop(item, amt);
*/
void do_cmd_destroy(void)
{
- int item, amt = 1;
- int old_number;
-
- bool force = FALSE;
+ OBJECT_IDX item;
+ QUANTITY amt = 1;
+ QUANTITY old_number;
- object_type *o_ptr;
- object_type forge;
- object_type *q_ptr = &forge;
+ bool force = FALSE;
- char o_name[MAX_NLEN];
+ object_type *o_ptr;
+ object_type forge;
+ object_type *q_ptr = &forge;
- char out_val[MAX_NLEN+40];
+ char o_name[MAX_NLEN];
+ char out_val[MAX_NLEN+40];
cptr q, s;
o_ptr->number = old_number;
/* Take a turn */
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Artifacts cannot be destroyed */
if (!can_player_destroy_object(o_ptr))
{
- energy_use = 0;
+ p_ptr->energy_use = 0;
/* Message */
msg_format(_("%sは破壊不可能だ。", "You cannot destroy %s."), o_name);
*/
void do_cmd_observe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
char o_name[MAX_NLEN];
cptr q, s;
*/
void do_cmd_uninscribe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
cptr q, s;
item_tester_no_ryoute = TRUE;
*/
void do_cmd_inscribe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
char o_name[MAX_NLEN];
-
char out_val[80];
-
cptr q, s;
item_tester_no_ryoute = TRUE;
*/
static void do_cmd_refill_lamp(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
object_type *j_ptr;
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Access the lantern */
j_ptr = &inventory[INVEN_LITE];
*/
static void do_cmd_refill_torch(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
object_type *j_ptr;
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Access the primary torch */
j_ptr = &inventory[INVEN_LITE];
*/
void do_cmd_query_symbol(void)
{
- int i, n, r_idx;
+ IDX i;
+ int n;
+ MONRACE_IDX r_idx;
char sym, query;
char buf[128];
bool recall = FALSE;
u16b why = 0;
- u16b *who;
+ IDX *who;
/* Get a character, or abort */
if (!get_com(_("知りたい文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^R乗馬,^M名前): ",
prt(buf, 0, 0);
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, u16b);
+ C_MAKE(who, max_r_idx, IDX);
/* Collect matching monsters */
for (n = 0, i = 1; i < max_r_idx; i++)
#ifdef JP
if (iskanji( temp[xx])) { xx++; continue; }
#endif
- if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
+ if (isupper(temp[xx])) temp[xx] = (char)tolower(temp[xx]);
}
#ifdef JP
strcpy(temp2, r_name+r_ptr->name);
#endif
for (xx=0; temp2[xx] && xx<80; xx++)
- if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
+ if (isupper(temp2[xx])) temp2[xx] = (char)tolower(temp2[xx]);
#ifdef JP
if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
#else
if (my_strstr(temp2, temp))
#endif
- who[n++]=i;
+ who[n++] = i;
}
/* Collect "appropriate" monsters */
if (!n)
{
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
return;
}
if (query != 'y')
{
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
return;
}
}
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
/* Re-display the identity */
prt(buf, 0, 0);