switch (slot)
{
case INVEN_RARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && can_two_hands_wielding(creature_ptr))
act = STR_WIELD_ARMS;
else
act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
break;
case INVEN_LARM:
- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && can_two_hands_wielding(creature_ptr))
act = STR_WIELD_ARMS;
else
act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
calc_android_exp(creature_ptr);
}
+
/*!
* @brief 持ち替え処理
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param item 持ち替えを行いたい装備部位ID
* @return なし
*/
if (object_is_cursed(o_ptr))
{
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
return;
}
owner_ptr->total_weight += o_ptr->weight;
inven_item_increase(owner_ptr, INVEN_LARM, -((int)o_ptr->number));
inven_item_optimize(owner_ptr, INVEN_LARM);
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
else
msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
if (has_melee_weapon(owner_ptr, INVEN_RARM))
{
- if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+ if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
return;
}
MONSTER_IDX old_riding = creature_ptr->riding;
bool old_riding_ryoute = creature_ptr->riding_ryoute;
bool old_old_riding_ryoute = creature_ptr->old_riding_ryoute;
- bool old_pf_ryoute = (creature_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
+ bool old_pf_ryoute = (creature_ptr->pet_extra_flags & PF_TWO_HANDS) ? TRUE : FALSE;
/* Hack -- prevent "icky" message */
current_world_ptr->character_xtra = TRUE;
else
{
creature_ptr->riding = 0;
- creature_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+ creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
}
p_can_enter = player_can_enter(creature_ptr, g_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
creature_ptr->riding = old_riding;
- if (old_pf_ryoute) creature_ptr->pet_extra_flags |= (PF_RYOUTE);
- else creature_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+ if (old_pf_ryoute) creature_ptr->pet_extra_flags |= (PF_TWO_HANDS);
+ else creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
creature_ptr->riding_ryoute = old_riding_ryoute;
creature_ptr->old_riding_ryoute = old_old_riding_ryoute;
}
creature_ptr->riding = 0;
- creature_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+ creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
}
else
(creature_ptr->hidarite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) &&
object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_LARM])))
{
- if (creature_ptr->pet_extra_flags & PF_RYOUTE)
+ if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
{
power_desc[num] = _("武器を片手で持つ", "use one hand to control a riding pet");
}
case CLASS_BERSERKER:
if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
{
- if (creature_ptr->pet_extra_flags & PF_RYOUTE)
+ if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
{
power_desc[num] = _("片手で格闘する", "use one hand to control a riding pet");
}
}
else if ((empty_hands(creature_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
{
- if (creature_ptr->pet_extra_flags & PF_RYOUTE)
+ if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
{
power_desc[num] = _("格闘を行わない", "use one hand to control a riding pet");
}
case PET_RYOUTE:
{
- if (creature_ptr->pet_extra_flags & PF_RYOUTE) creature_ptr->pet_extra_flags &= ~(PF_RYOUTE);
- else creature_ptr->pet_extra_flags |= (PF_RYOUTE);
+ if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
+ else creature_ptr->pet_extra_flags |= (PF_TWO_HANDS);
creature_ptr->update |= (PU_BONUS);
handle_stuff(creature_ptr);
break;
}
creature_ptr->riding = 0;
- creature_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+ creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
creature_ptr->update |= (PU_BONUS | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
#define PF_ATTACK_SPELL 0x0008 /*!< ペットの行動許可…攻撃魔法を使ってよい */
#define PF_SUMMON_SPELL 0x0010 /*!< ペットの行動許可…召喚魔法を使ってよい */
#define PF_BALL_SPELL 0x0020 /*!< ペットの行動許可…ボール魔法でプレイヤーを巻き込んでよい */
-#define PF_RYOUTE 0x0040 /*!< プレイヤーの騎乗フラグ…武器を片手で持つ */
+#define PF_TWO_HANDS 0x0040 /*!< プレイヤーの騎乗フラグ…武器を片手で持つ */
add_flag(flgs, TR_SEE_INVIS);
if (creature_ptr->tim_regen)
add_flag(flgs, TR_REGEN);
- if (IS_TIM_ESP())
+ if (is_time_limit_esp(creature_ptr))
add_flag(flgs, TR_TELEPATHY);
if (IS_FAST(creature_ptr) || creature_ptr->slow)
add_flag(flgs, TR_SPEED);
if (m_ptr->parent_m_idx)
{
master_ptr->riding = 0;
- master_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+ master_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
master_ptr->riding_ryoute = master_ptr->old_riding_ryoute = FALSE;
}
else
if (!creature_ptr->migite) default_hand = 1;
}
- if (CAN_TWO_HANDS_WIELDING())
+ if (can_two_hands_wielding(creature_ptr))
{
if (creature_ptr->migite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) &&
object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_RARM]))
creature_ptr->riding_ryoute = FALSE;
if (creature_ptr->ryoute || (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_NONE)) creature_ptr->riding_ryoute = TRUE;
- else if (creature_ptr->pet_extra_flags & PF_RYOUTE)
+ else if (creature_ptr->pet_extra_flags & PF_TWO_HANDS)
{
switch (creature_ptr->pclass)
{
if (!creature_ptr->inventory_list[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM;
if (!creature_ptr->inventory_list[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM;
- if (riding_control && (status != EMPTY_HAND_NONE) && creature_ptr->riding && !(creature_ptr->pet_extra_flags & PF_RYOUTE))
+ if (riding_control && (status != EMPTY_HAND_NONE) && creature_ptr->riding && !(creature_ptr->pet_extra_flags & PF_TWO_HANDS))
{
if (status & EMPTY_HAND_LARM) status &= ~(EMPTY_HAND_LARM);
else if (status & EMPTY_HAND_RARM) status &= ~(EMPTY_HAND_RARM);
{
return creature_ptr->tim_stealth || music_singing(creature_ptr, MUSIC_STEALTH);
}
+
+
+bool can_two_hands_wielding(player_type *creature_ptr)
+{
+ return !creature_ptr->riding || (creature_ptr->pet_extra_flags & PF_TWO_HANDS);
+}
extern bool is_oppose_pois(player_type *creature_ptr);
extern bool is_time_limit_esp(player_type *creature_ptr);
extern bool is_time_limit_stealth(player_type *creature_ptr);
+extern bool can_two_hands_wielding(player_type *creature_ptr);
/*
* Player "food" crucial values
#define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
-#define CAN_TWO_HANDS_WIELDING() (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))
-
extern void cheat_death(player_type *creature_ptr);