X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmspells1.c;h=1ea98f1b4edf96fae813146e2c0fe01199d2f84a;hb=refs%2Ftags%2Fv2.1.3;hp=667bfe3878ee01a6b3eecf303b6efbbea0666b51;hpb=f308b71f8523a9328f58252aa0d93ca62b94b368;p=hengband%2Fhengband.git diff --git a/src/mspells1.c b/src/mspells1.c index 667bfe387..1ea98f1b4 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -13,8 +13,6 @@ #include "angband.h" -#ifdef DRS_SMART_OPTIONS - /* * And now for Intelligent monster attacks (including spells). * @@ -88,7 +86,8 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p) if (smart_learn) { /* Hack -- Occasionally forget player status */ - if (m_ptr->smart && (randint0(100) < 1)) m_ptr->smart = 0L; + /* Only save SM_FRIENDLY, SM_PET or SM_CLONED */ + if (m_ptr->smart && (randint0(100) < 1)) m_ptr->smart &= (SM_FRIENDLY | SM_PET | SM_CLONED); /* Use the memorized flags */ smart = m_ptr->smart; @@ -350,8 +349,6 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p) (*f6p) = f6; } -#endif /* DRS_SMART_OPTIONS */ - /* * Determine if there is a space near the player in which @@ -373,11 +370,10 @@ bool summon_possible(int y1, int x1) if (distance(y1, x1, y, x)>2) continue; /* ...nor on the Pattern */ - if ((cave[y][x].feat >= FEAT_PATTERN_START) - && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue; + if (pattern_tile(y, x)) continue; - /* Require empty floor grid in line of sight */ - if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE); + /* Require empty floor grid in line of projection */ + if (cave_empty_bold(y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE); } } @@ -385,9 +381,11 @@ bool summon_possible(int y1, int x1) } -static bool raise_possible(int y, int x) +bool raise_possible(monster_type *m_ptr) { int xx, yy; + int y = m_ptr->fy; + int x = m_ptr->fx; s16b this_o_idx, next_o_idx = 0; cave_type *c_ptr; @@ -397,6 +395,7 @@ static bool raise_possible(int y, int x) { if (distance(y, x, yy, xx) > 5) continue; if (!los(y, x, yy, xx)) continue; + if (!projectable(y, x, yy, xx)) continue; c_ptr = &cave[yy][xx]; /* Scan the pile of objects */ @@ -410,7 +409,9 @@ static bool raise_possible(int y, int x) /* Known to be worthless? */ if (o_ptr->tval == TV_CORPSE) - return TRUE; + { + if (!monster_has_hostile_align(m_ptr, 0, 0, &r_info[o_ptr->pval])) return TRUE; + } } } } @@ -431,7 +432,7 @@ static bool raise_possible(int y, int x) * no equally friendly monster is * between the attacker and target. */ -bool clean_shot(int y1, int x1, int y2, int x2, bool friend) +bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend) { /* Must be the same as projectable() */ @@ -461,15 +462,15 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool friend) if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2))) { monster_type *m_ptr = &m_list[cave[y][x].m_idx]; - if (friend == is_pet(m_ptr)) + if (is_friend == is_pet(m_ptr)) { return (FALSE); } } /* Pets may not shoot through the character - TNB */ - if ((y == py) && (x == px)) + if (player_bold(y, x)) { - if (friend) return (FALSE); + if (is_friend) return (FALSE); } } @@ -483,7 +484,8 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool friend) */ static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER | PROJECT_REFLECTABLE; + int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER; + if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE; /* Target the player with a bolt attack */ (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1)); @@ -516,10 +518,22 @@ static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool b /* Handle breath attacks */ if (breath) rad = 0 - rad; - if (typ == GF_ROCKET) flg |= PROJECT_STOP; - if (typ == GF_MIND_BLAST || typ == GF_BRAIN_SMASH || - typ == GF_CAUSE_1 || typ == GF_CAUSE_2 || typ == GF_CAUSE_3 || - typ == GF_CAUSE_4 || typ == GF_HAND_DOOM) flg |= PROJECT_HIDE; + switch (typ) + { + case GF_ROCKET: + flg |= PROJECT_STOP; + break; + case GF_DRAIN_MANA: + case GF_MIND_BLAST: + case GF_BRAIN_SMASH: + case GF_CAUSE_1: + case GF_CAUSE_2: + case GF_CAUSE_3: + case GF_CAUSE_4: + case GF_HAND_DOOM: + flg |= (PROJECT_HIDE | PROJECT_AIMED); + break; + } /* Target the player with a ball attack */ (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1)); @@ -545,8 +559,8 @@ u32b get_curse(int power, object_type *o_ptr) { if (new_curse & TRC_HEAVY_MASK) continue; } - if (((o_ptr->tval < TV_BOW) || (o_ptr->tval > TV_SWORD)) && (new_curse == TRC_LOW_MELEE)) continue; - if (((o_ptr->tval < TV_BOOTS) || (o_ptr->tval > TV_DRAG_ARMOR)) && (new_curse == TRC_LOW_AC)) continue; + if (new_curse == TRC_LOW_MELEE && !object_is_weapon(o_ptr)) continue; + if (new_curse == TRC_LOW_AC && !object_is_armour(o_ptr)) continue; break; } return new_curse; @@ -567,7 +581,7 @@ void curse_equipment(int chance, int heavy_chance) object_flags(o_ptr, oflgs); - object_desc(o_name, o_ptr, FALSE, 0); + object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); /* Extra, biased saving throw for blessed items */ if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance)) @@ -584,7 +598,7 @@ msg_format("%s } if ((randint1(100) <= heavy_chance) && - (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name)) + (object_is_artifact(o_ptr) || object_is_ego(o_ptr))) { if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE)) changed = TRUE; @@ -594,7 +608,7 @@ msg_format("%s } else { - if (!cursed_p(o_ptr)) + if (!object_is_cursed(o_ptr)) changed = TRUE; o_ptr->curse_flags |= TRC_CURSED; } @@ -821,7 +835,7 @@ static bool spell_dispel(byte spell) /* * Check should monster cast dispel spell. */ -static bool dispel_check(int m_idx) +bool dispel_check(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -859,7 +873,7 @@ static bool dispel_check(int m_idx) if (r_ptr->flags4 & RF4_BR_FIRE) { - if (!(prace_is_(RACE_DEMON) && p_ptr->lev > 44)) + if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44)) { if (!p_ptr->immune_fire && (p_ptr->oppose_fire || music_singing(MUSIC_RESIST))) return (TRUE); if (p_ptr->special_defense & DEFENSE_FIRE) return (TRUE); @@ -894,11 +908,11 @@ static bool dispel_check(int m_idx) if (p_ptr->tsuyoshi) return (TRUE); /* Elemental Brands */ - if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flags3 & RF3_IM_ACID)) return (TRUE); - if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flags3 & RF3_IM_FIRE)) return (TRUE); - if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flags3 & RF3_IM_ELEC)) return (TRUE); - if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flags3 & RF3_IM_COLD)) return (TRUE); - if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flags3 & RF3_IM_POIS)) return (TRUE); + if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)) return (TRUE); + if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) return (TRUE); + if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)) return (TRUE); + if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)) return (TRUE); + if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)) return (TRUE); /* Speed */ if (p_ptr->pspeed < 145) @@ -911,7 +925,7 @@ static bool dispel_check(int m_idx) if (p_ptr->riding && (m_list[p_ptr->riding].mspeed < 135)) { - if (m_list[p_ptr->riding].fast) return (TRUE); + if (MON_FAST(&m_list[p_ptr->riding])) return (TRUE); } /* No need to cast dispel spell */ @@ -1036,7 +1050,7 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) } /* Hurt badly or afraid, attempt to flee */ - if (((m_ptr->hp < m_ptr->maxhp / 3) || m_ptr->monfear) && one_in_(2)) + if (((m_ptr->hp < m_ptr->maxhp / 3) || MON_MONFEAR(m_ptr)) && one_in_(2)) { /* Choose escape spell if possible */ if (escape_num) return (escape[randint0(escape_num)]); @@ -1046,16 +1060,17 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) if (special_num) { bool success = FALSE; - switch(m_ptr->r_idx) + switch (m_ptr->r_idx) { case MON_OHMU: - if (randint0(100) < 50) success = TRUE; + case MON_BANOR: + case MON_LUPART: break; case MON_BANORLUPART: if (randint0(100) < 70) success = TRUE; break; - case MON_BANOR: - case MON_LUPART: + case MON_ROLENTO: + if (randint0(100) < 40) success = TRUE; break; default: if (randint0(100) < 50) success = TRUE; @@ -1089,7 +1104,7 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) } /* Raise-dead if possible (sometimes) */ - if (raise_num && (randint0(100) < 40) && raise_possible(m_ptr->fy, m_ptr->fx)) + if (raise_num && (randint0(100) < 40)) { /* Choose raise-dead spell */ return (raise[randint0(raise_num)]); @@ -1123,7 +1138,7 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) } /* Cast globe of invulnerability if not already in effect */ - if (invul_num && !(m_ptr->invulner) && (randint0(100) < 50)) + if (invul_num && !m_ptr->mtimed[MTIMED_INVULNER] && (randint0(100) < 50)) { /* Choose Globe of Invulnerability */ return (invul[randint0(invul_num)]); @@ -1137,7 +1152,7 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) } /* Haste self if we aren't already somewhat hasted (rarely) */ - if (haste_num && (randint0(100) < 20) && !(m_ptr->fast)) + if (haste_num && (randint0(100) < 20) && !MON_FAST(m_ptr)) { /* Choose haste spell */ return (haste[randint0(haste_num)]); @@ -1156,6 +1171,76 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num) /* + * Return TRUE if a spell is inate spell. + */ +bool spell_is_inate(u16b spell) +{ + if (spell < 32 * 4) /* Set RF4 */ + { + if ((1L << (spell - 32 * 3)) & RF4_NOMAGIC_MASK) return TRUE; + } + else if (spell < 32 * 5) /* Set RF5 */ + { + if ((1L << (spell - 32 * 4)) & RF5_NOMAGIC_MASK) return TRUE; + } + else if (spell < 32 * 6) /* Set RF6 */ + { + if ((1L << (spell - 32 * 5)) & RF6_NOMAGIC_MASK) return TRUE; + } + + /* This spell is not "inate" */ + return FALSE; +} + + +static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp, + int f_flag, bool (*path_check)(int, int, int, int)) +{ + int i; + int tonari; + static int tonari_y[4][8] = {{-1, -1, -1, 0, 0, 1, 1, 1}, + {-1, -1, -1, 0, 0, 1, 1, 1}, + { 1, 1, 1, 0, 0, -1, -1, -1}, + { 1, 1, 1, 0, 0, -1, -1, -1}}; + static int tonari_x[4][8] = {{-1, 0, 1, -1, 1, -1, 0, 1}, + { 1, 0, -1, 1, -1, 1, 0, -1}, + {-1, 0, 1, -1, 1, -1, 0, 1}, + { 1, 0, -1, 1, -1, 1, 0, -1}}; + + if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0; + else if (m_ptr->fy < py) tonari = 1; + else if (m_ptr->fx < px) tonari = 2; + else tonari = 3; + + for (i = 0; i < 8; i++) + { + int next_x = *xp + tonari_x[tonari][i]; + int next_y = *yp + tonari_y[tonari][i]; + cave_type *c_ptr; + + /* Access the next grid */ + c_ptr = &cave[next_y][next_x]; + + /* Skip this feature */ + if (!cave_have_flag_grid(c_ptr, f_flag)) continue; + + if (path_check(m_ptr->fy, m_ptr->fx, next_y, next_x)) + { + *yp = next_y; + *xp = next_x; + return TRUE; + } + } + + return FALSE; +} + +#define DO_SPELL_NONE 0 +#define DO_SPELL_BR_LITE 1 +#define DO_SPELL_BR_DISI 2 +#define DO_SPELL_BA_LITE 3 + +/* * Creatures can cast spells, shoot missiles, and breathe. * * Returns "TRUE" if a spell (or whatever) was (successfully) cast. @@ -1217,19 +1302,25 @@ bool make_attack_spell(int m_idx) monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; char m_name[80]; +#ifndef JP char m_poss[80]; - char ddesc[80]; +#endif bool no_inate = FALSE; - bool do_disi = FALSE; + bool do_spell = DO_SPELL_NONE; int dam = 0; u32b mode = 0L; int s_num_6 = (easy_band ? 2 : 6); int s_num_4 = (easy_band ? 1 : 4); + int rad = 0; //For elemental spells /* Target location */ int x = px; int y = py; + /* Target location for lite breath */ + int x_br_lite = 0; + int y_br_lite = 0; + /* Summon count */ int count = 0; @@ -1245,8 +1336,15 @@ bool make_attack_spell(int m_idx) /* Check "projectable" */ bool direct; + bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level + && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + + bool can_use_lite_area = FALSE; + + bool can_remember; + /* Cannot cast spells when confused */ - if (m_ptr->confused) + if (MON_CONFUSED(m_ptr)) { reset_target(m_ptr); return (FALSE); @@ -1273,11 +1371,46 @@ bool make_attack_spell(int m_idx) /* Check range */ if ((m_ptr->cdis > MAX_RANGE) && !m_ptr->target_y) return (FALSE); + /* Check path for lite breath */ + if (f4 & RF4_BR_LITE) + { + y_br_lite = y; + x_br_lite = x; + + if (los(m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite)) + { + feature_type *f_ptr = &f_info[cave[y_br_lite][x_br_lite].feat]; + + if (!have_flag(f_ptr->flags, FF_LOS)) + { + if (have_flag(f_ptr->flags, FF_PROJECT) && one_in_(2)) f4 &= ~(RF4_BR_LITE); + } + } + + /* Check path to next grid */ + else if (!adjacent_grid_check(m_ptr, &y_br_lite, &x_br_lite, FF_LOS, los)) f4 &= ~(RF4_BR_LITE); + + /* Don't breath lite to the wall if impossible */ + if (!(f4 & RF4_BR_LITE)) + { + y_br_lite = 0; + x_br_lite = 0; + } + } + /* Check path */ if (projectable(m_ptr->fy, m_ptr->fx, y, x)) { - /* Breath disintegration to the glyph if possible */ - if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE; + feature_type *f_ptr = &f_info[cave[y][x].feat]; + + if (!have_flag(f_ptr->flags, FF_PROJECT)) + { + /* Breath disintegration to the wall if possible */ + if ((f4 & RF4_BR_DISI) && have_flag(f_ptr->flags, FF_HURT_DISI) && one_in_(2)) do_spell = DO_SPELL_BR_DISI; + + /* Breath lite to the transparent wall if possible */ + else if ((f4 & RF4_BR_LITE) && have_flag(f_ptr->flags, FF_LOS) && one_in_(2)) do_spell = DO_SPELL_BR_LITE; + } } /* Check path to next grid */ @@ -1285,60 +1418,32 @@ bool make_attack_spell(int m_idx) { bool success = FALSE; - if ((r_ptr->flags4 & RF4_BR_DISI) && - (m_ptr->cdis < MAX_RANGE/2) && + if ((f4 & RF4_BR_DISI) && (m_ptr->cdis < MAX_RANGE/2) && in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) && (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2)))) { - do_disi = TRUE; + do_spell = DO_SPELL_BR_DISI; success = TRUE; } - else + else if ((f4 & RF4_BR_LITE) && (m_ptr->cdis < MAX_RANGE/2) && + los(m_ptr->fy, m_ptr->fx, y, x) && one_in_(5)) { - int i; - int tonari; - int tonari_y[4][8] = {{-1,-1,-1,0,0,1,1,1}, - {-1,-1,-1,0,0,1,1,1}, - {1,1,1,0,0,-1,-1,-1}, - {1,1,1,0,0,-1,-1,-1}}; - int tonari_x[4][8] = {{-1,0,1,-1,1,-1,0,1}, - {1,0,-1,1,-1,1,0,-1}, - {-1,0,1,-1,1,-1,0,1}, - {1,0,-1,1,-1,1,0,-1}}; - - if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0; - else if (m_ptr->fy < py) tonari = 1; - else if (m_ptr->fx < px) tonari = 2; - else tonari = 3; - - for (i = 0; i < 8; i++) + do_spell = DO_SPELL_BR_LITE; + success = TRUE; + } + else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE)) + { + int by = y, bx = x; + get_project_point(m_ptr->fy, m_ptr->fx, &by, &bx, 0L); + if ((distance(by, bx, y, x) <= 3) && los(by, bx, y, x) && one_in_(5)) { - int next_x = x + tonari_x[tonari][i]; - int next_y = y + tonari_y[tonari][i]; - cave_type *c_ptr; - - /* Access the next grid */ - c_ptr = &cave[next_y][next_x]; - - /* Skip door, rubble, wall */ - if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue; - - /* Skip tree */ - if (c_ptr->feat == FEAT_TREES) continue; - - /* Skip mountain */ - if (c_ptr->feat == FEAT_MOUNTAIN) continue; - - if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x)) - { - y = next_y; - x = next_x; - success = TRUE; - break; - } + do_spell = DO_SPELL_BA_LITE; + success = TRUE; } } + if (!success) success = adjacent_grid_check(m_ptr, &y, &x, FF_PROJECT, projectable); + if (!success) { if (m_ptr->target_y && m_ptr->target_x) @@ -1350,6 +1455,18 @@ bool make_attack_spell(int m_idx) f6 &= (RF6_INDIRECT_MASK); success = TRUE; } + + if (y_br_lite && x_br_lite && (m_ptr->cdis < MAX_RANGE/2) && one_in_(5)) + { + if (!success) + { + y = y_br_lite; + x = x_br_lite; + do_spell = DO_SPELL_BR_LITE; + success = TRUE; + } + else f4 |= (RF4_BR_LITE); + } } /* No spells */ @@ -1364,82 +1481,116 @@ bool make_attack_spell(int m_idx) /* Forbid inate attacks sometimes */ if (no_inate) { - f4 &= ~(RF4_BREATH_MASK); - f5 &= ~(RF5_BREATH_MASK); - f6 &= ~(RF6_BREATH_MASK); + f4 &= ~(RF4_NOMAGIC_MASK); + f5 &= ~(RF5_NOMAGIC_MASK); + f6 &= ~(RF6_NOMAGIC_MASK); } - if (!p_ptr->csp) - { - f5 &= ~(RF5_DRAIN_MANA); - } - if ((p_ptr->pclass == CLASS_NINJA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE))) + if (f6 & RF6_DARKNESS) { - f6 &= ~(RF6_DARKNESS); + if ((p_ptr->pclass == CLASS_NINJA) && + !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) && + !(r_ptr->flags7 & RF7_DARK_MASK)) + can_use_lite_area = TRUE; + + if (!(r_ptr->flags2 & RF2_STUPID)) + { + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS); + else if ((p_ptr->pclass == CLASS_NINJA) && !can_use_lite_area) f6 &= ~(RF6_DARKNESS); + } } - if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC)) + if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID)) { f4 &= (RF4_NOMAGIC_MASK); f5 &= (RF5_NOMAGIC_MASK); f6 &= (RF6_NOMAGIC_MASK); } - /* Hack -- allow "desperate" spells */ - if ((r_ptr->flags2 & (RF2_SMART)) && - (m_ptr->hp < m_ptr->maxhp / 10) && - (randint0(100) < 50)) + if (r_ptr->flags2 & RF2_SMART) { - /* Require intelligent spells */ - f4 &= (RF4_INT_MASK); - f5 &= (RF5_INT_MASK); - f6 &= (RF6_INT_MASK); + /* Hack -- allow "desperate" spells */ + if ((m_ptr->hp < m_ptr->maxhp / 10) && + (randint0(100) < 50)) + { + /* Require intelligent spells */ + f4 &= (RF4_INT_MASK); + f5 &= (RF5_INT_MASK); + f6 &= (RF6_INT_MASK); + } - /* No spells left */ - if (!f4 && !f5 && !f6) return (FALSE); + /* Hack -- decline "teleport level" in some case */ + if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF(0)) + { + f6 &= ~(RF6_TELE_LEVEL); + } } + /* No spells left */ + if (!f4 && !f5 && !f6) return (FALSE); + /* Remove the "ineffective" spells */ remove_bad_spells(m_idx, &f4, &f5, &f6); - if (p_ptr->inside_arena) + if (p_ptr->inside_arena || p_ptr->inside_battle) { f4 &= ~(RF4_SUMMON_MASK); f5 &= ~(RF5_SUMMON_MASK); - f6 &= ~(RF6_SUMMON_MASK); + f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL); + + if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL); } /* No spells left */ if (!f4 && !f5 && !f6) return (FALSE); - /* Check for a clean bolt shot */ - if (((f4 & RF4_BOLT_MASK) || - (f5 & RF5_BOLT_MASK) || - (f6 & RF6_BOLT_MASK)) && - !(r_ptr->flags2 & RF2_STUPID) && - !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE)) + if (!(r_ptr->flags2 & RF2_STUPID)) { - /* Remove spells that will only hurt friends */ - f4 &= ~(RF4_BOLT_MASK); - f5 &= ~(RF5_BOLT_MASK); - f6 &= ~(RF6_BOLT_MASK); - } + if (!p_ptr->csp) f5 &= ~(RF5_DRAIN_MANA); - /* Check for a possible summon */ - if (((f4 & RF4_SUMMON_MASK) || - (f5 & RF5_SUMMON_MASK) || - (f6 & RF6_SUMMON_MASK)) && - !(r_ptr->flags2 & RF2_STUPID) && - !(summon_possible(y, x))) - { - /* Remove summoning spells */ - f4 &= ~(RF4_SUMMON_MASK); - f5 &= ~(RF5_SUMMON_MASK); - f6 &= ~(RF6_SUMMON_MASK); - } + /* Check for a clean bolt shot */ + if (((f4 & RF4_BOLT_MASK) || + (f5 & RF5_BOLT_MASK) || + (f6 & RF6_BOLT_MASK)) && + !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE)) + { + /* Remove spells that will only hurt friends */ + f4 &= ~(RF4_BOLT_MASK); + f5 &= ~(RF5_BOLT_MASK); + f6 &= ~(RF6_BOLT_MASK); + } - /* No spells left */ - if (!f4 && !f5 && !f6) return (FALSE); + /* Check for a possible summon */ + if (((f4 & RF4_SUMMON_MASK) || + (f5 & RF5_SUMMON_MASK) || + (f6 & RF6_SUMMON_MASK)) && + !(summon_possible(y, x))) + { + /* Remove summoning spells */ + f4 &= ~(RF4_SUMMON_MASK); + f5 &= ~(RF5_SUMMON_MASK); + f6 &= ~(RF6_SUMMON_MASK); + } + + /* Check for a possible raise dead */ + if ((f6 & RF6_RAISE_DEAD) && !raise_possible(m_ptr)) + { + /* Remove raise dead spell */ + f6 &= ~(RF6_RAISE_DEAD); + } + + /* Special moves restriction */ + if (f6 & RF6_SPECIAL) + { + if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(y, x)) + { + f6 &= ~(RF6_SPECIAL); + } + } + + /* No spells left */ + if (!f4 && !f5 && !f6) return (FALSE); + } /* Extract the "inate" spells */ for (k = 0; k < 32; k++) @@ -1471,22 +1622,38 @@ bool make_attack_spell(int m_idx) /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0x00); +#ifndef JP /* Get the monster possessive ("his"/"her"/"its") */ - monster_desc(m_poss, m_ptr, 0x22); - - /* Hack -- Get the "died from" name */ - monster_desc(ddesc, m_ptr, 0x288); + monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE); +#endif - if (do_disi) - thrown_spell = 96+31; - else + switch (do_spell) { - int attempt = 10; - while(attempt--) + case DO_SPELL_NONE: { - thrown_spell = choose_attack_spell(m_idx, spell, num); - if (thrown_spell) break; + int attempt = 10; + while (attempt--) + { + thrown_spell = choose_attack_spell(m_idx, spell, num); + if (thrown_spell) break; + } } + break; + + case DO_SPELL_BR_LITE: + thrown_spell = 96+14; /* RF4_BR_LITE */ + break; + + case DO_SPELL_BR_DISI: + thrown_spell = 96+31; /* RF4_BR_DISI */ + break; + + case DO_SPELL_BA_LITE: + thrown_spell = 128+20; /* RF5_BA_LITE */ + break; + + default: + return FALSE; /* Paranoia */ } /* Abort if no spell was chosen */ @@ -1499,24 +1666,35 @@ bool make_attack_spell(int m_idx) if (r_ptr->flags2 & RF2_STUPID) failrate = 0; /* Check for spell failure (inate attacks never fail) */ - if ((thrown_spell >= 128) && ((m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate))) + if (!spell_is_inate(thrown_spell) + && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate))) { - disturb(1, 0); + disturb(1, 1); /* Message */ - if (thrown_spell != (160+7)) /* Not RF6_SPECIAL */ - { #ifdef JP - msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name); + msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name); #else - msg_format("%^s tries to cast a spell, but fails.", m_name); + msg_format("%^s tries to cast a spell, but fails.", m_name); #endif - } return (TRUE); } + /* Hex: Anti Magic Barrier */ + if (!spell_is_inate(thrown_spell) && magic_barrier(m_idx)) + { +#ifdef JP + msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%^s¤Î¼öʸ¤ò¤«¤­¾Ã¤·¤¿¡£", m_name); +#else + msg_format("Anti magic barrier cancels the spell which %^s casts."); +#endif + return (TRUE); + } + /* Projectable? */ - direct = ((x == px) && (y == py)); + direct = player_bold(y, x); + + can_remember = is_original_ap_and_seen(m_ptr); /* Cast the spell. */ switch (thrown_spell) @@ -1524,7 +1702,7 @@ bool make_attack_spell(int m_idx) /* RF4_SHRIEK */ case 96+0: { - disturb(1, 0); + disturb(1, 1); #ifdef JP msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name); #else @@ -1546,7 +1724,7 @@ msg_format("%^s case 96+2: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name); @@ -1554,96 +1732,8 @@ msg_format("%^s if (blind) msg_format("%^s mumbles powerfully.", m_name); else msg_format("%^s invokes a dispel magic.", m_name); #endif - set_fast(0, TRUE); - set_lightspeed(0, TRUE); - set_slow(0, TRUE); - set_shield(0, TRUE); - set_blessed(0, TRUE); - set_tsuyoshi(0, TRUE); - set_hero(0, TRUE); - set_shero(0, TRUE); - set_protevil(0, TRUE); - set_invuln(0, TRUE); - set_wraith_form(0, TRUE); - set_kabenuke(0, TRUE); - set_tim_res_nether(0, TRUE); - set_tim_res_time(0, TRUE); - /* by henkma */ - set_tim_reflect(0,TRUE); - set_multishadow(0,TRUE); - set_dustrobe(0,TRUE); - - set_tim_invis(0, TRUE); - set_tim_infra(0, TRUE); - set_tim_esp(0, TRUE); - set_tim_regen(0, TRUE); - set_tim_stealth(0, TRUE); - set_tim_ffall(0, TRUE); - set_tim_sh_touki(0, TRUE); - set_tim_sh_fire(0, TRUE); - set_tim_sh_holy(0, TRUE); - set_tim_eyeeye(0, TRUE); - set_magicdef(0, TRUE); - set_resist_magic(0, TRUE); - set_oppose_acid(0, TRUE); - set_oppose_elec(0, TRUE); - set_oppose_fire(0, TRUE); - set_oppose_cold(0, TRUE); - set_oppose_pois(0, TRUE); - set_ultimate_res(0, TRUE); - set_mimic(0, 0, TRUE); - set_ele_attack(0, 0); - set_ele_immune(0, 0); - /* Cancel glowing hands */ - if (p_ptr->special_attack & ATTACK_CONFUSE) - { - p_ptr->special_attack &= ~(ATTACK_CONFUSE); -#ifdef JP - msg_print("¼ê¤Îµ±¤­¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£"); -#else - msg_print("Your hands stop glowing."); -#endif - - } - if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0])) - { - p_ptr->magic_num1[1] = p_ptr->magic_num1[0]; - p_ptr->magic_num1[0] = 0; -#ifdef JP - msg_print("²Î¤¬ÅÓÀڤ줿¡£"); -#else - msg_print("Your singing is interrupted."); -#endif - p_ptr->action = ACTION_NONE; - - /* Recalculate bonuses */ - p_ptr->update |= (PU_BONUS | PU_HP); - - /* Redraw map */ - p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE); - - /* Update monsters */ - p_ptr->update |= (PU_MONSTERS); - - /* Window stuff */ - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - - p_ptr->energy_need += ENERGY_NEED(); - } - if (p_ptr->riding) - { - monster_type *riding_ptr = &m_list[p_ptr->riding]; - if (riding_ptr->invulner) - { - riding_ptr->invulner = 0; - riding_ptr->energy_need += ENERGY_NEED(); - } - riding_ptr->fast = 0; - riding_ptr->slow = 0; - p_ptr->update |= PU_BONUS; - if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH; - p_ptr->redraw |= (PR_UHEALTH); - } + dispel_player(); + if (p_ptr->riding) dispel_monster_status(p_ptr->riding); #ifdef JP if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) @@ -1653,10 +1743,10 @@ msg_format("%^s break; } - /* RF4_XXX4X4 */ + /* RF4_ROCKET */ case 96+3: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name); #else @@ -1680,7 +1770,7 @@ else msg_format("%^s case 96+4: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name); #else @@ -1723,7 +1813,7 @@ else msg_format("%^s /* RF4_BR_ACID */ case 96+8: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1745,7 +1835,7 @@ else msg_format("%^s /* RF4_BR_ELEC */ case 96+9: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1767,7 +1857,7 @@ else msg_format("%^s /* RF4_BR_FIRE */ case 96+10: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1789,7 +1879,7 @@ else msg_format("%^s /* RF4_BR_COLD */ case 96+11: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1811,7 +1901,7 @@ else msg_format("%^s /* RF4_BR_POIS */ case 96+12: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1834,7 +1924,7 @@ else msg_format("%^s /* RF4_BR_NETH */ case 96+13: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1856,7 +1946,7 @@ else msg_format("%^s /* RF4_BR_LITE */ case 96+14: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1870,7 +1960,7 @@ else msg_format("%^s #endif dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6)); - breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable); + breath(y_br_lite, x_br_lite, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable); update_smart_learn(m_idx, DRS_LITE); break; } @@ -1878,7 +1968,7 @@ else msg_format("%^s /* RF4_BR_DARK */ case 96+15: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1900,7 +1990,7 @@ else msg_format("%^s /* RF4_BR_CONF */ case 96+16: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1922,7 +2012,7 @@ else msg_format("%^s /* RF4_BR_SOUN */ case 96+17: { - disturb(1, 0); + disturb(1, 1); if (m_ptr->r_idx == MON_JAIAN) #ifdef JP msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×"); @@ -1950,7 +2040,7 @@ else msg_format("%^s /* RF4_BR_CHAO */ case 96+18: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1972,7 +2062,7 @@ else msg_format("%^s /* RF4_BR_DISE */ case 96+19: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -1994,7 +2084,7 @@ else msg_format("%^s /* RF4_BR_NEXU */ case 96+20: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2016,7 +2106,7 @@ else msg_format("%^s /* RF4_BR_TIME */ case 96+21: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2037,7 +2127,7 @@ else msg_format("%^s /* RF4_BR_INER */ case 96+22: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2058,7 +2148,7 @@ else msg_format("%^s /* RF4_BR_GRAV */ case 96+23: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2079,7 +2169,7 @@ else msg_format("%^s /* RF4_BR_SHAR */ case 96+24: { - disturb(1, 0); + disturb(1, 1); if (m_ptr->r_idx == MON_BOTEI) #ifdef JP msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×"); @@ -2107,7 +2197,7 @@ else msg_format("%^s /* RF4_BR_PLAS */ case 96+25: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2128,7 +2218,7 @@ else msg_format("%^s /* RF4_BR_WALL */ case 96+26: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2149,7 +2239,7 @@ else msg_format("%^s /* RF4_BR_MANA */ case 96+27: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2169,7 +2259,7 @@ else msg_format("%^s /* RF4_BA_NUKE */ case 96+28: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2191,7 +2281,7 @@ else msg_format("%^s /* RF4_BR_NUKE */ case 96+29: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2213,7 +2303,7 @@ else msg_format("%^s /* RF4_BA_CHAO */ case 96+30: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2235,7 +2325,7 @@ else msg_format("%^s /* RF4_BR_DISI */ case 96+31: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name); #else @@ -2258,21 +2348,25 @@ else msg_format("%^s /* RF5_BA_ACID */ case 128+0: { - disturb(1, 0); + disturb(1, 1); #ifdef JP -if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); #else if (blind) msg_format("%^s mumbles.", m_name); -#endif - -#ifdef JP -else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); -#else else msg_format("%^s casts an acid ball.", m_name); #endif - - dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1); - breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable); + if (r_ptr->flags2 & RF2_POWERFUL) + { + rad = 4; + dam = (rlev * 4) + 50 + damroll(10, 10); + } + else + { + rad = 2; + dam = (randint1(rlev * 3) + 15); + } + breath(y, x, m_idx, GF_ACID, dam, rad, FALSE, MS_BALL_ACID, learnable); update_smart_learn(m_idx, DRS_ACID); break; } @@ -2280,21 +2374,26 @@ else msg_format("%^s /* RF5_BA_ELEC */ case 128+1: { - disturb(1, 0); + int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 4 : 2; + disturb(1, 1); #ifdef JP -if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); #else if (blind) msg_format("%^s mumbles.", m_name); -#endif - -#ifdef JP -else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); -#else else msg_format("%^s casts a lightning ball.", m_name); #endif - - dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1); - breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable); + if (r_ptr->flags2 & RF2_POWERFUL) + { + rad = 4; + dam = (rlev * 4) + 50 + damroll(10, 10); + } + else + { + rad = 2; + dam = (randint1(rlev * 3 / 2) + 8); + } + breath(y, x, m_idx, GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC, learnable); update_smart_learn(m_idx, DRS_ELEC); break; } @@ -2302,7 +2401,8 @@ else msg_format("%^s /* RF5_BA_FIRE */ case 128+2: { - disturb(1, 0); + int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 4 : 2; + disturb(1, 1); if (m_ptr->r_idx == MON_ROLENTO) { @@ -2321,20 +2421,25 @@ else msg_format("%^s else { #ifdef JP -if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); #else if (blind) msg_format("%^s mumbles.", m_name); -#endif - -#ifdef JP -else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); -#else else msg_format("%^s casts a fire ball.", m_name); #endif } - dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1); - breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable); + if (r_ptr->flags2 & RF2_POWERFUL) + { + rad = 4; + dam = (rlev * 4) + 50 + damroll(10, 10); + } + else + { + rad = 2; + dam = (randint1(rlev * 7 / 2) + 10); + } + breath(y, x, m_idx, GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE, learnable); update_smart_learn(m_idx, DRS_FIRE); break; } @@ -2342,21 +2447,26 @@ else msg_format("%^s /* RF5_BA_COLD */ case 128+3: { - disturb(1, 0); + int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 4 : 2; + disturb(1, 1); #ifdef JP -if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); #else if (blind) msg_format("%^s mumbles.", m_name); -#endif - -#ifdef JP -else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name); -#else else msg_format("%^s casts a frost ball.", m_name); #endif - - dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1); - breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable); + if (r_ptr->flags2 & RF2_POWERFUL) + { + rad = 4; + dam = (rlev * 4) + 50 + damroll(10, 10); + } + else + { + rad = 2; + dam = (randint1(rlev * 3 / 2) + 10); + } + breath(y, x, m_idx, GF_COLD, dam, rad, FALSE, MS_BALL_COLD, learnable); update_smart_learn(m_idx, DRS_COLD); break; } @@ -2364,7 +2474,7 @@ else msg_format("%^s /* RF5_BA_POIS */ case 128+4: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2386,7 +2496,7 @@ else msg_format("%^s /* RF5_BA_NETH */ case 128+5: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2408,7 +2518,7 @@ else msg_format("%^s /* RF5_BA_WATE */ case 128+6: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2435,7 +2545,7 @@ msg_print(" /* RF5_BA_MANA */ case 128+7: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2456,7 +2566,7 @@ else msg_format("%^s /* RF5_BA_DARK */ case 128+8: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2479,68 +2589,10 @@ else msg_format("%^s case 128+9: { if (!direct) return (FALSE); - disturb(1, 0); - if (p_ptr->csp) - { - int r1; - - /* Basic message */ -#ifdef JP -msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name); -#else - msg_format("%^s draws psychic energy from you!", m_name); -#endif - - - /* Attack power */ - r1 = (randint1(rlev) / 2) + 1; - - /* Full drain */ - if (r1 >= p_ptr->csp) - { - r1 = p_ptr->csp; - p_ptr->csp = 0; - p_ptr->csp_frac = 0; - } + disturb(1, 1); - /* Partial drain */ - else - { - p_ptr->csp -= r1; - } - - learn_spell(MS_DRAIN_MANA); - - /* Redraw mana */ - p_ptr->redraw |= (PR_MANA); - - /* Window stuff */ - p_ptr->window |= (PW_PLAYER); - p_ptr->window |= (PW_SPELL); - - /* Heal the monster */ - if (m_ptr->hp < m_ptr->maxhp) - { - /* Heal */ - m_ptr->hp += (6 * r1); - if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; - - /* Redraw (later) if needed */ - if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); - if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); - - /* Special message */ - if (seen) - { -#ifdef JP -msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name); -#else - msg_format("%^s appears healthier.", m_name); -#endif - - } - } - } + dam = (randint1(rlev) / 2) + 1; + breath(y, x, m_idx, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, learnable); update_smart_learn(m_idx, DRS_MANA); break; } @@ -2549,7 +2601,7 @@ msg_format("%^s case 128+10: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); if (!seen) { #ifdef JP @@ -2578,7 +2630,7 @@ msg_format("%^s case 128+11: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); if (!seen) { #ifdef JP @@ -2607,7 +2659,7 @@ msg_format("%^s case 128+12: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2629,7 +2681,7 @@ else msg_format("%^s case 128+13: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2651,7 +2703,7 @@ else msg_format("%^s case 128+14: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name); #else @@ -2673,7 +2725,7 @@ else msg_format("%^s case 128+15: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name); #else @@ -2695,7 +2747,7 @@ else msg_format("%^s case 128+16: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2719,7 +2771,7 @@ else msg_format("%^s case 128+17: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2743,7 +2795,7 @@ else msg_format("%^s case 128+18: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2767,7 +2819,7 @@ else msg_format("%^s case 128+19: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2790,7 +2842,7 @@ else msg_format("%^s /* RF5_BA_LITE */ case 128+20: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2813,7 +2865,7 @@ else msg_format("%^s case 128+21: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2837,7 +2889,7 @@ else msg_format("%^s case 128+22: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2860,7 +2912,7 @@ else msg_format("%^s case 128+23: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2883,7 +2935,7 @@ else msg_format("%^s case 128+24: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2906,7 +2958,7 @@ else msg_format("%^s case 128+25: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2930,7 +2982,7 @@ else msg_format("%^s case 128+26: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -2953,7 +3005,7 @@ else msg_format("%^s case 128+27: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name); #else @@ -2997,7 +3049,7 @@ msg_print(" case 128+28: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3041,7 +3093,7 @@ msg_print(" case 128+29: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name); #else @@ -3085,7 +3137,7 @@ msg_print(" case 128+30: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name); #else @@ -3123,7 +3175,7 @@ msg_print(" case 128+31: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3166,7 +3218,7 @@ msg_format(" /* RF6_HASTE */ case 160+0: { - disturb(1, 0); + disturb(1, 1); if (blind) { #ifdef JP @@ -3179,7 +3231,7 @@ msg_format("%^s else { #ifdef JP -msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name, m_poss); +msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name); #else msg_format("%^s concentrates on %s body.", m_name, m_poss); #endif @@ -3187,16 +3239,14 @@ msg_format("%^s } /* Allow quick speed increases to base+10 */ - if (!m_ptr->fast) + if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100)) { #ifdef JP -msg_format("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name); + msg_format("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name); #else msg_format("%^s starts moving faster.", m_name); #endif } - m_ptr->fast = MIN(200, m_ptr->fast + 100); - if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS; break; } @@ -3204,9 +3254,9 @@ msg_format("%^s case 160+1: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP -msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name); +msg_format("%^s¤¬<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", m_name); #else msg_format("%^s invokes the Hand of Doom!", m_name); #endif @@ -3218,7 +3268,7 @@ msg_format("%^s /* RF6_HEAL */ case 160+2: { - disturb(1, 0); + disturb(1, 1); /* Message */ if (blind) @@ -3299,18 +3349,17 @@ msg_format("%^s if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); /* Cancel fear */ - if (m_ptr->monfear) + if (MON_MONFEAR(m_ptr)) { /* Cancel fear */ - m_ptr->monfear = 0; + (void)set_monster_monfear(m_idx, 0); /* Message */ #ifdef JP -msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name, m_poss); + msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name); #else msg_format("%^s recovers %s courage.", m_name, m_poss); #endif - } break; } @@ -3318,7 +3367,7 @@ msg_format("%^s /* RF6_INVULNER */ case 160+3: { - disturb(1, 0); + disturb(1, 1); /* Message */ if (!seen) @@ -3340,81 +3389,55 @@ msg_format("%s } - if (!(m_ptr->invulner)) - m_ptr->invulner = randint1(4) + 4; - - if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); - if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); + if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE); break; } /* RF6_BLINK */ case 160+4: { - disturb(1, 0); + disturb(1, 1); + if (teleport_barrier(m_idx)) + { #ifdef JP -msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name); + msg_format("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", m_name); #else - msg_format("%^s blinks away.", m_name); + msg_format("Magic barrier obstructs teleporting of %^s.", m_name); #endif - - teleport_away(m_idx, 10, FALSE); - p_ptr->update |= (PU_MONSTERS | PU_MON_LITE); + } + else + { +#ifdef JP + msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name); +#else + msg_format("%^s blinks away.", m_name); +#endif + teleport_away(m_idx, 10, 0L); + p_ptr->update |= (PU_MONSTERS); + } break; } /* RF6_TPORT */ case 160+5: { - int i, oldfy, oldfx; - u32b flgs[TR_FLAG_SIZE]; - object_type *o_ptr; - - oldfy = m_ptr->fy; - oldfx = m_ptr->fx; - - disturb(1, 0); -#ifdef JP -msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name); -#else - msg_format("%^s teleports away.", m_name); -#endif - - teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE); - - if (los(py, px, oldfy, oldfx) && !world_monster) + disturb(1, 1); + if (teleport_barrier(m_idx)) { - for (i=INVEN_RARM;imuta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR)) - { #ifdef JP - if(get_check_strict("¤Ä¤¤¤Æ¤¤¤­¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL)) + msg_format("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", m_name); #else - if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL)) + msg_format("Magic barrier obstructs teleporting of %^s.", m_name); #endif - { - if (one_in_(3)) - { - teleport_player(200); + } + else + { #ifdef JP - msg_print("¼ºÇÔ¡ª"); + msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name); #else - msg_print("Failed!"); + msg_format("%^s teleports away.", m_name); #endif - } - else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE); - p_ptr->energy_need += ENERGY_NEED(); - } - break; - } - } - } + teleport_away_followable(m_idx); } break; } @@ -3423,7 +3446,7 @@ msg_format("%^s case 160+6: { int who = 0; - disturb(1, 0); + disturb(1, 1); if(m_ptr->r_idx == MON_DIO) who = 1; else if(m_ptr->r_idx == MON_WONG) who = 3; dam = who; @@ -3436,17 +3459,13 @@ msg_format("%^s { int k; - disturb(1, 0); - switch(m_ptr->r_idx) + disturb(1, 1); + switch (m_ptr->r_idx) { case MON_OHMU: - if (p_ptr->inside_arena || p_ptr->inside_battle) return FALSE; - for (k = 0; k < 6; k++) - { - count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, PM_ALLOW_GROUP); - } + /* Moved to process_monster(), like multiplication */ return FALSE; - + case MON_BANORLUPART: { int dummy_hp = (m_ptr->hp + 1) / 2; @@ -3471,8 +3490,9 @@ msg_format("%^s break; } - case MON_BANOR: - case MON_LUPART: + + case MON_BANOR: + case MON_LUPART: { int dummy_hp = 0; int dummy_maxhp = 0; @@ -3507,10 +3527,34 @@ msg_format("%^s break; } + case MON_ROLENTO: +#ifdef JP + if (blind) msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name); + else msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name); +#else + if (blind) msg_format("%^s spreads something.", m_name); + else msg_format("%^s throws some hand grenades.", m_name); +#endif + + { + int num = 1 + randint1(3); + + for (k = 0; k < num; k++) + { + count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode); + } + } +#ifdef JP + if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¤Ð¤é¤Þ¤«¤ì¤ë²»¤¬¤¹¤ë¡£"); +#else + if (blind && count) msg_print("You hear many things are scattered nearby."); +#endif + break; + default: if (r_ptr->d_char == 'B') { - disturb(1, 0); + disturb(1, 1); if (one_in_(3) || !direct) { #ifdef JP @@ -3518,23 +3562,25 @@ msg_format("%^s #else msg_format("%^s suddenly go out of your sight!", m_name); #endif - teleport_away(m_idx, 10, FALSE); - p_ptr->update |= (PU_MONSTERS | PU_MON_LITE); + teleport_away(m_idx, 10, TELEPORT_NONMAGICAL); + p_ptr->update |= (PU_MONSTERS); } else { - int dam = damroll(4, 8); int get_damage = 0; + bool fear; /* dummy */ + #ifdef JP - msg_format("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍ¤¿¡£", m_name); + msg_format("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", m_name); #else msg_format("%^s holds you, and drops from the sky.", m_name); #endif - teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE); + dam = damroll(4, 8); + teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE); sound(SOUND_FALL); - if (p_ptr->ffall) + if (p_ptr->levitation) { #ifdef JP msg_print("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£"); @@ -3564,13 +3610,15 @@ msg_format("%^s char m_name_self[80]; /* hisself */ - monster_desc(m_name_self, m_ptr, 0x23); + monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE); msg_format("The attack of %s has wounded %s!", m_name, m_name_self); #endif project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1); set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE); } + + if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx); } break; } @@ -3585,14 +3633,14 @@ msg_format("%^s case 160+8: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", m_name); #else msg_format("%^s commands you to return.", m_name); #endif - teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE); + teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE); learn_spell(MS_TELE_TO); break; } @@ -3601,7 +3649,7 @@ msg_format("%^s case 160+9: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name); if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) @@ -3611,7 +3659,7 @@ msg_format("%^s #endif learn_spell(MS_TELE_AWAY); - teleport_player(100); + teleport_player_away(m_idx, 100); break; } @@ -3619,7 +3667,7 @@ msg_format("%^s case 160+10: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3652,7 +3700,7 @@ msg_print(" } else { - teleport_player_level(); + teleport_level(0); } learn_spell(MS_TELE_LEVEL); update_smart_learn(m_idx, DRS_NEXUS); @@ -3663,7 +3711,7 @@ msg_print(" case 160+11: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3685,34 +3733,34 @@ else msg_format("%^s case 160+12: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP -if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); + if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else if (blind) msg_format("%^s mumbles.", m_name); #endif #ifdef JP -else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name); -else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name); + else if (can_use_lite_area) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name); + else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name); #else - else if (p_ptr->pclass == CLASS_NINJA) - msg_format("%^s cast a spell to light up.", m_name); + else if (can_use_lite_area) msg_format("%^s cast a spell to light up.", m_name); else msg_format("%^s gestures in shadow.", m_name); #endif - learn_spell(MS_DARKNESS); - if (p_ptr->pclass == CLASS_NINJA) - (void)lite_area(0, 3); + if (can_use_lite_area) (void)lite_area(0, 3); else + { + learn_spell(MS_DARKNESS); (void)unlite_area(0, 3); + } break; } /* RF6_TRAPS */ case 160+13: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name); #else @@ -3734,7 +3782,7 @@ else msg_format("%^s case 160+14: { if (!direct) return (FALSE); - disturb(1, 0); + disturb(1, 1); #ifdef JP msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ­²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name); #else @@ -3767,7 +3815,7 @@ msg_print(" /* RF6_RAISE_DEAD */ case 160+15: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3783,25 +3831,11 @@ else msg_format("%^s break; } - /* RF6_SUMMON_KIN */ + /* RF6_S_KIN */ case 160+16: { - disturb(1, 0); - if (m_ptr->r_idx == MON_ROLENTO) - { -#ifdef JP - if (blind) - msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name); - else - msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name); -#else - if (blind) - msg_format("%^s spreads something.", m_name); - else - msg_format("%^s throws some hand grenades.", m_name); -#endif - } - else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT) + disturb(1, 1); + if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT) { #ifdef JP if (blind) @@ -3836,92 +3870,94 @@ else msg_format("%^s #endif } - if(m_ptr->r_idx == MON_ROLENTO) + switch (m_ptr->r_idx) { - int num = 1 + randint1(3); - - for (k = 0; k < num; k++) - { - count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode); - } - } - else if(m_ptr->r_idx == MON_THORONDOR || - m_ptr->r_idx == MON_GWAIHIR || - m_ptr->r_idx == MON_MENELDOR) - { - int num = 4 + randint1(3); - for (k = 0; k < num; k++) + case MON_MENELDOR: + case MON_GWAIHIR: + case MON_THORONDOR: { - count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); - } - } - else if(m_ptr->r_idx == MON_LOUSY) - { - int num = 2 + randint1(3); - for (k = 0; k < num; k++) - { - count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP); - } - } - else if(m_ptr->r_idx == MON_BULLGATES) - { - int num = 2 + randint1(3); - for (k = 0; k < num; k++) - { - count += summon_named_creature(m_idx, y, x, 921, mode); + int num = 4 + randint1(3); + for (k = 0; k < num; k++) + { + count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); + } } - } - else if (m_ptr->r_idx == MON_CALDARM) - { - int num = randint1(3); - for (k = 0; k < num; k++) + break; + + case MON_BULLGATES: { - count += summon_named_creature(m_idx, y, x, 930, mode); + int num = 2 + randint1(3); + for (k = 0; k < num; k++) + { + count += summon_named_creature(m_idx, y, x, MON_IE, mode); + } } - } - else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT) - { - int num = 2 + randint1(3); + break; - if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6)) + case MON_SERPENT: + case MON_ZOMBI_SERPENT: { + int num = 2 + randint1(3); + + if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6)) + { #ifdef JP - msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª"); + msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª"); #else - msg_print("Water blew off from the ground!"); + msg_print("Water blew off from the ground!"); #endif - fire_ball_hide(GF_WATER_FLOW, 0, 3, 8); + fire_ball_hide(GF_WATER_FLOW, 0, 3, 8); + } + + for (k = 0; k < num; k++) + { + count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); + } } + break; - for (k = 0; k < num; k++) + case MON_CALDARM: { - count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); + int num = randint1(3); + for (k = 0; k < num; k++) + { + count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode); + } } - } - else - { + break; + + case MON_LOUSY: + { + int num = 2 + randint1(3); + for (k = 0; k < num; k++) + { + count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP); + } + } + break; + default: summon_kin_type = r_ptr->d_char; /* Big hack */ for (k = 0; k < 4; k++) { count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP); } + break; } #ifdef JP -if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£"); + if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£"); #else if (blind && count) msg_print("You hear many things appear nearby."); #endif - break; } /* RF6_S_CYBER */ case 160+17: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3947,7 +3983,7 @@ if (blind && count) msg_print(" /* RF6_S_MONSTER */ case 160+18: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -3976,7 +4012,7 @@ if (blind && count) msg_print(" /* RF6_S_MONSTERS */ case 160+19: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4005,7 +4041,7 @@ if (blind && count) msg_print("¿ /* RF6_S_ANT */ case 160+20: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4034,7 +4070,7 @@ if (blind && count) msg_print("¿ /* RF6_S_SPIDER */ case 160+21: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4063,7 +4099,7 @@ if (blind && count) msg_print("¿ /* RF6_S_HOUND */ case 160+22: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4092,7 +4128,7 @@ if (blind && count) msg_print("¿ /* RF6_S_HYDRA */ case 160+23: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4123,7 +4159,7 @@ if (blind && count) msg_print("¿ { int num = 1; - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4169,7 +4205,7 @@ if (blind) msg_print("¿ /* RF6_S_DEMON */ case 160+25: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4198,7 +4234,7 @@ if (blind && count) msg_print(" /* RF6_S_UNDEAD */ case 160+26: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4227,7 +4263,7 @@ if (blind && count) msg_print(" /* RF6_S_DRAGON */ case 160+27: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4256,7 +4292,7 @@ if (blind && count) msg_print(" /* RF6_S_HI_UNDEAD */ case 160+28: { - disturb(1, 0); + disturb(1, 1); if (((m_ptr->r_idx == MON_MORGOTH) || (m_ptr->r_idx == MON_SAURON) || (m_ptr->r_idx == MON_ANGMAR)) && ((r_info[MON_NAZGUL].cur_num+2) < r_info[MON_NAZGUL].max_num)) { @@ -4278,17 +4314,17 @@ else msg_format("%^s for (k = 0; k < 30; k++) { - if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx)) + if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx)) { int j; for (j = 100; j > 0; j--) { scatter(&cy, &cx, y, x, 2, 0); - if (cave_floor_bold(cy, cx)) break; + if (cave_empty_bold(cy, cx)) break; } if (!j) break; } - if (!cave_floor_bold(cy, cx)) continue; + if (!cave_empty_bold(cy, cx)) continue; if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode)) { @@ -4351,7 +4387,7 @@ msg_print(" /* RF6_S_HI_DRAGON */ case 160+29: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4383,7 +4419,7 @@ msg_print("¿ /* RF6_S_AMBERITES */ case 160+30: { - disturb(1, 0); + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4417,7 +4453,10 @@ msg_print(" /* RF6_S_UNIQUE */ case 160+31: { - disturb(1, 0); + bool uniques_are_summoned = FALSE; + int non_unique_type = SUMMON_HI_UNDEAD; + + disturb(1, 1); #ifdef JP if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name); #else @@ -4434,28 +4473,26 @@ else msg_format("%^s { count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); } - if (r_ptr->flags3 & RF3_GOOD) - { - for (k = count; k < s_num_4; k++) - { - count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); - } - } - else + + if (count) uniques_are_summoned = TRUE; + + if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) + non_unique_type = 0; + else if (m_ptr->sub_align & SUB_ALIGN_GOOD) + non_unique_type = SUMMON_ANGEL; + + for (k = count; k < s_num_4; k++) { - for (k = count; k < s_num_4; k++) - { - count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); - } + count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE)); } + if (blind && count) { #ifdef JP -msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£"); + msg_format("¿¤¯¤Î%s¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£", uniques_are_summoned ? "Î϶¯¤¤¤â¤Î" : "¤â¤Î"); #else - msg_print("You hear many powerful things appear nearby."); + msg_format("You hear many %s appear nearby.", uniques_are_summoned ? "powerful things" : "things"); #endif - } break; } @@ -4468,7 +4505,7 @@ msg_print("¿ if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR)) { - if (thrown_spell != 167) + if (thrown_spell != 167) /* Not RF6_SPECIAL */ { if (p_ptr->mane_num == MAX_MANE) { @@ -4485,12 +4522,12 @@ msg_print("¿ p_ptr->mane_num++; new_mane = TRUE; - p_ptr->redraw |= (PR_MANE); + p_ptr->redraw |= (PR_IMITATION); } } /* Remember what the monster did to us */ - if (seen) + if (can_remember) { /* Inate spell */ if (thrown_spell < 32 * 4) @@ -4518,7 +4555,7 @@ msg_print("¿ /* Always take note of monsters that kill you */ if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena) { - r_ptr->r_deaths++; + r_ptr->r_deaths++; /* Ignore appearance difference */ } /* A spell was cast */