From bd1d91f4b91afaf8dd80c329c78b775f43382b87 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 6 Mar 2007 05:56:50 +0000 Subject: Kill hard tabs. redraw_dexterity now implies redraw_evasion. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@987 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/notes.cc | 148 +++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'crawl-ref/source/notes.cc') diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc index 496b83f336..286bdab320 100644 --- a/crawl-ref/source/notes.cc +++ b/crawl-ref/source/notes.cc @@ -39,8 +39,8 @@ static bool is_noteworthy_skill_level( int level ) { unsigned i; for ( i = 0; i < Options.note_skill_levels.size(); ++i ) - if ( level == Options.note_skill_levels[i] ) - return true; + if ( level == Options.note_skill_levels[i] ) + return true; return false; } @@ -48,10 +48,10 @@ static bool is_highest_skill( int skill ) { for ( int i = 0; i < NUM_SKILLS; ++i ) { - if ( i == skill ) - continue; - if ( you.skills[i] >= you.skills[skill] ) - return false; + if ( i == skill ) + continue; + if ( you.skills[i] >= you.skills[skill] ) + return false; } return true; } @@ -59,7 +59,7 @@ static bool is_highest_skill( int skill ) static bool is_noteworthy_hp( int hp, int maxhp ) { return (hp > 0 && Options.note_hp_percent && - hp <= (maxhp * Options.note_hp_percent) / 100); + hp <= (maxhp * Options.note_hp_percent) / 100); } static int dungeon_branch_depth( unsigned char branch ) @@ -76,12 +76,12 @@ 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; + (branch == BRANCH_MAIN_DUNGEON && (lev % 5) == 0) || + (branch != BRANCH_MAIN_DUNGEON && lev == 1) ) + return true; return false; } @@ -94,45 +94,45 @@ static bool is_noteworthy( const Note& note ) { /* always noteworthy */ if ( note.type == NOTE_XP_LEVEL_CHANGE || - note.type == NOTE_GET_GOD || - note.type == NOTE_GOD_GIFT || - note.type == NOTE_GET_MUTATION || - note.type == NOTE_LOSE_MUTATION || + note.type == NOTE_GET_GOD || + note.type == NOTE_GOD_GIFT || + note.type == NOTE_GET_MUTATION || + note.type == NOTE_LOSE_MUTATION || note.type == NOTE_SEEN_MONSTER || - note.type == NOTE_KILL_MONSTER || + note.type == NOTE_KILL_MONSTER || note.type == NOTE_POLY_MONSTER || - note.type == NOTE_USER_NOTE || + note.type == NOTE_USER_NOTE || note.type == NOTE_MESSAGE || - note.type == NOTE_LOSE_GOD || + note.type == NOTE_LOSE_GOD || note.type == NOTE_MOLLIFY_GOD ) - return true; + return true; /* never noteworthy, hooked up for fun or future use */ if ( note.type == NOTE_GET_ITEM || - note.type == NOTE_MP_CHANGE || - note.type == NOTE_MAXHP_CHANGE || - note.type == NOTE_MAXMP_CHANGE ) - return false; + note.type == NOTE_MP_CHANGE || + note.type == NOTE_MAXHP_CHANGE || + note.type == NOTE_MAXMP_CHANGE ) + 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; + real_god_power(note.first, note.second) == -1 ) + 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; + !is_noteworthy_hp(note.first, note.second) ) + return false; /* skills are noteworthy if in the skill value list or if it's a new maximal skill (depending on options) */ if ( note.type == NOTE_GAIN_SKILL ) { - if ( is_noteworthy_skill_level(note.second) ) - return true; - if ( Options.note_skill_max && is_highest_skill(note.first) ) - return true; - return false; + if ( is_noteworthy_skill_level(note.second) ) + return true; + if ( Options.note_skill_max && is_highest_skill(note.first) ) + return true; + return false; } if ( note.type == NOTE_DUNGEON_LEVEL_CHANGE ) @@ -147,41 +147,41 @@ static bool is_noteworthy( const Note& note ) /* 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 ) { - if ( note_list[i].type != note.type ) - continue; - const Note& rnote( note_list[i] ); - switch ( note.type ) + if ( note_list[i].type != note.type ) + continue; + const Note& rnote( note_list[i] ); + switch ( note.type ) { - case NOTE_DUNGEON_LEVEL_CHANGE: - if ( rnote.packed_place == note.packed_place ) - return false; - break; - case NOTE_LEARN_SPELL: - if (spell_difficulty(rnote.first) >= spell_difficulty(note.first)) - return false; - break; - case NOTE_GOD_POWER: - if ( rnote.first == note.first && rnote.second == note.second ) - return false; - break; - case NOTE_ID_ITEM: - /* re-id'ing an item, e.g. second copy of book, isn't - noteworthy */ - if ( rnote.name == note.name ) - return false; - break; - case NOTE_HP_CHANGE: - /* not if we have a recent warning */ - if ( (note.turn - rnote.turn < 5) && - /* unless we've lost half our HP since then */ - (note.first * 2 >= rnote.first) ) - return false; - break; - default: + case NOTE_DUNGEON_LEVEL_CHANGE: + if ( rnote.packed_place == note.packed_place ) + return false; + break; + case NOTE_LEARN_SPELL: + if (spell_difficulty(rnote.first) >= spell_difficulty(note.first)) + return false; + break; + case NOTE_GOD_POWER: + if ( rnote.first == note.first && rnote.second == note.second ) + return false; + break; + case NOTE_ID_ITEM: + /* re-id'ing an item, e.g. second copy of book, isn't + noteworthy */ + if ( rnote.name == note.name ) + return false; + break; + case NOTE_HP_CHANGE: + /* not if we have a recent warning */ + if ( (note.turn - rnote.turn < 5) && + /* unless we've lost half our HP since then */ + (note.first * 2 >= rnote.first) ) + 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. @@ -194,11 +194,11 @@ static bool is_noteworthy( const Note& note ) const char* number_to_ordinal( int number ) { const char* ordinals[5] = { "first", "second", "third", "fourth", - "fifth" }; + "fifth" }; if ( number < 1) - return "[unknown ordinal (too small)]"; + return "[unknown ordinal (too small)]"; if ( number > 5 ) - return "[unknown ordinal (too big)]"; + return "[unknown ordinal (too big)]"; return ordinals[number-1]; } @@ -332,7 +332,7 @@ Note::Note( NOTE_TYPES t, int f, int s, const char* n, const char* d ) : type(t), first(f), second(s) { if (n) - name = std::string(n); + name = std::string(n); if (d) desc = std::string(d); turn = you.num_turns; @@ -371,7 +371,7 @@ bool notes_are_active() void take_note( const Note& note, bool force ) { if ( notes_active && (force || is_noteworthy(note)) ) - note_list.push_back( note ); + note_list.push_back( note ); } void activate_notes( bool active ) @@ -384,20 +384,20 @@ void save_notes( FILE* fp ) writeLong( fp, NOTES_VERSION_NUMBER ); writeLong( fp, note_list.size() ); for ( unsigned i = 0; i < note_list.size(); ++i ) - note_list[i].save(fp); + note_list[i].save(fp); } void load_notes( FILE* fp ) { if ( readLong(fp) != NOTES_VERSION_NUMBER ) - return; + return; const long num_notes = readLong(fp); for ( long i = 0; i < num_notes; ++i ) { - Note new_note; - new_note.load(fp); - note_list.push_back(new_note); + Note new_note; + new_note.load(fp); + note_list.push_back(new_note); } } @@ -407,7 +407,7 @@ void make_user_note() char buf[400]; bool validline = !cancelable_get_line(buf, sizeof(buf)); if ( !validline || (!*buf) ) - return; + return; Note unote(NOTE_USER_NOTE); unote.name = std::string(buf); take_note(unote); -- cgit v1.2.3-54-g00ecf