Removed the return value as it was never getting used.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1850 c06c8d41-db1a-0410-9941-cceddc491573
AREBCIU2RU2RNHBWD4GARWEBKSL7HDFGDLII22H56OJO2AQUOMLQC XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC CMNLYUECIMEZSOYG4KOSINOPER5OM7PPCGIHCM7LQVWEO77XFUYQC PZDY3UT6KG5I53AIVQ5H7I2ECLFT7DI7ZR7XYMTCNIQB2J46WVKAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC YCL3W2PFE6ILTGBFODCSXNPDIA46KVSZP2TI7HDMYAOEJT65RIEAC UURAYLSSITZLQR56MCWFPIWMECU7F3USMA2UPJAO4IPIY5WVKP5QC CAGCTYIUYWDHQAJOLVLKOEV5HG6K5ZG7IDHONLIG6BDNCWZJAK4AC B62ICMDTN5V7R7RBL4JALFVKEMVOOVLRSJASRNYS6CGFWBEEF5JQC 74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC X5WLJCJVW55SXZVP7IKP7ADCJIGNKN4PKAXFECVR6TNK7XSMZR7QC TV3ZC6WOZKSQQJQN26JIVKCHK6UK7WMDBYZDUYRWEAZ4JB4YVNAAC JW2KRJHES33W7UTWZ6NDO4TLMK4EFU4HKZXBWR2UJOMPCCOTR4CQC QKGDOYIYKE6B36ION5O2DRW65DWWPZMYNWJVH7LJJ7FPGGM2MYAQC /* This determines how likely it is that more powerful wild magic effects* will occur. Set to 100 for the old probabilities (although the individual* effects have been made much nastier since then).*/bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail,int force_effect, const char *cause )
static void miscast_conjuration(int severity, const char* cause)
/* sp_type is the type of the spell* mag_pow is overall power of the spell or effect (ie its level)* mag_fail is the degree to which you failed* force_effect forces a certain severity of effect to occur.*/struct bolt beam;bool failMsg = true;int loopj;if (sp_type == SPTYP_RANDOM)sp_type = 1 << (random2(12));int spec_effect = (mag_pow * mag_fail * (10 + mag_pow) / 7* WILD_MAGIC_NASTINESS) / 100;if (force_effect == 100&& random2(40) > spec_effect && random2(40) > spec_effect)
bolt beam;switch (severity)
canned_msg(MSG_NOTHING_HAPPENS);return (false);}
case 0: // just a harmless messageswitch (random2(10)){case 0:msg::stream << "Sparks fly from your " << your_hand(true)<< '!' << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:msg::stream << "Wisps of smoke drift from your "<< your_hand(true) << '.' << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You are momentarily dazzled by a flash of light!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (player_can_smell())mpr("You smell something strange.");else if (you.species == SP_MUMMY)mpr("Your bandages flutter.");}break;
// setup beambeam.is_tracer = false;
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:msg::stream << "Smoke pours from your " << your_hand(true)<< '!' << std::endl;big_cloud( CLOUD_GREY_SMOKE, KC_YOU,you.x_pos, you.y_pos, 20,7 + random2(7) );break;case 1:mpr("A wave of violent energy washes through your body!");ouch(6 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;}break;
spec_effect /= 100;
case 2: // rather less harmless stuffswitch (random2(2)){case 0:mpr("Energy rips through your body!");ouch(9 + random2avg(17, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("You are caught in a violent explosion!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 12 );beam.flavour = BEAM_MISSILE; // unsure about this// BEAM_EXPLOSION instead? {dlb}beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = random_colour();beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;explosion(beam);break;}break;
#if DEBUG_DIAGNOSTICSconst int old_fail = spec_effect;#endifspec_effect = random2(spec_effect);if (spec_effect > 3)spec_effect = 3;else if (spec_effect < 0)spec_effect = 0;#if DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Sptype: %d, failure1: %d, failure2: %d",sp_type, old_fail, spec_effect );#endifif (force_effect != 100)spec_effect = force_effect;
case 3: // considerably less harmless stuffswitch (random2(2)){case 0:mpr("You are blasted with magical energy!");ouch(12 + random2avg(29, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("There is a sudden explosion of magical energy!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 20 );beam.flavour = BEAM_MISSILE; // unsure about this// BEAM_EXPLOSION instead? {dlb}beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = random_colour();beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = coinflip()?1:2;beam.is_explosion = true;explosion(beam);break;}}}
case 0: // just a harmless messageswitch (random2(10)){case 0:msg::stream << "Sparks fly from your " << your_hand(true)<< '!' << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:msg::stream << "Wisps of smoke drift from your "<< your_hand(true) << '.' << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You are momentarily dazzled by a flash of light!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:
case 0:msg::stream << "Your " << your_hand(true)<< " glow momentarily." << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("Multicolored lights dance before your eyes!");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Waves of light ripple over your body.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear something strange.", MSGCH_SOUND);else if (you.attribute[ATTR_TRANSFORMATION] != TRAN_AIR)mpr("Your skull vibrates slightly.");else
break;case 9:if (player_can_smell())mpr("You smell something strange.");else if (you.species == SP_MUMMY)mpr("Your bandages flutter.");}
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:msg::stream << "Smoke pours from your " << your_hand(true)<< '!' << std::endl;big_cloud( CLOUD_GREY_SMOKE, KC_YOU,you.x_pos, you.y_pos, 20,7 + random2(7) );break;case 1:mpr("A wave of violent energy washes through your body!");ouch(6 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;}
case 1: // slightly annoyingswitch (random2(2)){case 0:potion_effect(POT_LEVITATION, 20);break;case 1:random_uselessness(2 + random2(7), 0);
case 2: // rather less harmless stuffswitch (random2(2)){case 0:mpr("Energy rips through your body!");ouch(9 + random2avg(17, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("You are caught in a violent explosion!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 12 );beam.flavour = BEAM_MISSILE; // unsure about this// BEAM_EXPLOSION instead? {dlb}
case 2: // much more annoyingswitch (random2(7)){case 0:case 1:case 2:mpr("You sense a malignant aura.");curse_an_item(false);break;case 3:case 4:case 5:potion_effect(POT_SLOWING, 10);break;case 6:potion_effect(POT_BERSERK_RAGE, 10);break;}break;
beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = random_colour();beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;
case 3: // potentially lethalswitch (random2(4)){case 0:do {curse_an_item(false);} while ( !one_chance_in(3) );
case 3: // considerably less harmless stuffswitch (random2(2)){case 0:mpr("You are blasted with magical energy!");ouch(12 + random2avg(29, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("There is a sudden explosion of magical energy!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 20 );beam.flavour = BEAM_MISSILE; // unsure about this// BEAM_EXPLOSION instead? {dlb}beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = random_colour();beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = coinflip()?1:2;beam.is_explosion = true;explosion(beam);break;}
case 3:mpr("You feel saturated with unharnessed energies!");you.magic_contamination += random2avg(19,3);
case 0: // harmless messages onlyswitch (random2(10)){case 0:msg::stream << "Your " << your_hand(true)<< " glow momentarily." << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("Multicolored lights dance before your eyes!");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Waves of light ripple over your body.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear something strange.", MSGCH_SOUND);else if (you.attribute[ATTR_TRANSFORMATION] != TRAN_AIR)mpr("Your skull vibrates slightly.");elsecanned_msg(MSG_NOTHING_HAPPENS);break;}
case 0:mpr("Space warps around you.");break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("You feel a wrenching sensation.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You spin around.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("The world appears momentarily distorted!");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("You feel uncomfortable.");
case 1: // slightly annoyingswitch (random2(2)){case 0:potion_effect(POT_LEVITATION, 20);break;case 1:random_uselessness(2 + random2(7), 0);break;}
case 1: // mostly harmlessswitch (random2(6)){case 0:case 1:case 2:mpr("You are caught in a localised field of spatial distortion.");ouch(4 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);
case 2: // much more annoyingswitch (random2(7)){case 0:case 1:case 2:mpr("You sense a malignant aura.");curse_an_item(false);break;case 3:case 4:case 5:potion_effect(POT_SLOWING, 10);break;case 6:potion_effect(POT_BERSERK_RAGE, 10);break;}
case 3:case 4:mpr("Space bends around you!");random_blink(false);ouch(4 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause);
case 3: // potentially lethalswitch (random2(4)){case 0:do {curse_an_item(false);} while ( !one_chance_in(3) );mpr("You sense an overwhelmingly malignant aura!");break;case 1:potion_effect(POT_PARALYSIS, 10);break;case 2:potion_effect(POT_CONFUSION, 10);break;case 3:mpr("You feel saturated with unharnessed energies!");you.magic_contamination += random2avg(19,3);break;}
case 5:mpr("Space twists in upon itself!");create_monster( MONS_SPATIAL_VORTEX, 3, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );
case 0: // harmless messages onlyswitch (random2(10)){case 0:mpr("Space warps around you.");break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("You feel a wrenching sensation.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You spin around.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("The world appears momentarily distorted!");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("You feel uncomfortable.");break;}
case 0:case 1:case 2:mpr("You are caught in a strong localised spatial distortion.");ouch(9 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);
case 1: // mostly harmlessswitch (random2(6)){case 0:case 1:case 2:mpr("You are caught in a localised field of spatial distortion.");ouch(4 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 3:case 4:mpr("Space bends around you!");random_blink(false);ouch(4 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 5:mpr("Space twists in upon itself!");create_monster( MONS_SPATIAL_VORTEX, 3, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );break;}
if (one_chance_in(3))you_teleport_now( true );elserandom_blink( false );ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);potion_effect(POT_CONFUSION, 40);
case 0:case 1:case 2:mpr("You are caught in a strong localised spatial distortion.");ouch(9 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 3:case 4:mpr("Space warps around you!");if (one_chance_in(3))you_teleport_now( true );elserandom_blink( false );ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);potion_effect(POT_CONFUSION, 40);break;case 5:mpr("Space twists in upon itself!");loopj = 2 + random2(3);for (int i = 0; i < loopj; ++i)
const int count = 2 + random2(3);for (int i = 0; i < count; ++i)
switch (random2(4)){case 0:mpr("You are caught in an extremely strong localised spatial distortion!");ouch(15 + random2avg(29, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("Space warps crazily around you!");you_teleport_now( true );
switch (random2(4)){case 0:mpr("You are caught in an extremely strong localised spatial distortion!");ouch(15 + random2avg(29, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("Space warps crazily around you!");you_teleport_now( true );
ouch(9 + random2avg(17, 2), 0, KILLED_BY_WILD_MAGIC, cause);potion_effect(POT_CONFUSION, 60);break;case 2:send_abyss(cause);break;case 3:mpr("You feel saturated with unharnessed energies!");you.magic_contamination += random2avg(19,3);break;}
ouch(9 + random2avg(17, 2), 0, KILLED_BY_WILD_MAGIC, cause);potion_effect(POT_CONFUSION, 60);break;case 2:send_abyss(cause);break;case 3:mpr("You feel saturated with unharnessed energies!");you.magic_contamination += random2avg(19,3);
case 0: // harmless messages onlyswitch (random2(10)){case 0:mpr("Shadowy shapes form in the air around you, then vanish.");break;case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange voices.", MSGCH_SOUND);elsempr("You feel momentarily dizzy.");break;case 2:mpr("Your head hurts.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Your brain hurts!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("The world appears momentarily distorted.");break;case 7:mpr("Space warps around you.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("Distant voices call out to you!");break;}
case 0:mpr("Shadowy shapes form in the air around you, then vanish.");break;case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange voices.", MSGCH_SOUND);elsempr("You feel momentarily dizzy.");break;case 2:mpr("Your head hurts.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Your brain hurts!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("The world appears momentarily distorted.");break;case 7:mpr("Space warps around you.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("Distant voices call out to you!");
case 1: // a little badswitch (random2(6)){case 0: // identical to translocationcase 1:case 2:mpr("You are caught in a localised spatial distortion.");ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;
case 1: // a little badswitch (random2(6)){case 0: // identical to translocationcase 1:case 2:mpr("You are caught in a localised spatial distortion.");ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;
case 3:mpr("Space twists in upon itself!");create_monster( MONS_SPATIAL_VORTEX, 3, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );break;
case 3:mpr("Space twists in upon itself!");create_monster( MONS_SPATIAL_VORTEX, 3, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );break;
case 4:case 5:if (create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 ) != -1){mpr("Something appears in a flash of light!");}break;
case 4:case 5:if (create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 ) != -1){mpr("Something appears in a flash of light!");
case 1:case 2:if (create_monster( summon_any_demon(DEMON_COMMON), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250) != -1){mpr("Something forms out of thin air!");}break;
case 3:case 4:case 5:mpr("A chorus of chattering voices calls out to you!");create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );
case 3:case 4:case 5:mpr("A chorus of chattering voices calls out to you!");create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );
create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );
if (coinflip()){create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );}if (coinflip()){create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );}break;
case 0:if (create_monster( MONS_ABOMINATION_SMALL, 0, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 ) != -1){mpr("Something forms out of thin air.");}break;case 1:if (create_monster( summon_any_demon(DEMON_GREATER), 0,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 ) != -1){mpr("You sense a hostile presence.");}break;case 2:mpr("Something turns its malign attention towards you...");create_monster( summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,
create_monster( summon_any_demon(DEMON_LESSER), 5,BEH_HOSTILE, you.x_pos, you.y_pos,
create_monster( summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250);if (coinflip()){create_monster(summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250);}break;case 3:send_abyss(cause);break;
case 0:mpr("Weird images run through your mind.");break;case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange voices.", MSGCH_SOUND);elsempr("Your nose twitches.");break;case 2:mpr("Your head hurts.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Your brain hurts!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Everything looks hazy for a moment.");break;case 7:mpr("You seem to have forgotten something, but you can't remember what it was!");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("You feel uncomfortable.");break;
mpr("Something forms out of thin air.");
case 2: // even more annoying thingsswitch (random2(2))
case 2:mpr("Something turns its malign attention towards you...");create_monster( summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250 );create_monster( summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250);if (coinflip())
case 0:if (you.is_undead)mpr("You suddenly recall your previous life!");else if (lose_stat(STAT_INTELLIGENCE, 1 + random2(3)))mpr("You have damaged your brain!");elsempr("You have a terrible headache.");break;case 1:mpr("You feel lost.");forget_map(40 + random2(40));break;
create_monster(summon_any_demon(DEMON_COMMON), 3,BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250);
break;case 3:send_abyss(cause);break;}break;}}static void miscast_divination(int severity, const char* cause){switch (severity){case 0: // just a harmless messageswitch (random2(10)){case 0:mpr("Weird images run through your mind.");break;case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange voices.", MSGCH_SOUND);elsempr("Your nose twitches.");break;case 2:mpr("Your head hurts.");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Your brain hurts!");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Everything looks hazy for a moment.");break;case 7:mpr("You seem to have forgotten something, but you can't remember what it was!");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("You feel uncomfortable.");break;}break;case 1: // more annoying thingsswitch (random2(2)){case 0:mpr("You feel slightly disoriented.");forget_map(10 + random2(10));break;case 1:potion_effect(POT_CONFUSION, 10);break;}break;
potion_effect(POT_CONFUSION, 1); // common to all cases here {dlb}
case 2: // even more annoying thingsswitch (random2(2)){case 0:if (you.is_undead)mpr("You suddenly recall your previous life!");else if (lose_stat(STAT_INTELLIGENCE, 1 + random2(3)))mpr("You have damaged your brain!");elsempr("You have a terrible headache.");break;case 1:mpr("You feel lost.");forget_map(40 + random2(40));
case 3: // nastyswitch (random2(3)){case 0:mpr( forget_spell() ? "You have forgotten a spell!": "You get a splitting headache." );break;case 1:mpr("You feel completely lost.");forget_map(100);break;case 2:if (you.is_undead)mpr("You suddenly recall your previous life.");else if (lose_stat(STAT_INTELLIGENCE, 3 + random2(3)))mpr("You have damaged your brain!");elsempr("You have a terrible headache.");break;}
potion_effect(POT_CONFUSION, 1); // common to all cases here {dlb}break;
potion_effect(POT_CONFUSION, 1); // common to all cases here {dlb}
case 3: // nastyswitch (random2(3)){case 0:mpr( forget_spell() ? "You have forgotten a spell!": "You get a splitting headache." );break;case 1:mpr("You feel completely lost.");forget_map(100);break;case 2:if (you.is_undead)mpr("You suddenly recall your previous life.");else if (lose_stat(STAT_INTELLIGENCE, 3 + random2(3)))mpr("You have damaged your brain!");elsempr("You have a terrible headache.");
break; // end divinations
potion_effect(POT_CONFUSION, 1); // common to all cases here {dlb}break;}}static void miscast_necromancy(int severity, const char* cause){if (you.religion == GOD_KIKUBAAQUDGHA&& (!player_under_penance() && you.piety >= piety_breakpoint(1)&& random2(150) <= you.piety)){canned_msg(MSG_NOTHING_HAPPENS);return;}
case SPTYP_NECROMANCY:if (you.religion == GOD_KIKUBAAQUDGHA&& (!player_under_penance() && you.piety >= piety_breakpoint(1)&& random2(150) <= you.piety))
switch (severity){case 0:switch (random2(10))
case 0:if (player_can_smell())mpr("You smell decay.");break;case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange and distant voices.", MSGCH_SOUND);elsempr("You feel homesick.");break;case 2:mpr("Pain shoots through your body.");break;case 3:mpr("Your bones ache.");break;case 4:mpr("The world around you seems to dim momentarily.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("You shiver with cold.");break;case 7:mpr("You sense a malignant aura.");break;case 8:
case 1:if (!silenced(you.x_pos, you.y_pos))mpr("You hear strange and distant voices.", MSGCH_SOUND);elsempr("You feel homesick.");break;case 2:mpr("Pain shoots through your body.");break;case 3:mpr("Your bones ache.");break;case 4:mpr("The world around you seems to dim momentarily.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("You shiver with cold.");break;case 7:mpr("You sense a malignant aura.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mpr("You feel very uncomfortable.");break;
case 0:if (you.is_undead){mpr("You feel weird for a moment.");break;}mpr("Pain shoots through your body!");ouch(5 + random2avg(15, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("You feel horribly lethargic.");potion_effect(POT_SLOWING, 15);break;case 2:// josh declares mummies cannot smell {dlb}if (player_can_smell()){mpr("You smell decay."); // identical to a harmless messageyou.rotting++;}break;
mpr("You smell decay."); // identical to a harmless messageyou.rotting++;
if (coinflip()){create_monster( MONS_SHADOW, 2, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );}if (coinflip()){create_monster( MONS_SHADOW, 2, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );}
case 1:if (!player_prot_life() && one_chance_in(3)){drain_exp();
case 1:if (!player_prot_life() && one_chance_in(3)){drain_exp();break;} // otherwise it just flows through...case 2:if (you.is_undead){mpr("You feel weird for a moment.");break;}mpr("You convulse helplessly as pain tears through your body!");ouch(15 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);
case 2:if (you.is_undead){mpr("You feel weird for a moment.");
case 0:if (you.is_undead){mpr("Something just walked over your grave. No, really!");break;}torment_monsters(you.x_pos, you.y_pos, 0, TORMENT_GENERIC);
mpr("Something just walked over your grave. No, really!");
case 4:if (create_monster( MONS_SOUL_EATER, 4, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250) != -1){mpr("Something reaches out for you...");}break;
rot_player( random2avg(7, 2) + 1 );break;
case 5:if (create_monster( MONS_REAPER, 4, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250) != -1){mpr("Death has come for you...");}break;
case 4:if (create_monster( MONS_SOUL_EATER, 4, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250) != -1){mpr("Something reaches out for you...");
case 0:msg::stream << "Your " << your_hand(true)<< " glow momentarily." << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("Multicolored lights dance before your eyes!");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Waves of light ripple over your body.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (player_can_smell())mpr("You smell something strange.");break;
mpr("Death has come for you...");
case 1: // slightly annoyingswitch (random2(2)){case 0:mpr("Your body is twisted painfully.");ouch(1 + random2avg(11, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:random_uselessness(2 + random2(7), 0);break;}
static void miscast_transmigration(int severity, const char* cause){switch (severity){case 0: // just a harmless messageswitch (random2(10)){case 0:msg::stream << "Your " << your_hand(true)<< " glow momentarily." << std::endl;break;case 1:mpr("The air around you crackles with energy!");break;case 2:mpr("Multicolored lights dance before your eyes!");break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("Waves of light ripple over your body.");break;case 5:mpr("Strange energies run through your body.");break;case 6:mpr("Your skin tingles.");break;case 7:mpr("Your skin glows momentarily.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (player_can_smell())mpr("You smell something strange.");
case 2: // much more annoyingswitch (random2(4)){case 0:mpr("Your body is twisted very painfully!");ouch(3 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:mpr("You feel saturated with unharnessed energies!");you.magic_contamination += random2avg(19,3);break;case 2:potion_effect(POT_PARALYSIS, 10);break;case 3:potion_effect(POT_CONFUSION, 10);break;}
case 1: // slightly annoyingswitch (random2(2)){case 0:mpr("Your body is twisted painfully.");ouch(1 + random2avg(11, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;case 1:random_uselessness(2 + random2(7), 0);break;}break;case 2: // much more annoyingswitch (random2(4)){case 0:mpr("Your body is twisted very painfully!");ouch(3 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);
switch (random2(3)){case 0:mpr("Your body is flooded with distortional energies!");you.magic_contamination += random2avg(35, 3);
switch (random2(3)){case 0:mpr("Your body is flooded with distortional energies!");you.magic_contamination += random2avg(35, 3);
case 1:mpr("You feel very strange.");delete_mutation(RANDOM_MUTATION);ouch(5 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;
case 1:mpr("You feel very strange.");delete_mutation(RANDOM_MUTATION);ouch(5 + random2avg(23, 2), 0, KILLED_BY_WILD_MAGIC, cause);break;
case 0: // just a harmless messageswitch (random2(10)){case 0:msg::stream << "Sparks fly from your " << your_hand(true)<< '!' << std::endl;break;case 1:mpr("The air around you burns with energy!");break;case 2:msg::stream << "Wisps of smoke drift from your "<< your_hand(true) << '.' << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:if (player_can_smell())mpr("You smell smoke.");break;case 5:mpr("Heat runs through your body.");break;case 6:mpr("You feel uncomfortably hot.");break;case 7:mpr("Lukewarm flames ripple over your body.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a sizzling sound.", MSGCH_SOUND);elsempr("You feel like you have heartburn.");break;}
case 0:msg::stream << "Sparks fly from your " << your_hand(true)<< '!' << std::endl;break;case 1:mpr("The air around you burns with energy!");break;case 2:msg::stream << "Wisps of smoke drift from your "<< your_hand(true) << '.' << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:if (player_can_smell())mpr("You smell smoke.");break;case 5:mpr("Heat runs through your body.");break;case 6:mpr("You feel uncomfortably hot.");
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:msg::stream << "Smoke pours from your "<< your_hand(true) << "!" << std::endl;big_cloud( random_smoke_type(), KC_YOU,you.x_pos, you.y_pos, 20, 7 + random2(7) );break;case 1:mpr("Flames sear your flesh.");expose_player_to_element(BEAM_FIRE, 3);
case 7:mpr("Lukewarm flames ripple over your body.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a sizzling sound.", MSGCH_SOUND);elsempr("You feel like you have heartburn.");break;}break;
if (player_res_fire() < 0){ouch(2 + random2avg(13, 2), 0, KILLED_BY_WILD_MAGIC, cause);}break;}
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:msg::stream << "Smoke pours from your "<< your_hand(true) << "!" << std::endl;big_cloud( random_smoke_type(), KC_YOU,you.x_pos, you.y_pos, 20, 7 + random2(7) );
beam.type = SYM_BURST;beam.damage = dice_def( 3, 14 );beam.flavour = BEAM_FIRE;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = RED;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;
ouch( check_your_resists( 5 + random2avg(29, 2), 2 ), 0,KILLED_BY_WILD_MAGIC, cause );
case 3: // considerably less harmless stuffswitch (random2(3)){case 0:mpr("You are blasted with searing flames!");
case 1:mpr("You are caught in a fiery explosion!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 14 );beam.flavour = BEAM_FIRE;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = RED;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;explosion(beam);break;}break;
expose_player_to_element(BEAM_FIRE, 10);break;case 1:mpr("There is a sudden and violent explosion of flames!");
ouch( check_your_resists( 9 + random2avg(33, 2), 2 ), 0,KILLED_BY_WILD_MAGIC, cause );
beam.type = SYM_BURST;beam.damage = dice_def( 3, 20 );beam.flavour = BEAM_FIRE;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "fireball";beam.colour = RED;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = coinflip()?1:2;beam.is_explosion = true;
expose_player_to_element(BEAM_FIRE, 10);break;case 1:mpr("There is a sudden and violent explosion of flames!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 20 );beam.flavour = BEAM_FIRE;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "fireball";beam.colour = RED;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = coinflip()?1:2;beam.is_explosion = true;explosion(beam);break;
case 2:mpr("You are covered in liquid fire!");you.duration[DUR_LIQUID_FLAMES] += random2avg(7, 3) + 1;break;}
static void miscast_ice(int severity, const char* cause){bolt beam;switch (severity){case 0: // just a harmless messageswitch (random2(10)){case 0:mpr("You shiver with cold.");break;case 1:mpr("A chill runs through your body.");break;case 2:msg::stream << "Wisps of condensation drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:msg::stream << "Your " << your_hand(true)<< " feel numb with cold." << std::endl;break;case 5:mpr("A chill runs through your body.");break;case 6:mpr("You feel uncomfortably cold.");break;case 7:mpr("Frost covers your body.");
case 0: // just a harmless messageswitch (random2(10)){case 0:mpr("You shiver with cold.");break;case 1:mpr("A chill runs through your body.");break;case 2:msg::stream << "Wisps of condensation drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:msg::stream << "Your " << your_hand(true)<< " feel numb with cold." << std::endl;break;case 5:mpr("A chill runs through your body.");break;case 6:mpr("You feel uncomfortably cold.");break;case 7:mpr("Frost covers your body.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a crackling sound.", MSGCH_SOUND);elsempr("A snowflake lands on your nose.");break;}
case 0:mpr("You feel extremely cold.");
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:mpr("You feel extremely cold.");break;case 1:mpr("You are covered in a thin layer of ice");expose_player_to_element(BEAM_COLD, 2);
case 1:mpr("You are covered in a thin layer of ice");expose_player_to_element(BEAM_COLD, 2);
case 1:mpr("You are caught in an explosion of ice and frost!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 11 );beam.flavour = BEAM_COLD;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = WHITE;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)
case 1:mpr("You are caught in an explosion of ice and frost!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 11 );beam.flavour = BEAM_COLD;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = WHITE;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)
beam.ex_size = 1;beam.is_explosion = true;explosion(beam);break;}
beam.ex_size = 1;beam.is_explosion = true;explosion(beam);
expose_player_to_element(BEAM_COLD, 9);break;case 1:msg::stream << "Freezing gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_COLD, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(4));break;}
expose_player_to_element(BEAM_COLD, 9);break;case 1:msg::stream << "Freezing gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_COLD, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(4));
switch (random2(10)){case 0:mpr("You feel earthy.");break;case 1:mpr("You are showered with tiny particles of grit.");break;case 2:msg::stream << "Sand pours from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a surge of energy from the ground.");break;case 4:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a distant rumble.", MSGCH_SOUND);elsempr("You sympathise with the stones.");break;case 5:mpr("You feel gritty.");break;case 6:mpr("You feel momentarily lethargic.");break;case 7:mpr("Motes of dust swirl before your eyes.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:mprf("Your %s warm.",(you.species == SP_NAGA) ? "underbelly feels" :(you.species == SP_CENTAUR) ? "hooves feel": "feet feel");break;}
mpr("You are showered with tiny particles of grit.");break;case 2:msg::stream << "Sand pours from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a surge of energy from the ground.");break;case 4:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a distant rumble.", MSGCH_SOUND);elsempr("You sympathise with the stones.");break;case 5:mpr("You feel gritty.");break;case 6:mpr("You feel momentarily lethargic.");break;case 7:mpr("Motes of dust swirl before your eyes.");
case 2: // slightly less harmless stuffswitch (random2(1)){case 0:switch (random2(3)){case 0:mpr("You are hit by flying rocks!");break;case 1:mpr("You are blasted with sand!");break;case 2:mpr("Rocks fall onto you out of nowhere!");break;}ouch( random2avg(13,2) + 10 - random2(1 + player_AC()),0, KILLED_BY_WILD_MAGIC, cause);break;}
case 8:canned_msg(MSG_NOTHING_HAPPENS);
case 3: // less harmless stuffswitch (random2(1)){case 0:mpr("You are caught in an explosion of flying shrapnel!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 15 );beam.flavour = BEAM_FRAG;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = CYAN;if (one_chance_in(5))beam.colour = BROWN;if (one_chance_in(5))beam.colour = LIGHTCYAN;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;explosion(beam);break;}
case 9:mprf("Your %s warm.",(you.species == SP_NAGA) ? "underbelly feels" :(you.species == SP_CENTAUR) ? "hooves feel": "feet feel");
msg::stream << "Wisps of vapour drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You feel electric!");break;case 5:msg::stream << "Sparks of electricity dance between your "<< your_hand(true) << "." << std::endl;break;case 6:mpr("You are blasted with air!");
mpr("Rocks fall onto you out of nowhere!");
case 7:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a whooshing sound.", MSGCH_SOUND);else if (player_can_smell())mpr("You smell ozone.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a crackling sound.", MSGCH_SOUND);else if (player_can_smell())mpr("You smell something musty.");break;
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:mpr("There is a short, sharp shower of sparks.");break;case 1:mprf("The wind %s around you!",silenced(you.x_pos, you.y_pos) ? "whips" : "howls");break;}
case 3: // less harmless stuffswitch (random2(1)){case 0:mpr("You are caught in an explosion of flying shrapnel!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 15 );beam.flavour = BEAM_FRAG;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = CYAN;if (one_chance_in(5))beam.colour = BROWN;if (one_chance_in(5))beam.colour = LIGHTCYAN;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = 1;beam.is_explosion = true;explosion(beam);
case 2: // rather less harmless stuffswitch (random2(2)){case 0:mpr("Electricity courses through your body.");ouch(check_your_resists(4 + random2avg(9, 2), 5), 0,KILLED_BY_WILD_MAGIC, cause);break;case 1:msg::stream << "Noxious gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20,9 + random2(4));break;}
static void miscast_air(int severity, const char* cause){bolt beam;switch (severity){case 0: // just a harmless messageswitch (random2(10)){case 0:mpr("Ouch! You gave yourself an electric shock.");break;case 1:mpr("You feel momentarily weightless.");break;case 2:msg::stream << "Wisps of vapour drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You feel electric!");break;case 5:msg::stream << "Sparks of electricity dance between your "<< your_hand(true) << "." << std::endl;break;case 6:mpr("You are blasted with air!");break;case 7:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a whooshing sound.", MSGCH_SOUND);else if (player_can_smell())mpr("You smell ozone.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a crackling sound.", MSGCH_SOUND);else if (player_can_smell())mpr("You smell something musty.");
case 3: // less harmless stuffswitch (random2(2)){case 0:mpr("You are caught in an explosion of electrical discharges!");
case 1: // a bit less harmless stuffswitch (random2(2)){case 0:mpr("There is a short, sharp shower of sparks.");break;case 1:mprf("The wind %s around you!",silenced(you.x_pos, you.y_pos) ? "whips" : "howls");break;}break;
beam.type = SYM_BURST;beam.damage = dice_def( 3, 8 );beam.flavour = BEAM_ELECTRICITY;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = LIGHTBLUE;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = one_chance_in(4)?1:2;beam.is_explosion = true;
case 2: // rather less harmless stuffswitch (random2(2)){case 0:mpr("Electricity courses through your body.");ouch(check_your_resists(4 + random2avg(9, 2), 5), 0,KILLED_BY_WILD_MAGIC, cause);break;case 1:msg::stream << "Noxious gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20,9 + random2(4));break;}break;
explosion(beam);break;case 1:msg::stream << "Venomous gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud( CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(5) );break;}
case 3: // less harmless stuffswitch (random2(2)){case 0:mpr("You are caught in an explosion of electrical discharges!");beam.type = SYM_BURST;beam.damage = dice_def( 3, 8 );beam.flavour = BEAM_ELECTRICITY;beam.target_x = you.x_pos;beam.target_y = you.y_pos;beam.name = "explosion";beam.colour = LIGHTBLUE;beam.beam_source = NON_MONSTER;beam.thrower = (cause) ? KILL_MISC : KILL_YOU;beam.aux_source.clear();if (cause)beam.aux_source = cause;beam.ex_size = one_chance_in(4)?1:2;beam.is_explosion = true;explosion(beam);break;case 1:msg::stream << "Venomous gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud( CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(5) );
case 0: // just a harmless messageswitch (random2(10)){case 0:mpr("You feel mildly nauseous.");break;case 1:mpr("You feel slightly ill.");break;case 2:msg::stream << "Wisps of poison gas drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You feel faint for a moment.");break;case 5:mpr("You feel sick.");break;case 6:mpr("You feel odd.");break;case 7:mpr("You feel weak for a moment.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a slurping sound.", MSGCH_SOUND);else if (you.species != SP_MUMMY)mpr("You taste almonds.");break;}
case 0:mpr("You feel mildly nauseous.");break;case 1:mpr("You feel slightly ill.");break;case 2:msg::stream << "Wisps of poison gas drift from your "<< your_hand(true) << "." << std::endl;break;case 3:mpr("You feel a strange surge of energy!");break;case 4:mpr("You feel faint for a moment.");break;case 5:mpr("You feel sick.");break;case 6:mpr("You feel odd.");break;case 7:mpr("You feel weak for a moment.");break;case 8:canned_msg(MSG_NOTHING_HAPPENS);break;case 9:if (!silenced(you.x_pos, you.y_pos))mpr("You hear a slurping sound.", MSGCH_SOUND);else if (you.species != SP_MUMMY)mpr("You taste almonds.");
case 1:msg::stream << "Noxious gasses pour from your "<< your_hand(true) << "!" << std::endl;place_cloud(CLOUD_STINK, you.x_pos, you.y_pos,2 + random2(4), KC_YOU);break;}
case 1:msg::stream << "Noxious gasses pour from your "<< your_hand(true) << "!" << std::endl;place_cloud(CLOUD_STINK, you.x_pos, you.y_pos,2 + random2(4), KC_YOU);
case 1:mpr("Noxious gasses pour from your hands!");big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(5));break;
case 1:mpr("Noxious gasses pour from your hands!");big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20,8 + random2(5));break;
break;case 1:msg::stream << "Venomous gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20,7 + random2(7));break;case 2:if (player_res_poison()){canned_msg(MSG_NOTHING_HAPPENS);return (false);}
}break;case 1:msg::stream << "Venomous gasses pour from your "<< your_hand(true) << "!" << std::endl;big_cloud(CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20,7 + random2(7));break;case 2:if (player_res_poison())canned_msg(MSG_NOTHING_HAPPENS);else
break; // end poison
break;}}/* sp_type is the type of the spell* mag_pow is overall power of the spell or effect (i.e. its level)* mag_fail is the degree to which you failed* force_effect forces a certain severity of effect to occur* (set to 100 to avoid forcing.)*/void miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail,int force_effect, const char *cause ){if (sp_type == SPTYP_RANDOM)sp_type = 1 << (random2(SPTYP_LAST_EXPONENT));int sever = (mag_pow*mag_fail*(10+mag_pow)/7 * WILD_MAGIC_NASTINESS)/100;if (force_effect == 100 && random2(40) > sever && random2(40) > sever){canned_msg(MSG_NOTHING_HAPPENS);return;}sever /= 100;#if DEBUG_DIAGNOSTICSconst int old_fail = sever;#endifsever = random2(sever);if (sever > 3)sever = 3;else if (sever < 0)sever = 0;#if DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS, "Sptype: %u, failure1: %d, failure2: %d",sp_type, old_fail, sever );#endifif (force_effect != 100)sever = force_effect;switch (sp_type){case SPTYP_CONJURATION: miscast_conjuration(sever, cause); break;case SPTYP_ENCHANTMENT: miscast_enchantment(sever, cause); break;case SPTYP_TRANSLOCATION: miscast_translocation(sever, cause); break;case SPTYP_SUMMONING: miscast_summoning(sever, cause); break;case SPTYP_DIVINATION: miscast_divination(sever, cause); break;case SPTYP_NECROMANCY: miscast_necromancy(sever, cause); break;case SPTYP_TRANSMIGRATION: miscast_transmigration(sever, cause); break;case SPTYP_FIRE: miscast_fire(sever, cause); break;case SPTYP_ICE: miscast_ice(sever, cause); break;case SPTYP_EARTH: miscast_earth(sever, cause); break;case SPTYP_AIR: miscast_air(sever, cause); break;case SPTYP_POISON: miscast_poison(sever, cause); break;