summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-19 14:28:34 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-19 14:28:34 +0000
commit664fb9584c981672c32b2f245e486d35cda6170d (patch)
treed2b7d8b39dd7813580e8ae5168c8271c3ad7b7ef
parent312dc18d5eb1785e8fd4169e6fd72fedf8abb244 (diff)
downloadcrawl-ref-664fb9584c981672c32b2f245e486d35cda6170d.tar.gz
crawl-ref-664fb9584c981672c32b2f245e486d35cda6170d.zip
Tutorial fix and improvements along with fixes 1832819 and 1831983.
(Horn mutation makeing helmet slot "restricted", and autobutcher respecting !w) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2873 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc16
-rw-r--r--crawl-ref/source/describe.cc10
-rw-r--r--crawl-ref/source/food.cc1
-rw-r--r--crawl-ref/source/monstuff.cc6
-rw-r--r--crawl-ref/source/player.cc4
-rw-r--r--crawl-ref/source/spl-book.cc2
-rw-r--r--crawl-ref/source/spl-book.h2
-rw-r--r--crawl-ref/source/tutorial.cc50
-rw-r--r--crawl-ref/source/tutorial.h4
9 files changed, 56 insertions, 39 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index f55c5dbe7d..a32a1f67e4 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1014,15 +1014,19 @@ static void input()
{
tutorial_healing_reminder();
}
- else if (!you.running &&
- Options.tutorial_events[TUT_SHIFT_RUN] &&
- you.num_turns >= 200)
+ else if (!you.running
+ && Options.tutorial_events[TUT_SHIFT_RUN]
+ && you.num_turns >= 200
+ && you.hp == you.hp_max
+ && you.magic_points == you.max_magic_points)
{
learned_something_new(TUT_SHIFT_RUN);
}
- else if (!you.running &&
- Options.tutorial_events[TUT_MAP_VIEW] &&
- you.num_turns >= 500)
+ else if (!you.running
+ && Options.tutorial_events[TUT_MAP_VIEW]
+ && you.num_turns >= 500
+ && you.hp == you.hp_max
+ && you.magic_points == you.max_magic_points)
{
learned_something_new(TUT_MAP_VIEW);
}
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 34e699fa6d..e37251368f 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3365,6 +3365,8 @@ static void show_item_description(const item_def &item)
const std::string description = get_item_description( item, 1 );
print_description(description);
+ if (Options.tutorial_left)
+ tutorial_describe_item(item);
if (item.has_spells())
{
@@ -3423,13 +3425,9 @@ void describe_item( item_def &item, bool allow_inscribe )
break;
}
- if (Options.tutorial_left)
- {
- tutorial_describe_item(item);
- getch();
- }
// Don't ask during tutorial, or if there aren't enough rows left
- else if (allow_inscribe && wherey() <= get_number_of_lines() - 3)
+ if (!Options.tutorial_left && allow_inscribe
+ && wherey() <= get_number_of_lines() - 3)
{
gotoxy(1, wherey() + 2);
formatted_string::parse_string(
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 61593ad88a..1dc360886b 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -167,6 +167,7 @@ static bool find_butchering_implement( bool fallback )
&& item_known_uncursed(you.inv[i])
&& item_type_known(you.inv[i])
&& get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION
+ && !has_warning_inscription(you.inv[i], OPER_WIELD) // don't even ask
&& can_wield( &you.inv[i] ))
{
mpr("Switching to a butchering implement.");
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 6f07e24420..adf19e2e98 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -329,7 +329,11 @@ static void place_monster_corpse(const monsters *monster)
// Don't care if 'o' is changed, and it shouldn't be (corpses don't stack)
move_item_to_grid( &o, monster->x, monster->y );
if (see_grid(monster->x, monster->y))
- tutorial_dissection_reminder();
+ {
+ tutorial_dissection_reminder(
+ mons_corpse_effect(monster->type) != CE_POISONOUS
+ || player_res_poison() > 0 );
+ }
} // end place_monster_corpse()
static void tutorial_inspect_kill()
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 4e657821d0..efacc4313a 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -445,8 +445,8 @@ bool you_can_wear(int eq, bool special_armour)
if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS))
return false;
- if (you.species == SP_MINOTAUR && eq == EQ_HELMET)
- return false;
+ if (you.mutation[MUT_HORNS] && eq == EQ_HELMET)
+ return (special_armour);
if (you.species == SP_GHOUL && eq == EQ_GLOVES)
return false;
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index fab5a6db33..9b4535d3dc 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -1140,7 +1140,7 @@ bool undead_cannot_memorise(spell_type spell, char being)
return false;
} // end undead_cannot_memorise()
-bool player_can_memorise(item_def &book)
+bool player_can_memorise(const item_def &book)
{
if (book.base_type != OBJ_BOOKS || book.sub_type == BOOK_MANUAL)
return false;
diff --git a/crawl-ref/source/spl-book.h b/crawl-ref/source/spl-book.h
index 29a01280fe..7e6fe1cdf8 100644
--- a/crawl-ref/source/spl-book.h
+++ b/crawl-ref/source/spl-book.h
@@ -48,7 +48,7 @@ int read_book( item_def &item, read_book_action_type action );
/* ***********************************************************************
* called from: acr
* *********************************************************************** */
-bool player_can_memorise(item_def &book);
+bool player_can_memorise(const item_def &book);
bool learn_spell(void);
spell_type which_spell_in_book(int sbook_type, int spl);
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 126c0c0652..c83906e634 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -720,13 +720,13 @@ void tutorial_finished()
}
// occasionally remind religious characters of sacrifices
-void tutorial_dissection_reminder()
+void tutorial_dissection_reminder(bool healthy)
{
if (Options.tut_just_triggered || !Options.tutorial_left)
return;
// when hungry, give appropriate message or at least don't suggest sacrifice
- if (you.hunger_state < HS_SATIATED)
+ if (you.hunger_state < HS_SATIATED && healthy)
{
learned_something_new(TUT_MAKE_CHUNKS);
return;
@@ -740,7 +740,7 @@ void tutorial_dissection_reminder()
else if (one_chance_in(8))
{
std::string text;
- text += "If you don't need to eat it, consider <w>D<magenta>issecting "
+ text += "If you don't want to eat it, consider <w>D<magenta>issecting "
"this corpse under <w>p<magenta>rayer as a sacrifice to ";
text += god_name(you.religion);
text += ". Whenever you <w>v<magenta>iew a corpse while in tutorial mode "
@@ -975,20 +975,19 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y)
"spells via <w>M<magenta> and cast a memorised spell with "
"<w>Z<magenta>.";
- if (!you.skills[SK_SPELLCASTING])
- {
- text << "\nHowever, first you will have to get accustomed to "
- "spellcasting by reading lots of scrolls.";
- }
if (you.religion == GOD_TROG)
{
- more();
- text << "\n\nAs a worshipper of "
+ text << "\nAs a worshipper of "
<< god_name(GOD_TROG)
<< ", though, you might instead wish to burn those tomes of "
"hated magic by using the corresponding "
"<w>a<magenta>bility.";
}
+ else if (!you.skills[SK_SPELLCASTING])
+ {
+ text << "\nHowever, first you will have to get accustomed to "
+ "spellcasting by reading lots of scrolls.";
+ }
text << "\nDuring the tutorial you can reread this information at "
"any time by <w>v<magenta>iewing the item in question.";
break;
@@ -1228,18 +1227,22 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y)
text << "Corpses can be spoiled or inedible, making you sick. "
"Also, some monsters' flesh is less palatable than others'. "
"While sick, your hitpoints won't regenerate and sometimes "
- "an attribute may decrease. It wears off with time (wait with "
- "<w>5<magenta>) or you can quaff a potion of healing. "
- "Also you can always press <w>@<magenta> to see your current "
- "status. ";
+ "an attribute may decrease. It wears off with time (";
+
+ if (!i_feel_safe())
+ text << "find a quiet corner and ";
+ text << "wait with <w>5<magenta>) or you could quaff a potion of "
+ "healing. ";
break;
case TUT_YOU_POISON:
learned_something_new(TUT_YOU_ENCHANTED);
- text << "Poison will slowly reduce your hp. It wears off with time "
- "(wait with <w>5<magenta>) or you could quaff a potion of "
- "healing. Also you can always press <w>@<magenta> to see your "
- "current status. ";
+ text << "Poison will slowly reduce your hp. It wears off with time (";
+
+ if (!i_feel_safe())
+ text << "find a quiet corner and ";
+ text << "wait with <w>5<magenta>) or you could quaff a potion of "
+ "healing. ";
break;
case TUT_YOU_CURSED:
@@ -1256,6 +1259,9 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y)
"latter, all you need to do is <w>D<magenta>issect a corpse "
"with a sharp implement. Your starting weapon will do nicely. "
"Try to dine on chunks in order to save permanent food.";
+
+ if (Options.tutorial_type == TUT_BERSERK_CHAR)
+ text << "\nNote that you cannot Berserk while hungry.";
break;
case TUT_YOU_STARVING:
@@ -1263,6 +1269,9 @@ void learned_something_new(tutorial_event_type seen_what, int x, int y)
"<w>e<magenta>at something quickly, or you'll die. The safest "
"way to deal with this is to simply eat something from your "
"inventory rather than wait for a monster to leave a corpse.";
+
+ if (Options.tutorial_type == TUT_MAGIC_CHAR)
+ text << "\nNote that you cannot cast spells while starving.";
break;
case TUT_MULTI_PICKUP:
@@ -1519,7 +1528,7 @@ static std::string tut_abilities()
"activation, especially by the untrained, is likely to fail.");
}
-static std::string tut_throw_stuff(item_def &item)
+static std::string tut_throw_stuff(const item_def &item)
{
std::string result;
@@ -1536,7 +1545,7 @@ static std::string tut_throw_stuff(item_def &item)
return (result);
}
-void tutorial_describe_item(item_def &item)
+void tutorial_describe_item(const item_def &item)
{
std::ostringstream ostr;
ostr << "<magenta>";
@@ -1924,6 +1933,7 @@ void tutorial_describe_item(item_def &item)
return;
}
+ ostr << "</magenta>";
std::string broken = ostr.str();
linebreak_string2(broken, get_tutorial_cols());
gotoxy(1, wherey() + 2);
diff --git a/crawl-ref/source/tutorial.h b/crawl-ref/source/tutorial.h
index 942086d207..267ef6fd55 100644
--- a/crawl-ref/source/tutorial.h
+++ b/crawl-ref/source/tutorial.h
@@ -31,7 +31,7 @@ void tut_starting_screen();
void tutorial_death_screen(void);
void tutorial_finished(void);
-void tutorial_dissection_reminder(void);
+void tutorial_dissection_reminder(bool healthy);
void tutorial_healing_reminder(void);
void taken_new_item(unsigned char item_type);
@@ -41,7 +41,7 @@ void learned_something_new(tutorial_event_type seen_what, int x=0, int y=0);
formatted_string tut_abilities_info();
// additional information for tutorial players
-void tutorial_describe_item(item_def &item);
+void tutorial_describe_item(const item_def &item);
bool tutorial_feat_interesting(dungeon_feature_type feat);
void tutorial_describe_feature(dungeon_feature_type feat);
bool tutorial_monster_interesting(const monsters *mons);