summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/zotdef.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-11-04 17:18:19 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-11-04 17:18:19 +0100
commit2d0488338ac2a0388167c9e8b73766ae8af1e8d4 (patch)
treec92aa786daa5e2f0782de9234d70fcb0fdfaf700 /crawl-ref/source/zotdef.cc
parent177cfa8d1158dd7c2ed8c995cf1ee706f1492f80 (diff)
parent59910180e554e796fe4a8b1f095f88dccbe0ac89 (diff)
downloadcrawl-ref-2d0488338ac2a0388167c9e8b73766ae8af1e8d4.tar.gz
crawl-ref-2d0488338ac2a0388167c9e8b73766ae8af1e8d4.zip
Merge branch 'master' into mon-pick
Merge commits instead of rerere suck, but not being able to comfortably use the test rig sucks even more.
Diffstat (limited to 'crawl-ref/source/zotdef.cc')
-rw-r--r--crawl-ref/source/zotdef.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/crawl-ref/source/zotdef.cc b/crawl-ref/source/zotdef.cc
index 32062d28ef..22ec3fca87 100644
--- a/crawl-ref/source/zotdef.cc
+++ b/crawl-ref/source/zotdef.cc
@@ -4,8 +4,10 @@
**/
#include "AppHdr.h"
+#include "bitary.h"
#include "branch.h"
+#include "describe.h"
#include "directn.h"
#include "dungeon.h" // for Zotdef unique placement
#include "env.h"
@@ -27,6 +29,7 @@
#include "random.h"
#include "religion.h"
#include "state.h"
+#include "stuff.h"
#include "terrain.h"
#include "traps.h"
#include "libutil.h"
@@ -128,7 +131,7 @@ static branch_type _zotdef_random_branch()
static int _mon_strength(monster_type mon_type)
{
- monsterentry *mentry = get_monster_data(mon_type);
+ const monsterentry *mentry = get_monster_data(mon_type);
if (!mentry)
return 0; // sanity
int strength = (mentry->hpdice[0] * mentry->exp_mod) / 10;
@@ -435,7 +438,7 @@ static void _insect_wave(int power)
wave_name("INSECT WAVE");
monster_type insects[] = {MONS_WORKER_ANT, MONS_KILLER_BEE, MONS_YELLOW_WASP,
MONS_GOLIATH_BEETLE, MONS_QUEEN_BEE, MONS_WOLF_SPIDER, MONS_BUTTERFLY,
- MONS_BOULDER_BEETLE, MONS_GIANT_MITE, MONS_BUMBLEBEE, MONS_REDBACK,
+ MONS_BOULDER_BEETLE, MONS_GIANT_MITE, MONS_FIREFLY, MONS_REDBACK,
MONS_VAMPIRE_MOSQUITO, MONS_RED_WASP, MONS_SOLDIER_ANT, MONS_QUEEN_ANT,
MONS_GIANT_COCKROACH, MONS_BORING_BEETLE, MONS_TRAPDOOR_SPIDER,
MONS_SCORPION, MONS_GIANT_CENTIPEDE, END};
@@ -464,7 +467,7 @@ static void _pan_wave(int power)
while (env.mons_alloc[i] == MONS_PROGRAM_BUG)
{
monster_type mon_type = static_cast<monster_type>(random2(NUM_MONSTERS));
- monsterentry *mentry = get_monster_data(mon_type);
+ const monsterentry *mentry = get_monster_data(mon_type);
int pow = random2avg(power, 2);
switch (mentry->basechar)
{
@@ -568,7 +571,7 @@ static monster_type _get_zotdef_monster(level_id &place, int power)
}
// Calculate strength
- monsterentry *mentry = get_monster_data(mon_type);
+ const monsterentry *mentry = get_monster_data(mon_type);
if (!mentry)
continue; // sanity
if (mentry == get_monster_data(MONS_PROGRAM_BUG))
@@ -626,7 +629,7 @@ static monster_type _get_zotdef_monster(level_id &place, int power)
continue;
// Less OOD allowed on early levels
- if (diff < std::min(-3,-power))
+ if (diff < min(-3,-power))
continue;
if (random2avg(100, 2) <= chance)
@@ -750,14 +753,14 @@ void zotdef_set_wave()
dprf("NEW WAVE: %s", zotdef_debug_wave_desc().c_str());
}
-std::string zotdef_debug_wave_desc()
+string zotdef_debug_wave_desc()
{
- std::string list = you.zotdef_wave_name + " [";
+ string list = you.zotdef_wave_name + " [";
for (int i = 0; i <= (crawl_state.game_is_zotdef() ? NSLOTS : 9); i++)
{
if (i)
list += ", ";
- monsterentry *mentry = get_monster_data(env.mons_alloc[i]);
+ const monsterentry *mentry = get_monster_data(env.mons_alloc[i]);
if (!env.mons_alloc[i])
list += "EMPTY";
else if (mentry)
@@ -947,7 +950,7 @@ bool zotdef_create_altar(bool wizmode)
if (specs[0] == '\0')
return false;
- std::string spec = lowercase_string(specs);
+ string spec = lowercase_string(specs);
god_type god = GOD_NO_GOD;
@@ -958,7 +961,7 @@ bool zotdef_create_altar(bool wizmode)
if (!wizmode && is_unavailable_god(gi))
continue;
- if (lowercase_string(god_name(gi)).find(spec) != std::string::npos)
+ if (lowercase_string(god_name(gi)).find(spec) != string::npos)
{
god = gi;
break;
@@ -994,7 +997,7 @@ bool create_zotdef_ally(monster_type mtyp, const char *successmsg)
}
dist abild;
- std::string msg = "Make ";
+ string msg = "Make ";
msg += get_monster_data(mtyp)->name;
msg += " where?";