• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiond7ed1997913a2801ba0f402386c9420b597bec61 (tree)
Time2019-07-10 12:28:00
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 empty_hands() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -406,14 +406,14 @@ void do_cmd_wield(void)
406406 switch (slot)
407407 {
408408 case INVEN_RARM:
409- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
409+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
410410 act = STR_WIELD_ARMS;
411411 else
412412 act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
413413 break;
414414
415415 case INVEN_LARM:
416- if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
416+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
417417 act = STR_WIELD_ARMS;
418418 else
419419 act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
@@ -506,7 +506,7 @@ void kamaenaoshi(INVENTORY_IDX item)
506506 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
507507 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
508508 }
509- else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
509+ else if (!(empty_hands(p_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
510510 {
511511 new_o_ptr = &p_ptr->inventory_list[INVEN_LARM];
512512 object_copy(new_o_ptr, o_ptr);
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -602,9 +602,9 @@ void do_cmd_pet(void)
602602
603603 if (p_ptr->riding)
604604 {
605- if ((p_ptr->migite && (empty_hands(FALSE) == EMPTY_HAND_LARM) &&
605+ if ((p_ptr->migite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_LARM) &&
606606 object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_RARM])) ||
607- (p_ptr->hidarite && (empty_hands(FALSE) == EMPTY_HAND_RARM) &&
607+ (p_ptr->hidarite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_RARM) &&
608608 object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_LARM])))
609609 {
610610 if (p_ptr->pet_extra_flags & PF_RYOUTE)
@@ -625,7 +625,7 @@ void do_cmd_pet(void)
625625 case CLASS_MONK:
626626 case CLASS_FORCETRAINER:
627627 case CLASS_BERSERKER:
628- if (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
628+ if (empty_hands(p_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
629629 {
630630 if (p_ptr->pet_extra_flags & PF_RYOUTE)
631631 {
@@ -638,7 +638,7 @@ void do_cmd_pet(void)
638638
639639 powers[num++] = PET_RYOUTE;
640640 }
641- else if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
641+ else if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
642642 {
643643 if (p_ptr->pet_extra_flags & PF_RYOUTE)
644644 {
--- a/src/files.c
+++ b/src/files.c
@@ -1789,7 +1789,7 @@ static void display_player_middle(void)
17891789 {
17901790 display_player_melee_bonus(1, left_hander ? ENTRY_RIGHT_HAND2: ENTRY_LEFT_HAND2);
17911791 }
1792- else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(TRUE) & EMPTY_HAND_RARM))
1792+ else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
17931793 {
17941794 int i;
17951795 if (p_ptr->special_defense & KAMAE_MASK)
@@ -2135,7 +2135,7 @@ static void display_player_various(void)
21352135 for(i = 0; i < 2; i++)
21362136 {
21372137 damage[i] = p_ptr->dis_to_d[i] * 100;
2138- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM))
2138+ if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
21392139 {
21402140 PLAYER_LEVEL level = p_ptr->lev;
21412141 if (i)
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -1342,7 +1342,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
13421342 case CLASS_MONK:
13431343 case CLASS_FORCETRAINER:
13441344 case CLASS_BERSERKER:
1345- if ((empty_hands(TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
1345+ if ((empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
13461346 break;
13471347 }
13481348
@@ -2186,7 +2186,7 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
21862186 !(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
21872187 {
21882188 msg_format(_("%s攻撃できない。", "You cannot do attacking."),
2189- (empty_hands(FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
2189+ (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
21902190 return FALSE;
21912191 }
21922192
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -1369,7 +1369,7 @@ void calc_bonuses(void)
13691369 int i, j, hold;
13701370 int new_speed;
13711371 int default_hand = 0;
1372- int empty_hands_status = empty_hands(TRUE);
1372+ int empty_hands_status = empty_hands(p_ptr, TRUE);
13731373 int extra_blows[2];
13741374 object_type *o_ptr;
13751375 BIT_FLAGS flgs[TR_FLAG_SIZE];
@@ -1574,12 +1574,12 @@ void calc_bonuses(void)
15741574
15751575 if (CAN_TWO_HANDS_WIELDING())
15761576 {
1577- if (p_ptr->migite && (empty_hands(FALSE) == EMPTY_HAND_LARM) &&
1577+ if (p_ptr->migite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_LARM) &&
15781578 object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_RARM]))
15791579 {
15801580 p_ptr->ryoute = TRUE;
15811581 }
1582- else if (p_ptr->hidarite && (empty_hands(FALSE) == EMPTY_HAND_RARM) &&
1582+ else if (p_ptr->hidarite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_RARM) &&
15831583 object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_LARM]))
15841584 {
15851585 p_ptr->ryoute = TRUE;
@@ -1591,7 +1591,7 @@ void calc_bonuses(void)
15911591 case CLASS_MONK:
15921592 case CLASS_FORCETRAINER:
15931593 case CLASS_BERSERKER:
1594- if (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
1594+ if (empty_hands(p_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
15951595 {
15961596 p_ptr->migite = TRUE;
15971597 p_ptr->ryoute = TRUE;
@@ -3457,7 +3457,7 @@ void calc_bonuses(void)
34573457
34583458 p_ptr->riding_ryoute = FALSE;
34593459
3460- if (p_ptr->ryoute || (empty_hands(FALSE) == EMPTY_HAND_NONE)) p_ptr->riding_ryoute = TRUE;
3460+ if (p_ptr->ryoute || (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE)) p_ptr->riding_ryoute = TRUE;
34613461 else if (p_ptr->pet_extra_flags & PF_RYOUTE)
34623462 {
34633463 switch (p_ptr->pclass)
@@ -3465,7 +3465,7 @@ void calc_bonuses(void)
34653465 case CLASS_MONK:
34663466 case CLASS_FORCETRAINER:
34673467 case CLASS_BERSERKER:
3468- if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
3468+ if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
34693469 p_ptr->riding_ryoute = TRUE;
34703470 break;
34713471 }
@@ -3655,7 +3655,7 @@ void calc_bonuses(void)
36553655 p_ptr->dis_to_d[default_hand] += MAX(bonus_to_d, 1);
36563656 }
36573657
3658- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE;
3658+ if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(p_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE;
36593659
36603660 /* Affect Skill -- stealth (bonus one) */
36613661 p_ptr->skill_stl += 1;
@@ -3829,7 +3829,7 @@ void calc_bonuses(void)
38293829 if (p_ptr->riding_ryoute)
38303830 {
38313831 #ifdef JP
3832- msg_format("%s馬を操れない。", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "両手がふさがっていて" : "");
3832+ msg_format("%s馬を操れない。", (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? "両手がふさがっていて" : "");
38333833 #else
38343834 msg_print("You are using both hand for fighting, and you can't control a riding pet.");
38353835 #endif
@@ -3837,7 +3837,7 @@ void calc_bonuses(void)
38373837 else
38383838 {
38393839 #ifdef JP
3840- msg_format("%s馬を操れるようになった。", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "手が空いて" : "");
3840+ msg_format("%s馬を操れるようになった。", (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? "手が空いて" : "");
38413841 #else
38423842 msg_print("You began to control riding pet with one hand.");
38433843 #endif
@@ -4937,14 +4937,14 @@ bool has_melee_weapon(int i)
49374937 * @param riding_control 乗馬中により片手を必要としている状態ならばTRUEを返す。
49384938 * @return 開いている手のビットフラグ
49394939 */
4940-BIT_FLAGS16 empty_hands(bool riding_control)
4940+BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control)
49414941 {
49424942 BIT_FLAGS16 status = EMPTY_HAND_NONE;
49434943
4944- if (!p_ptr->inventory_list[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM;
4945- if (!p_ptr->inventory_list[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM;
4944+ if (!creature_ptr->inventory_list[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM;
4945+ if (!creature_ptr->inventory_list[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM;
49464946
4947- if (riding_control && (status != EMPTY_HAND_NONE) && p_ptr->riding && !(p_ptr->pet_extra_flags & PF_RYOUTE))
4947+ if (riding_control && (status != EMPTY_HAND_NONE) && creature_ptr->riding && !(creature_ptr->pet_extra_flags & PF_RYOUTE))
49484948 {
49494949 if (status & EMPTY_HAND_LARM) status &= ~(EMPTY_HAND_LARM);
49504950 else if (status & EMPTY_HAND_RARM) status &= ~(EMPTY_HAND_RARM);
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -738,7 +738,7 @@ extern bool is_heavy_shoot(object_type *o_ptr);
738738
739739 extern bool heavy_armor(player_type *creature_ptr);
740740 extern void update_creature(player_type *creature_ptr);
741-extern BIT_FLAGS16 empty_hands(bool riding_control);
741+extern BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
742742 extern bool player_has_no_spellbooks(player_type *creature_ptr);
743743
744744 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
--- a/src/racial.c
+++ b/src/racial.c
@@ -463,7 +463,7 @@ static bool cmd_racial_power_aux(s32b command)
463463 }
464464 case CLASS_MONK:
465465 {
466- if (!(empty_hands(TRUE) & EMPTY_HAND_RARM))
466+ if (!(empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
467467 {
468468 msg_print(_("素手じゃないとできません。", "You need to be bare hand."));
469469 return FALSE;
--- a/src/realm-hex.c
+++ b/src/realm-hex.c
@@ -613,7 +613,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
613613 #ifdef JP
614614 msg_print("あなたの武器が黒く輝いた。");
615615 #else
616- if (!empty_hands(FALSE))
616+ if (!empty_hands(p_ptr, FALSE))
617617 msg_print("Your weapons glow bright black.");
618618 else
619619 msg_print("Your weapon glows bright black.");
@@ -624,7 +624,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
624624 #ifdef JP
625625 msg_print("武器の輝きが消え去った。");
626626 #else
627- msg_format("Brightness of weapon%s disappeared.", (empty_hands(FALSE)) ? "" : "s");
627+ msg_format("Brightness of weapon%s disappeared.", (empty_hands(p_ptr, FALSE)) ? "" : "s");
628628 #endif
629629 }
630630 break;
@@ -974,7 +974,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
974974 #ifdef JP
975975 msg_print("あなたの武器が血を欲している。");
976976 #else
977- if (!empty_hands(FALSE))
977+ if (!empty_hands(p_ptr, FALSE))
978978 msg_print("Your weapons want more blood now.");
979979 else
980980 msg_print("Your weapon wants more blood now.");
@@ -985,7 +985,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
985985 #ifdef JP
986986 msg_print("武器の渇望が消え去った。");
987987 #else
988- msg_format("Thirsty of weapon%s disappeared.", (empty_hands(FALSE)) ? "" : "s");
988+ msg_format("Thirsty of weapon%s disappeared.", (empty_hands(p_ptr, FALSE)) ? "" : "s");
989989 #endif
990990 }
991991 break;
Show on old repository browser