take_turn(attacker_ptr, 100);
- if (!has_right_hand_weapon(attacker_ptr) && !has_left_hand_weapon(attacker_ptr)
+ if (!can_attack_with_main_hand(attacker_ptr) && !can_attack_with_sub_hand(attacker_ptr)
&& !(attacker_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES))) {
msg_format(_("%s攻撃できない。", "You cannot do attacking."), (empty_hands(attacker_ptr, FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
return FALSE;
chg_virtue(attacker_ptr, V_HONOUR, -1);
}
- if (has_right_hand_weapon(attacker_ptr) && has_left_hand_weapon(attacker_ptr)) {
+ if (can_attack_with_main_hand(attacker_ptr) && can_attack_with_sub_hand(attacker_ptr)) {
if ((attacker_ptr->skill_exp[GINOU_NITOURYU] < s_info[attacker_ptr->pclass].s_max[GINOU_NITOURYU])
&& ((attacker_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level)) {
if (attacker_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_BEGINNER)
attacker_ptr->riding_t_m_idx = g_ptr->m_idx;
bool fear = FALSE;
bool mdeath = FALSE;
- if (has_right_hand_weapon(attacker_ptr))
+ if (can_attack_with_main_hand(attacker_ptr))
exe_player_attack_to_monster(attacker_ptr, y, x, &fear, &mdeath, 0, mode);
- if (has_left_hand_weapon(attacker_ptr) && !mdeath)
+ if (can_attack_with_sub_hand(attacker_ptr) && !mdeath)
exe_player_attack_to_monster(attacker_ptr, y, x, &fear, &mdeath, 1, mode);
if (!mdeath) {
powers[num++] = PET_NAME;
if (creature_ptr->riding) {
- if ((has_right_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_SUB)
+ if ((can_attack_with_main_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_SUB)
&& object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_MAIN_HAND]))
- || (has_left_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_MAIN)
+ || (can_attack_with_sub_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_MAIN)
&& object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_SUB_HAND]))) {
if (creature_ptr->pet_extra_flags & PF_TWO_HANDS) {
power_desc[num] = _("武器を片手で持つ", "use one hand to control the pet you are riding");
if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE)) || (pa_ptr->mode == HISSATSU_KYUSHO)) {
int n = 1;
- if (has_right_hand_weapon(attacker_ptr) && has_left_hand_weapon(attacker_ptr))
+ if (can_attack_with_main_hand(attacker_ptr) && can_attack_with_sub_hand(attacker_ptr))
n *= 2;
if (pa_ptr->mode == HISSATSU_3DAN)
fis_ptr->e2--;
if (fis_ptr->equip && has_two_handed_weapons(owner_ptr) && !(fis_ptr->mode & IGNORE_BOTHHAND_SLOT)) {
- if (has_right_hand_weapon(owner_ptr)) {
+ if (can_attack_with_main_hand(owner_ptr)) {
if (fis_ptr->e2 < INVEN_SUB_HAND)
fis_ptr->e2 = INVEN_SUB_HAND;
- } else if (has_left_hand_weapon(owner_ptr))
+ } else if (can_attack_with_sub_hand(owner_ptr))
fis_ptr->e1 = INVEN_MAIN_HAND;
}
switch (i) {
#ifdef JP
case INVEN_MAIN_HAND:
- p = owner_ptr->heavy_wield[0] ? "運搬中"
- : ((has_two_handed_weapons(owner_ptr) && has_right_hand_weapon(owner_ptr)) ? " 両手" : (left_hander ? " 左手" : " 右手"));
+ p = owner_ptr->heavy_wield[0]
+ ? "運搬中"
+ : ((has_two_handed_weapons(owner_ptr) && can_attack_with_main_hand(owner_ptr)) ? " 両手" : (left_hander ? " 左手" : " 右手"));
break;
#else
case INVEN_MAIN_HAND:
- p = owner_ptr->heavy_wield[0] ? "Just lifting" : (has_right_hand_weapon(owner_ptr) ? "Wielding" : "On arm");
+ p = owner_ptr->heavy_wield[0] ? "Just lifting" : (can_attack_with_main_hand(owner_ptr) ? "Wielding" : "On arm");
break;
#endif
#ifdef JP
case INVEN_SUB_HAND:
- p = owner_ptr->heavy_wield[1] ? "運搬中"
- : ((has_two_handed_weapons(owner_ptr) && has_left_hand_weapon(owner_ptr)) ? " 両手" : (left_hander ? " 右手" : " 左手"));
+ p = owner_ptr->heavy_wield[1]
+ ? "運搬中"
+ : ((has_two_handed_weapons(owner_ptr) && can_attack_with_sub_hand(owner_ptr)) ? " 両手" : (left_hander ? " 右手" : " 左手"));
break;
#else
case INVEN_SUB_HAND:
- p = owner_ptr->heavy_wield[1] ? "Just lifting" : (has_left_hand_weapon(owner_ptr) ? "Wielding" : "On arm");
+ p = owner_ptr->heavy_wield[1] ? "Just lifting" : (can_attack_with_sub_hand(owner_ptr) ? "Wielding" : "On arm");
break;
#endif
case INVEN_MAIN_HAND:
p = owner_ptr->heavy_wield[0]
? "運搬中の"
- : ((has_two_handed_weapons(owner_ptr) && has_right_hand_weapon(owner_ptr)) ? "両手に装備している"
- : (left_hander ? "左手に装備している" : "右手に装備している"));
+ : ((has_two_handed_weapons(owner_ptr) && can_attack_with_main_hand(owner_ptr)) ? "両手に装備している"
+ : (left_hander ? "左手に装備している" : "右手に装備している"));
break;
#else
case INVEN_MAIN_HAND:
- p = owner_ptr->heavy_wield[0] ? "just lifting" : (has_right_hand_weapon(owner_ptr) ? "attacking monsters with" : "wearing on your arm");
+ p = owner_ptr->heavy_wield[0] ? "just lifting" : (can_attack_with_main_hand(owner_ptr) ? "attacking monsters with" : "wearing on your arm");
break;
#endif
case INVEN_SUB_HAND:
p = owner_ptr->heavy_wield[1]
? "運搬中の"
- : ((has_two_handed_weapons(owner_ptr) && has_left_hand_weapon(owner_ptr)) ? "両手に装備している"
- : (left_hander ? "右手に装備している" : "左手に装備している"));
+ : ((has_two_handed_weapons(owner_ptr) && can_attack_with_sub_hand(owner_ptr)) ? "両手に装備している"
+ : (left_hander ? "右手に装備している" : "左手に装備している"));
break;
#else
case INVEN_SUB_HAND:
- p = owner_ptr->heavy_wield[1] ? "just lifting" : (has_left_hand_weapon(owner_ptr) ? "attacking monsters with" : "wearing on your arm");
+ p = owner_ptr->heavy_wield[1] ? "just lifting" : (can_attack_with_sub_hand(owner_ptr) ? "attacking monsters with" : "wearing on your arm");
break;
#endif
item_selection_ptr->e2--;
if (item_selection_ptr->equip && has_two_handed_weapons(owner_ptr) && !(item_selection_ptr->mode & IGNORE_BOTHHAND_SLOT)) {
- if (has_right_hand_weapon(owner_ptr)) {
+ if (can_attack_with_main_hand(owner_ptr)) {
if (item_selection_ptr->e2 < INVEN_SUB_HAND)
item_selection_ptr->e2 = INVEN_SUB_HAND;
- } else if (has_left_hand_weapon(owner_ptr))
+ } else if (can_attack_with_sub_hand(owner_ptr))
item_selection_ptr->e1 = INVEN_MAIN_HAND;
}
fprintf(fff, _(" [キャラクタの装備]\n\n", " [Character Equipment]\n\n"));
for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
describe_flavor(creature_ptr, o_name, &creature_ptr->inventory_list[i], 0);
- if ((((i == INVEN_MAIN_HAND) && has_left_hand_weapon(creature_ptr)) || ((i == INVEN_SUB_HAND) && has_right_hand_weapon(creature_ptr)))
+ if ((((i == INVEN_MAIN_HAND) && can_attack_with_sub_hand(creature_ptr)) || ((i == INVEN_SUB_HAND) && can_attack_with_main_hand(creature_ptr)))
&& has_two_handed_weapons(creature_ptr))
strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
*(pa_ptr->mdeath) = TRUE;
if ((attacker_ptr->pclass == CLASS_BERSERKER) && attacker_ptr->energy_use) {
- if (has_right_hand_weapon(attacker_ptr) && has_left_hand_weapon(attacker_ptr)) {
+ if (can_attack_with_main_hand(attacker_ptr) && can_attack_with_sub_hand(attacker_ptr)) {
if (pa_ptr->hand)
attacker_ptr->energy_use = attacker_ptr->energy_use * 3 / 5 + attacker_ptr->energy_use * num * 2 / (attacker_ptr->num_blow[pa_ptr->hand] * 5);
else
if (heavy_armor(creature_ptr)) {
add_flag(flags, TR_SPEED);
} else {
- if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || has_right_hand_weapon(creature_ptr))
- && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || has_left_hand_weapon(creature_ptr)))
+ if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || can_attack_with_main_hand(creature_ptr))
+ && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || can_attack_with_sub_hand(creature_ptr)))
add_flag(flags, TR_SPEED);
if (creature_ptr->lev > 24 && !creature_ptr->icky_wield[0] && !creature_ptr->icky_wield[1])
add_flag(flags, TR_FREE_ACT);
}
if (creature_ptr->pclass == CLASS_NINJA && !heavy_armor(creature_ptr)
- && (!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || has_right_hand_weapon(creature_ptr))
- && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || has_left_hand_weapon(creature_ptr))) {
+ && (!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || can_attack_with_main_hand(creature_ptr))
+ && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || can_attack_with_sub_hand(creature_ptr))) {
if (creature_ptr->lev > 24)
result |= 0x01 << FLAG_CAUSE_CLASS;
}
}
/*
- * @brief 右手(利き手)が武器を持っているかどうかを判定する
+ * @brief 利き手で攻撃可能かどうかを判定する
+ * 利き手で攻撃可能とは、利き手に武器を持っているか、
+ * 利き手が素手かつ左手も素手もしくは盾を装備している事を意味する。
* @detail Includes martial arts and hand combats as weapons.
*/
-bool has_right_hand_weapon(player_type *creature_ptr)
+bool can_attack_with_main_hand(player_type *creature_ptr)
{
if (has_melee_weapon(creature_ptr, INVEN_MAIN_HAND))
return TRUE;
- if ((empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN) && !has_left_hand_weapon(creature_ptr))
+ if ((empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN) && !can_attack_with_sub_hand(creature_ptr))
return TRUE;
return FALSE;
}
/*
- * @brief 左手(非利き手)が武器を持っているかどうかを判定する
+ * @brief 非利き手で攻撃可能かどうかを判定する
+ * 非利き手で攻撃可能とは、非利き手に武器を持っている事に等しい
* @detail Exclude martial arts and hand combats from weapons.
*/
-bool has_left_hand_weapon(player_type *creature_ptr) { return has_melee_weapon(creature_ptr, INVEN_SUB_HAND); }
+bool can_attack_with_sub_hand(player_type *creature_ptr) { return has_melee_weapon(creature_ptr, INVEN_SUB_HAND); }
/*
* @brief 両手持ち状態かどうかを判定する
bool has_two_handed_weapons(player_type *creature_ptr)
{
if (can_two_hands_wielding(creature_ptr)) {
- if (has_right_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_SUB)
+ if (can_attack_with_main_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_SUB)
&& object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_MAIN_HAND])) {
return TRUE;
- } else if (has_left_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_MAIN)
+ } else if (can_attack_with_sub_hand(creature_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_MAIN)
&& object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_SUB_HAND])) {
return TRUE;
}
return AGGRAVATE_NONE;
}
-bool has_aggravate(player_type *creature_ptr) { return player_aggravate_state(creature_ptr) == AGGRAVATE_NORMAL; }
\ No newline at end of file
+bool has_aggravate(player_type *creature_ptr) { return player_aggravate_state(creature_ptr) == AGGRAVATE_NORMAL; }
BIT_FLAGS has_immune_fire(player_type *creature_ptr);
BIT_FLAGS has_immune_cold(player_type *creature_ptr);
BIT_FLAGS has_immune_dark(player_type *creature_ptr);
-bool has_right_hand_weapon(player_type *creature_ptr);
-bool has_left_hand_weapon(player_type *creature_ptr);
+bool can_attack_with_main_hand(player_type *creature_ptr);
+bool can_attack_with_sub_hand(player_type *creature_ptr);
bool has_two_handed_weapons(player_type *creature_ptr);
BIT_FLAGS has_lite(player_type *creature_ptr);
bool has_disable_two_handed_bonus(player_type *creature_ptr, int i);
if (creature_ptr->pclass == CLASS_NINJA) {
if (heavy_armor(creature_ptr)) {
pow -= (creature_ptr->lev) / 10;
- } else if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || has_right_hand_weapon(creature_ptr))
- && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || has_left_hand_weapon(creature_ptr))) {
+ } else if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || can_attack_with_main_hand(creature_ptr))
+ && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || can_attack_with_sub_hand(creature_ptr))) {
pow += (creature_ptr->lev) / 10;
}
}
static bool is_martial_arts_mode(player_type *creature_ptr)
{
return ((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_BERSERKER))
- && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN) && !has_left_hand_weapon(creature_ptr);
+ && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN) && !can_attack_with_sub_hand(creature_ptr);
}
static s16b calc_num_blow(player_type *creature_ptr, int i)
}
if (creature_ptr->pclass == CLASS_NINJA) {
- if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || has_right_hand_weapon(creature_ptr))
- && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || has_left_hand_weapon(creature_ptr))) {
+ if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || can_attack_with_main_hand(creature_ptr))
+ && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || can_attack_with_sub_hand(creature_ptr))) {
ac += creature_ptr->lev / 2 + 5;
}
}
if (creature_ptr->pclass == CLASS_NINJA) {
if (heavy_armor(creature_ptr)) {
pow -= (creature_ptr->lev) / 10;
- } else if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || has_right_hand_weapon(creature_ptr))
- && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || has_left_hand_weapon(creature_ptr))) {
+ } else if ((!creature_ptr->inventory_list[INVEN_MAIN_HAND].k_idx || can_attack_with_main_hand(creature_ptr))
+ && (!creature_ptr->inventory_list[INVEN_SUB_HAND].k_idx || can_attack_with_sub_hand(creature_ptr))) {
pow += 3;
if (!(is_specific_player_race(creature_ptr, RACE_KLACKON) || is_specific_player_race(creature_ptr, RACE_SPRITE)
|| (creature_ptr->pseikaku == PERSONALITY_MUNCHKIN)))
damage -= 2;
} else if (creature_ptr->pclass == CLASS_BERSERKER) {
damage += creature_ptr->lev / 6;
- if (((calc_hand == PLAYER_HAND_MAIN) && !has_left_hand_weapon(creature_ptr)) || has_two_handed_weapons(creature_ptr)) {
+ if (((calc_hand == PLAYER_HAND_MAIN) && !can_attack_with_sub_hand(creature_ptr)) || has_two_handed_weapons(creature_ptr)) {
damage += creature_ptr->lev / 6;
}
} else if (creature_ptr->pclass == CLASS_SORCERER) {
hit -= 2;
} else if (creature_ptr->pclass == CLASS_BERSERKER) {
hit += creature_ptr->lev / 5;
- if (((calc_hand == PLAYER_HAND_MAIN) && !has_left_hand_weapon(creature_ptr)) || has_two_handed_weapons(creature_ptr)) {
+ if (((calc_hand == PLAYER_HAND_MAIN) && !can_attack_with_sub_hand(creature_ptr)) || has_two_handed_weapons(creature_ptr)) {
hit += creature_ptr->lev / 5;
}
} else if (creature_ptr->pclass == CLASS_SORCERER) {
* @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-static void display_left_hand(player_type *creature_ptr)
+static void display_sub_hand(player_type *creature_ptr)
{
- if (has_left_hand_weapon(creature_ptr)) {
+ if (can_attack_with_sub_hand(creature_ptr)) {
display_player_melee_bonus(creature_ptr, 1, left_hander ? ENTRY_RIGHT_HAND2 : ENTRY_LEFT_HAND2);
return;
}
*/
void display_player_middle(player_type *creature_ptr)
{
- if (has_right_hand_weapon(creature_ptr))
+ if (can_attack_with_main_hand(creature_ptr))
display_player_melee_bonus(creature_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
- display_left_hand(creature_ptr);
+ display_sub_hand(creature_ptr);
display_hit_damage(creature_ptr);
display_shoot_magnification(creature_ptr);
display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE);
if (creature_ptr->muta2 & MUT2_TENTACLES)
muta_att++;
- int blows1 = has_right_hand_weapon(creature_ptr) ? creature_ptr->num_blow[0] : 0;
- int blows2 = has_left_hand_weapon(creature_ptr) ? creature_ptr->num_blow[1] : 0;
+ int blows1 = can_attack_with_main_hand(creature_ptr) ? creature_ptr->num_blow[0] : 0;
+ int blows2 = can_attack_with_sub_hand(creature_ptr) ? creature_ptr->num_blow[1] : 0;
int xdis = creature_ptr->skill_dis;
int xdev = creature_ptr->skill_dev;
int xsav = creature_ptr->skill_sav;
}
term_putstr(0, i - INVEN_MAIN_HAND, 3, TERM_WHITE, tmp_val);
- if ((((i == INVEN_MAIN_HAND) && has_left_hand_weapon(owner_ptr)) || ((i == INVEN_SUB_HAND) && has_right_hand_weapon(owner_ptr))) && has_two_handed_weapons(owner_ptr)) {
+ if ((((i == INVEN_MAIN_HAND) && can_attack_with_sub_hand(owner_ptr)) || ((i == INVEN_SUB_HAND) && can_attack_with_main_hand(owner_ptr)))
+ && has_two_handed_weapons(owner_ptr)) {
strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
attr = TERM_WHITE;
} else {
for (k = 0, i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &owner_ptr->inventory_list[i];
if (!(owner_ptr->select_ring_slot ? is_ring_slot(i) : item_tester_okay(owner_ptr, o_ptr, tval) || (mode & USE_FULL))
- && (!((((i == INVEN_MAIN_HAND) && has_left_hand_weapon(owner_ptr)) || ((i == INVEN_SUB_HAND) && has_right_hand_weapon(owner_ptr))) && has_two_handed_weapons(owner_ptr))
+ && (!((((i == INVEN_MAIN_HAND) && can_attack_with_sub_hand(owner_ptr)) || ((i == INVEN_SUB_HAND) && can_attack_with_main_hand(owner_ptr)))
+ && has_two_handed_weapons(owner_ptr))
|| (mode & IGNORE_BOTHHAND_SLOT)))
continue;
describe_flavor(owner_ptr, o_name, o_ptr, 0);
- if ((((i == INVEN_MAIN_HAND) && has_left_hand_weapon(owner_ptr)) || ((i == INVEN_SUB_HAND) && has_right_hand_weapon(owner_ptr))) && has_two_handed_weapons(owner_ptr)) {
+ if ((((i == INVEN_MAIN_HAND) && can_attack_with_sub_hand(owner_ptr)) || ((i == INVEN_SUB_HAND) && can_attack_with_main_hand(owner_ptr)))
+ && has_two_handed_weapons(owner_ptr)) {
(void)strcpy(out_desc[k], _("(武器を両手持ち)", "(wielding with two-hands)"));
out_color[k] = TERM_WHITE;
} else {