OSDN Git Service

[Refactor] #37353 buki_motteruka() を has_melee_weapon() に改名。 / Rename buki_motteruka...
authorDeskull <deskull@users.sourceforge.jp>
Tue, 22 Jan 2019 12:05:19 +0000 (21:05 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 22 Jan 2019 12:05:19 +0000 (21:05 +0900)
17 files changed:
src/cmd-item.c
src/cmd-pet.c
src/cmd-read.c
src/cmd2.c
src/dungeon.c
src/effects.c
src/files.c
src/hissatsu.c
src/melee1.c
src/mind.c
src/mspells4.c
src/object2.c
src/patron.c
src/player-status.c
src/player-status.h
src/racial.c
src/realm-hissatsu.c

index ba23f65..fc9baba 100644 (file)
@@ -183,7 +183,7 @@ void do_cmd_wield(void)
        case TV_SHIELD:
        case TV_CARD:
                /* Dual wielding */
-               if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
+               if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
                {
                        /* Restrict the choices */
                        item_tester_hook = item_tester_hook_melee_weapon;
@@ -195,7 +195,7 @@ void do_cmd_wield(void)
                        if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
                }
 
-               else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
+               else if (has_melee_weapon(INVEN_LARM)) slot = INVEN_RARM;
 
                /* Both arms are already used by non-weapon */
                else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
@@ -222,7 +222,7 @@ void do_cmd_wield(void)
                        if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM;
                }
 
-               else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
+               else if (!inventory[INVEN_RARM].k_idx && has_melee_weapon(INVEN_LARM))
                {
                        if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM;
                }
@@ -238,7 +238,7 @@ void do_cmd_wield(void)
                        s = _("おっと。", "Oops.");
                        
                        if (!choose_object(&slot, q, s, (USE_EQUIP))) return;
-                       if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
+                       if ((slot == INVEN_LARM) && !has_melee_weapon(INVEN_RARM))
                                need_switch_wielding = INVEN_RARM;
                }
                break;
