summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/overmap.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-21 23:16:42 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-21 23:16:42 +0000
commitbf946a85fe99dda39802fd242474264101ddd14f (patch)
treeb82d5360b43986f6fd6162c6d394227d4bb2d18d /crawl-ref/source/overmap.cc
parent476b01632e0b94acf85a25dbad32782720cde555 (diff)
downloadcrawl-ref-bf946a85fe99dda39802fd242474264101ddd14f.tar.gz
crawl-ref-bf946a85fe99dda39802fd242474264101ddd14f.zip
For 2089989, reallow friendlies to walk into your damaging clouds in
some cases, regardless of god. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9145 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/overmap.cc')
-rw-r--r--crawl-ref/source/overmap.cc99
1 files changed, 35 insertions, 64 deletions
diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc
index d491f551e8..3890c33b95 100644
--- a/crawl-ref/source/overmap.cc
+++ b/crawl-ref/source/overmap.cc
@@ -109,18 +109,13 @@ bool move_notable_thing(const coord_def& orig, const coord_def& dest)
static dungeon_feature_type portal_to_feature(portal_type p)
{
- switch ( p )
+ switch (p)
{
- case PORTAL_LABYRINTH:
- return DNGN_ENTER_LABYRINTH;
- case PORTAL_HELL:
- return DNGN_ENTER_HELL;
- case PORTAL_ABYSS:
- return DNGN_ENTER_ABYSS;
- case PORTAL_PANDEMONIUM:
- return DNGN_ENTER_PANDEMONIUM;
- default:
- return DNGN_FLOOR;
+ case PORTAL_LABYRINTH: return DNGN_ENTER_LABYRINTH;
+ case PORTAL_HELL: return DNGN_ENTER_HELL;
+ case PORTAL_ABYSS: return DNGN_ENTER_ABYSS;
+ case PORTAL_PANDEMONIUM: return DNGN_ENTER_PANDEMONIUM;
+ default: return DNGN_FLOOR;
}
}
@@ -128,16 +123,11 @@ static const char* portaltype_to_string(portal_type p)
{
switch ( p )
{
- case PORTAL_LABYRINTH:
- return "<cyan>Labyrinth:</cyan>";
- case PORTAL_HELL:
- return "<red>Hell:</red>";
- case PORTAL_ABYSS:
- return "<magenta>Abyss:</magenta>";
- case PORTAL_PANDEMONIUM:
- return "<blue>Pan:</blue>";
- default:
- return "<lightred>Buggy:</lightred>";
+ case PORTAL_LABYRINTH: return "<cyan>Labyrinth:</cyan>";
+ case PORTAL_HELL: return "<red>Hell:</red>";
+ case PORTAL_ABYSS: return "<magenta>Abyss:</magenta>";
+ case PORTAL_PANDEMONIUM: return "<blue>Pan:</blue>";
+ default: return "<lightred>Buggy:</lightred>";
}
}
@@ -145,32 +135,19 @@ static std::string shoptype_to_string(shop_type s)
{
switch ( s )
{
- case SHOP_WEAPON:
- return "(";
- case SHOP_WEAPON_ANTIQUE:
- return "<yellow>(</yellow>";
- case SHOP_ARMOUR:
- return "[";
- case SHOP_ARMOUR_ANTIQUE:
- return "<yellow>[</yellow>";
- case SHOP_GENERAL:
- return "*";
- case SHOP_GENERAL_ANTIQUE:
- return "<yellow>*</yellow>";
- case SHOP_JEWELLERY:
- return "=";
- case SHOP_WAND:
- return "/";
- case SHOP_BOOK:
- return "+";
- case SHOP_FOOD:
- return "%";
- case SHOP_DISTILLERY:
- return "!";
- case SHOP_SCROLL:
- return "?";
- default:
- return "x";
+ case SHOP_WEAPON: return "(";
+ case SHOP_WEAPON_ANTIQUE: return "<yellow>(</yellow>";
+ case SHOP_ARMOUR: return "[";
+ case SHOP_ARMOUR_ANTIQUE: return "<yellow>[</yellow>";
+ case SHOP_GENERAL: return "*";
+ case SHOP_GENERAL_ANTIQUE: return "<yellow>*</yellow>";
+ case SHOP_JEWELLERY: return "=";
+ case SHOP_WAND: return "/";
+ case SHOP_BOOK: return "+";
+ case SHOP_FOOD: return "%";
+ case SHOP_DISTILLERY: return "!";
+ case SHOP_SCROLL: return "?";
+ default: return "x";
}
}
@@ -664,16 +641,11 @@ portal_type feature_to_portal( unsigned char feat )
{
switch (feat)
{
- case DNGN_ENTER_LABYRINTH:
- return PORTAL_LABYRINTH;
- case DNGN_ENTER_HELL:
- return PORTAL_HELL;
- case DNGN_ENTER_ABYSS:
- return PORTAL_ABYSS;
- case DNGN_ENTER_PANDEMONIUM:
- return PORTAL_PANDEMONIUM;
- default:
- return PORTAL_NONE;
+ case DNGN_ENTER_LABYRINTH: return PORTAL_LABYRINTH;
+ case DNGN_ENTER_HELL: return PORTAL_HELL;
+ case DNGN_ENTER_ABYSS: return PORTAL_ABYSS;
+ case DNGN_ENTER_PANDEMONIUM: return PORTAL_PANDEMONIUM;
+ default: return PORTAL_NONE;
}
}
@@ -729,8 +701,7 @@ void _seen_other_thing( dungeon_feature_type which_thing, const coord_def& pos )
////////////////////////////////////////////////////////////////////////
-void set_level_annotation(std::string str,
- level_id li)
+void set_level_annotation(std::string str, level_id li)
{
if (str.empty())
{
@@ -756,8 +727,7 @@ std::string get_level_annotation(level_id li)
return (i->second);
}
-bool level_annotation_has(std::string find,
- level_id li)
+bool level_annotation_has(std::string find, level_id li)
{
std::string str = get_level_annotation(li);
@@ -791,19 +761,20 @@ void annotate_level()
li = li2;
}
- if (get_level_annotation(li).length() > 0)
+ if (!get_level_annotation(li).empty())
{
mpr("Current level annotation is:", MSGCH_PROMPT);
mpr(get_level_annotation(li).c_str() );
}
- mpr( "Set level annotation to what (using ! forces prompt)? ", MSGCH_PROMPT );
+ mpr("Set level annotation to what (using ! forces prompt)? ",
+ MSGCH_PROMPT);
char buf[77];
if (cancelable_get_line( buf, sizeof(buf) ))
return;
- if (strlen(buf) == 0)
+ if (buf[0] == 0)
{
if (get_level_annotation(li).length() > 0)
{