return result;
}
-void has_sustain_str(player_type *creature_ptr)
+BIT_FLAGS has_sustain_str(player_type *creature_ptr)
{
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- creature_ptr->sustain_str = FALSE;
- if (creature_ptr->pclass == CLASS_BERSERKER) {
- creature_ptr->sustain_str = TRUE;
+ BIT_FLAGS result = 0L;
+
+ if (creature_ptr->pclass == CLASS_BERSERKER) {
+ result |= FLAG_CAUSE_CLASS;
}
if (is_specific_player_race(creature_ptr, RACE_HALF_TROLL) || is_specific_player_race(creature_ptr, RACE_HALF_OGRE)
|| is_specific_player_race(creature_ptr, RACE_HALF_GIANT)) {
- creature_ptr->sustain_str = TRUE;
+ result |= FLAG_CAUSE_RACE;
}
if (creature_ptr->ult_res) {
- creature_ptr->sustain_str = TRUE;
+ result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
}
if (creature_ptr->special_defense & KATA_MUSOU) {
- creature_ptr->sustain_str = TRUE;
+ result |= FLAG_CAUSE_BATTLE_FORM;
}
- for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
- o_ptr = &creature_ptr->inventory_list[i];
- if (!o_ptr->k_idx)
- continue;
-
- object_flags(creature_ptr, o_ptr, flgs);
- if (has_flag(flgs, TR_SUST_STR))
- creature_ptr->sustain_str = TRUE;
- }
+ result |= check_equipment_flags(creature_ptr, TR_SUST_STR);
+ return result;
}
void has_sustain_int(player_type *creature_ptr)
void has_hold_exp(player_type *creature_ptr);
void has_see_inv(player_type *creature_ptr);
BIT_FLAGS has_free_act(player_type *creature_ptr);
-void has_sustain_str(player_type *creature_ptr);
+BIT_FLAGS has_sustain_str(player_type *creature_ptr);
void has_sustain_int(player_type *creature_ptr);
void has_sustain_wis(player_type *creature_ptr);
void has_sustain_dex(player_type *creature_ptr);
has_hold_exp(creature_ptr);
has_see_inv(creature_ptr);
creature_ptr->free_act = has_free_act(creature_ptr);
- has_sustain_str(creature_ptr);
+ creature_ptr->sustain_str = has_sustain_str(creature_ptr);
has_sustain_int(creature_ptr);
has_sustain_wis(creature_ptr);
has_sustain_dex(creature_ptr);
BIT_FLAGS anti_magic; /* Anti-magic */
BIT_FLAGS anti_tele; /* Prevent teleportation */
- bool sustain_str; /* Keep strength */
+ BIT_FLAGS sustain_str; /* Keep strength */
bool sustain_int; /* Keep intelligence */
bool sustain_wis; /* Keep wisdom */
bool sustain_dex; /* Keep dexterity */