else
color = _("白く", "white");
- o_ptr = choose_warning_item();
+ o_ptr = choose_warning_item(p_ptr);
if (o_ptr)
{
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
#include "angband.h"
#include "util.h"
* Calculate spell damages
* @return 警告を行う
*/
-object_type *choose_warning_item(void)
+object_type *choose_warning_item(player_type *creature_ptr)
{
int i;
int choices[INVEN_TOTAL - INVEN_RARM];
int number = 0;
/* Paranoia -- Player has no warning ability */
- if (!p_ptr->warning) return NULL;
+ if (!creature_ptr->warning) return NULL;
/* Search Inventory */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
BIT_FLAGS flgs[TR_FLAG_SIZE];
- object_type *o_ptr = &p_ptr->inventory_list[i];
+ object_type *o_ptr = &creature_ptr->inventory_list[i];
object_flags(o_ptr, flgs);
if (have_flag(flgs, TR_WARNING))
}
/* Choice one of them */
- return number ? &p_ptr->inventory_list[choices[randint0(number)]] : NULL;
+ return number ? &creature_ptr->inventory_list[choices[randint0(number)]] : NULL;
}
/*!
if (dam_max > creature_ptr->chp / 2)
{
- object_type *o_ptr = choose_warning_item();
+ object_type *o_ptr = choose_warning_item(creature_ptr);
if (o_ptr)
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
if (((!easy_disarm && is_trap(g_ptr->feat))
|| (g_ptr->mimic && is_trap(g_ptr->feat))) && !one_in_(13))
{
- object_type *o_ptr = choose_warning_item();
+ object_type *o_ptr = choose_warning_item(creature_ptr);
if (o_ptr)
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
return TRUE;
}
-