static owner_type *ot_ptr = NULL;
#endif
+/*
+ * We store the current "store feat" here so everyone can access it
+ */
+static int cur_store_feat;
+
case TV_DIGGING:
case TV_BOW:
{
- if (o_ptr->name2) break;
+ if (object_is_artifact(o_ptr)) break;
+ if (object_is_ego(o_ptr)) break;
if (cost <= 10L) size += damroll(3, 5);
if (cost <= 100L) size += damroll(3, 5);
break;
if (o_ptr->to_d != j_ptr->to_d) return (0);
if (o_ptr->to_a != j_ptr->to_a) return (0);
- /* Require identical "artifact" names */
- if (o_ptr->name1 != j_ptr->name1) return (0);
-
/* Require identical "ego-item" names */
if (o_ptr->name2 != j_ptr->name2) return (0);
- /* Random artifacts don't stack !*/
- if (o_ptr->art_name || j_ptr->art_name) return (0);
+ /* Artifacts don't stack! */
+ if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
/* Hack -- Identical art_flags! */
for (i = 0; i < TR_FLAG_SIZE; i++)
if (o_ptr->tval < j_ptr->tval) continue;
/* Can happen in the home */
- if (!object_aware_p(o_ptr)) continue;
- if (!object_aware_p(j_ptr)) break;
+ if (!object_is_aware(o_ptr)) continue;
+ if (!object_is_aware(j_ptr)) break;
/* Objects sort by increasing sval */
if (o_ptr->sval < j_ptr->sval) break;
if (o_ptr->sval > j_ptr->sval) continue;
/* Objects in the home can be unknown */
- if (!object_known_p(o_ptr)) continue;
- if (!object_known_p(j_ptr)) break;
+ if (!object_is_known(o_ptr)) continue;
+ if (!object_is_known(j_ptr)) break;
/*
* Hack: otherwise identical rods sort by
int i, j;
/* Ego items are never crap */
- if (o_ptr->name2) return (FALSE);
+ if (object_is_ego(o_ptr)) return (FALSE);
/* Good items are never crap */
if (o_ptr->to_a > 0) return (FALSE);
object_known(q_ptr);
/* Mark it storebought */
- q_ptr->ident |= IDENT_STOREB;
+ q_ptr->ident |= IDENT_STORE;
/* Mega-Hack -- no chests in stores */
if (q_ptr->tval == TV_CHEST) continue;
a |= 0x40;
#endif
- Term_draw(cur_col, i + 6, a, c);
- if (use_bigtile)
- {
- cur_col++;
- if (a & 0x80)
- Term_draw(cur_col, i + 6, 255, -1);
- }
+ Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
cur_col += 2;
}
if (show_weights) maxwid -= 10;
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
o_name[maxwid] = '\0';
c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
if (show_weights) maxwid -= 7;
/* Describe the object (fully) */
- object_desc_store(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
o_name[maxwid] = '\0';
c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
/* Normal stores */
else
{
- cptr store_name = (f_name + f_info[FEAT_SHOP_HEAD + cur_store_num].name);
+ cptr store_name = (f_name + f_info[cur_store_feat].name);
cptr owner_name = (ot_ptr->owner_name);
cptr race_name = race_info[ot_ptr->owner_race].title;
/* Ask until done */
while (TRUE)
{
+ bool res;
+
+ /* Display prompt */
+ prt(buf, 0, 0);
+
/* Default */
strcpy(out_val, "");
- /* Ask the user for a response */
- if (!get_string(buf, out_val, 32)) return (FALSE);
+ /*
+ * Ask the user for a response.
+ * Don't allow to use numpad as cursor key.
+ */
+ res = askfor_aux(out_val, 32, FALSE);
+
+ /* Clear prompt */
+ prt("", 0, 0);
+
+ /* Cancelled */
+ if (!res) return FALSE;
/* Skip leading spaces */
for (p = out_val; *p == ' '; p++) /* loop */;
else
{
/* Describe the object (fully) */
- object_desc_store(o_name, j_ptr, TRUE, 3);
+ object_desc(o_name, j_ptr, 0);
/* Message */
#ifdef JP
j_ptr->ident &= ~(IDENT_FIXED);
/* Describe the transaction */
- object_desc(o_name, j_ptr, TRUE, 3);
+ object_desc(o_name, j_ptr, 0);
/* Message */
#ifdef JP
record_turn = turn;
if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
if(record_rand_art && o_ptr->art_name)
do_cmd_write_nikki(NIKKI_ART, 0, o_name);
/* Erase the "feeling" */
j_ptr->feeling = FEEL_NONE;
- j_ptr->ident &= ~(IDENT_STOREB);
+ j_ptr->ident &= ~(IDENT_STORE);
/* Give it to the player */
item_new = inven_carry(j_ptr);
/* Describe the final result */
- object_desc(o_name, &inventory[item_new], TRUE, 3);
+ object_desc(o_name, &inventory[item_new], 0);
/* Message */
#ifdef JP
#endif
/* Auto-inscription */
- auto_do_item(item_new, FALSE);
+ autopick_alter_item(item_new, FALSE);
/* Now, reduce the original stack's pval. */
if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
put_str(buf, 3, 10);
sprintf(buf, "%s (%ld)",
- (f_name + f_info[FEAT_SHOP_HEAD + cur_store_num].name), (long)(ot_ptr->max_cost));
+ (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
prt(buf, 3, 50);
}
item_new = inven_carry(j_ptr);
/* Describe just the result */
- object_desc(o_name, &inventory[item_new], TRUE, 3);
+ object_desc(o_name, &inventory[item_new], 0);
/* Message */
#ifdef JP
/* Hack -- Cannot remove cursed items */
- if ((item >= INVEN_RARM) && cursed_p(o_ptr))
+ if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
{
/* Oops */
#ifdef JP
}
/* Get a full description */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, 0);
/* Remove any inscription, feeling for stores */
if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
/* Modify quantity */
q_ptr->number = amt;
+ /* Make it look like to be known */
+ q_ptr->ident |= IDENT_STORE;
+
/*
* Hack -- If a rod or wand, let the shopkeeper know just
* how many charges he really paid for. -LM-
value = object_value(q_ptr) * q_ptr->number;
/* Get the description all over again */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, 0);
/* Describe the result (in message buffer) */
#ifdef JP
/* If items remain, auto-inscribe before optimizing */
if (o_ptr->number > 0)
- auto_do_item(item, FALSE);
+ autopick_alter_item(item, FALSE);
inven_item_optimize(item);
else if (cur_store_num == STORE_MUSEUM)
{
char o2_name[MAX_NLEN];
- object_desc(o2_name, q_ptr, TRUE, 0);
+ object_desc(o2_name, q_ptr, OD_NAME_ONLY);
if (-1 == store_check_num(q_ptr))
{
}
/* Description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Describe */
#ifdef JP
c_ptr = &cave[py][px];
/* Verify a store */
- if (!((c_ptr->feat >= FEAT_SHOP_HEAD) &&
- (c_ptr->feat <= FEAT_SHOP_TAIL)) &&
- (c_ptr->feat != FEAT_MUSEUM))
+ if (!cave_have_flag_grid(c_ptr, FF_STORE))
{
#ifdef JP
msg_print("¤³¤³¤Ë¤ÏŹ¤¬¤¢¤ê¤Þ¤»¤ó¡£");
}
/* Extract the store code */
- if (c_ptr->feat == FEAT_MUSEUM) which = STORE_MUSEUM;
- else which = (c_ptr->feat - FEAT_SHOP_HEAD);
+ which = f_info[c_ptr->feat].power;
old_town_num = p_ptr->town_num;
if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
/* Save the store number */
cur_store_num = which;
+ /* Hack -- save the store feature */
+ cur_store_feat = c_ptr->feat;
+
/* Save the store and owner pointers */
st_ptr = &town[p_ptr->town_num].store[cur_store_num];
ot_ptr = &owners[cur_store_num][st_ptr->owner];
object_copy(q_ptr, o_ptr);
/* Describe it */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, 0);
/* Message */
#ifdef JP
/* Get the item */
o_ptr = &st_ptr->stock[i];
- if (!(artifact_p(o_ptr) || o_ptr->art_name))
+ if (!object_is_artifact(o_ptr))
{
/* Hack -- Sell all non-artifact old items for "half price" */
o_ptr->discount = 50;
st_ptr = &town[p_ptr->town_num].store[STORE_BLACK];
- o_ptr->ident |= IDENT_STOREB;
+ o_ptr->ident |= IDENT_STORE;
(void)store_carry(o_ptr);