summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-15 15:03:31 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-15 15:03:31 +0000
commitdc6826e6b1d0672e12cc13aae63c0b9192bc72dc (patch)
treea78857b3710d3fde90b37ef821ca48e0d0ef1b64
parentc4fe8d851bbeceb9c768dc72f53378360f5938f2 (diff)
downloadcrawl-ref-dc6826e6b1d0672e12cc13aae63c0b9192bc72dc.tar.gz
crawl-ref-dc6826e6b1d0672e12cc13aae63c0b9192bc72dc.zip
Treat all bazaars as noteworthy, not just the first one.
Since bazaars are currently the only type of portal chambers, just refer to them as bazaars in the notes. (The subchecks for the "bazaar" flag don't work with packed_place, unfortunately.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5848 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/notes.cc43
-rw-r--r--crawl-ref/source/place.cc19
2 files changed, 33 insertions, 29 deletions
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc
index 40bee46258..22638449f2 100644
--- a/crawl-ref/source/notes.cc
+++ b/crawl-ref/source/notes.cc
@@ -89,16 +89,16 @@ static bool _is_noteworthy_dlevel( unsigned short place )
// Special levels (Abyss, etc.) are always interesting.
if (lev == 0xFF)
- return true;
+ return (true);
if (lev == _dungeon_branch_depth(branch)
|| branch == BRANCH_MAIN_DUNGEON && (lev % 5) == 0
|| branch != BRANCH_MAIN_DUNGEON && lev == 1)
{
- return true;
+ return (true);
}
- return false;
+ return (false);
}
// Is a note worth taking?
@@ -124,7 +124,7 @@ static bool _is_noteworthy( const Note& note )
|| note.type == NOTE_MOLLIFY_GOD
|| note.type == NOTE_DEATH)
{
- return true;
+ return (true);
}
// Never noteworthy, hooked up for fun or future use.
@@ -132,21 +132,21 @@ static bool _is_noteworthy( const Note& note )
|| note.type == NOTE_MAXHP_CHANGE
|| note.type == NOTE_MAXMP_CHANGE)
{
- return false;
+ return (false);
}
// God powers might be noteworthy if it's an actual power.
if (note.type == NOTE_GOD_POWER
&& _real_god_power(note.first, note.second) == -1)
{
- return false;
+ return (false);
}
// HP noteworthiness is handled in its own function.
if (note.type == NOTE_HP_CHANGE
&& !_is_noteworthy_hp(note.first, note.second))
{
- return false;
+ return (false);
}
// Skills are noteworthy if in the skill value list or if
@@ -157,27 +157,28 @@ static bool _is_noteworthy( const Note& note )
|| _is_noteworthy_skill_level(note.second)
|| Options.note_skill_max && _is_highest_skill(note.first))
{
- return true;
+ return (true);
}
- return false;
+ return (false);
}
if (note.type == NOTE_DUNGEON_LEVEL_CHANGE)
{
if (!_is_noteworthy_dlevel(note.packed_place))
- return false;
+ return (false);
- // Labyrinths are always interesting.
+ // Labyrinths and portal vaults are always interesting.
if ((note.packed_place & 0xFF) == 0xFF
- && (note.packed_place >> 8) == LEVEL_LABYRINTH)
+ && ((note.packed_place >> 8) == LEVEL_LABYRINTH
+ || (note.packed_place >> 8) == LEVEL_PORTAL_VAULT))
{
- return true;
+ return (true);
}
}
// Learning a spell is always noteworthy if note_all_spells is set.
if (note.type == NOTE_LEARN_SPELL && Options.note_all_spells)
- return true;
+ return (true);
for (unsigned i = 0; i < note_list.size(); ++i)
{
@@ -189,18 +190,18 @@ static bool _is_noteworthy( const Note& note )
{
case NOTE_DUNGEON_LEVEL_CHANGE:
if (rnote.packed_place == note.packed_place)
- return false;
+ return (false);
break;
case NOTE_LEARN_SPELL:
if (spell_difficulty(static_cast<spell_type>(rnote.first))
>= spell_difficulty(static_cast<spell_type>(note.first)))
{
- return false;
+ return (false);
}
break;
case NOTE_GOD_POWER:
if (rnote.first == note.first && rnote.second == note.second)
- return false;
+ return (false);
break;
case NOTE_HP_CHANGE:
// Not if we have a recent warning
@@ -208,17 +209,17 @@ static bool _is_noteworthy( const Note& note )
if (note.turn - rnote.turn < 5
&& note.first * 2 >= rnote.first)
{
- return false;
+ return (false);
}
break;
default:
mpr("Buggy note passed: unknown note type");
// Return now, rather than give a "Buggy note passed" message
// for each note of the matching type in the note list.
- return true;
+ return (true);
}
}
- return true;
+ return (true);
}
static const char* _number_to_ordinal( int number )
@@ -377,7 +378,7 @@ void Note::check_milestone() const
if (type == NOTE_DUNGEON_LEVEL_CHANGE)
{
const int br = place_branch(packed_place),
- dep = place_depth(packed_place);
+ dep = place_depth(packed_place);
if (br != -1)
{
diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc
index fc89dbd60b..efaf31ede9 100644
--- a/crawl-ref/source/place.cc
+++ b/crawl-ref/source/place.cc
@@ -49,16 +49,18 @@ unsigned short get_packed_place( branch_type branch, int subdepth,
{
unsigned short place = (unsigned short)
( (static_cast<int>(branch) << 8) | (subdepth & 0xFF) );
+
if (level_type != LEVEL_DUNGEON)
place = (unsigned short) ( (static_cast<int>(level_type) << 8) | 0xFF );
+
return place;
}
unsigned short get_packed_place()
{
- return get_packed_place( you.where_are_you,
- subdungeon_depth(you.where_are_you, you.your_level),
- you.level_type );
+ return get_packed_place(you.where_are_you,
+ subdungeon_depth(you.where_are_you, you.your_level),
+ you.level_type);
}
bool single_level_branch( branch_type branch )
@@ -87,10 +89,12 @@ std::string place_name( unsigned short place, bool long_name,
case LEVEL_LABYRINTH:
return ( long_name ? "a Labyrinth" : "Lab" );
case LEVEL_PORTAL_VAULT:
- if ( you.level_type_name == "bazaar" )
+ // FIXME: While there are no further portal vaults, declare all
+ // portal vaults as bazaars.
+// if (you.level_type_name == "bazaar")
return ( long_name ? "a Bazaar" : "Bazaar" );
- return ( long_name ? "a Portal Chamber" : "Port" );
+// return ( long_name ? "a Portal Chamber" : "Port" );
default:
return ( long_name ? "Buggy Badlands" : "Bug" );
}
@@ -135,9 +139,8 @@ std::string prep_branch_level_name(unsigned short packed_place)
std::string place = place_name( packed_place, true, true );
if (place.length() && place != "Pandemonium")
place[0] = tolower(place[0]);
- return (place.find("level") == 0?
- "on " + place
- : "in " + place);
+ return (place.find("level") == 0 ? "on " + place
+ : "in " + place);
}
// Use current branch and depth