The march towards ostringstream goes on.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1385 c06c8d41-db1a-0410-9941-cceddc491573
IHIJSWVOONSTA2WCHKW3YKBLETUQECFVBVLMET5SGQZ4C6U3GCUQC
2YZN7CPQFZMSMFMVCE2FATR52SVDE3OZHTS7F7QCKJIZUA4WX2AQC
RCU52DRCPWJVQ6HME4QR6V6EVQWTBKZTPWDI47UGUDAUBPOO5YNAC
VNHFP63ZLLZU3A3PLXP4BITX57DUIYDHFOHQYK3BOBHV3S64G26QC
77H4BWWPPGLM3PLZH4QTAJRXIZTSDVNCOKZE223I437FN2UJ34RQC
7NDXS36TE7QVXTXJWMYSVG5UHCCLPIO4VL6NXFGTDK3ZNKE3A2IAC
XPCGZBHHSL6MB3ORMUJI64BAERU6AZTIY6RK56BBW7SNB3IK24IAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
2KTJHQUX2LTU2BCLS5YXVRRKMOYKKIZAPF2LBKORFGSHEN5IO3IAC
HYS3HXTXATFPN7GLN3WBGDCP22UT2D3JBVUS7SP5FE7L54TDCJRQC
void tutorial_first_monster(const monsters mon);
void tutorial_first_item(const item_def item);
void learned_something_new(unsigned int seen_what, int x=0, int y=0);
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);
// any change in this list warrants an increase in the
// version number in tutorial.cc
enum tutorial_event
{
TUT_SEEN_FIRST_OBJECT, // 0
// seen certain items
TUT_SEEN_POTION,
TUT_SEEN_SCROLL,
TUT_SEEN_WAND,
TUT_SEEN_SPBOOK,
TUT_SEEN_JEWELLERY, // 5
TUT_SEEN_MISC,
TUT_SEEN_STAFF,
TUT_SEEN_WEAPON,
TUT_SEEN_MISSILES,
TUT_SEEN_ARMOUR, // 10
TUT_SEEN_RANDART,
TUT_SEEN_FOOD,
TUT_SEEN_CARRION,
// encountered dungeon features
TUT_SEEN_STAIRS,
TUT_SEEN_TRAPS, // 15
TUT_SEEN_ALTAR,
TUT_SEEN_SHOP,
TUT_SEEN_DOOR,
// other 'first events'
TUT_SEEN_MONSTER,
TUT_KILLED_MONSTER, // 20
TUT_NEW_LEVEL,
TUT_SKILL_RAISE,
TUT_YOU_ENCHANTED,
TUT_YOU_SICK,
TUT_YOU_POISON, // 25
TUT_YOU_CURSED,
TUT_YOU_HUNGRY,
TUT_YOU_STARVING,
TUT_MULTI_PICKUP,
TUT_HEAVY_LOAD, // 30
TUT_ROTTEN_FOOD,
TUT_NEED_HEALING,
TUT_NEED_POISON_HEALING,
TUT_RUN_AWAY,
TUT_MAKE_CHUNKS, // 35
TUT_POSTBERSERK,
TUT_SHIFT_RUN,
TUT_MAP_VIEW,
TUT_DONE_EXPLORE,
TUT_YOU_MUTATED, // 40
TUT_NEW_ABILITY,
TUT_WIELD_WEAPON,
TUT_EVENTS_NUM // 43
}; // for numbers higher than 45 change size of tutorial_events in externs.h
enum tutorial_types
{
TUT_BERSERK_CHAR,
TUT_MAGIC_CHAR,
TUT_RANGER_CHAR,
TUT_TYPES_NUM // 3
};
}
if (item_typ < AMU_RAGE) // rings
{
buff << ring_secondary_string(this->special / 13)
<< ring_primary_string(this->special % 13)
<< " ring";
buff << amulet_secondary_string(this->special / 13)
<< amulet_primary_string(this->special % 13)
<< " amulet";
if (item_typ < AMU_RAGE) // rings
{
buff << ring_secondary_string(this->special / 13)
<< ring_primary_string(this->special % 13)
<< " ring";
}
else // amulets
{
buff << amulet_secondary_string(this->special / 13)
<< amulet_primary_string(this->special % 13)
<< " amulet";
}
// any change in this list warrants an increase in the
// version number in tutorial.cc
enum tutorial_event_type
{
TUT_SEEN_FIRST_OBJECT, // 0
// seen certain items
TUT_SEEN_POTION,
TUT_SEEN_SCROLL,
TUT_SEEN_WAND,
TUT_SEEN_SPBOOK,
TUT_SEEN_JEWELLERY, // 5
TUT_SEEN_MISC,
TUT_SEEN_STAFF,
TUT_SEEN_WEAPON,
TUT_SEEN_MISSILES,
TUT_SEEN_ARMOUR, // 10
TUT_SEEN_RANDART,
TUT_SEEN_FOOD,
TUT_SEEN_CARRION,
// encountered dungeon features
TUT_SEEN_STAIRS,
TUT_SEEN_TRAPS, // 15
TUT_SEEN_ALTAR,
TUT_SEEN_SHOP,
TUT_SEEN_DOOR,
// other 'first events'
TUT_SEEN_MONSTER,
TUT_KILLED_MONSTER, // 20
TUT_NEW_LEVEL,
TUT_SKILL_RAISE,
TUT_YOU_ENCHANTED,
TUT_YOU_SICK,
TUT_YOU_POISON, // 25
TUT_YOU_CURSED,
TUT_YOU_HUNGRY,
TUT_YOU_STARVING,
TUT_MULTI_PICKUP,
TUT_HEAVY_LOAD, // 30
TUT_ROTTEN_FOOD,
TUT_NEED_HEALING,
TUT_NEED_POISON_HEALING,
TUT_RUN_AWAY,
TUT_MAKE_CHUNKS, // 35
TUT_POSTBERSERK,
TUT_SHIFT_RUN,
TUT_MAP_VIEW,
TUT_DONE_EXPLORE,
TUT_YOU_MUTATED, // 40
TUT_NEW_ABILITY,
TUT_WIELD_WEAPON,
TUT_EVENTS_NUM // 43
}; // for numbers higher than 45 change size of tutorial_events in externs.h
enum tutorial_types
{
TUT_BERSERK_CHAR,
TUT_MAGIC_CHAR,
TUT_RANGER_CHAR,
TUT_TYPES_NUM // 3
};
description += "A small bottle of liquid.";
else
{
description += "A";
switch (item.sub_type)
{
case POT_HEALING:
description += " blessed";
break;
case POT_HEAL_WOUNDS:
description += " magical healing";
break;
case POT_SPEED:
description += "n enchanted";
break;
case POT_MIGHT:
description += " magic";
break;
case POT_POISON:
description += " nasty poisonous";
break;
case POT_PORRIDGE:
description += " filling";
break;
case POT_DEGENERATION:
description += " noxious";
break;
case POT_DECAY:
description += " vile and putrid cursed";
break;
case POT_WATER:
description += " unique";
break;
case POT_EXPERIENCE:
description += " truly wonderful and very rare";
break;
case POT_MAGIC:
description += " valuable";
break;
case POT_STRONG_POISON:
description += " terribly venomous";
break;
}
description += " ";
return "A small bottle of liquid.$";
switch (item.sub_type)
{
case POT_MIGHT:
case POT_GAIN_STRENGTH:
case POT_GAIN_DEXTERITY:
case POT_GAIN_INTELLIGENCE:
case POT_LEVITATION:
case POT_SLOWING:
case POT_PARALYSIS:
case POT_CONFUSION:
case POT_INVISIBILITY:
case POT_PORRIDGE:
case POT_MAGIC:
case POT_RESTORE_ABILITIES:
case POT_STRONG_POISON:
case POT_BERSERK_RAGE:
case POT_CURE_MUTATION:
case POT_MUTATION:
description += "potion";
break;
case POT_HEALING:
description += "fluid";
break;
case POT_HEAL_WOUNDS:
description += "elixir";
break;
case POT_SPEED:
description += "beverage";
break;
case POT_POISON:
case POT_DECAY:
description += "liquid";
break;
case POT_DEGENERATION:
description += "concoction";
break;
case POT_WATER:
description += "substance";
break;
case POT_EXPERIENCE:
description += "drink";
break;
}
switch (item.sub_type)
{
case POT_HEALING:
case POT_HEAL_WOUNDS:
case POT_SPEED:
case POT_MIGHT:
case POT_LEVITATION:
case POT_SLOWING:
case POT_PARALYSIS:
case POT_CONFUSION:
case POT_INVISIBILITY:
case POT_DEGENERATION:
case POT_DECAY:
case POT_MAGIC:
case POT_RESTORE_ABILITIES:
case POT_BERSERK_RAGE:
case POT_CURE_MUTATION:
case POT_MUTATION:
description += " which ";
break;
case POT_GAIN_STRENGTH:
case POT_GAIN_DEXTERITY:
case POT_GAIN_INTELLIGENCE:
case POT_PORRIDGE:
description += " of ";
break;
}
switch (item.sub_type)
{
case POT_HEALING:
description += "heals some wounds, clears the mind, "
"and cures diseases";
break;
case POT_HEAL_WOUNDS:
description += "causes wounds to close and heal "
"almost instantly";
break;
case POT_SPEED:
description += "speeds the actions of anyone who drinks it";
break;
case POT_MIGHT:
description += "greatly increases the strength and "
"physical power of one who drinks it";
break;
case POT_GAIN_STRENGTH:
case POT_GAIN_DEXTERITY:
case POT_GAIN_INTELLIGENCE:
description += "beneficial mutation";
break;
case POT_LEVITATION:
description += "confers great buoyancy on one who consumes it";
break;
case POT_SLOWING:
description += "slows your actions";
break;
case POT_PARALYSIS:
description += "eliminates your control over your own body";
break;
case POT_CONFUSION:
description += "confuses your perceptions and reduces "
"your control over your own actions";
break;
case POT_INVISIBILITY:
description += "hides you from the sight of others";
break;
case POT_PORRIDGE:
description += "sludge, high in cereal fibre";
break;
case POT_DEGENERATION:
description += "can do terrible things to your "
"body, brain and reflexes";
break;
case POT_DECAY:
description += "causes your flesh to decay "
"before your very eyes";
break;
case POT_WATER:
description += ", vital for the existence of most life";
break;
case POT_MAGIC:
description += "grants a person with an "
"infusion of magical energy";
break;
case POT_RESTORE_ABILITIES:
description += "restores the abilities of one who drinks it";
break;
case POT_BERSERK_RAGE:
description += "can send one into an incoherent rage";
break;
case POT_CURE_MUTATION:
description += "removes some or all of any mutations "
"which may be afflicting you";
break;
case POT_MUTATION:
description += "does very strange things to you";
break;
}
description += ". ";
switch (item.sub_type)
{
case POT_HEALING:
case POT_HEAL_WOUNDS:
description += "If one uses it when they are "
"at or near full health, it can also ";
if (item.sub_type == POT_HEALING)
description += "slightly ";
description += "repair permanent injuries. ";
break;
}
//default:
// DEBUGSTR("Unknown potion"); // I had no idea where to put this back 16jan2000 {dlb}
switch (static_cast<potion_type>(item.sub_type))
{
case POT_HEALING:
return "A blessed fluid which heals some wounds, clears the mind, "
"and cures diseases. If one uses it when they are at or near "
"full health, it can also slightly repair permanent injuries.$";
case POT_HEAL_WOUNDS:
return "A magical healing elixir which causes wounds to close and "
"heal almost instantly. If one uses it when they are at or near "
"full health, it can also repair permanent injuries.$";
case POT_SPEED:
return "An enchanted beverage which speeds the actions of anyone who "
"drinks it.$";
case POT_MIGHT:
return "A magic potion which greatly increases the strength and "
"physical power of one who drinks it.$";
case POT_GAIN_STRENGTH:
return "A potion of beneficial mutation.$";
case POT_GAIN_DEXTERITY:
return "A potion of beneficial mutation.$";
case POT_GAIN_INTELLIGENCE:
return "A potion of beneficial mutation.$";
case POT_LEVITATION:
return "A potion which confers great buoyancy "
"on one who consumes it.$";
case POT_POISON:
return "A nasty poisonous liquid.$";
case POT_SLOWING:
return "A potion which slows your actions.$";
case POT_PARALYSIS:
return "A potion which eliminates your control over your own body.$";
case POT_CONFUSION:
return "A potion which confuses your perceptions and "
"reduces your control over your own actions.$";
case POT_INVISIBILITY:
return "A potion which hides you from the sight of others.$";
case POT_PORRIDGE:
return "A filling potion of sludge, high in cereal fibre.$";
case POT_DEGENERATION:
return "A noxious concoction which can do terrible things "
"to your body, brain and reflexes.$";
case POT_DECAY:
return "A vile and putrid cursed liquid which causes your "
"flesh to decay before your very eyes.$";
case POT_WATER:
return "A unique substance, vital for the existence of most life.$";
case POT_EXPERIENCE:
return "A truly wonderful and very rare drink.$";
case POT_MAGIC:
return "A valuable potion which grants a person with an "
"infusion of magical energy.$";
case POT_RESTORE_ABILITIES:
return "A potion which restores the abilities of one who drinks it.$";
case POT_STRONG_POISON:
return "A terribly venomous potion.$";
case POT_BERSERK_RAGE:
return "A potion which can send one into an incoherent rage.$";
case POT_CURE_MUTATION:
return "A potion which removes some or all of any mutations "
"which may be afflicting you.$";
case POT_MUTATION:
return "A potion which does very strange things to you.$";
case NUM_POTIONS:
return "A buggy potion.";
std::string text =
"<h>Item types (and common commands)\n"
"<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
"<brown>(</brown> : missiles (<w>t</w>hrow or <w>f</w>ire)\n"
"<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
"<brown>%</brown> : food and corpses (<w>e</w>at and <w>D</w>issect)\n"
"<w>?</w> : scrolls (<w>r</w>ead)\n"
"<magenta>!</magenta> : potions (<w>q</w>uaff)\n"
"<blue>=</blue> : rings (<w>P</w>ut on and <w>R</w>emove)\n"
"<red>\"</red> : amulets (<w>P</w>ut on and <w>R</w>emove)\n"
"<darkgrey>/</darkgrey> : wands (<w>z</w>ap)\n"
"<lightcyan>";
std::ostringstream text;
text <<
"<h>Item types (and common commands)\n"
"<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
"<brown>(</brown> : missiles (<w>t</w>hrow or <w>f</w>ire)\n"
"<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
"<brown>%</brown> : food and corpses (<w>e</w>at and <w>D</w>issect)\n"
"<w>?</w> : scrolls (<w>r</w>ead)\n"
"<magenta>!</magenta> : potions (<w>q</w>uaff)\n"
"<blue>=</blue> : rings (<w>P</w>ut on and <w>R</w>emove)\n"
"<red>\"</red> : amulets (<w>P</w>ut on and <w>R</w>emove)\n"
"<darkgrey>/</darkgrey> : wands (<w>z</w>ap)\n"
"<lightcyan>";
snprintf(info, INFO_SIZE, "%c", ch);
text += info;
text += "</lightcyan> : books (<w>r</w>ead, <w>M</w>emorise and <w>Z</w>ap)\n"
"<brown>";
text << static_cast<char>(ch);
text << "</lightcyan> : books (<w>r</w>ead, <w>M</w>emorise and "
"<w>Z</w>ap)\n"
"<brown>";