#include "object-enchant/object-ego.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
-#include "object-hook/hook-weapon.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
#include "player/player-class.h"
#include "player/player-race-types.h"
#include "player/player-race.h"
+#include "player/player-skill.h"
#include "player/player-status.h"
+#include "player/player-status-flags.h"
#include "player/special-defense-types.h"
#include "realm/realm-hex-numbers.h"
#include "realm/realm-song-numbers.h"
#include "system/floor-type-definition.h"
#include "system/monster-type-definition.h"
#include "system/object-type-definition.h"
+#include "sv-definition/sv-weapon-types.h"
#include "util/bit-flags-calculator.h"
#include "util/quarks.h"
#include "util/string-processor.h"
creature_ptr->pass_wall = TRUE;
}
- if (creature_ptr->riding) {
+ if (creature_ptr->riding) {
monster_type *riding_m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
if (!(riding_r_ptr->flags2 & RF2_PASS_WALL))
creature_ptr->resist_fear = TRUE;
}
- if (is_hero(creature_ptr) || creature_ptr->shero) {
+ if (is_hero(creature_ptr) || creature_ptr->shero) {
creature_ptr->resist_fear = TRUE;
}
void have_right_hand_weapon(player_type *creature_ptr)
{
- creature_ptr->right_hand_weapon = FALSE;
+ creature_ptr->right_hand_weapon = FALSE;
if (has_melee_weapon(creature_ptr, INVEN_RARM))
creature_ptr->right_hand_weapon = TRUE;
if (can_two_hands_wielding(creature_ptr)) {
switch (creature_ptr->pclass) {
- case CLASS_MONK:
- case CLASS_FORCETRAINER:
- case CLASS_BERSERKER:
- if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) {
- creature_ptr->right_hand_weapon = TRUE;
- }
- break;
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ case CLASS_BERSERKER:
+ if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) {
+ creature_ptr->right_hand_weapon = TRUE;
+ }
+ break;
}
}
-
}
void have_left_hand_weapon(player_type *creature_ptr)
}
void have_two_handed_weapons(player_type *creature_ptr)
-{
- creature_ptr->two_handed_weapon = FALSE;
+{
+ creature_ptr->two_handed_weapon = FALSE;
if (can_two_hands_wielding(creature_ptr)) {
if (creature_ptr->right_hand_weapon && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM)
&& object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_RARM])) {
if (creature_ptr->pclass == CLASS_NINJA)
return;
- if (creature_ptr->mimic_form == MIMIC_VAMPIRE) {
- creature_ptr->lite = TRUE;
+ if (creature_ptr->mimic_form == MIMIC_VAMPIRE) {
+ creature_ptr->lite = TRUE;
}
if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_VAMPIRE)
creature_ptr->lite = TRUE;
- if (creature_ptr->sh_fire)
+ if (creature_ptr->sh_fire)
creature_ptr->lite = TRUE;
if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
- creature_ptr->lite = TRUE;
+ creature_ptr->lite = TRUE;
}
}
}
return FALSE;
}
+
+void is_icky_wield_weapon(player_type* creature_ptr, int i)
+{
+
+ object_type *o_ptr;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
+ object_flags(creature_ptr, o_ptr, flgs);
+
+ creature_ptr->icky_wield[i] = FALSE;
+ if ((creature_ptr->pclass == CLASS_PRIEST) && (!(have_flag(flgs, TR_BLESSED))) && ((o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM))) {
+ creature_ptr->icky_wield[i] = TRUE;
+ } else if (creature_ptr->pclass == CLASS_SORCERER) {
+ if (!((o_ptr->tval == TV_HAFTED) && ((o_ptr->sval == SV_WIZSTAFF) || (o_ptr->sval == SV_NAMAKE_HAMMER)))) {
+ creature_ptr->icky_wield[i] = TRUE;
+ }
+ }
+ if (is_not_monk_weapon(creature_ptr, i) || is_not_ninja_weapon(creature_ptr, i)) {
+ creature_ptr->icky_wield[i] = TRUE;
+ }
+}
+
+bool is_not_ninja_weapon(player_type *creature_ptr, int i)
+{
+ tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
+ OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval;
+ return creature_ptr->pclass == CLASS_NINJA
+ && !((s_info[CLASS_NINJA].w_max[tval][sval] > WEAPON_EXP_BEGINNER) && (creature_ptr->inventory_list[INVEN_LARM - i].tval != TV_SHIELD));
+}
+
+bool is_not_monk_weapon(player_type *creature_ptr, int i)
+{
+ tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
+ OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval;
+ return (creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) && (!s_info[creature_ptr->pclass].w_max[tval][sval]);
+}
#include "world/world.h"
static bool is_martial_arts_mode(player_type *creature_ptr);
-static bool is_not_ninja_weapon(player_type *creature_ptr, int i);
-static bool is_not_monk_weapon(player_type *creature_ptr, int i);
static void calc_intra_vision(player_type *creature_ptr);
static void calc_stealth(player_type *creature_ptr);
}
for (int i = 0; i < 2; i++) {
- o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
- object_flags(creature_ptr, o_ptr, flgs);
-
+ is_icky_wield_weapon(creature_ptr, i);
calc_num_blow(creature_ptr, i);
-
- if ((creature_ptr->pclass == CLASS_PRIEST) && (!(have_flag(flgs, TR_BLESSED))) && ((o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM))) {
- creature_ptr->icky_wield[i] = TRUE;
- } else if (creature_ptr->pclass == CLASS_SORCERER) {
- if (!((o_ptr->tval == TV_HAFTED) && ((o_ptr->sval == SV_WIZSTAFF) || (o_ptr->sval == SV_NAMAKE_HAMMER)))) {
- creature_ptr->icky_wield[i] = TRUE;
- }
- }
-
calc_to_weapon_dice_num(creature_ptr, INVEN_RARM + i);
calc_to_weapon_dice_side(creature_ptr, INVEN_RARM + i);
&& !have_flag(flgs, TR_RIDING)) {
creature_ptr->riding_wield[i] = TRUE;
}
-
- if (is_not_monk_weapon(creature_ptr, i) || is_not_ninja_weapon(creature_ptr, i)) {
- creature_ptr->icky_wield[i] = TRUE;
- }
}
calc_riding_weapon_penalty(creature_ptr);
&& (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM) && !creature_ptr->left_hand_weapon;
}
-static bool is_not_ninja_weapon(player_type *creature_ptr, int i)
-{
- tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
- OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval;
- return creature_ptr->pclass == CLASS_NINJA
- && !((s_info[CLASS_NINJA].w_max[tval][sval] > WEAPON_EXP_BEGINNER) && (creature_ptr->inventory_list[INVEN_LARM - i].tval != TV_SHIELD));
-}
-
-static bool is_not_monk_weapon(player_type *creature_ptr, int i)
-{
- tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
- OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval;
- return (creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) && (!s_info[creature_ptr->pclass].w_max[tval][sval]);
-}
-
static void calc_num_blow(player_type *creature_ptr, int i)
{
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
object_flags(creature_ptr, o_ptr, flgs);
creature_ptr->heavy_wield[i] = FALSE;
- creature_ptr->icky_wield[i] = FALSE;
creature_ptr->riding_wield[i] = FALSE;
if (!has_melee_weapon(creature_ptr, INVEN_RARM + i)) {
creature_ptr->num_blow[i] = 1;