msg_print(_("熱い!", "It's hot!"));
take_hit(player_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"));
}
+
if (auras.has(MonsterAuraType::ELEC) && !has_immune_elec(player_ptr)) {
damage = r_info[player_ptr->current_floor_ptr->m_list[player_ptr->riding].r_idx].level / 2;
if (race.tr_flags().has(TR_VUL_ELEC))
msg_print(_("痛い!", "It hurts!"));
take_hit(player_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"));
}
- if ((r_info[player_ptr->current_floor_ptr->m_list[player_ptr->riding].r_idx].flags3 & RF3_XX10) && !has_immune_cold(player_ptr)) {
+
+ if (auras.has(MonsterAuraType::COLD) && !has_immune_cold(player_ptr)) {
damage = r_info[player_ptr->current_floor_ptr->m_list[player_ptr->riding].r_idx].level / 2;
if (race.tr_flags().has(TR_VUL_COLD))
damage += damage / 3;
#include "load/lore-loader.h"
#include "game-option/runtime-arguments.h"
-#include "monster-race/monster-race.h"
+#include "load/angband-version-comparer.h"
#include "load/load-util.h"
#include "load/load-v1-5-0.h"
-#include "load/angband-version-comparer.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags2.h"
+#include "monster-race/race-flags3.h"
#include "system/monster-race-definition.h"
+#include "util/bit-flags-calculator.h"
+
+static void rd_r_flags2(monster_race *r_ptr)
+{
+ r_ptr->r_flags2 = rd_u32b();
+ if (loading_savefile_version_is_older_than(10)) {
+ if (any_bits(r_ptr->r_flags2, RF2_XX14)) {
+ r_ptr->r_aura_flags.set(MonsterAuraType::FIRE);
+ }
+
+ if (any_bits(r_ptr->r_flags3, RF3_XX10)) {
+ r_ptr->r_aura_flags.set(MonsterAuraType::COLD);
+ }
+
+ if (any_bits(r_ptr->r_flags2, RF2_XX15)) {
+ r_ptr->r_aura_flags.set(MonsterAuraType::ELEC);
+ }
+ }
+}
+
+static void rd_r_aura_flags(monster_race *r_ptr)
+{
+ if (loading_savefile_version_is_older_than(10)) {
+ return;
+ }
+
+ uint32_t auras = rd_s32b();
+ migrate_bitflag_to_flaggroup(r_ptr->r_aura_flags, auras, sizeof(uint32_t) * 8 * 0);
+}
/*!
* @brief モンスターの思い出を読み込む / Read the monster lore
r_ptr->r_blows[3] = rd_byte();
r_ptr->r_flags1 = rd_u32b();
- r_ptr->r_flags2 = rd_u32b();
+ rd_r_flags2(r_ptr);
r_ptr->r_flags3 = rd_u32b();
if (loading_savefile_version_is_older_than(3)) {
- uint32_t f4, f5, f6;
- f4 = rd_u32b();
- f5 = rd_u32b();
- f6 = rd_u32b();
+ uint32_t f4 = rd_u32b();
+ uint32_t f5 = rd_u32b();
+ uint32_t f6 = rd_u32b();
if (h_older_than(1, 5, 0, 3))
set_old_lore(r_ptr, f4, r_idx);
else
rd_FlagGroup(r_ptr->r_ability_flags, rd_byte);
}
+ rd_r_aura_flags(r_ptr);
r_ptr->max_num = rd_byte();
-
r_ptr->floor_id = rd_s16b();
if (!loading_savefile_version_is_older_than(4)) {
{
monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx];
monster_race *tr_ptr = &r_info[mam_ptr->t_ptr->r_idx];
- if (((tr_ptr->flags3 & RF3_XX10) == 0) || (mam_ptr->m_ptr->r_idx == 0))
+ if (tr_ptr->aura_flags.has_not(MonsterAuraType::COLD) || (mam_ptr->m_ptr->r_idx == 0))
return;
if (((r_ptr->flagsr & RFR_EFF_IM_COLD_MASK) != 0) && is_original_ap_and_seen(player_ptr, mam_ptr->m_ptr)) {
msg_format(_("%^sは突然寒くなった!", "%^s is suddenly very cold!"), mam_ptr->m_name);
if (mam_ptr->m_ptr->ml && is_original_ap_and_seen(player_ptr, mam_ptr->t_ptr))
- tr_ptr->r_flags3 |= RF3_XX10;
+ tr_ptr->aura_flags.set(MonsterAuraType::COLD);
project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), GF_COLD,
PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED);
if (!mon_hook_dungeon(player_ptr, r_idx))
return false;
- return (any_bits(r_ptr->flagsr, RFR_EFF_IM_FIRE_MASK) || any_bits(r_ptr->flags7, RF7_CAN_FLY)) && none_bits(r_ptr->flags3, RF3_XX10);
+ return (any_bits(r_ptr->flagsr, RFR_EFF_IM_FIRE_MASK) || any_bits(r_ptr->flags7, RF7_CAN_FLY)) && r_ptr->aura_flags.has_not(MonsterAuraType::COLD);
}
/*!
{
process_aura_damage(m_ptr, player_ptr, (bool)has_immune_fire(player_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_aura_flags), enum2i(MonsterAuraType::FIRE),
fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!"));
- process_aura_damage(m_ptr, player_ptr, (bool)has_immune_cold(player_ptr), offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_XX10,
+ process_aura_damage(m_ptr, player_ptr, (bool)has_immune_cold(player_ptr), offsetof(monster_race, flags3), offsetof(monster_race, r_aura_flags), enum2i(MonsterAuraType::COLD),
cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!"));
process_aura_damage(m_ptr, player_ptr, (bool)has_immune_elec(player_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_aura_flags), enum2i(MonsterAuraType::ELEC),
elec_dam, _("電撃をくらった!", "You get zapped!"));
wr_u32b(r_ptr->r_flags3);
wr_u32b(r_ptr->r_flagsr);
wr_FlagGroup(r_ptr->r_ability_flags, wr_byte);
+ wr_FlagGroup(r_ptr->r_aura_flags, wr_byte);
wr_byte((byte)r_ptr->max_num);
wr_s16b(r_ptr->floor_id);
/*!
* @brief セーブファイルのバージョン(3.0.0から導入)
*/
-constexpr uint32_t SAVEFILE_VERSION = 9;
+constexpr uint32_t SAVEFILE_VERSION = 10;
/*!
* @brief バージョンが開発版が安定版かを返す(廃止予定)
{
auto has_fire_aura = lore_ptr->aura_flags.has(MonsterAuraType::FIRE);
auto has_elec_aura = lore_ptr->aura_flags.has(MonsterAuraType::ELEC);
- if (has_fire_aura && has_elec_aura && (lore_ptr->flags3 & RF3_XX10))
+ auto has_cold_aura = lore_ptr->aura_flags.has(MonsterAuraType::COLD);
+ if (has_fire_aura && has_elec_aura && has_cold_aura)
hook_c_roff(
TERM_VIOLET, format(_("%^sは炎と氷とスパークに包まれている。", "%^s is surrounded by flames, ice and electricity. "), Who::who(lore_ptr->msex)));
else if (has_fire_aura && has_elec_aura)
hook_c_roff(TERM_L_RED, format(_("%^sは炎とスパークに包まれている。", "%^s is surrounded by flames and electricity. "), Who::who(lore_ptr->msex)));
- else if (has_fire_aura && (lore_ptr->flags3 & RF3_XX10))
+ else if (has_fire_aura && has_cold_aura)
hook_c_roff(TERM_BLUE, format(_("%^sは炎と氷に包まれている。", "%^s is surrounded by flames and ice. "), Who::who(lore_ptr->msex)));
- else if ((lore_ptr->flags3 & RF3_XX10) && has_elec_aura)
+ else if (has_cold_aura && has_elec_aura)
hook_c_roff(TERM_L_GREEN, format(_("%^sは氷とスパークに包まれている。", "%^s is surrounded by ice and electricity. "), Who::who(lore_ptr->msex)));
else if (has_fire_aura)
hook_c_roff(TERM_RED, format(_("%^sは炎に包まれている。", "%^s is surrounded by flames. "), Who::who(lore_ptr->msex)));
- else if (lore_ptr->flags3 & RF3_XX10)
+ else if (has_cold_aura)
hook_c_roff(TERM_BLUE, format(_("%^sは氷に包まれている。", "%^s is surrounded by ice. "), Who::who(lore_ptr->msex)));
else if (has_elec_aura)
hook_c_roff(TERM_L_BLUE, format(_("%^sはスパークに包まれている。", "%^s is surrounded by electricity. "), Who::who(lore_ptr->msex)));