X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmspells1.c;h=15dbc2e5b6e77caafc174b98a0037e6f91d76bb0;hb=deb69109fced5d67799320bb0a1100f8e5f2dec0;hp=538ea897c18ff9354127daaf0007bb7e4530a26f;hpb=8d7e1f8596404ef71177491f706263bf59506030;p=hengband%2Fhengband.git diff --git a/src/mspells1.c b/src/mspells1.c index 538ea897c..15dbc2e5b 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -558,8 +558,8 @@ u32b get_curse(int power, object_type *o_ptr) { if (new_curse & TRC_HEAVY_MASK) continue; } - if (((o_ptr->tval < TV_WEAPON_BEGIN) || (o_ptr->tval > TV_WEAPON_END)) && (new_curse == TRC_LOW_MELEE)) continue; - if (((o_ptr->tval < TV_ARMOR_BEGIN) || (o_ptr->tval > TV_ARMOR_END)) && (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; @@ -597,7 +597,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; @@ -607,7 +607,7 @@ msg_format("%s } else { - if (!cursed_p(o_ptr)) + if (!object_is_cursed(o_ptr)) changed = TRUE; o_ptr->curse_flags |= TRC_CURSED; } @@ -834,7 +834,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]; @@ -924,7 +924,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 */ @@ -1049,7 +1049,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)]); @@ -1137,7 +1137,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)]); @@ -1151,7 +1151,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)]); @@ -1192,6 +1192,48 @@ bool spell_is_inate(u16b spell) } +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 @@ -1273,6 +1315,10 @@ bool make_attack_spell(int m_idx) 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; @@ -1291,8 +1337,12 @@ bool make_attack_spell(int m_idx) 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); @@ -1319,6 +1369,33 @@ 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)) { @@ -1347,8 +1424,7 @@ bool make_attack_spell(int m_idx) success = TRUE; } else if ((f4 & RF4_BR_LITE) && (m_ptr->cdis < MAX_RANGE/2) && - los(m_ptr->fy, m_ptr->fx, y, x) && - (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2)))) + los(m_ptr->fy, m_ptr->fx, y, x) && one_in_(5)) { do_spell = DO_SPELL_BR_LITE; success = TRUE; @@ -1357,53 +1433,14 @@ bool make_attack_spell(int m_idx) { 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_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2)))) + if ((distance(by, bx, y, x) <= 3) && los(by, bx, y, x) && one_in_(5)) { do_spell = DO_SPELL_BA_LITE; success = TRUE; } } - if (!success) - { - 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++) - { - 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, tree, mountain, etc. */ - if (!have_flag(f_flags_grid(c_ptr), FF_PROJECT)) continue; - - if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x)) - { - y = next_y; - x = next_x; - success = TRUE; - break; - } - } - } + if (!success) success = adjacent_grid_check(m_ptr, &y, &x, FF_PROJECT, projectable); if (!success) { @@ -1416,6 +1453,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 */ @@ -1435,16 +1484,18 @@ bool make_attack_spell(int m_idx) f6 &= ~(RF6_NOMAGIC_MASK); } - if (!p_ptr->csp) + if (f6 & RF6_DARKNESS) { - f5 &= ~(RF5_DRAIN_MANA); - } + 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 ((p_ptr->pclass == CLASS_NINJA) && - ((r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) || - (r_ptr->flags7 & RF7_DARK_MASK))) - { - f6 &= ~(RF6_DARKNESS); + 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 (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID)) @@ -1493,6 +1544,8 @@ bool make_attack_spell(int m_idx) if (!(r_ptr->flags2 & RF2_STUPID)) { + if (!p_ptr->csp) f5 &= ~(RF5_DRAIN_MANA); + /* Check for a clean bolt shot */ if (((f4 & RF4_BOLT_MASK) || (f5 & RF5_BOLT_MASK) || @@ -1612,7 +1665,7 @@ bool make_attack_spell(int m_idx) /* Check for spell failure (inate attacks never fail) */ if (!spell_is_inate(thrown_spell) - && (in_no_magic_dungeon || (m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate))) + && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate))) { disturb(1, 0); /* Message */ @@ -1628,6 +1681,8 @@ bool make_attack_spell(int m_idx) /* Projectable? */ direct = player_bold(y, x); + can_remember = is_original_ap_and_seen(m_ptr); + /* Cast the spell. */ switch (thrown_spell) { @@ -1664,96 +1719,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)) @@ -1980,7 +1947,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; } @@ -3239,16 +3206,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; } @@ -3351,18 +3316,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); + msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name); #else msg_format("%^s recovers %s courage.", m_name, m_poss); #endif - } break; } @@ -3392,11 +3356,7 @@ 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; } @@ -3410,7 +3370,7 @@ msg_format("%^s msg_format("%^s blinks away.", m_name); #endif - teleport_away(m_idx, 10, FALSE); + teleport_away(m_idx, 10, 0L); p_ptr->update |= (PU_MONSTERS); break; } @@ -3418,56 +3378,14 @@ msg_format("%^s /* 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); + 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) - { - for (i=INVEN_RARM;imuta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR)) - { -#ifdef JP - if(get_check_strict("¤Ä¤¤¤Æ¤¤¤­¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL)) -#else - if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL)) -#endif - { - if (one_in_(3)) - { - teleport_player(200); -#ifdef JP - msg_print("¼ºÇÔ¡ª"); -#else - msg_print("Failed!"); -#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; } @@ -3591,7 +3509,7 @@ msg_format("%^s #else msg_format("%^s suddenly go out of your sight!", m_name); #endif - teleport_away(m_idx, 10, FALSE); + teleport_away(m_idx, 10, TELEPORT_NONMAGICAL); p_ptr->update |= (PU_MONSTERS); } else @@ -3600,16 +3518,16 @@ msg_format("%^s 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 dam = damroll(4, 8); - teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE); + 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("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£"); @@ -3669,7 +3587,7 @@ msg_format("%^s 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; } @@ -3688,7 +3606,7 @@ msg_format("%^s #endif learn_spell(MS_TELE_AWAY); - teleport_player(100); + teleport_player_away(m_idx, 100); break; } @@ -3764,25 +3682,25 @@ else msg_format("%^s if (!direct) return (FALSE); disturb(1, 0); #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; } @@ -4550,12 +4468,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 && is_original_ap(m_ptr)) + if (can_remember) { /* Inate spell */ if (thrown_spell < 32 * 4)