summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-19 16:06:29 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-19 16:06:29 +0000
commit6c343fd8e3a09865c8ee23ffeb5da6dc07379cfe (patch)
treee751b603908fa9ebffa8b9dfa5d3f57f9d9b76f5
parent90a29a297d45fe8cc7f7b553123c8adc191a46ad (diff)
downloadcrawl-ref-6c343fd8e3a09865c8ee23ffeb5da6dc07379cfe.tar.gz
crawl-ref-6c343fd8e3a09865c8ee23ffeb5da6dc07379cfe.zip
Enable menu colour for the 'V' item sub-menu.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9657 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/changes.stone_soup2
-rw-r--r--crawl-ref/source/directn.cc2
-rw-r--r--crawl-ref/source/format.cc5
-rw-r--r--crawl-ref/source/format.h3
-rw-r--r--crawl-ref/source/menu.cc5
-rw-r--r--crawl-ref/source/xom.cc29
6 files changed, 29 insertions, 17 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup
index 214b8fe387..952f1b78aa 100644
--- a/crawl-ref/docs/changes.stone_soup
+++ b/crawl-ref/docs/changes.stone_soup
@@ -94,6 +94,7 @@ Interface
* Wizard commands can now be used from the wizard help screen.
* Allow quivering/firing of wielded missiles and wielded weapons of returning.
* With a full pack, check entire list of selected items to allow for merging.
+* Eating now prompts for chunks sorted by age and side effects.
* Added an option to make menu colours apply to shops.
* Use menu colours for announcements of items found while travelling.
* Pressing Esc at -More- automatically clears all queued -More- prompts.
@@ -149,6 +150,7 @@ Gods
* Beogh has a non-cannibalism conduct.
* Disallow shapeshifters in orc form to become Beoghites' followers.
* Offer card descriptions when using Nemelex's Triple Draw or Stack Five.
+* Enable automatic note taking for Xom effects.
Tiles
-----
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 6013f609ff..62af5d962a 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -522,7 +522,7 @@ void full_describe_view()
InvMenu desc_menu(MF_SINGLESELECT | MF_ANYPRINTABLE
| MF_ALLOW_FORMATTING | MF_SELECT_BY_PAGE);
- desc_menu.set_highlighter(NULL);
+// desc_menu.set_highlighter(NULL);
// FIXME: Need different title for the opposite toggle:
// "Visible Monsters/Items (select for more detail, '!' to examine):"
std::string title = "";
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc
index 8ceea8ed91..4dd398cb0c 100644
--- a/crawl-ref/source/format.cc
+++ b/crawl-ref/source/format.cc
@@ -86,11 +86,12 @@ formatted_string formatted_string::parse_block(
formatted_string formatted_string::parse_string(
const std::string &s,
bool eot_ends_format,
- bool (*process)(const std::string &tag))
+ bool (*process)(const std::string &tag),
+ int main_colour)
{
// Safe assumption, that incoming color is LIGHTGREY
std::vector<int> colour_stack;
- colour_stack.push_back(LIGHTGREY);
+ colour_stack.push_back(main_colour);
formatted_string fs;
diff --git a/crawl-ref/source/format.h b/crawl-ref/source/format.h
index 297e793106..bb07698fa3 100644
--- a/crawl-ref/source/format.h
+++ b/crawl-ref/source/format.h
@@ -57,7 +57,8 @@ public:
static formatted_string parse_string(
const std::string &s,
bool eot_ends_format = true,
- bool (*process_tag)(const std::string &tag) = NULL );
+ bool (*process_tag)(const std::string &tag) = NULL,
+ int main_colour = LIGHTGREY );
static void parse_string_to_multiple(
const std::string &s,
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 62146b0038..46958288b6 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -40,9 +40,10 @@ MenuDisplayText::MenuDisplayText(Menu *menu) : MenuDisplay(menu), m_starty(1)
void MenuDisplayText::draw_stock_item(int index, const MenuEntry *me)
{
- textattr(m_menu->item_colour(index, me));
+ const int col = m_menu->item_colour(index, me);
+ textattr(col);
if (m_menu->get_flags() & MF_ALLOW_FORMATTING)
- formatted_string::parse_string(me->get_text()).display();
+ formatted_string::parse_string(me->get_text(), true, NULL, col).display();
else
{
std::string text = me->get_text();
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 1c0012ac01..9e0dba7e50 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -179,13 +179,17 @@ bool xom_is_nice(int tension)
: std::min((MAX_PIETY - you.piety) / 2,
random2(tension)));
+ const int effective_piety = you.piety + tension_bonus;
+ ASSERT(effective_piety >= 0 && effective_piety <= MAX_PIETY);
+
#ifdef DEBUG_XOM
mprf(MSGCH_DIAGNOSTICS,
- "Xom: tension: %d, piety: %d -> tension bonus = %d",
- tension, you.piety, tension_bonus);
+ "Xom: tension: %d, piety: %d -> tension bonus = %d, eff. piety: %d",
+ tension, you.piety, tension_bonus, effective_piety);
#endif
+
// Whether Xom is nice depends largely on his mood (== piety).
- return (x_chance_in_y(you.piety + tension_bonus, MAX_PIETY));
+ return (x_chance_in_y(effective_piety, MAX_PIETY));
}
else // CARD_XOM
return coinflip();
@@ -482,6 +486,8 @@ static bool _xom_makes_you_cast_random_spell(int sever, int tension)
else
{
const int nxomspells = ARRAYSZ(_xom_nontension_spells);
+ // spellenum will be at least 3, so we don't run into infinite loops
+ // for Detect Creatures/Magic Mapping in fully explored levels.
spellenum = std::min(nxomspells, std::max(3 + coinflip(), spellenum));
spell = _xom_nontension_spells[random2(spellenum)];
@@ -1463,12 +1469,14 @@ static bool _xom_give_mutations(bool good)
const int num_tries = random2(4) + 1;
static char mut_buf[80];
- snprintf(mut_buf, sizeof(mut_buf), "give %smutations",
+ snprintf(mut_buf, sizeof(mut_buf), "give %smutation%s",
#ifdef NOTE_DEBUG_XOM
- good ? "good " : "random ");
+ good ? "good " : "random ",
#else
- "");
+ "",
#endif
+ num_tries > 1 ? "s" : "");
+
take_note(Note(NOTE_XOM_EFFECT, you.piety, -1, mut_buf), true);
mpr("Your body is suffused with distortional energy.");
@@ -2943,7 +2951,7 @@ void xom_acts(bool niceness, int sever, int tension)
const FixedVector<unsigned char, NUM_MUTATIONS> orig_mutation
= you.mutation;
-#ifdef DEBUG_XOM
+#ifdef NOTE_DEBUG_XOM
static char xom_buf[100];
snprintf(xom_buf, sizeof(xom_buf), "xom_acts(%s, %d, %d), mood: %d",
(niceness ? "true" : "false"), sever, tension, you.piety);
@@ -2961,7 +2969,7 @@ void xom_acts(bool niceness, int sever, int tension)
{
if (was_bored && Options.note_xom_effects)
take_note(Note(NOTE_MESSAGE, 0, 0, "XOM is BORED!"), true);
-#ifdef DEBUG_XOM
+#ifdef NOTE_DEBUG_XOM
else if (niceness)
{
take_note(Note(NOTE_MESSAGE, 0, 0, "good act randomly turned bad"),
@@ -2997,9 +3005,8 @@ void xom_acts(bool niceness, int sever, int tension)
const std::string msg = "You are now " + new_xom_favour;
god_speaks(you.religion, msg.c_str());
}
-#ifdef DEBUG_XOM
- snprintf(info, INFO_SIZE, "xom_acts(): reroll piety(1/5), piety: %d",
- you.piety);
+#ifdef NOTE_DEBUG_XOM
+ snprintf(info, INFO_SIZE, "reroll piety: %d", you.piety);
take_note(Note(NOTE_MESSAGE, 0, 0, info), true);
#endif
}