*/
#include "angband.h"
+#include "core.h"
#include "util.h"
+#include "cmd-spell.h"
#include "cmd-dump.h"
#include "selfinfo.h"
#include "realm-trump.h"
#include "mind.h"
#include "avatar.h"
+#include "player-damage.h"
#include "player-status.h"
#include "player-effects.h"
#include "player-skill.h"
q = _("どの本を読みますか? ", "Browse which book? ");
s = _("読める本がない。", "You have no books that you can read.");
- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval);
if (!o_ptr)
{
if (item == INVEN_FORCE) /* the_force */
q = _("どの本から学びますか? ", "Study which book? ");
s = _("読める本がない。", "You have no books that you can read.");
- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
if (!o_ptr) return;
/* Access the item's sval */
prayer = spell_category_name(mp_ptr->spell_book);
- /* Restrict choices to spell books */
- item_tester_tval = mp_ptr->spell_book;
-
q = _("どの呪文書を使いますか? ", "Use which book? ");
s = _("呪文書がない!", "You have no spell books!");
- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), mp_ptr->spell_book);
if (!o_ptr)
{
if (item == INVEN_FORCE) /* the_force */
take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), _("暗黒魔法の逆流", "a miscast Death spell"), -1);
if ((spell > 15) && one_in_(6) && !p_ptr->hold_exp)
- lose_exp(spell * 250);
+ lose_exp(p_ptr, spell * 250);
}
}
else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
}
/* Gain experience */
- gain_exp(e * s_ptr->slevel);
+ gain_exp(p_ptr, e * s_ptr->slevel);
/* Redraw object recall */
p_ptr->window |= (PW_OBJECT);
msg_print(_("精神を集中しすぎて気を失ってしまった!", "You faint from the effort!"));
/* Hack -- Bypass free action */
- (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(5 * oops + 1));
switch (realm)
{
msg_print(_("体を悪くしてしまった!", "You have damaged your health!"));
/* Reduce constitution */
- (void)dec_stat(A_CON, 15 + randint1(10), perm);
+ (void)dec_stat(p_ptr, A_CON, 15 + randint1(10), perm);
}
}