#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
"現在持っているエッセンスの一覧を表示する。",
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
- /* Grid */
c_ptr = &cave[y][x];
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* Refuse "illegal" locations */
if (!in_bounds(y, x)) return;
- /* Grid */
c_ptr = &cave[y][x];
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* Repair objects */
for (i = 1; i < o_max; i++)
{
- /* Acquire object */
o_ptr = &o_list[i];
/* Skip "dead" objects */
o_ptr->next_o_idx = i2;
}
}
-
- /* Acquire object */
o_ptr = &o_list[i1];
/* Monster */
/* Acquire monster */
m_ptr = &m_list[o_ptr->held_m_idx];
- /* Get the location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Dungeon */
else
{
- /* Get the location */
y = o_ptr->iy;
x = o_ptr->ix;
}
for (i = 1; i < o_max; i++)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[i];
/* Skip live objects */
if (level > MAX_DEPTH - 1) level = MAX_DEPTH - 1;
/* Boost level */
- if ((level > 0) && !(d_info[dungeon_type].flags1 & DF1_BEGINNER))
+ if ((level > 0) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
{
/* Occasional "boost" */
if (one_in_(GREAT_OBJ))
{
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))
f1 = lev + 10;
/* Maximal chance of being "good" */
- if (f1 > d_info[dungeon_type].obj_good) f1 = d_info[dungeon_type].obj_good;
+ if (f1 > d_info[p_ptr->dungeon_idx].obj_good) f1 = d_info[p_ptr->dungeon_idx].obj_good;
/* Base chance of being "great" */
f2 = f1 * 2 / 3;
/* Maximal chance of being "great" */
- if ((p_ptr->pseikaku != SEIKAKU_MUNCHKIN) && (f2 > d_info[dungeon_type].obj_great))
- f2 = d_info[dungeon_type].obj_great;
+ if ((p_ptr->pseikaku != SEIKAKU_MUNCHKIN) && (f2 > d_info[p_ptr->dungeon_idx].obj_great))
+ f2 = d_info[p_ptr->dungeon_idx].obj_great;
if (p_ptr->muta3 & MUT3_GOOD_LUCK)
{
return;
}
-
- /* Apply magic */
switch (o_ptr->tval)
{
case TV_DIGGING:
/* Avoid stacking on other objects */
if (c_ptr->o_idx) return;
-
- /* Get local object */
q_ptr = &forge;
object_wipe(q_ptr);
if (o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[o_idx];
/* Structure Copy */
/* Avoid stacking on other objects */
if (c_ptr->o_idx) return;
-
- /* Get local object */
q_ptr = &forge;
object_wipe(q_ptr);
if (o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[o_idx];
/* Copy the object */
cave_type *c_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
bool flag = FALSE;
bool done = FALSE;
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
}
- /* Grid */
c_ptr = &cave[by][bx];
/* Scan objects in that grid for combination */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* 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 */
#ifdef JP
msg_format("%sは消えた。", o_name);
#else
- msg_format("The %s disappear%s.",
- o_name, (plural ? "" : "s"));
+ 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 */
return (o_idx);
}
-
-/*!
- * @brief 獲得ドロップを行う。
- * Scatter some "great" objects near the player
- * @param y1 配置したいフロアのY座標
- * @param x1 配置したいフロアのX座標
- * @param num 獲得の処理回数
- * @param great TRUEならば必ず高級品以上を落とす
- * @param special TRUEならば必ず特別品を落とす
- * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
- * @return なし
- */
-void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
-{
- object_type *i_ptr;
- object_type object_type_body;
- BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L) ;
-
- /* Acquirement */
- while (num--)
- {
- /* Get local object */
- i_ptr = &object_type_body;
- object_wipe(i_ptr);
-
- /* Make a good (or great) object (if possible) */
- if (!make_object(i_ptr, mode)) continue;
-
- if (known)
- {
- object_aware(i_ptr);
- object_known(i_ptr);
- }
-
- /* Drop the object */
- (void)drop_near(i_ptr, -1, y1, x1);
- }
-}
-
-/*
- * Scatter some "amusing" objects near the player
- */
-
-#define AMS_NOTHING 0x00 /* No restriction */
-#define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */
-#define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */
-#define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */
-#define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */
-
-typedef struct
-{
- OBJECT_TYPE_VALUE tval;
- OBJECT_SUBTYPE_VALUE sval;
- PERCENTAGE prob;
- byte flag;
-} amuse_type;
-
-amuse_type amuse_info[] =
-{
- { TV_BOTTLE, SV_ANY, 5, AMS_NOTHING },
- { TV_JUNK, SV_ANY, 3, AMS_MULTIPLE },
- { TV_SPIKE, SV_ANY, 10, AMS_PILE },
- { TV_STATUE, SV_ANY, 15, AMS_NOTHING },
- { TV_CORPSE, SV_ANY, 15, AMS_NO_UNIQUE },
- { TV_SKELETON, SV_ANY, 10, AMS_NO_UNIQUE },
- { TV_FIGURINE, SV_ANY, 10, AMS_NO_UNIQUE },
- { TV_PARCHMENT, SV_ANY, 1, AMS_NOTHING },
- { TV_POLEARM, SV_TSURIZAO, 3, AMS_NOTHING }, //Fishing Pole of Taikobo
- { TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, //Broken Dagger of Magician
- { TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING },
- { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
- { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
-
- { 0, 0, 0 }
-};
-
-/*!
- * @brief 誰得ドロップを行う。
- * @param y1 配置したいフロアのY座標
- * @param x1 配置したいフロアのX座標
- * @param num 誰得の処理回数
- * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
- * @return なし
- */
-void amusement(POSITION y1, POSITION x1, int num, bool known)
-{
- object_type *i_ptr;
- object_type object_type_body;
- int n, t = 0;
-
- for (n = 0; amuse_info[n].tval != 0; n++)
- {
- t += amuse_info[n].prob;
- }
-
- /* Acquirement */
- while (num)
- {
- int i;
- KIND_OBJECT_IDX k_idx;
- ARTIFACT_IDX a_idx = 0;
- int r = randint0(t);
- bool insta_art, fixed_art;
-
- for (i = 0; ; i++)
- {
- r -= amuse_info[i].prob;
- if (r <= 0) break;
- }
-
- /* Get local object */
- i_ptr = &object_type_body;
- object_wipe(i_ptr);
- k_idx = lookup_kind(amuse_info[i].tval, amuse_info[i].sval);
-
- /* Paranoia - reroll if nothing */
- if (!k_idx) continue;
-
- /* Search an artifact index if need */
- insta_art = (k_info[k_idx].gen_flags & TRG_INSTA_ART);
- fixed_art = (amuse_info[i].flag & AMS_FIXED_ART);
-
- if (insta_art || fixed_art)
- {
- for (a_idx = 1; a_idx < max_a_idx; a_idx++)
- {
- if (insta_art && !(a_info[a_idx].gen_flags & TRG_INSTA_ART)) continue;
- if (a_info[a_idx].tval != k_info[k_idx].tval) continue;
- if (a_info[a_idx].sval != k_info[k_idx].sval) continue;
- if (a_info[a_idx].cur_num > 0) continue;
- break;
- }
-
- if (a_idx >= max_a_idx) continue;
- }
-
- /* Make an object (if possible) */
- object_prep(i_ptr, k_idx);
- if (a_idx) i_ptr->name1 = a_idx;
- apply_magic(i_ptr, 1, AM_NO_FIXED_ART);
-
- if (amuse_info[i].flag & AMS_NO_UNIQUE)
- {
- if (r_info[i_ptr->pval].flags1 & RF1_UNIQUE) continue;
- }
-
- if (amuse_info[i].flag & AMS_MULTIPLE) i_ptr->number = randint1(3);
- if (amuse_info[i].flag & AMS_PILE) i_ptr->number = randint1(99);
-
- if (known)
- {
- object_aware(i_ptr);
- object_known(i_ptr);
- }
-
- /* Paranoia - reroll if nothing */
- if (!(i_ptr->k_idx)) continue;
-
- /* Drop the object */
- (void)drop_near(i_ptr, -1, y1, x1);
-
- num--;
- }
-}
-
-
/*!
* @brief 魔道具の使用回数の残量を示すメッセージを表示する /
* Describe the charges on an item in the inventory.
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);
}
/*!
- * @brief アイテムを増やし残り所持数メッセージを表示する /
+ * @brief アイテムを増減させ残り所持数メッセージを表示する /
* Increase the "number" of an item in the inventory
* @param item 所持数を増やしたいプレイヤーのアイテム所持スロット
* @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 */
/* Verify */
if (amt > o_ptr->number) amt = o_ptr->number;
-
- /* Get local object */
q_ptr = &forge;
/* Obtain a local object */
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)
{
o_ptr = &inventory[item];
}
-
- /* Get local object */
q_ptr = &forge;
/* Obtain local object */
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;
/* Take note */
flag = TRUE;
-
- /* Get local object */
q_ptr = &forge;
/* Save a copy of the moving item */
int sval;
REALM_IDX use_realm;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
/* Erase the window */
/* No info */
if (!k_idx) return;
-
- /* Get local object */
q_ptr = &forge;
/* Prepare the object */
{
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;
BIT_FLAGS f5 = r_ptr->a_ability_flags1;
BIT_FLAGS f6 = r_ptr->a_ability_flags2;
- if (!(d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC))
{
if (f4 & RF4_BA_CHAO) spell_damcalc_by_spellnum(MS_BALL_CHAOS, GF_CHAOS, c_ptr->m_idx, &dam_max0);
if (f5 & RF5_BA_MANA) spell_damcalc_by_spellnum(MS_BALL_MANA, GF_MANA, c_ptr->m_idx, &dam_max0);
}
/* Monster melee attacks */
- if (!(r_ptr->flags1 & RF1_NEVER_BLOW) && !(d_info[dungeon_type].flags1 & DF1_NO_MELEE))
+ if (!(r_ptr->flags1 & RF1_NEVER_BLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE))
{
if (mx <= xx + 1 && mx >= xx - 1 && my <= yy + 1 && my >= yy - 1)
{
*/
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;
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
object_flags(o_ptr, old_flgs);
if (have_flag(old_flgs, TR_KILL_DRAGON)) add_flag(old_flgs, TR_SLAY_DRAGON);
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 };
/* Show list */
redraw = TRUE;
-
- /* Save the screen */
if (!use_menu) screen_save();
for (y = 1; y < 24; y++)
{
/* Hide list */
redraw = FALSE;
-
- /* Restore the screen */
screen_load();
}
/* Stop the loop */
flag = TRUE;
}
-
- /* Restore the screen */
if (redraw) screen_load();
if (!flag) return;
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)))
{
if ((o_ptr->to_h >= p_ptr->lev/5+5) && (o_ptr->to_d >= p_ptr->lev/5+5))
{
msg_print(_("改良に失敗した。", "You failed to enchant."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return;
}
else
if (o_ptr->to_a >= p_ptr->lev/5+5)
{
msg_print(_("改良に失敗した。", "You failed to enchant."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return;
}
else
}
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
#ifdef JP
msg_format("%sに%sの能力を付加しました。", o_name, es_ptr->add_name);
#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;
+ take_turn(p_ptr, 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!"));