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YTQQC S34LKQDIQJLIWVIPASOJBBZ6ZCXDHP5KPS7TRBZJSCDRVNCLK6UAC Z7FLGOQODOWQ2FDJRMCNM6MM3FOVORG6BMJZ3AA5HADPNJTYZD2QC NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC XEZ5PLCFGH7YHIQVUCB3VO5C35DXE7N4RSBC7M3AKXJW4OBDZWVQC XQYNQDAY5HSS57HPEH3GG3OZHAK6NUQZUU5DHZSJ3H7TAFZPMWZAC Y5IKTUDW3HOMUJBEUKVTLM4KZTNX4KMPE544A5LFY2S2BKSQRNSQC 4SWAT5KCKQV527NKELAXFQ5XA4Q5HONQXD4VBXMUZNPVPQKPCPNAC YF6CE2VBFK6K4V34PKBVYVQUTJRDDDCF2M5RMUGW6V6N2M4SUPLAC WXSNNK2RXP3DQFAEQGQUZJHFWXJC7ZKG2WURZGL566UDM4YXFSWQC // NB: this must be checked against the same effects// in fight.cc for all forms of attack !!! {dlb}// This function should be currently unused (the effect is too powerful).static int _distortion_monsters(coord_def where, int pow, int, actor *){if (pow > 100)pow = 100;if (where == you.pos()){if (you.skills[SK_TRANSLOCATIONS] < random2(8)){MiscastEffect( &you, NON_MONSTER, SPTYP_TRANSLOCATION,pow / 9 + 1, pow, "cast bend on self" );}else{MiscastEffect( &you, NON_MONSTER, SPTYP_TRANSLOCATION, 1, 1,"cast bend on self" );}return (1);}monsters *defender = monster_at(where);if (defender == NULL)return (0);int specdam = 0;if (defender->type == MONS_BLINK_FROG|| defender->type == MONS_PRINCE_RIBBIT) // any others resist?{int hp = defender->hit_points;int max_hp = defender->max_hit_points;mpr("The blink frog basks in the translocular energy.");if (hp < max_hp)hp += 1 + random2(1 + pow / 4) + random2(1 + pow / 7);if (hp > max_hp)hp = max_hp;defender->hit_points = hp;return 1;}else if (coinflip()){mprf("Space bends around %s.",defender->name(DESC_NOCAP_THE).c_str());specdam += 1 + random2avg( 7, 2 ) + random2(pow) / 40;}else if (coinflip()){mprf("Space warps horribly around %s!",defender->name(DESC_NOCAP_THE).c_str());specdam += 3 + random2avg( 12, 2 ) + random2(pow) / 25;}else if (one_chance_in(3)){monster_blink(defender);return 1;}else if (one_chance_in(3)){monster_teleport(defender, coinflip());return 1;}else if (one_chance_in(3)){defender->banish();return 1;}else{canned_msg(MSG_NOTHING_HAPPENS);return 1;}_player_hurt_monster(*defender, specdam);return (specdam);}void cast_bend(int pow){apply_one_neighbouring_square( _distortion_monsters, pow );}
}static int _spell_swap_func(coord_def where, int pow, int, actor *){monsters *defender = monster_at(where);if (defender == NULL)return (0);if (defender->type == MONS_BLINK_FROG|| defender->type == MONS_PRINCE_RIBBIT|| check_mons_resist_magic( defender, pow )){simple_monster_message( defender, mons_immune_magic(defender) ?" is unaffected." : " resists." );}else{// Swap doesn't seem to actually swap, but just sets the// monster's location equal to the players... this being because// the acr.cc call is going to move the player afterwards (for// the regular friendly monster swap). So we'll go through// standard swap procedure here... since we really want to apply// the same swap_places function as with friendly monsters...// see note over there. -- bwrcoord_def old_pos = defender->pos();if (swap_places( defender ))you.moveto(old_pos);}return 1;}void cast_swap(int pow){apply_one_neighbouring_square(_spell_swap_func, pow);
static int _rot_living(coord_def where, int pow, int, actor *){monsters *monster = monster_at(where);if (monster == NULL)return (0);if (mons_holiness(monster) != MH_NATURAL)return (0);if (check_mons_resist_magic(monster, pow))return (0);int ench = ((random2(pow) + random2(pow) + random2(pow) + random2(pow))/4);ench = 1 + (ench >= 20) + (ench >= 35) + (ench >= 50);monster->add_ench(mon_enchant(ENCH_ROT, ench, KC_YOU));
return (1);}static int _rot_undead(coord_def where, int pow, int, actor *){monsters *monster = monster_at(where);if (monster == NULL)return (0);if (mons_holiness(monster) != MH_UNDEAD)return (0);if (check_mons_resist_magic(monster, pow))return (0);// This does not make sense -- player mummies are// immune to rotting (or have been) -- so what is// the schema in use here to determine rotting??? {dlb}//jmf: Up for discussion. it is clearly unfair to// rot player mummies.// the `schema' here is: corporeal non-player undead// rot, discorporeal undead don't rot. if you wanna// insist that monsters get the same treatment as// players, I demand my player mummies get to worship// the evil mummy & orc gods.switch (monster->type){case MONS_ZOMBIE_SMALL:case MONS_ZOMBIE_LARGE:case MONS_MUMMY:case MONS_GUARDIAN_MUMMY:case MONS_GREATER_MUMMY:case MONS_MUMMY_PRIEST:case MONS_GHOUL:case MONS_NECROPHAGE:case MONS_VAMPIRE:case MONS_VAMPIRE_KNIGHT:case MONS_VAMPIRE_MAGE:case MONS_LICH:case MONS_ANCIENT_LICH:case MONS_WIGHT:case MONS_BORIS:break;case MONS_ROTTING_HULK:default:return 0; // Immune (no flesh) or already rotting.}int ench = ((random2(pow) + random2(pow) + random2(pow) + random2(pow))/4);ench = 1 + (ench >= 20) + (ench >= 35) + (ench >= 50);monster->add_ench(mon_enchant(ENCH_ROT, ench, KC_YOU));return (1);}static int _rot_corpses(coord_def where, int pow, int, actor *){return _make_a_rot_cloud(where, pow, CLOUD_MIASMA);}void cast_rotting(int pow){apply_area_visible(_rot_living, pow);apply_area_visible(_rot_undead, pow);apply_area_visible(_rot_corpses, pow);return;}void do_monster_rot(int mon){int damage = 1 + random2(3);if (mons_holiness(&menv[mon]) == MH_UNDEAD && !one_chance_in(5)){apply_area_cloud(make_a_normal_cloud, menv[mon].pos(),10, 1, CLOUD_MIASMA, KC_YOU, KILL_YOU_MISSILE);}_player_hurt_monster( mon, damage );}
bool cast_twist(int pow, const coord_def& where){monsters *monster = monster_at(where);// Anything there?if (monster == NULL){mpr("There is no monster there!");// This counts as a real cast, in order not to leak invisible// monster locations, and to allow victory-dancing.return (true);}
// Identify mimics, if necessary.if (mons_is_mimic(monster->type))monster->flags |= MF_KNOWN_MIMIC;// Monster can magically save vs attack.if (check_mons_resist_magic(monster, pow * 2)){simple_monster_message(monster, mons_resist_string(monster));return (true);}// Roll the damage... this spell is pretty low on damage, because// it can target any monster in LOS (high utility). This is// similar to the damage done by Magic Dart (although, the// distribution is much more uniform). -- bwrconst int damage = 1 + random2(3 + pow / 5);// Inflict the damage.if (!_player_hurt_monster(*monster, damage))if (mons_is_mimic(monster->type))mimic_alert(monster);return (true);}
//// This version of far strike is a bit too creative for level one, in// order to make it work we needed to put a lot of restrictions on it// (like the damage limitation), which wouldn't be necessary if it were// a higher level spell. This code might come back as a high level// translocation spell later (maybe even with special effects if it's// using some of Josh's ideas about occasionally losing the weapon).// Would potentially make a good high-level, second book Warper spell// (since Translocations is a utility school, it should be higher level// that usual... especially if it turns into a flavoured smiting spell).// This can all wait until after the next release (as it would be better// to have a proper way to do a single weapon strike here (you_attack// does far more than we need or want here)). --bwr//void cast_far_strike(int pow){dist targ;bolt tmp; // used, but ignored// Get target, using DIR_TARGET for targetting only,// since we don't use fire_beam() for this spell.if (!spell_direction(targ, tmp, DIR_TARGET))return;
// Get the target monster...if (monster_at(targ.target) == NULL){mpr("There is no monster there!");return;}if (trans_wall_blocking( targ.target )){mpr("A translucent wall is in the way.");return;}// Start with weapon base damage...int damage = 3; // default unarmed damageint speed = 10; // default unarmed timeif (you.weapon()) // if not unarmed{const item_def& wpn(*you.weapon());// Look up the base damage.if (wpn.base_type == OBJ_WEAPONS){damage = property( wpn, PWPN_DAMAGE );speed = property( wpn, PWPN_SPEED );if (get_weapon_brand(wpn) == SPWPN_SPEED)speed /= 2;}else if (item_is_staff(wpn)){damage = property(wpn, PWPN_DAMAGE );speed = property(wpn, PWPN_SPEED );}}// Because we're casting a spell (and don't want to make this level// one spell too good), we're not applying skill speed bonuses and at// the very least guaranteeing one full turn (speed == 10) like the// other spells (if any thing else related to speed is changed, at// least leave this right before the application to you.time_taken).// Leaving skill out of the speed bonus is an important part of// keeping this spell from becoming a "better than actual melee"// spell... although, it's fine if that's the case for early Warpers,// Fighter types, and such that pick up this trivial first level spell,// shouldn't be using it instead of melee (but rather as an accessory// long range plinker). Therefore, we tone things down to try and// guarantee that the spell is never begins to approach real combat// (although the magic resistance check might end up with a higher// hit rate than attacking against EV for high level Warpers). -- bwrif (speed < 10)speed = 10;you.time_taken *= speed;you.time_taken /= 10;// Apply strength only to damage (since we're only interested in// force here, not finesse... the dex/to-hit part of combat is// instead handled via magical ability). This part could probably// just be removed, as it's unlikely to make any real difference...// if it is, the Warper stats in newgame.cc should be changed back// to the standard 6 int-4 dex of spellcasters. -- bwrint dammod = 78;const int dam_stat_val = you.strength;if (dam_stat_val > 11)dammod += (random2(dam_stat_val - 11) * 2);else if (dam_stat_val < 9)dammod -= (random2(9 - dam_stat_val) * 3);damage *= dammod;damage /= 78;monsters *monster = monster_at(targ.target);// Apply monster's AC.if (monster->ac > 0)damage -= random2( 1 + monster->ac );// Roll the damage...damage = 1 + random2( damage );// Monster can magically save vs attack (this could be replaced or// augmented with an EV check).if (check_mons_resist_magic( monster, pow * 2 )){simple_monster_message( monster, mons_immune_magic(monster) ?" is unaffected." : " resists." );return;}// Inflict the damage._player_hurt_monster(*monster, damage);}
void turn_undead(int pow){mpr("You attempt to repel the undead.");for (int i = 0; i < MAX_MONSTERS; i++){monsters* const monster = &menv[i];if (monster->type == -1 || !mons_near(monster))continue;// Used to inflict random2(5) + (random2(pow) / 20) damage,// in addition. {dlb}if (mons_holiness(monster) == MH_UNDEAD){if (check_mons_resist_magic( monster, pow )){simple_monster_message( monster, mons_immune_magic(monster) ?" is unaffected." : " resists." );continue;}
if (!monster->add_ench(ENCH_FEAR))continue;simple_monster_message( monster, " is repelled!" );//mv: Must be here to work.behaviour_event( monster, ME_SCARE, MHITYOU );// Reduce power based on monster turned.pow -= monster->hit_dice * 3;if (pow <= 0)break;}}}
bool summon_holy_being_type(monster_type mon, int pow,god_type god, int spell){return _summon_holy_being_wrapper(pow, god, spell, mon,std::min(2 + (random2(pow) / 4), 6),true, false);}