*/
void touch_zap_player(monster_type *m_ptr, player_type *touched_ptr)
{
- process_aura_damage(m_ptr, touched_ptr, touched_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE, fire_dam,
+ process_aura_damage(m_ptr, touched_ptr, (bool)touched_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
+ fire_dam,
_("突然とても熱くなった!", "You are suddenly very hot!"));
- process_aura_damage(m_ptr, touched_ptr, touched_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD, cold_dam,
+ process_aura_damage(m_ptr, touched_ptr, (bool)touched_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
+ cold_dam,
_("突然とても寒くなった!", "You are suddenly very cold!"));
- process_aura_damage(m_ptr, touched_ptr, touched_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC, elec_dam,
+ process_aura_damage(m_ptr, touched_ptr, (bool)touched_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
+ elec_dam,
_("電撃をくらった!", "You get zapped!"));
}
return result;
}
-void has_immune_elec(player_type *creature_ptr)
+BIT_FLAGS has_immune_elec(player_type *creature_ptr)
{
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- creature_ptr->immune_elec = FALSE;
- if (creature_ptr->ele_immune) {
+ BIT_FLAGS result = 0L;
+
+ if (creature_ptr->ele_immune) {
if (creature_ptr->special_defense & DEFENSE_ELEC)
- creature_ptr->immune_elec = TRUE;
+ result = FLAG_CAUSE_MAGIC_TIME_EFFECT;
}
- 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_IM_ELEC))
- creature_ptr->immune_elec = TRUE;
- }
+ result |= check_equipment_flags(creature_ptr, TR_IM_ELEC);
+ return result;
}
void has_immune_fire(player_type *creature_ptr)
void has_resist_water(player_type *creature_ptr);
void has_resist_fear(player_type *creature_ptr);
BIT_FLAGS has_immune_acid(player_type *creature_ptr);
-void has_immune_elec(player_type *creature_ptr);
+BIT_FLAGS has_immune_elec(player_type *creature_ptr);
void has_immune_fire(player_type *creature_ptr);
void has_immune_cold(player_type *creature_ptr);
bool has_right_hand_weapon(player_type *creature_ptr);
creature_ptr->impact = has_impact(creature_ptr);
has_extra_blow(creature_ptr);
creature_ptr->immune_acid = has_immune_acid(creature_ptr);
- has_immune_elec(creature_ptr);
+ creature_ptr->immune_elec = has_immune_elec(creature_ptr);
has_immune_fire(creature_ptr);
has_immune_cold(creature_ptr);
has_resist_acid(creature_ptr);