From 68e2a10b2d76cb3a2f5aa6818b4b184b6a02ef14 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 20 Jun 2016 22:49:05 +0200 Subject: Rework RF{1,2,3,7,8,9}_* monster flags to use flag_set<> --- src/spells1.cc | 277 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 139 insertions(+), 138 deletions(-) (limited to 'src/spells1.cc') diff --git a/src/spells1.cc b/src/spells1.cc index 98520b04..8e109a77 100644 --- a/src/spells1.cc +++ b/src/spells1.cc @@ -22,6 +22,7 @@ #include "monster2.hpp" #include "monster3.hpp" #include "monster_race.hpp" +#include "monster_race_flag.hpp" #include "monster_spell_flag.hpp" #include "monster_type.hpp" #include "object1.hpp" @@ -93,7 +94,7 @@ s16b poly_r_idx(int r_idx) int i, r; /* Hack -- Uniques never polymorph */ - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) return (r_idx); /* Pick a (possibly new) non-unique race */ @@ -109,7 +110,7 @@ s16b poly_r_idx(int r_idx) r_ptr = &r_info[r]; /* Ignore unique monsters */ - if (r_ptr->flags1 & RF1_UNIQUE) continue; + if (r_ptr->flags & RF_UNIQUE) continue; /* Use that index */ r_idx = r; @@ -353,7 +354,7 @@ void teleport_away(int m_idx, int dis) /* Update monster light */ auto const r_ptr = m_ptr->race(); - if (r_ptr->flags9 & RF9_HAS_LITE) + if (r_ptr->flags & RF_HAS_LITE) { p_ptr->update |= (PU_MON_LITE); } @@ -471,7 +472,7 @@ static void teleport_to_player(int m_idx) lite_spot(ny, nx); /* Update monster light */ - if (r_ptr->flags9 & RF9_HAS_LITE) p_ptr->update |= (PU_MON_LITE); + if (r_ptr->flags & RF_HAS_LITE) p_ptr->update |= (PU_MON_LITE); } @@ -600,7 +601,7 @@ void teleport_player(int dis) { auto const r_ptr = m_list[cave[oy + yy][ox + xx].m_idx].race(); - if ((r_ptr->spells & SF_TPORT) && !(r_ptr->flags3 & RF3_RES_TELE)) + if ((r_ptr->spells & SF_TPORT) && !(r_ptr->flags & RF_RES_TELE)) /* * The latter limitation is to avoid * totally unkillable suckers... @@ -3891,7 +3892,7 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ) monster_race *r_ptr = &r_info[o_ptr->pval2]; s32b dama, radius = 7; - if (r_ptr->flags1 & RF1_FORCE_MAXHP) + if (r_ptr->flags & RF_FORCE_MAXHP) dama = maxroll(r_ptr->hdice, r_ptr->hside); else dama = damroll(r_ptr->hdice, r_ptr->hside); @@ -4356,17 +4357,17 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) auto r_ptr = m_ptr->race(); /* Mega Gachk */ - if (r_ptr->flags2 & RF2_DEATH_ORB) + if (r_ptr->flags & RF_DEATH_ORB) { msg_format("%^s is immune to magic.", m_name); return seen; } /* Some monsters get "destroyed" */ - if ((r_ptr->flags3 & RF3_DEMON) || - (r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags2 & RF2_STUPID) || - (r_ptr->flags3 & RF3_NONLIVING) || + if ((r_ptr->flags & RF_DEMON) || + (r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_STUPID) || + (r_ptr->flags & RF_NONLIVING) || (strchr("Evg", r_ptr->d_char))) { /* Special note at death */ @@ -4397,48 +4398,48 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_IDENTIFY: break; /* none of the above anger */ case GF_TRAP_DEMONSOUL: - if (r_ptr->flags3 & RF3_DEMON) + if (r_ptr->flags & RF_DEMON) get_angry = TRUE; break; case GF_KILL_WALL: - if (r_ptr->flags3 & RF3_HURT_ROCK) + if (r_ptr->flags & RF_HURT_ROCK) get_angry = TRUE; break; case GF_HOLY_FIRE: - if (!(r_ptr->flags3 & RF3_GOOD)) + if (!(r_ptr->flags & RF_GOOD)) get_angry = TRUE; break; case GF_TURN_UNDEAD: case GF_DISP_UNDEAD: - if (r_ptr->flags3 & RF3_UNDEAD) + if (r_ptr->flags & RF_UNDEAD) get_angry = TRUE; break; case GF_TURN_EVIL: case GF_DISP_EVIL: - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags & RF_EVIL) get_angry = TRUE; break; case GF_DISP_GOOD: - if (r_ptr->flags3 & RF3_GOOD) + if (r_ptr->flags & RF_GOOD) get_angry = TRUE; break; case GF_DISP_DEMON: - if (r_ptr->flags3 & RF3_DEMON) + if (r_ptr->flags & RF_DEMON) get_angry = TRUE; break; case GF_DISP_LIVING: case GF_UNBREATH: - if (!(r_ptr->flags3 & RF3_UNDEAD) && - !(r_ptr->flags3 & RF3_NONLIVING)) + if (!(r_ptr->flags & RF_UNDEAD) && + !(r_ptr->flags & RF_NONLIVING)) get_angry = TRUE; break; case GF_PSI: case GF_PSI_DRAIN: - if (!(r_ptr->flags2 & RF2_EMPTY_MIND)) + if (!(r_ptr->flags & RF_EMPTY_MIND)) get_angry = TRUE; break; case GF_DOMINATION: - if (!(r_ptr->flags3 & RF3_NO_CONF)) + if (!(r_ptr->flags & RF_NO_CONF)) get_angry = TRUE; break; case GF_OLD_POLY: @@ -4448,7 +4449,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) break; case GF_LITE: case GF_LITE_WEAK: - if (r_ptr->flags3 & RF3_HURT_LITE) + if (r_ptr->flags & RF_HURT_LITE) get_angry = TRUE; break; case GF_INSTA_DEATH: @@ -4497,7 +4498,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (seen) obvious = TRUE; - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { note = " resists."; dam = 0; @@ -4520,12 +4521,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_ACID: { if (seen) obvious = TRUE; - if (r_ptr->flags9 & RF9_SUSCEP_ACID) + if (r_ptr->flags & RF_SUSCEP_ACID) { note = " is hit hard."; dam *= 3; } - if (r_ptr->flags3 & RF3_IM_ACID) + if (r_ptr->flags & RF_IM_ACID) { note = " resists a lot."; dam /= 9; @@ -4537,12 +4538,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_ELEC: { if (seen) obvious = TRUE; - if (r_ptr->flags9 & RF9_SUSCEP_ELEC) + if (r_ptr->flags & RF_SUSCEP_ELEC) { note = " is hit hard."; dam *= 3; } - if (r_ptr->flags3 & RF3_IM_ELEC) + if (r_ptr->flags & RF_IM_ELEC) { note = " resists a lot."; dam /= 9; @@ -4554,12 +4555,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_FIRE: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_SUSCEP_FIRE) + if (r_ptr->flags & RF_SUSCEP_FIRE) { note = " is hit hard."; dam *= 3; } - if (r_ptr->flags3 & RF3_IM_FIRE) + if (r_ptr->flags & RF_IM_FIRE) { note = " resists a lot."; dam /= 9; @@ -4571,12 +4572,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_COLD: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_SUSCEP_COLD) + if (r_ptr->flags & RF_SUSCEP_COLD) { note = " is hit hard."; dam *= 3; } - if (r_ptr->flags3 & RF3_IM_COLD) + if (r_ptr->flags & RF_IM_COLD) { note = " resists a lot."; dam /= 9; @@ -4589,13 +4590,13 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (seen) obvious = TRUE; if (magik(25)) do_pois = (10 + randint(11) + r) / (r + 1); - if (r_ptr->flags9 & RF9_SUSCEP_POIS) + if (r_ptr->flags & RF_SUSCEP_POIS) { note = " is hit hard."; dam *= 3; do_pois *= 2; } - if (r_ptr->flags3 & RF3_IM_POIS) + if (r_ptr->flags & RF_IM_POIS) { note = " resists a lot."; dam /= 9; @@ -4610,7 +4611,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (seen) obvious = TRUE; if (magik(15)) do_pois = (10 + randint(11) + r) / (r + 1); - if ((r_ptr->flags3 & RF3_NONLIVING) || (r_ptr->flags3 & RF3_UNDEAD)) + if ((r_ptr->flags & RF_NONLIVING) || (r_ptr->flags & RF_UNDEAD)) { note = " is immune."; dam = 0; @@ -4624,7 +4625,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_IM_POIS) + if (r_ptr->flags & RF_IM_POIS) { note = " resists."; dam *= 3; @@ -4638,7 +4639,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_HELL_FIRE: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags & RF_EVIL) { dam *= 2; note = " is hit hard."; @@ -4650,12 +4651,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_HOLY_FIRE: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_GOOD) + if (r_ptr->flags & RF_GOOD) { dam = 0; note = " is immune."; } - else if (r_ptr->flags3 & RF3_EVIL) + else if (r_ptr->flags & RF_EVIL) { dam *= 2; note = " is hit hard."; @@ -4680,7 +4681,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_PLASMA: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_RES_PLAS) + if (r_ptr->flags & RF_RES_PLAS) { note = " resists."; dam *= 3; @@ -4693,18 +4694,18 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_NETHER: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_UNDEAD) + if (r_ptr->flags & RF_UNDEAD) { note = " is immune."; dam = 0; } - else if (r_ptr->flags3 & RF3_RES_NETH) + else if (r_ptr->flags & RF_RES_NETH) { note = " resists."; dam *= 3; dam /= (randint(6) + 6); } - else if (r_ptr->flags3 & RF3_EVIL) + else if (r_ptr->flags & RF_EVIL) { dam /= 2; note = " resists somewhat."; @@ -4723,7 +4724,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) note = " is immune."; dam = 0; } - else if (r_ptr->flags3 & RF3_RES_WATE) + else if (r_ptr->flags & RF_RES_WATE) { note = " resists."; dam *= 3; @@ -4743,7 +4744,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) note = " is immune."; dam = 0; } - else if (r_ptr->flags3 & RF3_RES_WATE) + else if (r_ptr->flags & RF_RES_WATE) { note = " resists."; dam *= 3; @@ -4832,7 +4833,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_poly = TRUE; do_conf = (5 + randint(11) + r) / (r + 1); if ((r_ptr->spells & SF_BR_CHAO) || - ((r_ptr->flags3 & RF3_DEMON) && (randint(3) == 1))) + ((r_ptr->flags & RF_DEMON) && (randint(3) == 1))) { note = " resists."; dam *= 3; @@ -4904,7 +4905,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) dam *= 2; dam /= (randint(6) + 6); } - else if (r_ptr->flags3 & RF3_NO_CONF) + else if (r_ptr->flags & RF_NO_CONF) { note = " resists somewhat."; dam /= 2; @@ -4916,7 +4917,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISENCHANT: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_RES_DISE) + if (r_ptr->flags & RF_RES_DISE) { note = " resists."; dam *= 3; @@ -4929,7 +4930,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_NEXUS: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_RES_NEXU) + if (r_ptr->flags & RF_RES_NEXU) { note = " resists."; dam *= 3; @@ -5082,9 +5083,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_RES_TELE) + if (r_ptr->flags & RF_RES_TELE) { - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { note = " is unaffected!"; resist_tele = TRUE; @@ -5110,7 +5111,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { /* 1. slowness */ /* Powerful monsters can resist */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { obvious = FALSE; @@ -5126,7 +5127,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5151,14 +5152,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISINTEGRATE: { if (seen) obvious = TRUE; - if (r_ptr->flags3 & RF3_HURT_ROCK) + if (r_ptr->flags & RF_HURT_ROCK) { note = " loses some skin!"; note_dies = " evaporates!"; dam *= 2; } - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { if (rand_int(m_ptr->level + 10) > rand_int(p_ptr->lev)) { @@ -5171,7 +5172,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_FEAR: { - if (r_ptr->flags3 & RF3_NO_FEAR) + if (r_ptr->flags & RF_NO_FEAR) note = " is unaffected."; else set_afraid(p_ptr->afraid + (dam / 2) + randint(dam / 2)); @@ -5184,14 +5185,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_PSI: { if (seen) obvious = TRUE; - if (r_ptr->flags2 & RF2_EMPTY_MIND) + if (r_ptr->flags & RF_EMPTY_MIND) { dam = 0; note = " is immune!"; } - else if ((r_ptr->flags2 & RF2_STUPID) || - (r_ptr->flags2 & RF2_WEIRD_MIND) || - (r_ptr->flags3 & RF3_ANIMAL) || + else if ((r_ptr->flags & RF_STUPID) || + (r_ptr->flags & RF_WEIRD_MIND) || + (r_ptr->flags & RF_ANIMAL) || (m_ptr->level > randint(3 * dam))) { dam /= 3; @@ -5199,8 +5200,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* Powerful demons & undead can turn a mindcrafter's * attacks back on them */ - if (((r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags3 & RF3_DEMON)) && + if (((r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_DEMON)) && (m_ptr->level > p_ptr->lev / 2) && (randint(2) == 1)) { @@ -5229,7 +5230,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) break; case 3: { - if (r_ptr->flags3 & RF3_NO_FEAR) + if (r_ptr->flags & RF_NO_FEAR) note = " is unaffected."; else set_afraid(p_ptr->afraid + 3 + randint(dam)); @@ -5272,14 +5273,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_PSI_DRAIN: { if (seen) obvious = TRUE; - if (r_ptr->flags2 & RF2_EMPTY_MIND) + if (r_ptr->flags & RF_EMPTY_MIND) { dam = 0; note = " is immune!"; } - else if ((r_ptr->flags2 & RF2_STUPID) || - (r_ptr->flags2 & RF2_WEIRD_MIND) || - (r_ptr->flags3 & RF3_ANIMAL) || + else if ((r_ptr->flags & RF_STUPID) || + (r_ptr->flags & RF_WEIRD_MIND) || + (r_ptr->flags & RF_ANIMAL) || (m_ptr->level > randint(3 * dam))) { dam /= 3; @@ -5289,8 +5290,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) * Powerful demons & undead can turn a mindcrafter's * attacks back on them */ - if (((r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags3 & RF3_DEMON)) && + if (((r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_DEMON)) && (m_ptr->level > p_ptr->lev / 2) && (randint(2) == 1)) { @@ -5336,7 +5337,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > 5 + randint(dam))) { /* Resist */ @@ -5360,8 +5361,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || - (r_ptr->flags3 & RF3_NO_CONF) || + if ((r_ptr->flags & RF_UNIQUE) || + (r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5371,8 +5372,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) * Powerful demons & undead can turn a mindcrafter's * attacks back on them */ - if (((r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags3 & RF3_DEMON)) && + if (((r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_DEMON)) && (m_ptr->level > p_ptr->lev / 2) && (randint(2) == 1)) { @@ -5397,7 +5398,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) break; default: { - if (r_ptr->flags3 & RF3_NO_FEAR) + if (r_ptr->flags & RF_NO_FEAR) note = " is unaffected."; else set_afraid(p_ptr->afraid + dam); @@ -5418,7 +5419,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { note = " is in your thrall!"; m_ptr->status = MSTATUS_PET; - if ((r_ptr->flags3 & RF3_ANIMAL) && (!(r_ptr->flags3 & RF3_EVIL))) + if ((r_ptr->flags & RF_ANIMAL) && (!(r_ptr->flags & RF_EVIL))) inc_piety(GOD_YAVANNA, m_ptr->level * 2); } else @@ -5450,13 +5451,13 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; do_stun = (randint(15) + 1) / (r + 1); if (magik(33)) do_cut = (10 + randint(15) + r) / (r + 1); - if (r_ptr->flags3 & RF3_SUSCEP_COLD) + if (r_ptr->flags & RF_SUSCEP_COLD) { note = " is hit hard."; dam *= 3; do_cut *= 2; } - if (r_ptr->flags3 & RF3_IM_COLD) + if (r_ptr->flags & RF_IM_COLD) { note = " resists a lot."; dam /= 9; @@ -5471,9 +5472,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (seen) obvious = TRUE; - if ((r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags3 & RF3_DEMON) || - (r_ptr->flags3 & RF3_NONLIVING) || + if ((r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_DEMON) || + (r_ptr->flags & RF_NONLIVING) || (strchr("Egv", r_ptr->d_char))) { note = " is unaffected!"; @@ -5488,14 +5489,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DEATH_RAY: { if (seen) obvious = TRUE; - if ((r_ptr->flags3 & RF3_UNDEAD) || - (r_ptr->flags3 & RF3_NONLIVING)) + if ((r_ptr->flags & RF_UNDEAD) || + (r_ptr->flags & RF_NONLIVING)) { note = " is immune."; obvious = FALSE; dam = 0; } - else if (((r_ptr->flags1 & RF1_UNIQUE) && + else if (((r_ptr->flags & RF_UNIQUE) && (randint(888) != 666)) || (((m_ptr->level + randint(20)) > randint((dam) + randint(10))) && randint(100) != 66 )) @@ -5519,7 +5520,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_poly = TRUE; /* Powerful monsters can resist */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { @@ -5610,7 +5611,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Powerful monsters can resist */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { note = " is unaffected!"; @@ -5636,7 +5637,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags3 & RF3_NO_SLEEP) || + if ((r_ptr->flags & RF_NO_SLEEP) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* No obvious effect */ @@ -5662,7 +5663,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { note = " is unaffected!"; @@ -5689,7 +5690,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* Attempt a saving throw */ if ((m_ptr->mflag & MFLAG_QUEST) || - (r_ptr->flags3 & RF3_NO_CONF) || + (r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 5)) { /* Resist */ @@ -5707,7 +5708,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { note = " suddenly seems friendly!"; m_ptr->status = MSTATUS_FRIEND; - if ((r_ptr->flags3 & RF3_ANIMAL) && (!(r_ptr->flags3 & RF3_EVIL))) + if ((r_ptr->flags & RF_ANIMAL) && (!(r_ptr->flags & RF_EVIL))) inc_piety(GOD_YAVANNA, m_ptr->level * 2); } } @@ -5726,7 +5727,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* Attempt a saving throw */ if ((m_ptr->mflag & MFLAG_QUEST) || - (r_ptr->flags3 & RF3_NO_CONF) || + (r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 5)) { /* Resist */ @@ -5746,7 +5747,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (can_create_companion()) m_ptr->status = MSTATUS_COMPANION; else m_ptr->status = MSTATUS_PET; - if ((r_ptr->flags3 & RF3_ANIMAL) && (!(r_ptr->flags3 & RF3_EVIL))) + if ((r_ptr->flags & RF_ANIMAL) && (!(r_ptr->flags & RF_EVIL))) inc_piety(GOD_YAVANNA, m_ptr->level * 2); } } @@ -5762,9 +5763,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || - (!(r_ptr->flags3 & RF3_UNDEAD)) || + (!(r_ptr->flags & RF_UNDEAD)) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5793,9 +5794,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || - (!(r_ptr->flags1 & RF1_NEVER_MOVE)) || + (!(r_ptr->flags & RF_NEVER_MOVE)) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5824,10 +5825,10 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || - (!(r_ptr->flags3 & RF3_ANIMAL)) || - (r_ptr->flags3 & RF3_NO_CONF) || + (!(r_ptr->flags & RF_ANIMAL)) || + (r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5857,9 +5858,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || - (!(r_ptr->flags3 & RF3_DEMON)) || + (!(r_ptr->flags & RF_DEMON)) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5891,7 +5892,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_conf = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags3 & RF3_NO_CONF) || + if ((r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5938,7 +5939,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_conf = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags3 & RF3_NO_CONF) || + if ((r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5978,7 +5979,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -5990,7 +5991,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) } /* Non_living resists */ - if (r_ptr->flags3 & RF3_NONLIVING) + if (r_ptr->flags & RF_NONLIVING) { /* Resist */ do_stun = 0; @@ -6012,7 +6013,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_conf = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags3 & RF3_NO_CONF) || + if ((r_ptr->flags & RF_NO_CONF) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Resist */ @@ -6043,7 +6044,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_LITE_WEAK: { /* Hurt by light */ - if (r_ptr->flags3 & RF3_HURT_LITE) + if (r_ptr->flags & RF_HURT_LITE) { /* Obvious effect */ if (seen) obvious = TRUE; @@ -6075,7 +6076,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) dam *= 2; dam /= (randint(6) + 6); } - else if (r_ptr->flags3 & RF3_HURT_LITE) + else if (r_ptr->flags & RF_HURT_LITE) { note = " cringes from the light!"; note_dies = " shrivels away in the light!"; @@ -6092,8 +6093,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* Likes darkness... */ if ((r_ptr->spells & SF_BR_DARK) || - (r_ptr->flags3 & RF3_ORC) || - (r_ptr->flags3 & RF3_HURT_LITE)) + (r_ptr->flags & RF_ORC) || + (r_ptr->flags & RF_HURT_LITE)) { note = " resists."; dam *= 2; @@ -6107,7 +6108,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_KILL_WALL: { /* Hurt by rock remover */ - if (r_ptr->flags3 & RF3_HURT_ROCK) + if (r_ptr->flags & RF_HURT_ROCK) { /* Notice effect */ if (seen) obvious = TRUE; @@ -6134,13 +6135,13 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (dungeon_flags & DF_NO_TELEPORT) break; /* No teleport on special levels */ /* Only affect undead */ - if (r_ptr->flags3 & RF3_UNDEAD) + if (r_ptr->flags & RF_UNDEAD) { bool_ resists_tele = FALSE; - if (r_ptr->flags3 & RF3_RES_TELE) + if (r_ptr->flags & RF_RES_TELE) { - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { note = " is unaffected!"; resists_tele = TRUE; @@ -6177,13 +6178,13 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) { if (dungeon_flags & DF_NO_TELEPORT) break; /* No teleport on special levels */ /* Only affect evil */ - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags & RF_EVIL) { bool_ resists_tele = FALSE; - if (r_ptr->flags3 & RF3_RES_TELE) + if (r_ptr->flags & RF_RES_TELE) { - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { note = " is unaffected!"; resists_tele = TRUE; @@ -6221,9 +6222,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) bool_ resists_tele = FALSE; if (dungeon_flags & DF_NO_TELEPORT) break; /* No teleport on special levels */ - if (r_ptr->flags3 & RF3_RES_TELE) + if (r_ptr->flags & RF_RES_TELE) { - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { note = " is unaffected!"; resists_tele = TRUE; @@ -6254,7 +6255,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_TURN_UNDEAD: { /* Only affect undead */ - if (r_ptr->flags3 & RF3_UNDEAD) + if (r_ptr->flags & RF_UNDEAD) { /* Obvious */ if (seen) obvious = TRUE; @@ -6289,7 +6290,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_TURN_EVIL: { /* Only affect evil */ - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags & RF_EVIL) { /* Obvious */ if (seen) obvious = TRUE; @@ -6330,8 +6331,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_fear = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ - if ((r_ptr->flags1 & RF1_UNIQUE) || - (r_ptr->flags3 & RF3_NO_FEAR) || + if ((r_ptr->flags & RF_UNIQUE) || + (r_ptr->flags & RF_NO_FEAR) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* No obvious effect */ @@ -6350,7 +6351,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISP_UNDEAD: { /* Only affect undead */ - if (r_ptr->flags3 & RF3_UNDEAD) + if (r_ptr->flags & RF_UNDEAD) { /* Obvious */ if (seen) obvious = TRUE; @@ -6378,7 +6379,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISP_EVIL: { /* Only affect evil */ - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags & RF_EVIL) { /* Obvious */ if (seen) obvious = TRUE; @@ -6405,7 +6406,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISP_GOOD: { /* Only affect good */ - if (r_ptr->flags3 & RF3_GOOD) + if (r_ptr->flags & RF_GOOD) { /* Obvious */ if (seen) obvious = TRUE; @@ -6432,8 +6433,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISP_LIVING: { /* Only affect non-undead */ - if (!(r_ptr->flags3 & RF3_UNDEAD) && - !(r_ptr->flags3 & RF3_NONLIVING)) + if (!(r_ptr->flags & RF_UNDEAD) && + !(r_ptr->flags & RF_NONLIVING)) { /* Obvious */ if (seen) obvious = TRUE; @@ -6460,7 +6461,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_DISP_DEMON: { /* Only affect demons */ - if (r_ptr->flags3 & RF3_DEMON) + if (r_ptr->flags & RF_DEMON) { /* Obvious */ if (seen) obvious = TRUE; @@ -6527,9 +6528,9 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if (seen) obvious = TRUE; /* Check race */ - if ((r_ptr->flags1 & RF1_UNIQUE) || + if ((r_ptr->flags & RF_UNIQUE) || (m_ptr->mflag & MFLAG_QUEST) || - (!(r_ptr->flags3 & RF3_DEMON))) + (!(r_ptr->flags & RF_DEMON))) { /* No obvious effect */ note = " is unaffected!"; @@ -6546,7 +6547,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) object_prep(i_ptr, lookup_kind(TV_CORPSE, SV_CORPSE_CORPSE)); /* Unique corpses are unique */ - if (r_ptr->flags1 & RF1_UNIQUE) + if (r_ptr->flags & RF_UNIQUE) { object_aware(i_ptr); i_ptr->name1 = 201; @@ -6573,7 +6574,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) case GF_INSTA_DEATH: { - if (magik(95) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags3 & RF3_UNDEAD) && !(r_ptr->flags3 & RF3_NONLIVING)) { + if (magik(95) && !(r_ptr->flags & RF_UNIQUE) && !(r_ptr->flags & RF_UNDEAD) && !(r_ptr->flags & RF_NONLIVING)) { /* Kill outright, but reduce exp. */ m_ptr->level = m_ptr->level / 3; dam = 32535; /* Should be enough */ @@ -6598,7 +6599,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* "Unique" monsters cannot be polymorphed */ - if (r_ptr->flags1 & RF1_UNIQUE) do_poly = FALSE; + if (r_ptr->flags & RF_UNIQUE) do_poly = FALSE; /* * "Quest" monsters cannot be polymorphed @@ -6607,7 +6608,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) do_poly = FALSE; /* "Unique" monsters can only be "killed" by the player unless they are player's friends */ - if ((r_ptr->flags1 & RF1_UNIQUE) && (m_ptr->status <= MSTATUS_NEUTRAL_P)) + if ((r_ptr->flags & RF_UNIQUE) && (m_ptr->status <= MSTATUS_NEUTRAL_P)) { /* Uniques may only be killed by the player */ if (who && (who != -2) && (dam > m_ptr->hp)) dam = m_ptr->hp; @@ -6621,7 +6622,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) if ((who > 0) && (dam > m_ptr->hp)) dam = m_ptr->hp; } - if (do_pois && (!(r_ptr->flags3 & RF3_IM_POIS)) && (!(r_ptr->flags3 & SF_BR_POIS)) && hurt_monster(m_ptr)) + if (do_pois && (!(r_ptr->flags & RF_IM_POIS)) && (!(r_ptr->flags & SF_BR_POIS)) && hurt_monster(m_ptr)) { if (m_ptr->poisoned) note = " is more poisoned."; else note = " is poisoned."; @@ -6785,7 +6786,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ) /* Confusion and Chaos breathers (and sleepers) never confuse */ else if (do_conf && - !(r_ptr->flags3 & RF3_NO_CONF) && + !(r_ptr->flags & RF_NO_CONF) && !(r_ptr->spells & SF_BR_CONF) && !(r_ptr->spells & SF_BR_CHAO) && hurt_monster(m_ptr)) { @@ -8488,7 +8489,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg) { auto ref_ptr = m_list[cave[y][x].m_idx].race(); - if ((ref_ptr->flags2 & RF2_REFLECTING) && (randint(10) != 1) + if ((ref_ptr->flags & RF_REFLECTING) && (randint(10) != 1) && (dist_hack > 1)) { int t_y, t_x; -- cgit v1.2.3