From 530629bdca5cc8d4dbcba61e12e30066ad052d39 Mon Sep 17 00:00:00 2001 From: nothere Date: Fri, 5 Sep 2003 13:03:35 +0000 Subject: [PATCH] =?utf8?q?empty=5Fhands()=E3=81=AE=E6=88=BB=E3=82=8A?= =?utf8?q?=E5=80=A4=E3=81=AE=E6=84=8F=E5=91=B3=E3=82=92=E8=A8=98=E5=8F=B7?= =?utf8?q?=E5=AE=9A=E6=95=B0=E5=8C=96.=20=E4=B8=8D=E7=AD=89=E5=8F=B7?= =?utf8?q?=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E9=83=A8?= =?utf8?q?=E5=88=86=E3=81=AF=E8=AB=96=E7=90=86=20=E6=BC=94=E7=AE=97?= =?utf8?q?=E3=81=AB=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd1.c | 4 ++-- src/cmd3.c | 4 ++-- src/cmd5.c | 2 +- src/defines.h | 6 ++++++ src/files.c | 4 ++-- src/racial.c | 2 +- src/xtra1.c | 22 +++++++++++----------- 7 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/cmd1.c b/src/cmd1.c index 819ecb059..c3767df72 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -2174,7 +2174,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int m_name); else { - if (!(((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1))) + if (!(((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM))) #ifdef JP msg_format("%s¤ò¹¶·â¤·¤¿¡£", m_name); #else @@ -2235,7 +2235,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int vorpal_cut = TRUE; else vorpal_cut = FALSE; - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1)) + if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) { int special_effect = 0, stun_effect = 0, times = 0, max_times; int min_level = 1; diff --git a/src/cmd3.c b/src/cmd3.c index 37f64c763..beb477648 100644 --- a/src/cmd3.c +++ b/src/cmd3.c @@ -485,7 +485,7 @@ msg_print(" /* Where is the item now */ if (slot == INVEN_RARM) { - if((o_ptr->tval != TV_SHIELD) && (o_ptr->tval != TV_CAPTURE) && (o_ptr->tval != TV_CARD) && (empty_hands(FALSE) & 0x00000001) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) + if ((o_ptr->tval != TV_SHIELD) && (o_ptr->tval != TV_CAPTURE) && (o_ptr->tval != TV_CARD) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) #ifdef JP act = "¤òξ¼ê¤Ç¹½¤¨¤¿"; #else @@ -679,7 +679,7 @@ void kamaenaoshi(int item) msg_format("You are wielding %s with two-handed.", o_name ); #endif } - else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & 0x0002)) + else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & EMPTY_HAND_RARM)) { o_ptr = &inventory[INVEN_LARM]; o2_ptr = &inventory[INVEN_RARM]; diff --git a/src/cmd5.c b/src/cmd5.c index 2d9998649..25397665a 100644 --- a/src/cmd5.c +++ b/src/cmd5.c @@ -6072,7 +6072,7 @@ power_desc[num] = "Î¥ powers[num++] = PET_NAME; - if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM))) + if (p_ptr->riding && buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM))) { if (p_ptr->pet_extra_flags & PF_RYOUTE) { diff --git a/src/defines.h b/src/defines.h index 60eb946e3..4da88ac28 100644 --- a/src/defines.h +++ b/src/defines.h @@ -2720,6 +2720,12 @@ #define ACTION_SING 7 #define ACTION_HAYAGAKE 8 + +/* Empty hand status */ +#define EMPTY_HAND_NONE 0x0000 /* Both hands are used */ +#define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */ +#define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */ + /*** General index values ***/ diff --git a/src/files.c b/src/files.c index d90744931..ccacabee3 100644 --- a/src/files.c +++ b/src/files.c @@ -1680,7 +1680,7 @@ static void display_player_middle(void) else display_player_one_line(ENTRY_LEFT_HAND2, buf, TERM_L_BLUE); } - else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(TRUE) > 1)) + else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) { int i; if (p_ptr->special_defense & KAMAE_MASK) @@ -2084,7 +2084,7 @@ static void display_player_various(void) for(i = 0; i < 2; i++) { damage[i] = p_ptr->dis_to_d[i] * 100; - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(TRUE) > 1)) + if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) { int level = p_ptr->lev; if (i) diff --git a/src/racial.c b/src/racial.c index 791a1495e..4f3766bd2 100644 --- a/src/racial.c +++ b/src/racial.c @@ -989,7 +989,7 @@ static bool cmd_racial_power_aux(s32b command) } case CLASS_MONK: { - if (empty_hands(TRUE) < 2) + if (!(empty_hands(TRUE) & EMPTY_HAND_RARM)) { #ifdef JP msg_print("ÁǼꤸ¤ã¤Ê¤¤¤È¤Ç¤­¤Þ¤»¤ó¡£"); diff --git a/src/xtra1.c b/src/xtra1.c index 91ab35d7e..bf53b868d 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -3127,14 +3127,14 @@ void calc_bonuses(void) /* Base skill -- digging */ p_ptr->skill_dig = 0; - if (buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & 0x00000001) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE; - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == 3) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE; + if (buki_motteruka(INVEN_RARM) && (empty_hands(FALSE) & EMPTY_HAND_LARM) && ((inventory[INVEN_RARM].weight > 99) || (inventory[INVEN_RARM].tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE; + if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))) p_ptr->ryoute = TRUE; if (buki_motteruka(INVEN_RARM) || !buki_motteruka(INVEN_LARM)) p_ptr->migite = TRUE; if (buki_motteruka(INVEN_LARM)) p_ptr->hidarite = TRUE; if (p_ptr->special_defense & KAMAE_MASK) { - if (empty_hands(TRUE) < 2) + if (!(empty_hands(TRUE) & EMPTY_HAND_RARM)) { set_action(ACTION_NONE); } @@ -4947,7 +4947,7 @@ void calc_bonuses(void) int penalty = 0; p_ptr->riding_ryoute = FALSE; - if (p_ptr->ryoute || !empty_hands(FALSE)) p_ptr->riding_ryoute = TRUE; + if (p_ptr->ryoute || (empty_hands(FALSE) == EMPTY_HAND_NONE)) p_ptr->riding_ryoute = TRUE; if ((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY)) { @@ -4965,7 +4965,7 @@ void calc_bonuses(void) } /* Different calculation for monks with empty hands */ - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1)) + if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM)) { int blow_base = p_ptr->lev + adj_dex_blow[p_ptr->stat_ind[A_DEX]]; p_ptr->num_blow[0] = 0; @@ -5137,7 +5137,7 @@ void calc_bonuses(void) p_ptr->dis_to_d[0] += MAX(bonus_to_d,1); } - if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == 3)) p_ptr->ryoute = FALSE; + if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE; /* Affect Skill -- stealth (bonus one) */ p_ptr->skill_stl += 1; @@ -5958,12 +5958,12 @@ void handle_stuff(void) s16b empty_hands(bool is_monk) { - s16b kaerichi = 0; - if (is_monk && (p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_BERSERKER)) return FALSE; + s16b status = EMPTY_HAND_NONE; + if (is_monk && (p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_BERSERKER)) return EMPTY_HAND_NONE; - if (!(inventory[INVEN_RARM].k_idx)) kaerichi +=2; - if (!(inventory[INVEN_LARM].k_idx)) kaerichi +=1; - return kaerichi; + if (!(inventory[INVEN_RARM].k_idx)) status |= EMPTY_HAND_RARM; + if (!(inventory[INVEN_LARM].k_idx)) status |= EMPTY_HAND_LARM; + return status; } -- 2.11.0