summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-26 23:36:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-26 23:36:20 +0000
commitfdf4a732d8eea286ae087ba52fcdb2c5e8142b98 (patch)
tree3a76c62267d88e1993a5d9fa55a19d661012d86d
parent02561cdbb4714cbda683165e6a7d8d4d0d89fa18 (diff)
downloadcrawl-ref-fdf4a732d8eea286ae087ba52fcdb2c5e8142b98.tar.gz
crawl-ref-fdf4a732d8eea286ae087ba52fcdb2c5e8142b98.zip
Reset RAP_CURSE < 0 to 0 after initially cursing the item, so it's not
counted as a valid property. (Fixes 2393950) Wrap FAQ questions longer than a line. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7985 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/command.cc35
-rw-r--r--crawl-ref/source/dat/database/FAQ.txt31
-rw-r--r--crawl-ref/source/randart.cc42
3 files changed, 80 insertions, 28 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 0f66b7282e..3066b5a311 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1428,6 +1428,8 @@ static bool _do_description(std::string key, std::string type,
return (true);
}
+// Reads all questions from database/FAQ.txt, outputs them in the form of
+// a selectable menu and prints the corresponding answer for a chosen question.
static bool _handle_FAQ()
{
clrscr();
@@ -1439,25 +1441,40 @@ static bool _handle_FAQ()
mpr("No questions found in FAQ! Please submit a bug report!");
return (false);
}
- Menu FAQmenu(MF_SINGLESELECT | MF_ANYPRINTABLE | MF_ALLOW_FORMATTING
- | MF_ALWAYS_SHOW_MORE);
- FAQmenu.set_more(formatted_string::parse_string("Choose a question!"));
+ Menu FAQmenu(MF_SINGLESELECT | MF_ANYPRINTABLE | MF_ALLOW_FORMATTING);
+// FAQmenu.set_more(formatted_string::parse_string("Choose a question!"));
MenuEntry *title = new MenuEntry("Frequently Asked Questions");
title->colour = YELLOW;
FAQmenu.set_title(title);
+ const int width = std::min(80, get_number_of_cols());
for (unsigned int i = 0, size = question_keys.size(); i < size; i++)
{
const char letter = index_to_letter(i);
- MenuEntry *me = new MenuEntry(getFAQ_Question(question_keys[i]),
- MEL_ITEM, 1, letter);
+ std::string question = getFAQ_Question(question_keys[i]);
+ // Wraparound if the question is longer than fits into a line.
+ linebreak_string2(question, width - 4);
+ std::vector<formatted_string> fss;
+ formatted_string::parse_string_to_multiple(question, fss);
- me->data = (void*) &question_keys[i];
- FAQmenu.add_entry(me);
+ MenuEntry *me;
+ for (unsigned int j = 0; j < fss.size(); j++)
+ {
+ if (j == 0)
+ {
+ me = new MenuEntry(question, MEL_ITEM, 1, letter);
+ me->data = (void*) &question_keys[i];
+ }
+ else
+ {
+ question = " " + fss[j].tostring();
+ me = new MenuEntry(question, MEL_ITEM, 1);
+ }
+ FAQmenu.add_entry(me);
+ }
}
- const int width = std::min(80, get_number_of_cols());
while (true)
{
std::vector<MenuEntry*> sel = FAQmenu.show();
@@ -1473,7 +1490,7 @@ static bool _handle_FAQ()
std::string answer = getFAQ_Answer(key);
if (answer.empty())
{
- mpr("No answer found in FAQ! Please submit a bug report!");
+ mpr("No answer found in the FAQ! Please submit a bug report!");
return (false);
}
answer = "Q: " + getFAQ_Question(key) + EOL + "A: " + answer;
diff --git a/crawl-ref/source/dat/database/FAQ.txt b/crawl-ref/source/dat/database/FAQ.txt
index b769fb9355..5d9fd25839 100644
--- a/crawl-ref/source/dat/database/FAQ.txt
+++ b/crawl-ref/source/dat/database/FAQ.txt
@@ -132,7 +132,7 @@ Apart from the standard items you'll find lying around in the dungeon, you might
* unrandart: an artefact that looks like a randart but is really predefined. There's no further difference except that players "in the know" can recognize such an item by its special description and/or colour.
* fixed art: an artefact that does not use the random artefact properties but instead has unique hardcoded effects and descriptions.
-All three types cannot be enchanted or branded, neither temporarily not permanently.
+None of the three types can be enchanted or branded, neither temporarily nor permanently.
%%%%
##############################################
# Questions about the development process.
@@ -192,7 +192,7 @@ There are several areas where you can get creative and outside help is much appr
* tiles (For this you'll need the sourcecode, check the rltiles/ folder.)
If you've got some great addition, you can send it over the mailing list, or post it as a Sourceforge item.
-You can also help us by giving feedback on the most recent version or trunk (downloadable from http://crawl.develz.org/).
+You can also help us by giving feedback on the most recent version or trunk (downloadable from http://crawl.develz.org).
Thanks a lot for your support!
%%%%
@@ -202,7 +202,7 @@ Is there a way for me to play the new version before it is released?
%%%%
A:beta
-There certainly is! You can play "trunk" (what will eventually become the next version) online on http://crawl.develz.org/trunk/, or you can download it from the same site. Note that trunk may be buggy, and that many changes will invalidate your saved games. If that doesn't bother you, go ahead and play. Be sure to leave some feedback/suggestions/bug reports on the Sourceforge trackers.
+There certainly is! You can play "trunk" (what will eventually become the next version) online on http://crawl.develz.org, or you can download it from the same site. Note that trunk may be buggy, and that many changes will invalidate your saved games. If that doesn't bother you, go ahead and play. Be sure to leave some feedback/suggestions/bug reports on the Sourceforge trackers.
%%%%
Q:interact
@@ -210,14 +210,33 @@ Is there a way for me to interact with other players?
%%%%
A:interact
-If you play online on http://crawl.akrasiac.org/ or http://crawl.develz.org/trunk/ you can watch games in progress, other players can watch you while you play, and you can kill other players' ghosts. You can even send and receive messages.
+If you play online on http://crawl.akrasiac.org/ or http://crawl.develz.org you can watch games in progress, other players can watch you while you play, and you can kill other players' ghosts. You can even send and receive messages.
Check docs/ssh_guide.txt for an explanation about how to play online. You can also chat in the Crawl channel (irc.freenode.net, ##crawl), or discuss in the Something Awful forum or the rec.games.roguelike.misc newsgroup.
%%%%
-Q:tiles
+##############################################
+# Questions about the Tiles version
+##############################################
+Q:tiles online
Can I play Tiles online?
%%%%
-A:tiles
+A:tiles online
Sadly, no, that's not possible at the moment. We do hope that one day this will be different, but so far we haven't even decided how to go about it, and it's still far off. If you can, do give the console version a try: playing online is certainly worth it.
%%%%
+Q:tiles graphics
+
+Is there a way for me to replace some of the tiles with different ones?
+%%%%
+A:tiles graphics
+
+Not without compiling, no. If you can compile (or get someone to do it for you), either directly replace the tiles in the rltiles/ folder, or change the paths in the dc-xxxx.txt files. You may also need to delete or rename the *.png files in rltiles/. Upon compilation, the newly rolled *.png files are copied into the dat/tiles/ folder which is where the game accesses the tiles it needs.
+%%%%
+Q:tiles options
+
+Is there a way to modify the size of the tiles screen, the font etc?
+%%%%
+A:tiles options
+
+Yes. Play around with the options in settings/tiles_options.txt until you're satisfied.
+%%%%
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 5be03b5185..148cbafea4 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -110,9 +110,9 @@ static bool _god_fits_artefact(const god_type which_god, const item_def &item,
if (is_evil_god(which_god) && brand == SPWPN_HOLY_WRATH)
return (false);
else if (is_good_god(which_god)
- && (brand == SPWPN_DRAINING || brand == SPWPN_PAIN
- || brand == SPWPN_VAMPIRICISM
- || randart_wpn_property(item, RAP_CURSED) != 0))
+ && (brand == SPWPN_DRAINING || brand == SPWPN_PAIN
+ || brand == SPWPN_VAMPIRICISM
+ || randart_wpn_property(item, RAP_CURSED) != 0))
{
return (false);
}
@@ -853,8 +853,10 @@ void static _get_randart_properties(const item_def &item,
}
}
- // This can't be right. random2(boolean) == 0, always. (jpeg)
-// bool done_powers = (random2(12 < power_level));
+ // This used to be: bool done_powers = (random2(12 < power_level));
+ // ... which can't be right. random2(boolean) == 0, always.
+ // So it's probably more along the lines of... (jpeg)
+// bool done_powers = (random2(12) < power_level);
// Try to improve items that still have a low power level.
bool done_powers = x_chance_in_y(power_level, 12);
@@ -1116,6 +1118,8 @@ void static _get_randart_properties(const item_def &item,
proprt[RAP_CURSED] = 1 + random2(5);
else
proprt[RAP_CURSED] = -1;
+
+ mprf("Set RAP_CURSED to %d", proprt[RAP_CURSED]);
}
}
@@ -1211,7 +1215,14 @@ static bool _init_randart_properties(item_def &item)
_get_randart_properties(item, prop);
for (int i = 0; i < RA_PROPERTIES; i++)
+ {
+ if (i == RAP_CURSED && prop[i] < 0)
+ {
+ do_curse_item(item);
+ continue;
+ }
rap[i] = (short) prop[i];
+ }
return (true);
}
@@ -2101,11 +2112,11 @@ bool make_item_randart( item_def &item )
}
}
- // already is a randart
+ // This already is a randart.
if (item.flags & ISFLAG_RANDART)
return (true);
- // not a truly random artefact
+ // Not a truly random artefact.
if (item.flags & ISFLAG_UNRANDART)
return (false);
@@ -2151,8 +2162,7 @@ bool make_item_randart( item_def &item )
if (item.props.exists( RANDART_APPEAR_KEY ))
ASSERT(item.props[RANDART_APPEAR_KEY].get_type() == SV_STR);
else
- item.props[RANDART_APPEAR_KEY].get_string() =
- artefact_name(item, true);
+ item.props[RANDART_APPEAR_KEY].get_string() = artefact_name(item, true);
return (true);
}
@@ -2179,9 +2189,15 @@ bool make_item_unrandart( item_def &item, int unrand_index )
_init_randart_properties(item);
item.special = unrand->prpty[ RAP_BRAND ];
- if (unrand->prpty[ RAP_CURSED ] != 0)
+ if (item.special != 0)
+ {
do_curse_item( item );
+ // If the property doesn't allow for recursing, clear it now.
+ if (item.special < 0)
+ item.special = 0;
+ }
+
// get true artefact name
ASSERT(!item.props.exists( RANDART_NAME_KEY ));
item.props[RANDART_NAME_KEY].get_string() = unrand->name;
@@ -2193,12 +2209,12 @@ bool make_item_unrandart( item_def &item, int unrand_index )
set_unrandart_exist( unrand_index, true );
return (true);
-} // end make_item_unrandart()
+}
const char *unrandart_descrip( int which_descrip, const item_def &item )
{
-// Eventually it would be great to have randomly generated descriptions
-// for randarts.
+ // Eventually it would be great to have randomly generated descriptions
+ // for randarts.
const unrandart_entry *unrand = _seekunrandart( item );
return ((which_descrip == 0) ? unrand->spec_descrip1 :