@@ -465,7 +465,7 @@ void kamaenaoshi(INVENTORY_IDX item)
 
        if (item == INVEN_RARM)
        {
-               if (buki_motteruka(INVEN_LARM))
+               if (has_melee_weapon(INVEN_LARM))
                {
                        o_ptr = &inventory[INVEN_LARM];
                        object_desc(o_name, o_ptr, 0);
@@ -495,7 +495,7 @@ void kamaenaoshi(INVENTORY_IDX item)
                o_ptr = &inventory[INVEN_RARM];
                if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
 
-               if (buki_motteruka(INVEN_RARM))
+               if (has_melee_weapon(INVEN_RARM))
                {
                        if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
                                msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
index dee6ab1..82dbc77 100644 (file)
@@ -674,7 +674,7 @@ void do_cmd_pet(void)
 
                                        powers[num++] = PET_RYOUTE;
                                }
-                               else if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+                               else if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
                                {
                                        if (p_ptr->pet_extra_flags & PF_RYOUTE)
                                        {
index 4ae2058..911fbd6 100644 (file)
@@ -107,12 +107,12 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
                case SV_SCROLL_CURSE_WEAPON:\r
                {\r
                        k = 0;\r
-                       if (buki_motteruka(INVEN_RARM))\r
+                       if (has_melee_weapon(INVEN_RARM))\r
                        {\r
                                k = INVEN_RARM;\r
-                               if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;\r
+                               if (has_melee_weapon(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;\r
                        }\r
-                       else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;\r
+                       else if (has_melee_weapon(INVEN_LARM)) k = INVEN_LARM;\r
                        if (k && curse_weapon(FALSE, k)) ident = TRUE;\r
                        break;\r
                }\r
index 9d54de2..cba6e7f 100644 (file)
@@ -2332,7 +2332,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
        }
        else if (boomerang)
        {
-               if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
+               if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
                {
                        item_tester_hook = item_tester_hook_boomerang;
                        q = _("どの武器を投げますか? ", "Throw which item? ");
@@ -2344,7 +2344,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
                                return FALSE;
                        }
                }
-               else if (buki_motteruka(INVEN_LARM))
+               else if (has_melee_weapon(INVEN_LARM))
                {
                        item = INVEN_LARM;
                        o_ptr = &inventory[item];
index 87d4a8e..389492c 100644 (file)
@@ -2596,18 +2596,18 @@ static void process_world_aux_mutation(void)
                take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
 
                msg_print(NULL);
-               if (buki_motteruka(INVEN_RARM))
+               if (has_melee_weapon(INVEN_RARM))
                {
                        slot = INVEN_RARM;
                        o_ptr = &inventory[INVEN_RARM];
 
-                       if (buki_motteruka(INVEN_LARM) && one_in_(2))
+                       if (has_melee_weapon(INVEN_LARM) && one_in_(2))
                        {
                                o_ptr = &inventory[INVEN_LARM];
                                slot = INVEN_LARM;
                        }
                }
-               else if (buki_motteruka(INVEN_LARM))
+               else if (has_melee_weapon(INVEN_LARM))
                {
                        o_ptr = &inventory[INVEN_LARM];
                        slot = INVEN_LARM;
index c379696..23ac4f4 100644 (file)
@@ -4505,7 +4505,7 @@ void calc_android_exp(void)
                        if (value > 100000L)
                                exp += (value - 100000L) / 4  * level;
                }
-               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
+               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
                else total_exp += exp / 16;
                if (i == INVEN_BODY) total_exp += exp / 32;
        }
@@ -4720,7 +4720,7 @@ bool choose_ele_attack(void)
 
        char choice;
 
-       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
        {
                msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
                return FALSE;
index 3662dd3..9268167 100644 (file)
@@ -1695,7 +1695,7 @@ static void display_player_melee_bonus(int hand, int hand_entry)
        sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
 
        /* Dump the bonuses to hit/dam */
-       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
                display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
        else if (p_ptr->ryoute)
                display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
index 8559eb1..ca0d6f4 100644 (file)
@@ -319,7 +319,7 @@ void do_cmd_hissatsu(void)
                msg_print(_("混乱していて集中できない!", "You are too confused!"));
                return;
        }
-       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
        {
                if (flush_failure) flush();
                msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
index 29a055a..70bac3f 100644 (file)
@@ -466,7 +466,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
        {
        case CLASS_ROGUE:
        case CLASS_NINJA:
-               if (buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
+               if (has_melee_weapon(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
                {
                        int tmp = p_ptr->lev * 6 + (p_ptr->skill_stl + 10) * 4;
                        if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
@@ -937,7 +937,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
                                }
                                else k = 1;
                        }
-                       else if ((p_ptr->pclass == CLASS_NINJA) && buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
+                       else if ((p_ptr->pclass == CLASS_NINJA) && has_melee_weapon(INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
                        {
                                int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
                                if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
index 2a4b27c..6aa219b 100644 (file)
@@ -856,8 +856,8 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                                put_str(format(_("Lv   %s   失率 効果", "Lv   %s   Fail Info"),
                                        ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
 
-                               has_weapon[0] = buki_motteruka(INVEN_RARM);
-                               has_weapon[1] = buki_motteruka(INVEN_LARM);
+                               has_weapon[0] = has_melee_weapon(INVEN_RARM);
+                               has_weapon[1] = has_melee_weapon(INVEN_LARM);
 
                                /* Dump the spells */
                                for (i = 0; i < MAX_MIND_POWERS; i++)
@@ -1830,9 +1830,9 @@ void do_cmd_mind(void)
        {
                if (heavy_armor()) chance += 20;
                if (p_ptr->icky_wield[0]) chance += 20;
-               else if (buki_motteruka(INVEN_RARM)) chance += 10;
+               else if (has_melee_weapon(INVEN_RARM)) chance += 10;
                if (p_ptr->icky_wield[1]) chance += 20;
-               else if (buki_motteruka(INVEN_LARM)) chance += 10;
+               else if (has_melee_weapon(INVEN_LARM)) chance += 10;
                if (n == 5)
                {
                        int j;
index f2588f3..a3ee739 100644 (file)
@@ -4155,8 +4155,8 @@ HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE)
        int shoot_dd = 1, shoot_ds = 1, shoot_base = 0;
        object_type *o_ptr = NULL;
 
-       if (buki_motteruka(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
-       else if (buki_motteruka(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
+       if (has_melee_weapon(INVEN_RARM)) o_ptr = &inventory[INVEN_RARM];
+       else if (has_melee_weapon(INVEN_LARM)) o_ptr = &inventory[INVEN_LARM];
 
        if (o_ptr)
        {
index fb41dcb..eb3c238 100644 (file)
@@ -5657,7 +5657,7 @@ void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
                {
                        if ((item == INVEN_RARM) || (item == INVEN_LARM))
                        {
-                               if (!buki_motteruka(INVEN_RARM + INVEN_LARM - item))
+                               if (!has_melee_weapon(INVEN_RARM + INVEN_LARM - item))
                                {
                                        /* Clear all temporary elemental brands */
                                        set_ele_attack(0, 0);
index 6e26feb..2a9f15a 100644 (file)
@@ -615,15 +615,15 @@ void gain_level_reward(int chosen_reward)
 
                case REW_CURSE_WP:
 
-                       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM)) break;
+                       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
                        msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[p_ptr->chaos_patron]);
                        msg_print(_("「汝、武器に頼ることなかれ。」", "'Thou reliest too much on thy weapon.'"));
 
                        dummy = INVEN_RARM;
-                       if (buki_motteruka(INVEN_LARM))
+                       if (has_melee_weapon(INVEN_LARM))
                        {
                                dummy = INVEN_LARM;
-                               if (buki_motteruka(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
+                               if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
                        }
                        object_desc(o_name, &inventory[dummy], OD_NAME_ONLY);
                        (void)curse_weapon(FALSE, dummy);
@@ -658,12 +658,12 @@ void gain_level_reward(int chosen_reward)
                        case 3:
                                if (one_in_(2))
                                {
-                                       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM)) break;
+                                       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
                                        dummy = INVEN_RARM;
-                                       if (buki_motteruka(INVEN_LARM))
+                                       if (has_melee_weapon(INVEN_LARM))
                                        {
                                                dummy = INVEN_LARM;
-                                               if (buki_motteruka(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
+                                               if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
                                        }
                                        object_desc(o_name, &inventory[dummy], OD_NAME_ONLY);
                                        (void)curse_weapon(FALSE, dummy);
@@ -703,12 +703,12 @@ void gain_level_reward(int chosen_reward)
                        {
                                dummy = 0;
 
-                               if (buki_motteruka(INVEN_RARM))
+                               if (has_melee_weapon(INVEN_RARM))
                                {
                                        dummy = INVEN_RARM;
-                                       if (buki_motteruka(INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
+                                       if (has_melee_weapon(INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
                                }
-                               else if (buki_motteruka(INVEN_LARM)) dummy = INVEN_LARM;
+                               else if (has_melee_weapon(INVEN_LARM)) dummy = INVEN_LARM;
 
                                if (dummy) (void)curse_weapon(FALSE, dummy);
                        }
index e21d630..3ec8a28 100644 (file)
@@ -282,8 +282,8 @@ void calc_bonuses(void)
        /* Base skill -- digging */
        p_ptr->skill_dig = 0;
 
-       if (buki_motteruka(INVEN_RARM)) p_ptr->migite = TRUE;
-       if (buki_motteruka(INVEN_LARM))
+       if (has_melee_weapon(INVEN_RARM)) p_ptr->migite = TRUE;
+       if (has_melee_weapon(INVEN_LARM))
        {
                p_ptr->hidarite = TRUE;
                if (!p_ptr->migite) default_hand = 1;
@@ -1227,8 +1227,8 @@ void calc_bonuses(void)
                }
 
                /* Hack -- do not apply "weapon" bonuses */
-               if (i == INVEN_RARM && buki_motteruka(i)) continue;
-               if (i == INVEN_LARM && buki_motteruka(i)) continue;
+               if (i == INVEN_RARM && has_melee_weapon(i)) continue;
+               if (i == INVEN_LARM && has_melee_weapon(i)) continue;
 
                /* Hack -- do not apply "bow" bonuses */
                if (i == INVEN_BOW) continue;
@@ -1744,7 +1744,7 @@ void calc_bonuses(void)
                p_ptr->dis_to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
        }
 
-       if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
+       if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
        {
                int penalty1, penalty2;
                penalty1 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - inventory[INVEN_RARM].weight) / 8);
@@ -1924,7 +1924,7 @@ void calc_bonuses(void)
                p_ptr->icky_wield[i] = FALSE;
                p_ptr->riding_wield[i] = FALSE;
 
-               if (!buki_motteruka(INVEN_RARM + i))
+               if (!has_melee_weapon(INVEN_RARM + i))
                {
                        p_ptr->num_blow[i] = 1;
                        continue;
@@ -2215,7 +2215,7 @@ void calc_bonuses(void)
                        case CLASS_MONK:
                        case CLASS_FORCETRAINER:
                        case CLASS_BERSERKER:
-                               if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+                               if ((empty_hands(FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
                                        p_ptr->riding_ryoute = TRUE;
                                break;
                        }
@@ -2331,7 +2331,7 @@ void calc_bonuses(void)
 
        for (i = 0; i < 2; i++)
        {
-               if (buki_motteruka(INVEN_RARM + i))
+               if (has_melee_weapon(INVEN_RARM + i))
                {
                        OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
                        OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM + i].sval;
@@ -2552,7 +2552,7 @@ void calc_bonuses(void)
                        {
                                msg_print(_("こんな重い武器を装備しているのは大変だ。", "You have trouble wielding such a heavy weapon."));
                        }
-                       else if (buki_motteruka(INVEN_RARM + i))
+                       else if (has_melee_weapon(INVEN_RARM + i))
                        {
                                msg_print(_("これなら装備していても辛くない。", "You have no trouble wielding your weapon."));
                        }
@@ -2580,7 +2580,7 @@ void calc_bonuses(void)
                        {
                                msg_print(_("この武器は徒歩で使いやすい。", "This weapon was not suitable for use while riding."));
                        }
-                       else if (buki_motteruka(INVEN_RARM + i))
+                       else if (has_melee_weapon(INVEN_RARM + i))
                        {
                                msg_print(_("これなら乗馬中にぴったりだ。", "This weapon is suitable for use while riding."));
                        }
@@ -2599,7 +2599,7 @@ void calc_bonuses(void)
                                        chg_virtue(V_FAITH, -1);
                                }
                        }
-                       else if (buki_motteruka(INVEN_RARM + i))
+                       else if (has_melee_weapon(INVEN_RARM + i))
                        {
                                msg_print(_("今の装備は自分にふさわしい気がする。", "You feel comfortable with your weapon."));
                        }
@@ -3634,7 +3634,7 @@ WEIGHT weight_limit(void)
  * @param i 判定する手のID(右手:0 左手:1)
  * @return 持っているならばTRUE
  */
-bool buki_motteruka(int i)
+bool has_melee_weapon(int i)
 {
        return ((inventory[i].k_idx && object_is_melee_weapon(&inventory[i])) ? TRUE : FALSE);
 }
index b070693..cbd9e86 100644 (file)
@@ -6,7 +6,7 @@ extern int spell_exp_level(int spell_exp);
 extern s16b calc_num_fire(object_type *o_ptr);
 extern void calc_bonuses(void);
 extern WEIGHT weight_limit(void);
-extern bool buki_motteruka(int i);
+extern bool has_melee_weapon(int i);
 extern bool is_heavy_shoot(object_type *o_ptr);
 extern bool heavy_armor(void);
 extern void update_creature(player_type *creature_ptr);
index f49fff8..df59f85 100644 (file)
@@ -993,7 +993,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+                               if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
                                {
                                        msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
                                        return FALSE;
index 2774b26..b1c6307 100644 (file)
@@ -583,7 +583,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                int damage;
 
-                               if (!buki_motteruka(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(INVEN_RARM + i)) break;
                                o_ptr = &inventory[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;
@@ -863,7 +863,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        for (i = 0; i < 2; i++)
                        {
                                int damage;
-                               if (!buki_motteruka(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(INVEN_RARM + i)) break;
                                o_ptr = &inventory[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;