#include "avatar.h"
#include "spells.h"
#include "spells-status.h"
-#include "player-status.h"
#include "player-effects.h"
+#include "player-status.h"
+#include "player-damage.h"
+#include "player-race.h"
#include "realm-hex.h"
+#include "realm-song.h"
#include "spells-floor.h"
#include "object-broken.h"
#include "cmd-basic.h"
+#include "floor.h"
+#include "objectkind.h"
+#include "view-mainwindow.h"
+#include "player-class.h"
/*!
* @brief 薬を飲むコマンドのサブルーチン /
* @param item 飲む薬オブジェクトの所持品ID
* @return なし
*/
-void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
+void exe_quaff_potion(INVENTORY_IDX item)
{
bool ident;
DEPTH lev;
/* Get the item (in the pack) */
if (item >= 0)
{
- o_ptr = &inventory[item];
+ o_ptr = &p_ptr->inventory_list[item];
}
/* Get the item (on the floor) */
o_ptr = ¤t_floor_ptr->o_list[0 - item];
}
q_ptr = &forge;
-
- /* Obtain a local object */
object_copy(q_ptr, o_ptr);
/* Single object */
q_ptr->number = 1;
- /* Reduce and describe inventory */
+ /* Reduce and describe p_ptr->inventory_list */
if (item >= 0)
{
inven_item_increase(item, -1);
break;
case SV_POTION_SLOWNESS:
- if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
+ if (set_slow(p_ptr, randint1(25) + 15, FALSE)) ident = TRUE;
break;
case SV_POTION_SALT_WATER:
msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
- if (!(prace_is_(RACE_GOLEM) ||
- prace_is_(RACE_ZOMBIE) ||
- prace_is_(RACE_DEMON) ||
- prace_is_(RACE_ANDROID) ||
- prace_is_(RACE_SPECTRE) ||
+ if (!(PRACE_IS_(p_ptr, RACE_GOLEM) ||
+ PRACE_IS_(p_ptr, RACE_ZOMBIE) ||
+ PRACE_IS_(p_ptr, RACE_DEMON) ||
+ PRACE_IS_(p_ptr, RACE_ANDROID) ||
+ PRACE_IS_(p_ptr, RACE_SPECTRE) ||
(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
{
/* Only living creatures get thirsty */
(void)set_food(PY_FOOD_STARVE - 1);
}
- (void)set_poisoned(0);
- (void)set_paralyzed(p_ptr->paralyzed + 4);
+ (void)set_poisoned(p_ptr, 0);
+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 4);
ident = TRUE;
break;
case SV_POTION_POISON:
if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
{
- if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
+ if (set_poisoned(p_ptr, p_ptr->poisoned + randint0(15) + 10))
{
ident = TRUE;
}
case SV_POTION_BLINDNESS:
if (!p_ptr->resist_blind)
{
- if (set_blind(p_ptr->blind + randint0(100) + 100))
+ if (set_blind(p_ptr, p_ptr->blind + randint0(100) + 100))
{
ident = TRUE;
}
/* Have some nightmares */
sanity_blast(NULL, FALSE);
}
- if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
+ if (set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4))
{
ident = TRUE;
}
msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
- (void)dec_stat(A_DEX, 25, TRUE);
- (void)dec_stat(A_WIS, 25, TRUE);
- (void)dec_stat(A_CON, 25, TRUE);
- (void)dec_stat(A_STR, 25, TRUE);
- (void)dec_stat(A_CHR, 25, TRUE);
- (void)dec_stat(A_INT, 25, TRUE);
+ (void)dec_stat(p_ptr, A_DEX, 25, TRUE);
+ (void)dec_stat(p_ptr, A_WIS, 25, TRUE);
+ (void)dec_stat(p_ptr, A_CON, 25, TRUE);
+ (void)dec_stat(p_ptr, A_STR, 25, TRUE);
+ (void)dec_stat(p_ptr, A_CHR, 25, TRUE);
+ (void)dec_stat(p_ptr, A_INT, 25, TRUE);
ident = TRUE;
break;
case SV_POTION_DEC_STR:
- if (do_dec_stat(A_STR)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_STR)) ident = TRUE;
break;
case SV_POTION_DEC_INT:
- if (do_dec_stat(A_INT)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_INT)) ident = TRUE;
break;
case SV_POTION_DEC_WIS:
- if (do_dec_stat(A_WIS)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_WIS)) ident = TRUE;
break;
case SV_POTION_DEC_DEX:
- if (do_dec_stat(A_DEX)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_DEX)) ident = TRUE;
break;
case SV_POTION_DEC_CON:
- if (do_dec_stat(A_CON)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_CON)) ident = TRUE;
break;
case SV_POTION_DEC_CHR:
- if (do_dec_stat(A_CHR)) ident = TRUE;
+ if (do_dec_stat(p_ptr, A_CHR)) ident = TRUE;
break;
case SV_POTION_DETONATIONS:
break;
case SV_POTION_INFRAVISION:
- if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
+ if (set_tim_infra(p_ptr, p_ptr->tim_infra + 100 + randint1(100), FALSE))
{
ident = TRUE;
}
break;
case SV_POTION_DETECT_INVIS:
- if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
+ if (set_tim_invis(p_ptr, p_ptr->tim_invis + 12 + randint1(12), FALSE))
{
ident = TRUE;
}
break;
case SV_POTION_SLOW_POISON:
- if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
+ if (set_poisoned(p_ptr, p_ptr->poisoned / 2)) ident = TRUE;
break;
case SV_POTION_CURE_POISON:
- if (set_poisoned(0)) ident = TRUE;
+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
break;
case SV_POTION_BOLDNESS:
- if (set_afraid(0)) ident = TRUE;
+ if (set_afraid(p_ptr, 0)) ident = TRUE;
break;
case SV_POTION_SPEED:
if (!p_ptr->fast)
{
- if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
+ if (set_fast(p_ptr, randint1(25) + 15, FALSE)) ident = TRUE;
}
else
{
- (void)set_fast(p_ptr->fast + 5, FALSE);
+ (void)set_fast(p_ptr, p_ptr->fast + 5, FALSE);
}
break;
break;
case SV_POTION_RES_STR:
- if (do_res_stat(A_STR)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_STR)) ident = TRUE;
break;
case SV_POTION_RES_INT:
- if (do_res_stat(A_INT)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_INT)) ident = TRUE;
break;
case SV_POTION_RES_WIS:
- if (do_res_stat(A_WIS)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_WIS)) ident = TRUE;
break;
case SV_POTION_RES_DEX:
- if (do_res_stat(A_DEX)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_DEX)) ident = TRUE;
break;
case SV_POTION_RES_CON:
- if (do_res_stat(A_CON)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_CON)) ident = TRUE;
break;
case SV_POTION_RES_CHR:
- if (do_res_stat(A_CHR)) ident = TRUE;
+ if (do_res_stat(p_ptr, A_CHR)) ident = TRUE;
break;
case SV_POTION_INC_STR:
break;
case SV_POTION_RESISTANCE:
- (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
- (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
+ (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid + randint1(20) + 20, FALSE);
+ (void)set_oppose_elec(p_ptr, p_ptr->oppose_elec + randint1(20) + 20, FALSE);
(void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
(void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
(void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
break;
case SV_POTION_INVULNERABILITY:
- (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
+ (void)set_invuln(p_ptr, p_ptr->invuln + randint1(4) + 4, FALSE);
ident = TRUE;
break;
break;
case SV_POTION_NEO_TSUYOSHI:
- (void)set_image(0);
- (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
+ (void)set_image(p_ptr, 0);
+ (void)set_tsuyoshi(p_ptr, p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
ident = TRUE;
break;
msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
msg_print(NULL);
p_ptr->tsuyoshi = 1;
- (void)set_tsuyoshi(0, TRUE);
+ (void)set_tsuyoshi(p_ptr, 0, TRUE);
if (!p_ptr->resist_chaos)
{
- (void)set_image(50 + randint1(50));
+ (void)set_image(p_ptr, 50 + randint1(50));
}
ident = TRUE;
break;
}
}
- if (prace_is_(RACE_SKELETON))
+ if (PRACE_IS_(p_ptr, RACE_SKELETON))
{
msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
(void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
q = _("どの薬を飲みますか? ", "Quaff which potion? ");
s = _("飲める薬がない。", "You have no potions to quaff.");
- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
/* Quaff the potion */
- do_cmd_quaff_potion_aux(item);
+ exe_quaff_potion(item);
}