OSDN Git Service
(root)
/
hengband
/
hengband.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f71d52
)
[Refactor] #38997 CAN_TWO_HANDS_WIELDING() の関数マクロを普通の関数に変更し、player_type * 引数を追加 ...
author
Hourier
<hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 09:31:43 +0000
(18:31 +0900)
committer
Hourier
<hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 16:06:58 +0000
(
01:06
+0900)
src/cmd/cmd-item.c
patch
|
blob
|
history
src/cmd/cmd-pet.c
patch
|
blob
|
history
src/cmd/cmd-pet.h
patch
|
blob
|
history
src/files.c
patch
|
blob
|
history
src/floor-save.c
patch
|
blob
|
history
src/player-status.c
patch
|
blob
|
history
src/player-status.h
patch
|
blob
|
history
diff --git
a/src/cmd/cmd-item.c
b/src/cmd/cmd-item.c
index
35ead5e
..
fe84895
100644
(file)
--- a/
src/cmd/cmd-item.c
+++ b/
src/cmd/cmd-item.c
@@
-378,14
+378,14
@@
void do_cmd_wield(player_type *creature_ptr)
switch (slot)
{
case INVEN_RARM:
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:
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);
act = STR_WIELD_ARMS;
else
act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
@@
-431,8
+431,10
@@
void do_cmd_wield(player_type *creature_ptr)
calc_android_exp(creature_ptr);
}
calc_android_exp(creature_ptr);
}
+
/*!
* @brief 持ち替え処理
/*!
* @brief 持ち替え処理
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param item 持ち替えを行いたい装備部位ID
* @return なし
*/
* @param item 持ち替えを行いたい装備部位ID
* @return なし
*/
@@
-450,7
+452,7
@@
void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
if (object_is_cursed(o_ptr))
{
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;
}
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
return;
}
@@
-460,7
+462,7
@@
void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
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);
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,
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,
@@
-475,7
+477,7
@@
void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
if (has_melee_weapon(owner_ptr, INVEN_RARM))
{
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;
}
msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
return;
}
diff --git
a/src/cmd/cmd-pet.c
b/src/cmd/cmd-pet.c
index
94169c2
..
29209e7
100644
(file)
--- a/
src/cmd/cmd-pet.c
+++ b/
src/cmd/cmd-pet.c
@@
-37,7
+37,7
@@
bool player_can_ride_aux(player_type *creature_ptr, grid_type *g_ptr, bool now_r
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;
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;
/* Hack -- prevent "icky" message */
current_world_ptr->character_xtra = TRUE;
@@
-46,7
+46,7
@@
bool player_can_ride_aux(player_type *creature_ptr, grid_type *g_ptr, bool now_r
else
{
creature_ptr->riding = 0;
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;
}
creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
}
@@
-56,8
+56,8
@@
bool player_can_ride_aux(player_type *creature_ptr, grid_type *g_ptr, bool now_r
p_can_enter = player_can_enter(creature_ptr, g_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
creature_ptr->riding = old_riding;
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_ryoute = old_riding_ryoute;
creature_ptr->old_riding_ryoute = old_old_riding_ryoute;
@@
-308,7
+308,7
@@
bool do_cmd_riding(player_type *creature_ptr, bool force)
}
creature_ptr->riding = 0;
}
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->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
}
else
@@
-607,7
+607,7
@@
void do_cmd_pet(player_type *creature_ptr)
(creature_ptr->hidarite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) &&
object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_LARM])))
{
(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");
}
{
power_desc[num] = _("武器を片手で持つ", "use one hand to control a riding pet");
}
@@
-627,7
+627,7
@@
void do_cmd_pet(player_type *creature_ptr)
case CLASS_BERSERKER:
if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
{
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");
}
{
power_desc[num] = _("片手で格闘する", "use one hand to control a riding pet");
}
@@
-640,7
+640,7
@@
void do_cmd_pet(player_type *creature_ptr)
}
else if ((empty_hands(creature_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
{
}
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");
}
{
power_desc[num] = _("格闘を行わない", "use one hand to control a riding pet");
}
@@
-951,8
+951,8
@@
void do_cmd_pet(player_type *creature_ptr)
case PET_RYOUTE:
{
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->update |= (PU_BONUS);
handle_stuff(creature_ptr);
break;
@@
-1069,7
+1069,7
@@
bool rakuba(player_type *creature_ptr, HIT_POINT dam, bool force)
}
creature_ptr->riding = 0;
}
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);
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);
diff --git
a/src/cmd/cmd-pet.h
b/src/cmd/cmd-pet.h
index
e5e0025
..
2319e99
100644
(file)
--- a/
src/cmd/cmd-pet.h
+++ b/
src/cmd/cmd-pet.h
@@
-49,5
+49,5
@@
extern int total_friends;
#define PF_ATTACK_SPELL 0x0008 /*!< ペットの行動許可…攻撃魔法を使ってよい */
#define PF_SUMMON_SPELL 0x0010 /*!< ペットの行動許可…召喚魔法を使ってよい */
#define PF_BALL_SPELL 0x0020 /*!< ペットの行動許可…ボール魔法でプレイヤーを巻き込んでよい */
#define PF_ATTACK_SPELL 0x0008 /*!< ペットの行動許可…攻撃魔法を使ってよい */
#define PF_SUMMON_SPELL 0x0010 /*!< ペットの行動許可…召喚魔法を使ってよい */
#define PF_BALL_SPELL 0x0020 /*!< ペットの行動許可…ボール魔法でプレイヤーを巻き込んでよい */
-#define PF_
RYOUTE
0x0040 /*!< プレイヤーの騎乗フラグ…武器を片手で持つ */
+#define PF_
TWO_HANDS
0x0040 /*!< プレイヤーの騎乗フラグ…武器を片手で持つ */
diff --git
a/src/files.c
b/src/files.c
index
7562d68
..
efed57e
100644
(file)
--- a/
src/files.c
+++ b/
src/files.c
@@
-2723,7
+2723,7
@@
static void tim_player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_S
add_flag(flgs, TR_SEE_INVIS);
if (creature_ptr->tim_regen)
add_flag(flgs, TR_REGEN);
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);
add_flag(flgs, TR_TELEPATHY);
if (IS_FAST(creature_ptr) || creature_ptr->slow)
add_flag(flgs, TR_SPEED);
diff --git
a/src/floor-save.c
b/src/floor-save.c
index
030e6a5
..
bf687b3
100644
(file)
--- a/
src/floor-save.c
+++ b/
src/floor-save.c
@@
-411,7
+411,7
@@
static void preserve_pet(player_type *master_ptr)
if (m_ptr->parent_m_idx)
{
master_ptr->riding = 0;
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
master_ptr->riding_ryoute = master_ptr->old_riding_ryoute = FALSE;
}
else
diff --git
a/src/player-status.c
b/src/player-status.c
index
53701f7
..
a00a4dd
100644
(file)
--- a/
src/player-status.c
+++ b/
src/player-status.c
@@
-1573,7
+1573,7
@@
void calc_bonuses(player_type *creature_ptr)
if (!creature_ptr->migite) default_hand = 1;
}
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]))
{
if (creature_ptr->migite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) &&
object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_RARM]))
@@
-3457,7
+3457,7
@@
void calc_bonuses(player_type *creature_ptr)
creature_ptr->riding_ryoute = FALSE;
if (creature_ptr->ryoute || (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_NONE)) creature_ptr->riding_ryoute = TRUE;
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)
{
{
switch (creature_ptr->pclass)
{
@@
-4945,7
+4945,7
@@
BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control)
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 (!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);
{
if (status & EMPTY_HAND_LARM) status &= ~(EMPTY_HAND_LARM);
else if (status & EMPTY_HAND_RARM) status &= ~(EMPTY_HAND_RARM);
@@
-5984,3
+5984,9
@@
bool is_time_limit_stealth(player_type *creature_ptr)
{
return creature_ptr->tim_stealth || music_singing(creature_ptr, MUSIC_STEALTH);
}
{
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);
+}
diff --git
a/src/player-status.h
b/src/player-status.h
index
cc2c912
..
8dfc9a6
100644
(file)
--- a/
src/player-status.h
+++ b/
src/player-status.h
@@
-813,6
+813,7
@@
extern bool is_oppose_cold(player_type *creature_ptr);
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 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
/*
* Player "food" crucial values
@@
-833,6
+834,4
@@
extern bool is_time_limit_stealth(player_type *creature_ptr);
#define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
#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);
extern void cheat_death(player_type *creature_ptr);