diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-15 12:44:35 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-15 12:44:35 +0000 |
commit | 148d336e808fb9552692b46f750e8aaa35c92210 (patch) | |
tree | cf514ee380edc5cc356bc81f463c939691c29a5e /crawl-ref/source | |
parent | 9fc1df65621c76cb9edbb781df61fabb21f61342 (diff) | |
download | crawl-ref-148d336e808fb9552692b46f750e8aaa35c92210.tar.gz crawl-ref-148d336e808fb9552692b46f750e8aaa35c92210.zip |
Cleaned up abilities screen information for tutorial.
Small additions to Beogh.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1589 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/menu.cc | 57 | ||||
-rw-r--r-- | crawl-ref/source/menu.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/tutorial.cc | 18 | ||||
-rw-r--r-- | crawl-ref/source/tutorial.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 3 |
7 files changed, 33 insertions, 57 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 48365e448b..ab1fd61ab1 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1724,7 +1724,8 @@ int choose_ability_menu(const std::vector<talent>& talents) } } - std::vector<MenuEntry*> sel = abil_menu.show_ab(); + bool tutorial = (Options.tutorial_left > 0); + std::vector<MenuEntry*> sel = abil_menu.show(false, tutorial); redraw_screen(); if ( sel.empty() ) { diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index e3e48fcc2a..4d88c2160b 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -9,6 +9,7 @@ #include "AppHdr.h" #include "menu.h" #include "macro.h" +#include "tutorial.h" #include "view.h" #include "initfile.h" @@ -95,7 +96,7 @@ void Menu::reset() first_entry = 0; } -std::vector<MenuEntry *> Menu::show(bool reuse_selections) +std::vector<MenuEntry *> Menu::show(bool reuse_selections, bool tut_abil) { cursor_control cs(false); @@ -109,64 +110,18 @@ std::vector<MenuEntry *> Menu::show(bool reuse_selections) if (max_pagesize > 0 && pagesize > max_pagesize) pagesize = max_pagesize; - do_menu(); - - return (sel); -} - -std::vector<MenuEntry *> Menu::show_ab(bool reuse_selections) -{ - cursor_control cs(false); - - if (reuse_selections) - get_selected(&sel); - else - deselect_all(false); - - // Lose lines for the title + room for -more- line. - pagesize = get_number_of_lines() - !!title - 1; - if (max_pagesize > 0 && pagesize > max_pagesize) - pagesize = max_pagesize; - - do_menu_ab(); + do_menu(tut_abil); return (sel); } -void Menu::do_menu_ab() +void Menu::do_menu(bool tut_abil) { draw_menu(); - if (Options.tutorial_left) - { - const int bottom_line = (get_number_of_lines() > 30) ? 30 : get_number_of_lines(); - textcolor(MAGENTA); - gotoxy(1, bottom_line-5); - std::string text = - "This screen shows your character's set of talents. You can gain new " EOL - "abilities via certain items, through religion or by way of mutations. " EOL - "Activation of an ability usually comes at a cost, e.g. nutrition or " EOL - "Magic power. "; - if (you.religion == GOD_TROG) text += - "<w>Renounce Religion<magenta> will make your character leave your god" EOL - "(and usually anger said god), while <w>Berserk<magenta> temporarily increases your" EOL - "damage output in melee fights."; - - formatted_string::parse_block(text, false).display(); - } - - alive = true; - while (alive) + if (tut_abil) { - int keyin = getchm(c_getch); - - if (!process_key( keyin )) - return; + tut_describe_abilities(); } -} - -void Menu::do_menu() -{ - draw_menu(); alive = true; while (alive) diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index ceb0d66066..834946d820 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -184,8 +184,7 @@ public: unsigned char getkey() const { return lastch; } void reset(); - std::vector<MenuEntry *> show(bool reuse_selections = false); - std::vector<MenuEntry *> show_ab(bool reuse_selections = false); + std::vector<MenuEntry *> show(bool reuse_selections = false, bool tut_abil = false); std::vector<MenuEntry *> selected_entries() const; size_t item_count() const { return items.size(); } @@ -222,8 +221,7 @@ protected: bool alive; protected: - void do_menu(); - void do_menu_ab(); + void do_menu(bool tut_abil = false); virtual void draw_select_count(int count, bool force = false); virtual void draw_item( int index ) const; virtual void draw_index_item(int index, const MenuEntry *me) const; diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index c3efdca2a4..17892065d1 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -203,7 +203,7 @@ bool grid_destroys_items( int grid ) // returns 0 if grid is not an altar, else it returns the GOD_* type god_type grid_altar_god( unsigned char grid ) { - if (grid >= DNGN_ALTAR_ZIN && grid <= DNGN_ALTAR_LUGONU) + if (grid >= DNGN_ALTAR_ZIN && grid <= DNGN_ALTAR_BEOGH) return (static_cast<god_type>( grid - DNGN_ALTAR_ZIN + 1 )); return (GOD_NO_GOD); diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 7cf37d0414..e1863f7dca 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -1320,3 +1320,21 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y) Options.tutorial_events[seen_what] = 0; Options.tutorial_left--; } + +void tut_describe_abilities() +{ + const int bottom_line = (get_number_of_lines() > 30) ? 30 : get_number_of_lines(); + textcolor(MAGENTA); + gotoxy(1, bottom_line-5); + std::string text = + "This screen shows your character's set of talents. You can gain new " EOL + "abilities via certain items, through religion or by way of mutations. " EOL + "Activation of an ability usually comes at a cost, e.g. nutrition or " EOL + "Magic power. "; + if (you.religion == GOD_TROG) text += + "<w>Renounce Religion<magenta> will make your character leave your god" EOL + "(and usually anger said god), while <w>Berserk<magenta> temporarily increases your" EOL + "damage output in melee fights."; + + formatted_string::parse_block(text, false).display(); +} diff --git a/crawl-ref/source/tutorial.h b/crawl-ref/source/tutorial.h index 78cac89612..33fc630129 100644 --- a/crawl-ref/source/tutorial.h +++ b/crawl-ref/source/tutorial.h @@ -36,5 +36,6 @@ void taken_new_item(unsigned char item_type); void tutorial_first_monster(const monsters& mon); void tutorial_first_item(const item_def& item); void learned_something_new(tutorial_event_type seen_what, int x=0, int y=0); +void tut_describe_abilities(void); #endif diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index bb648c7741..acb938359a 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -783,6 +783,9 @@ void monster_grid(bool do_updates) // hostile later on, it won't count as a good kill monster->flags |= MF_CREATED_FRIENDLY; monster->flags |= MF_GOD_GIFT; + + // to avoid immobile "followers" + behaviour_event(monster, ME_ALERT, MHITYOU); } } else if (mons_species(monster->type) == MONS_ORC |