From 4a2e918c73a0f9e7486204a7722097a68186f7db Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Tue, 10 Nov 2009 20:03:03 -0800 Subject: tutorial: plant/fungus and toadstool events New events for the first time seeing a zero-experience monster and for first seeing a toadstool. --- crawl-ref/source/enum.h | 48 ++++++++++++++------------- crawl-ref/source/tutorial.cc | 79 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 103 insertions(+), 24 deletions(-) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 03250688ab..f452a9523c 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2972,65 +2972,67 @@ enum tutorial_event_type TUT_SEEN_SECRET_DOOR, // other 'first events' TUT_SEEN_MONSTER, - TUT_MONSTER_BRAND, // 25 + TUT_SEEN_ZERO_EXP_MON, // 25 + TUT_SEEN_TOADSTOOL, + TUT_MONSTER_BRAND, TUT_MONSTER_FRIENDLY, TUT_MONSTER_SHOUT, - TUT_MONSTER_LEFT_LOS, + TUT_MONSTER_LEFT_LOS, // 30 TUT_KILLED_MONSTER, - TUT_NEW_LEVEL, // 30 + TUT_NEW_LEVEL, TUT_SKILL_RAISE, TUT_GAINED_MAGICAL_SKILL, - TUT_GAINED_MELEE_SKILL, + TUT_GAINED_MELEE_SKILL, // 35 TUT_GAINED_RANGED_SKILL, - TUT_CHOOSE_STAT, // 35 + TUT_CHOOSE_STAT, TUT_MAKE_CHUNKS, TUT_OFFER_CORPSE, - TUT_NEW_ABILITY_GOD, + TUT_NEW_ABILITY_GOD, // 40 TUT_NEW_ABILITY_MUT, - TUT_NEW_ABILITY_ITEM, // 40 + TUT_NEW_ABILITY_ITEM, TUT_FLEEING_MONSTER, TUT_ROTTEN_FOOD, - TUT_CONVERT, + TUT_CONVERT, // 45 TUT_GOD_DISPLEASED, - TUT_EXCOMMUNICATE, // 45 + TUT_EXCOMMUNICATE, TUT_SPELL_MISCAST, TUT_SPELL_HUNGER, - TUT_GLOWING, + TUT_GLOWING, // 50 TUT_YOU_RESIST, // status changes - TUT_YOU_ENCHANTED, // 50 + TUT_YOU_ENCHANTED, TUT_YOU_SICK, TUT_YOU_POISON, - TUT_YOU_ROTTING, + TUT_YOU_ROTTING, // 55 TUT_YOU_CURSED, - TUT_YOU_HUNGRY, // 55 + TUT_YOU_HUNGRY, TUT_YOU_STARVING, TUT_YOU_MUTATED, - TUT_CAN_BERSERK, + TUT_CAN_BERSERK, // 60 TUT_POSTBERSERK, - TUT_CAUGHT_IN_NET, // 60 + TUT_CAUGHT_IN_NET, // warning TUT_RUN_AWAY, TUT_RETREAT_CASTER, - TUT_WIELD_WEAPON, + TUT_WIELD_WEAPON, // 65 TUT_NEED_HEALING, - TUT_NEED_POISON_HEALING, // 65 + TUT_NEED_POISON_HEALING, TUT_INVISIBLE_DANGER, TUT_NEED_HEALING_INVIS, - TUT_ABYSS, + TUT_ABYSS, // 70 // interface TUT_MULTI_PICKUP, - TUT_HEAVY_LOAD, // 70 + TUT_HEAVY_LOAD, TUT_SHIFT_RUN, TUT_MAP_VIEW, - TUT_AUTO_EXPLORE, + TUT_AUTO_EXPLORE, // 75 TUT_DONE_EXPLORE, - TUT_AUTO_EXCLUSION, // 75 + TUT_AUTO_EXCLUSION, TUT_STAIR_BRAND, TUT_HEAP_BRAND, - TUT_TRAP_BRAND, + TUT_TRAP_BRAND, // 80 TUT_LOAD_SAVED_GAME, - TUT_EVENTS_NUM // 80 + TUT_EVENTS_NUM // 82 }; // NOTE: For numbers higher than 85 change size of tutorial_events in externs.h. diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index c653349c9d..aaa8ce3372 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -68,7 +68,7 @@ static void _tutorial_describe_feature(int x, int y); static bool _water_is_disturbed(int x, int y); //#define TUTORIAL_DEBUG -#define TUTORIAL_VERSION 9 +#define TUTORIAL_VERSION 10 static int _get_tutorial_cols() { @@ -373,6 +373,10 @@ static std::string _tut_debug_list(int event) return "seen first misc. item"; case TUT_SEEN_MONSTER: return "seen first monster"; + case TUT_SEEN_ZERO_EXP_MON: + return "seen first zero experience monster"; + case TUT_SEEN_TOADSTOOL: + return "seen first toadstool"; case TUT_SEEN_STAIRS: return "seen first stairs"; case TUT_SEEN_ESCAPE_HATCH: @@ -1265,6 +1269,25 @@ static bool _advise_use_wand() void tutorial_first_monster(const monsters &mon) { + if (mons_class_flag(mon.type, M_NO_EXP_GAIN)) + { + tutorial_event_type et = mon.type == MONS_TOADSTOOL ? + TUT_SEEN_TOADSTOOL : TUT_SEEN_ZERO_EXP_MON; + + if (Options.tutorial_events[et]) + { + if (Options.tut_just_triggered) + return; + + learned_something_new(et, mon.pos()); + return; + } + + // Don't do TUT_SEEN_MONSTER for zero exp monsters. + if (Options.tutorial_events[TUT_SEEN_MONSTER]) + return; + } + if (!Options.tutorial_events[TUT_SEEN_MONSTER]) { if (Options.tut_just_triggered) @@ -3137,6 +3160,14 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (!m) DELAY_EVENT; + // "Shouts" from zero experience monsters are boring, ignore + // them. + if (mons_class_flag(m->type, M_NO_EXP_GAIN)) + { + Options.tutorial_events[TUT_MONSTER_SHOUT] = true; + return; + } + const bool vis = you.can_see(m); #ifdef USE_TILE @@ -3193,6 +3224,52 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) // Handled in special functions. break; + case TUT_SEEN_TOADSTOOL: + { + const monsters* m = monster_at(gc); + + if (!m || !you.can_see(m)) + DELAY_EVENT; + + viewwindow(false); + text << "Sometimes toadstools will grow on decaying corpses, and " + "will wither away soon after appearing. Worshipers of " + "Fedhas Madash, the plant god, can make use of them, " + "but to everyone else they're just ugly dungeon decoration."; + break; + } + + case TUT_SEEN_ZERO_EXP_MON: + { + const monsters* m = monster_at(gc); + + if (!m || !you.can_see(m)) + DELAY_EVENT; + viewwindow(false); + + text << "That "; +#ifdef USE_TILE + // need to highlight monster + const coord_def gc = m->pos(); + tiles.place_cursor(CURSOR_TUTORIAL, gc); + tiles.add_text_tag(TAG_TUTORIAL, m); + + text << "is a "; +#else + unsigned short col; + get_mons_glyph(m, &ch, &col); + + text << _colourize_glyph(col, ch) << " is a "; +#endif + text << m->name(DESC_PLAIN).c_str() << ". "; + + text << "While technically a monster, it's more like " + "dungeon furniture, since it's harmless and doesn't move. " + "If it's in your way you can attack and kill it like other " + "monsters, but you won't get any expereince for doing so. "; + break; + } + case TUT_ABYSS: text << "Uh-oh, you've wound up in the Abyss! The Abyss is a special " "place where you cannot remember or map where you've been; it " -- cgit v1.2.3-54-g00ecf