Removed the limit on how many monsters can be generated as I don't think it was ever being reached.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1257 c06c8d41-db1a-0410-9941-cceddc491573
JNB3PBPBJHDUHH47ZICB25QENPTMLYK7CXC5BXRVWZ3J3ZZPKCUAC
TCB6NKWD6VFEKM43J3ZIJJPRL7M4PRNWTELT4G2XWI4EMUDZIZLQC
5O7S2U2B5R7HYML3D66557BC56RG6XH66PFYP6NDJZMXOABMEUKQC
6L4EP4ZRWWYLT55PD5KTTJON5J2JB5VV5MWNHF5VPZQZ5BKEYZ4QC
FUQ25GQNKUQCAZRRWDOOWDRFQP7X55BL57BTP55QX2B4VIPC4LOQC
3XZOL3FFQZITUJIGDD6B6V6ZYMBN524JKNN6ZPJAXEC7RY433I3QC
77H4BWWPPGLM3PLZH4QTAJRXIZTSDVNCOKZE223I437FN2UJ34RQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
5UVDIVD4NSXA52U4QMQIVST3GSZJ2A2YZK3RUEXKPM43YVQ7LI5AC
MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC
XAFFD52IHN6FWFR2TT5F2KCUS7HAVCBI5CWTFMKPQG77GGTGAHLAC
BYOD7DKJ23XDIH5VQG5IG7WZTDI4QM2U5G6IX6JHL6HBSYFJHKAQC
static void builder_monsters(int level_number, char level_type, int mon_wanted)
// Place uniques on the level.
// There is a hidden dependency on the player's actual
// location (through your_branch().)
// Return the number of uniques placed.
static int place_uniques(int level_number, char level_type)
if (place_monster( not_used, RANDOM_MONSTER, level_number, BEH_SLEEP,
MHITNOT, false, 1, 1, true, PROX_ANYWHERE, 250, 0,
no_monster_zones ))
int which_unique = -1; // 30 in total
while(which_unique < 0 || you.unique_creatures[which_unique])
totalplaced++;
// sometimes, we just quit if a unique is already placed.
if (which_unique >= 0 && !one_chance_in(3))
{
which_unique = -1;
break;
}
which_unique = pick_unique(level_number);
}
// usually, we'll have quit after a few tries. Make sure we don't
// create unique[-1] by accident.
if (which_unique == -1)
break;
// note: unique_creatures 40 + used by unique demons
if (place_monster( not_used, which_unique, level_number,
BEH_SLEEP, MHITNOT, false, 1, 1, true,
PROX_ANYWHERE, 250, 0, no_monster_zones ))
{
++num_placed;
// Unique beasties:
if (level_number > 0
&& you.level_type == LEVEL_DUNGEON // avoid generating on temp levels
&& branches[(int)you.where_are_you].has_uniques)
static int place_monster_vector(int* montypes, int numtypes,
int level_number, int num_to_place)
{
int result = 0;
int not_used = 0;
for (int i = 0; i < num_to_place; i++)
int which_unique = -1; // 30 in total
while(which_unique < 0 || you.unique_creatures[which_unique])
{
// sometimes, we just quit if a unique is already placed.
if (which_unique >= 0 && !one_chance_in(3))
{
which_unique = -1;
break;
}
which_unique = pick_unique(level_number);
}
// usually, we'll have quit after a few tries. Make sure we don't
// create unique[-1] by accident.
if (which_unique == -1)
break;
// note: unique_creatures 40 + used by unique demons
if (place_monster( not_used, which_unique, level_number,
BEH_SLEEP, MHITNOT, false, 1, 1, true,
PROX_ANYWHERE, 250, 0, no_monster_zones ))
{
totalplaced++;
}
++result;
aq_creatures = random2avg(9, 2) + (random2(lava_spaces) / 10);
if (aq_creatures > 15)
aq_creatures = 15;
for (i = 0; i < aq_creatures; i++)
{
if (place_monster( not_used, swimming_things[ random2(4) ],
level_number, BEH_SLEEP, MHITNOT,
false, 1, 1, true, PROX_ANYWHERE, 250, 0,
no_monster_zones ))
{
totalplaced++;
}
if (totalplaced > 99)
break;
}
place_monster_vector(swimming_things, 4, level_number,
std::min(random2avg(9, 2) +
(random2(lava_spaces) / 10), 15));
aq_creatures = random2avg(9, 2) + (random2(water_spaces) / 10);
static void builder_monsters(int level_number, char level_type, int mon_wanted)
{
int not_used = 0;
if (level_type == LEVEL_PANDEMONIUM ||
player_in_branch(BRANCH_ECUMENICAL_TEMPLE))
return;
for (int i = 0; i < mon_wanted; i++)
place_monster( not_used, RANDOM_MONSTER, level_number, BEH_SLEEP,
MHITNOT, false, 1, 1, true, PROX_ANYWHERE, 250, 0,
no_monster_zones );
for (i = 0; i < aq_creatures; i++)
{
if (place_monster( not_used, swimming_things[ random2(4) ],
level_number, BEH_SLEEP, MHITNOT,
false, 1, 1, true, PROX_ANYWHERE, 250, 0,
no_monster_zones ))
{
totalplaced++;
}
// Special handling
if (player_in_branch( BRANCH_CRYPT ))
{
if (one_chance_in(3))
mons_place( MONS_CURSE_SKULL, BEH_SLEEP, MHITNOT, false, 0, 0 );