git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2916 c06c8d41-db1a-0410-9941-cceddc491573
F7Q5PX44SLPANIZXCY67TG2W5JTRVJMHGQW54VJLGB4XRH7R6JBQC
H2GLADU4H3H3WGWK74KCQD6U447Z723DXMX43OUCFD2JQGRDTUWAC
T2AYVN57EFJQLFUFLAZDXKDAFDGTDLQIEQWQZNYFWJZBYSTYH4QQC
GLHJZ2VIFB3BMTNJ2P6E6OO26QGKSURY7X4ACAGWPSCUSUFNZRGQC
BFZZ7DFLZM4WNHQOKWDJENZOLMXH3UPHZ437BMISYJ3VSO2Y57WQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
NNG27Y5ZQAZX6UD7F7M4F6KEZBEDFXPEEC3LFUSX4ESKT7K6UJQAC
C67GX7W5HBCDPQJRSHWMLM4DUJ3ELFSHH42SVICFJVCJW25T5Z3AC
H5M5SV7QUYUJ2X7U7CQCVGXIODWNRPCOGQO5NUWLUR2GLFBHTSFAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
5TWOIGLM6G4QEASFEKKTK7UBPTL4PXASVEOL5777FPT6RHSUTBBQC
R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC
EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC
MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC
GVCGKTH5IJ4VSQEIN4CRC7ZFVZW26JPIYNCPTO7GY66CSZZEW3ZQC
bool grid_compatible(int grid_wanted, int actual_grid, bool generation = false);
bool monster_habitable_grid(int monster_class, int actual_grid,
bool grid_compatible(dungeon_feature_type grid_wanted,
dungeon_feature_type actual_grid,
bool generation = false);
bool monster_habitable_grid(int monster_class,
dungeon_feature_type actual_grid,
//---------------------------------------------------------------
//
// handle_time
//
// Do various time related actions...
// This function is called about every 20 turns.
//
//---------------------------------------------------------------
void handle_time( long time_delta )
static void hell_effects()
// so as not to reduplicate f(x) calls {dlb}
unsigned int which_miscast = SPTYP_RANDOM;
mpr((temp_rand == 0) ? "\"You will not leave this place.\"" :
(temp_rand == 1) ? "\"Die, mortal!\"" :
(temp_rand == 2) ? "\"We do not forgive those who trespass against us!\"" :
(temp_rand == 3) ? "\"Trespassers are not welcome here!\"" :
(temp_rand == 4) ? "\"You do not belong in this place!\"" :
(temp_rand == 5) ? "\"Leave now, before it is too late!\"" :
(temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
(temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone." :
"Brimstone rains from above." :
(temp_rand == 8) ? "You feel lost and a long, long way from home..." :
(temp_rand == 9) ? "You shiver with fear." :
// warning
(temp_rand == 10) ? "You feel a terrible foreboding..." :
(temp_rand == 11) ? "Something frightening happens." :
(temp_rand == 12) ? "You sense an ancient evil watching you..." :
(temp_rand == 13) ? "You suddenly feel all small and vulnerable." :
(temp_rand == 14) ? "You sense a hostile presence." :
// sounds
(temp_rand == 15) ? "A gut-wrenching scream fills the air!" :
(temp_rand == 16) ? "You hear words spoken in a strange and terrible language..."
: "You hear diabolical laughter!",
(temp_rand < 7 ? MSGCH_TALK :
temp_rand < 10 ? MSGCH_PLAIN :
temp_rand < 15 ? MSGCH_WARN
: MSGCH_SOUND) );
bool summon_instead; // for branching within a single switch {dlb}
int which_beastie = MONS_PROGRAM_BUG; // error trapping {dlb}
unsigned char i; // loop variable {dlb}
bool new_rotting_item = false; //mv: becomes true when some new item becomes rotting
temp_rand = random2(27);
mpr((temp_rand == 0) ? "\"You will not leave this place.\"" :
(temp_rand == 1) ? "\"Die, mortal!\"" :
(temp_rand == 2) ? "\"We do not forgive those who trespass against us!\"" :
(temp_rand == 3) ? "\"Trespassers are not welcome here!\"" :
(temp_rand == 4) ? "\"You do not belong in this place!\"" :
(temp_rand == 5) ? "\"Leave now, before it is too late!\"" :
(temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
(temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone." :
"Brimstone rains from above." :
(temp_rand == 8) ? "You feel lost and a long, long way from home..." :
(temp_rand == 9) ? "You shiver with fear." :
// warning
(temp_rand == 10) ? "You feel a terrible foreboding..." :
(temp_rand == 11) ? "Something frightening happens." :
(temp_rand == 12) ? "You sense an ancient evil watching you..." :
(temp_rand == 13) ? "You suddenly feel all small and vulnerable." :
(temp_rand == 14) ? "You sense a hostile presence." :
// sounds
(temp_rand == 15) ? "A gut-wrenching scream fills the air!" :
(temp_rand == 16) ? "You hear words spoken in a strange and terrible language..."
: "You hear diabolical laughter!",
(temp_rand < 7 ? MSGCH_TALK :
temp_rand < 10 ? MSGCH_PLAIN :
temp_rand < 15 ? MSGCH_WARN
: MSGCH_SOUND) );
if (temp_rand > 3) // 4 in 8 odds {dlb}
which_miscast = SPTYP_NECROMANCY;
else if (temp_rand > 1) // 2 in 8 odds {dlb}
which_miscast = SPTYP_SUMMONING;
else if (temp_rand > 0) // 1 in 8 odds {dlb}
which_miscast = SPTYP_CONJURATION;
else // 1 in 8 odds {dlb}
which_miscast = SPTYP_ENCHANTMENT;
temp_rand = random2(27);
miscast_effect( which_miscast, 4 + random2(6), random2avg(97, 3),
100, "the effects of Hell" );
}
else if (temp_rand > 7) // 10 in 27 odds {dlb}
{
// 60:40 miscast:summon split {dlb}
summon_instead = (random2(5) > 2);
temp_rand = random2(8);
if (temp_rand > 3) // 4 in 8 odds {dlb}
case BRANCH_DIS:
if (summon_instead)
which_beastie = summon_any_demon(DEMON_GREATER);
else
which_miscast = SPTYP_EARTH;
break;
case BRANCH_GEHENNA:
if (summon_instead)
which_beastie = MONS_FIEND;
else
which_miscast = SPTYP_FIRE;
break;
case BRANCH_COCYTUS:
if (summon_instead)
which_beastie = MONS_ICE_FIEND;
else
which_miscast = SPTYP_ICE;
break;
case BRANCH_TARTARUS:
if (summon_instead)
which_beastie = MONS_SHADOW_FIEND;
else
else if (temp_rand > 1) // 2 in 8 odds {dlb}
which_miscast = SPTYP_SUMMONING;
else if (temp_rand > 0) // 1 in 8 odds {dlb}
which_miscast = SPTYP_CONJURATION;
else // 1 in 8 odds {dlb}
which_miscast = SPTYP_ENCHANTMENT;
break;
default: // this is to silence gcc compiler warnings {dlb}
if (summon_instead)
which_beastie = MONS_FIEND;
else
which_miscast = SPTYP_NECROMANCY;
break;
}
switch (you.where_are_you)
{
case BRANCH_DIS:
if (summon_instead)
which_beastie = summon_any_demon(DEMON_GREATER);
else
which_miscast = SPTYP_EARTH;
break;
case BRANCH_GEHENNA:
if (summon_instead)
which_beastie = MONS_FIEND;
else
which_miscast = SPTYP_FIRE;
break;
case BRANCH_COCYTUS:
if (summon_instead)
which_beastie = MONS_ICE_FIEND;
else
which_miscast = SPTYP_ICE;
break;
case BRANCH_TARTARUS:
if (summon_instead)
which_beastie = MONS_SHADOW_FIEND;
else
which_miscast = SPTYP_NECROMANCY;
break;
default: // this is to silence gcc compiler warnings {dlb}
if (summon_instead)
which_beastie = MONS_FIEND;
else
which_miscast = SPTYP_NECROMANCY;
break;
}
// NB: no "else" - 8 in 27 odds that nothing happens through
// first chain {dlb}
// also note that the following is distinct from and in
// addition to the above chain:
// try to summon at least one and up to five random monsters {dlb}
if (one_chance_in(3))
{
create_monster( RANDOM_MONSTER, 0, BEH_HOSTILE,
you.x_pos, you.y_pos, MHITYOU, 250 );
// NB: no "else" - 8 in 27 odds that nothing happens through
// first chain {dlb}
// also note that the following is distinct from and in
// addition to the above chain:
//---------------------------------------------------------------
//
// handle_time
//
// Do various time related actions...
// This function is called about every 20 turns.
//
//---------------------------------------------------------------
void handle_time( long time_delta )
{
int temp_rand; // probability determination {dlb}
// try to summon at least one and up to five random monsters {dlb}
if (one_chance_in(3))
{
create_monster( RANDOM_MONSTER, 0, BEH_HOSTILE,
you.x_pos, you.y_pos, MHITYOU, 250 );
unsigned char i; // loop variable {dlb}
bool new_rotting_item = false; //mv: becomes true when some new item becomes rotting
for (i = 0; i < 4; i++)
{
if (one_chance_in(3))
{
create_monster( RANDOM_MONSTER, 0, BEH_HOSTILE,
you.x_pos, you.y_pos, MHITYOU, 250 );
}
}
}
}
// END - special Hellish things...
// BEGIN - Nasty things happen to people who spend too long in Hell:
if (player_in_hell() && coinflip())
hell_effects();