#include "cmd-basic.h"
#include "artifact.h"
-#include "floor.h"
+#include "floor/floor.h"
#include "grid.h"
-#include "spells.h"
+#include "spell/spells3.h"
#include "spells-object.h"
-#include "object-boost.h"
-#include "object-hook.h"
-#include "object-flavor.h"
-#include "object-ego.h"
+#include "object/object-boost.h"
+#include "object/object-hook.h"
+#include "object/object-flavor.h"
+#include "object/object-ego.h"
#include "player-damage.h"
#include "player-status.h"
#include "avatar.h"
#include "player-effects.h"
#include "player-class.h"
#include "player-inventory.h"
-#include "objectkind.h"
-#include "autopick.h"
+#include "object/object-kind.h"
+#include "autopick/autopick.h"
#include "targeting.h"
-#include "view-mainwindow.h"
+#include "view/display-main-window.h"
typedef struct
{ TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING },
{ TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
- { 0, 0, 0 }
+ { 0, 0, 0, 0 }
};
/*!
object_type forge;
object_type *q_ptr;
q_ptr = &forge;
+
/**********Create shots*********/
if (ext == 1)
{
DIRECTION dir;
grid_type *g_ptr;
- if (!get_rep_dir(&dir, FALSE)) return FALSE;
+ if (!get_rep_dir(creature_ptr, &dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
{
- msg_print(_("そこには岩石がない。", "You need pile of rubble."));
+ msg_print(_("そこには岩石がない。", "You need a pile of rubble."));
return FALSE;
}
- else if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
+
+ if (!cave_have_flag_grid(g_ptr, FF_CAN_DIG) || !cave_have_flag_grid(g_ptr, FF_HURT_ROCK))
{
msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
+ return TRUE;
}
- else
- {
- s16b slot;
- q_ptr = &forge;
+
+ s16b slot;
+ q_ptr = &forge;
- /* Hack -- Give the player some small firestones */
- object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, creature_ptr->lev) + 1));
- q_ptr->number = (byte)rand_range(15, 30);
- object_aware(q_ptr);
- object_known(q_ptr);
- apply_magic(q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
- q_ptr->discount = 99;
+ /* Hack -- Give the player some small firestones */
+ object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, creature_ptr->lev) + 1));
+ q_ptr->number = (byte)rand_range(15, 30);
+ object_aware(creature_ptr, q_ptr);
+ object_known(q_ptr);
+ apply_magic(creature_ptr, q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
+ q_ptr->discount = 99;
- slot = inven_carry(q_ptr);
+ slot = inven_carry(creature_ptr, q_ptr);
- object_desc(o_name, q_ptr, 0);
- msg_format(_("%sを作った。", "You make some ammo."), o_name);
+ object_desc(creature_ptr, o_name, q_ptr, 0);
+ msg_format(_("%sを作った。", "You make some ammo."), o_name);
- /* Auto-inscription */
- if (slot >= 0) autopick_alter_item(slot, FALSE);
+ /* Auto-inscription */
+ if (slot >= 0) autopick_alter_item(creature_ptr, slot, FALSE);
- /* Destroy the wall */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ /* Destroy the wall */
+ cave_alter_feat(creature_ptr, y, x, FF_HURT_ROCK);
- creature_ptr->update |= (PU_FLOW);
- }
+ creature_ptr->update |= (PU_FLOW);
+ return TRUE;
}
+
/**********Create arrows*********/
- else if (ext == 2)
+ if (ext == 2)
{
OBJECT_IDX item;
concptr q, s;
/* Hack -- Give the player some small firestones */
object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, creature_ptr->lev) + 1));
q_ptr->number = (byte)rand_range(5, 10);
- object_aware(q_ptr);
+ object_aware(creature_ptr, q_ptr);
object_known(q_ptr);
- apply_magic(q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
+ apply_magic(creature_ptr, q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
q_ptr->discount = 99;
- object_desc(o_name, q_ptr, 0);
+ object_desc(creature_ptr, o_name, q_ptr, 0);
msg_format(_("%sを作った。", "You make some ammo."), o_name);
- vary_item(item, -1);
- slot = inven_carry(q_ptr);
+ vary_item(creature_ptr, item, -1);
+ slot = inven_carry(creature_ptr, q_ptr);
/* Auto-inscription */
- if (slot >= 0) autopick_alter_item(slot, FALSE);
+ if (slot >= 0) autopick_alter_item(creature_ptr, slot, FALSE);
+ return TRUE;
}
+
/**********Create bolts*********/
- else if (ext == 3)
+ if (ext == 3)
{
OBJECT_IDX item;
concptr q, s;
/* Hack -- Give the player some small firestones */
object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, creature_ptr->lev) + 1));
q_ptr->number = (byte)rand_range(4, 8);
- object_aware(q_ptr);
+ object_aware(creature_ptr, q_ptr);
object_known(q_ptr);
- apply_magic(q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
+ apply_magic(creature_ptr, q_ptr, creature_ptr->lev, AM_NO_FIXED_ART);
q_ptr->discount = 99;
- object_desc(o_name, q_ptr, 0);
+ object_desc(creature_ptr, o_name, q_ptr, 0);
msg_format(_("%sを作った。", "You make some ammo."), o_name);
- vary_item(item, -1);
+ vary_item(creature_ptr, item, -1);
- slot = inven_carry(q_ptr);
+ slot = inven_carry(creature_ptr, q_ptr);
/* Auto-inscription */
- if (slot >= 0) autopick_alter_item(slot, FALSE);
+ if (slot >= 0) autopick_alter_item(creature_ptr, slot, FALSE);
}
+
return TRUE;
}
OBJECT_IDX item;
object_type *o_ptr;
o_ptr = choose_object(user_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
- if (!o_ptr) return (FALSE);
+ if (!o_ptr) return FALSE;
if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
{
}
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, 0);
+ object_desc(user_ptr, o_name, o_ptr, 0);
msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
- vary_item(item, -999);
+ vary_item(user_ptr, item, -999);
take_turn(user_ptr, 100);
return TRUE;
}
/*!
* @brief 誰得ドロップを行う。
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param y1 配置したいフロアのY座標
* @param x1 配置したいフロアのX座標
* @param num 誰得の処理回数
* @param known TRUEならばオブジェクトが必ず*鑑定*済になる
* @return なし
*/
-void amusement(POSITION y1, POSITION x1, int num, bool known)
+void amusement(player_type *creature_ptr, POSITION y1, POSITION x1, int num, bool known)
{
int t = 0;
for (int n = 0; amuse_info[n].tval != 0; n++)
/* 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);
+ apply_magic(creature_ptr, i_ptr, 1, AM_NO_FIXED_ART);
if (amuse_info[i].flag & AMS_NO_UNIQUE)
{
if (known)
{
- object_aware(i_ptr);
+ object_aware(creature_ptr, i_ptr);
object_known(i_ptr);
}
/* Paranoia - reroll if nothing */
if (!(i_ptr->k_idx)) continue;
- (void)drop_near(i_ptr, -1, y1, x1);
+ (void)drop_near(creature_ptr, i_ptr, -1, y1, x1);
num--;
}
/*!
* @brief 獲得ドロップを行う。
* Scatter some "great" objects near the player
+ * @param caster_ptr プレーヤーへの参照ポインタ
* @param y1 配置したいフロアのY座標
* @param x1 配置したいフロアのX座標
* @param num 獲得の処理回数
* @param known TRUEならばオブジェクトが必ず*鑑定*済になる
* @return なし
*/
-void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
+void acquirement(player_type *caster_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
{
object_type *i_ptr;
object_type object_type_body;
object_wipe(i_ptr);
/* Make a good (or great) object (if possible) */
- if (!make_object(i_ptr, mode)) continue;
+ if (!make_object(caster_ptr, i_ptr, mode)) continue;
if (known)
{
- object_aware(i_ptr);
+ object_aware(caster_ptr, i_ptr);
object_known(i_ptr);
}
- (void)drop_near(i_ptr, -1, y1, x1);
+ (void)drop_near(caster_ptr, i_ptr, -1, y1, x1);
}
}
q_ptr->to_d = 3 + randint1(creature_ptr->current_floor_ptr->dun_level) % 10;
one_resistance(q_ptr);
q_ptr->name2 = EGO_CHAOTIC;
- (void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
+ (void)drop_near(creature_ptr, q_ptr, -1, creature_ptr->y, creature_ptr->x);
}
if (!o_ptr->k_idx) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
+ object_desc(owner_ptr, o_name, o_ptr, OD_OMIT_PREFIX);
/* Attempt a saving throw for artifacts */
if (object_is_artifact(o_ptr) && (randint0(100) < 50))
if (!o_ptr->k_idx) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
+ object_desc(owner_ptr, o_name, o_ptr, OD_OMIT_PREFIX);
/* Attempt a saving throw */
if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
if (!o_ptr) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
bool perilous_secrets(player_type *user_ptr)
{
- if (!ident_spell(user_ptr, FALSE)) return FALSE;
+ if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
if (mp_ptr->spell_book)
{
void phlogiston(player_type *caster_ptr)
{
GAME_TURN max_flog = 0;
- object_type * o_ptr = &caster_ptr->inventory_list[INVEN_LITE];
+ object_type *o_ptr = &caster_ptr->inventory_list[INVEN_LITE];
/* It's a lamp */
if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
if (!o_ptr) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
bool pulish_shield(player_type *caster_ptr)
{
- /* Assume enchant weapon */
- item_tester_tval = TV_SHIELD;
-
concptr q = _("どの盾を磨きますか?", "Pulish which weapon? ");
concptr s = _("磨く盾がありません。", "You have weapon to pulish.");
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_SHIELD);
if (!o_ptr) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
}
/* Failure */
- if (!res) return (FALSE);
+ if (!res) return FALSE;
caster_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
caster_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
calc_android_exp(caster_ptr);
/* Success */
- return (TRUE);
+ return TRUE;
}
OBJECT_IDX item;
object_type *o_ptr;
o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
- if (!o_ptr) return (FALSE);
+ if (!o_ptr) return FALSE;
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
msg_format("%s は明るく輝いた!", o_name);
#else
bool is_special_item = o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
!object_is_cursed(o_ptr) &&
- !((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) &&
+ !((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE)) &&
!((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE)) &&
!((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE));
if (!is_special_item)
{
if (flush_failure) flush();
- msg_print(_("属性付加に失敗した。", "The Branding failed."));
+ msg_print(_("属性付加に失敗した。", "The branding failed."));
chg_virtue(caster_ptr, V_ENCHANT, -2);
calc_android_exp(caster_ptr);
return;
/* Let's get the name before it is changed... */
GAME_TEXT o_name[MAX_NLEN];
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
concptr act = NULL;
switch (brand_type)