#include "angband.h"
#include "object-hook.h"
#include "object-curse.h"
+#include "artifact.h"
+#include "player-status.h"
static void one_sustain(object_type *o_ptr);
-static cptr const kaji_tips[5] =
+static concptr const kaji_tips[5] =
{
#ifdef JP
"現在持っているエッセンスの一覧を表示する。",
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
- /* Grid */
c_ptr = &cave[y][x];
/* Scan all objects in the grid */
/* Refuse "illegal" locations */
if (!in_bounds(y, x)) return;
- /* Grid */
c_ptr = &cave[y][x];
/* Scan all objects in the grid */
{
object_type forge;
object_type *q_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
q_ptr = &forge;
object_copy(q_ptr, o_ptr);
o_ptr->ident |= (IDENT_SENSE);
/* Combine the pack */
- p_ptr->notice |= (PN_COMBINE);
+ p_ptr->update |= (PU_COMBINE);
p_ptr->window |= (PW_INVEN | PW_EQUIP);
* @param sval 検索したいベースアイテムのsval
* @return なし
*/
-IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval)
+KIND_OBJECT_IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval)
{
- IDX k;
+ KIND_OBJECT_IDX k;
int num = 0;
- IDX bk = 0;
+ KIND_OBJECT_IDX bk = 0;
/* Look for it */
for (k = 1; k < max_k_idx; k++)
*/
static void object_mention(object_type *o_ptr)
{
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
object_aware(o_ptr);
object_known(o_ptr);
/* Mark the item as fully known */
o_ptr->ident |= (IDENT_MENTAL);
-
- /* Description */
object_desc(o_name, o_ptr, 0);
msg_format_wizard(CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
}
*/
static bool make_artifact(object_type *o_ptr)
{
- IDX i;
-
+ ARTIFACT_IDX i;
/* No artifacts in the town */
if (!dun_level) return (FALSE);
break;
}
}
- /* Uncurse it */
o_ptr->curse_flags = 0L;
}
else if ((power == -2) && one_in_(2))
}
}
}
- /* Uncurse it */
o_ptr->curse_flags = 0L;
}
else if ((power == -2) && one_in_(2))
return;
}
-
- /* Apply magic */
switch (o_ptr->tval)
{
case TV_DIGGING:
cave_type *c_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
bool flag = FALSE;
bool done = FALSE;
}
- /* Grid */
c_ptr = &cave[by][bx];
/* Scan objects in that grid for combination */
/* Check for combination */
if (object_similar(o_ptr, j_ptr))
{
- /* Combine the items */
object_absorb(o_ptr, j_ptr);
/* Success */
}
}
- /* Get new object */
if (!done) o_idx = o_pop();
/* Failure */
msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
#endif
-
/* Debug */
if (p_ptr->wizard) msg_print(_("(アイテムが多過ぎる)", "(too many objects)"));
done = TRUE;
}
- /* Note the spot */
note_spot(by, bx);
-
- /* Draw the spot */
lite_spot(by, bx);
-
sound(SOUND_DROP);
/* Mega-Hack -- no message if "dropped" by player */
void inven_item_describe(INVENTORY_IDX item)
{
object_type *o_ptr = &inventory[item];
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, o_ptr, 0);
* @param num 増やしたい量
* @return なし
*/
-void inven_item_increase(INVENTORY_IDX item, int num)
+void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
{
object_type *o_ptr = &inventory[item];
else if (num < 0) num = 0;
/* Un-apply */
- num -= (ITEM_NUMBER)o_ptr->number;
+ num -= o_ptr->number;
/* Change the number and weight */
if (num)
/* Add the weight */
p_ptr->total_weight += (num * o_ptr->weight);
-
- /* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
/* Recalculate mana XXX */
p_ptr->update |= (PU_MANA);
/* Combine the pack */
- p_ptr->notice |= (PN_COMBINE);
+ p_ptr->update |= (PU_COMBINE);
p_ptr->window |= (PW_INVEN | PW_EQUIP);
{
if ((item == INVEN_RARM) || (item == INVEN_LARM))
{
- if (!buki_motteruka(INVEN_RARM + INVEN_LARM - item))
+ if (!has_melee_weapon(INVEN_RARM + INVEN_LARM - item))
{
/* Clear all temporary elemental brands */
set_ele_attack(0, 0);
/* Erase the empty slot */
object_wipe(&inventory[item]);
-
- /* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
/* Recalculate torch */
void floor_item_describe(INVENTORY_IDX item)
{
object_type *o_ptr = &o_list[item];
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, o_ptr, 0);
* @param num 増やしたいアイテムの数
* @return なし
*/
-void floor_item_increase(INVENTORY_IDX item, int num)
+void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
{
object_type *o_ptr = &o_list[item];
else if (num < 0) num = 0;
/* Un-apply */
- num -= (int)o_ptr->number;
+ num -= o_ptr->number;
/* Change the number */
- o_ptr->number += (ITEM_NUMBER)num;
+ o_ptr->number += num;
}
/* Check if the two items can be combined */
if (object_similar(j_ptr, o_ptr))
{
- /* Combine the items */
object_absorb(j_ptr, o_ptr);
- /* Increase the weight */
p_ptr->total_weight += (o_ptr->number * o_ptr->weight);
-
- /* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
-
p_ptr->window |= (PW_INVEN);
/* Success */
/* Player touches it, and no longer marked */
j_ptr->marked = OM_TOUCHED;
- /* Increase the weight */
p_ptr->total_weight += (j_ptr->number * j_ptr->weight);
/* Count the items */
inven_cnt++;
-
- /* Recalculate bonuses */
- p_ptr->update |= (PU_BONUS);
-
- /* Combine and Reorder pack */
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);
-
+ p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
/* Return the slot */
object_type *o_ptr;
- cptr act;
+ concptr act;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
/* Get the item to take off */
object_type *q_ptr;
object_type *o_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
/* Access original object */
o_ptr = &inventory[item];
/* Not too many */
if (amt > o_ptr->number) amt = o_ptr->number;
-
/* Take off equipment */
if (item >= INVEN_RARM)
{
void combine_pack(void)
{
int i, j, k;
- object_type *o_ptr;
+ object_type *o_ptr;
object_type *j_ptr;
bool flag = FALSE, combined;
s32b o_value;
object_type forge;
object_type *q_ptr;
- object_type *o_ptr;
+ object_type *o_ptr;
bool flag = FALSE;
int sval;
REALM_IDX use_realm;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
/* Erase the window */
{
POSITION mx, my;
cave_type *c_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
#define WARNING_AWARE_RANGE 12
int dam_max = 0;
*/
typedef struct {
int add; /* TR flag number or special essence id */
- cptr add_name; /* Name of this ability */
+ concptr add_name; /* Name of this ability */
ESSENCE_IDX type; /* Menu number */
int essence; /* Index for carrying essences */
int value; /* Needed value to add this ability */
* エッセンス名テーブル / Essense names for Weapon smith
*/
#ifdef JP
-cptr essence_name[] =
+concptr essence_name[] =
{
"腕力",
"知能",
#else
-cptr essence_name[] =
+concptr essence_name[] =
{
"strength",
"intelligen.",
TIME_EFFECT old_timeout;
BIT_FLAGS old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
object_type *o_ptr;
- cptr q, s;
+ concptr q, s;
POSITION iy, ix;
byte_hack marked;
ITEM_NUMBER number;
drain_value[i] = 0;
item_tester_hook = object_is_weapon_armour_ammo;
- item_tester_no_ryoute = TRUE;
q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return;
if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
{
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
if (!get_check(format(_("本当に%sから抽出してよろしいですか?", "Really extract from %s? "), o_name))) return;
}
autopick_alter_item(item, TRUE);
/* Combine the pack */
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
}
COMMAND_CODE menu_line = (use_menu ? 1 : 0);
#ifdef JP
- cptr menu_name[] = {
+ concptr menu_name[] = {
"武器属性",
"耐性",
"能力",
"その他"
};
#else
- cptr menu_name[] = {
+ concptr menu_name[] = {
"Brand weapon",
"Resistance",
"Ability",
COMMAND_CODE i;
bool flag,redraw;
char choice;
- cptr q, s;
+ concptr q, s;
object_type *o_ptr;
int ask = TRUE;
char out_val[160];
int num[22];
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
int use_essence;
essence_type *es_ptr;
bool able[22] = { 0 };
item_tester_hook = object_is_armour;
else
item_tester_hook = object_is_weapon_armour_ammo;
- item_tester_no_ryoute = TRUE;
q = _("どのアイテムを改良しますか?", "Improve which item? ");
s = _("改良できるアイテムがありません。", "You have nothing to improve.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+ if (!o_ptr) return;
if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
{
#endif
/* Combine the pack */
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
}
static void erase_essence(void)
{
OBJECT_IDX item;
- cptr q, s;
+ concptr q, s;
object_type *o_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
BIT_FLAGS flgs[TR_FLAG_SIZE];
item_tester_hook = object_is_smith;
q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
s = _("エッセンスを付加したアイテムがありません。", "You have nothing to remove essence.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ if (!o_ptr) return;
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
if (!get_check(format(_("よろしいですか? [%s]", "Are you sure? [%s]"), o_name))) return;
p_ptr->energy_use = 100;
- if (o_ptr->xtra3 == 1+ESSENCE_SLAY_GLOVE)
+ if (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE)
{
o_ptr->to_h -= (o_ptr->xtra4>>8);
o_ptr->to_d -= (o_ptr->xtra4 & 0x000f);
msg_print(_("エッセンスを取り去った。", "You removed all essence you have added."));
/* Combine the pack */
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
}
if (!only_browse)
{
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて作業できない!", "You are too confused!"));
- return;
- }
+ if (cmd_limit_confused(p_ptr)) return;
if (p_ptr->blind)
{
msg_print(_("目が見えなくて作業できない!", "You are blind!"));