summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-30 13:42:32 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-30 13:42:32 +0000
commitea0b5d06177336c5d95367a659459b91e47f42ec (patch)
tree436eaeaf616d360ec594b3aa8ac5a45f49122443
parenta009c0f5790f03409f689848c228f0f22b802f27 (diff)
downloadcrawl-ref-ea0b5d06177336c5d95367a659459b91e47f42ec.tar.gz
crawl-ref-ea0b5d06177336c5d95367a659459b91e47f42ec.zip
Trunk->0.3 merge (2683-2685): CREDITS, INSTALL, Tomb:2 and Xom fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2686 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/CREDITS39
-rw-r--r--crawl-ref/INSTALL67
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/dat/crypt.des7
-rw-r--r--crawl-ref/source/enum.h3
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/mutation.cc274
-rw-r--r--crawl-ref/source/mutation.h6
-rw-r--r--crawl-ref/source/xom.cc13
9 files changed, 246 insertions, 169 deletions
diff --git a/crawl-ref/CREDITS b/crawl-ref/CREDITS
index e14462d1d0..6976aff2c6 100644
--- a/crawl-ref/CREDITS
+++ b/crawl-ref/CREDITS
@@ -1,6 +1,6 @@
The Dungeon Crawl Stone Soup team (Peter Berger, Matthew Cline, Nat Lanza,
-Haran Pilpel, Erik Piper, David Ploog, Johanna Ploog, Darshan Shaligram) would
-like to thank:
+Haran Pilpel, David Ploog, Johanna Ploog, Darshan Shaligram) would like to
+thank:
* Linley Henzell, the author of Dungeon Crawl, for writing this great game.
@@ -14,20 +14,21 @@ like to thank:
We'd also like to thank members of the Dungeon Crawl community who have
contributed to Dungeon Crawl Stone Soup:
-Warwick Allison Benoit Hudson Pedro
-Juha Arpiainen Ilyak Lemuel Pitkin
-Roy Axenov Mitsuhiro Itakura David Lawrence Ramsey
-Alexander Beisig Eino Keskitalo Remsleep
-Erik Inge Bolsø Jarmo Kielosto David Rose
-Peter Borgmann Kornel Kisielewicz Sebastian Salman
-Rachel Elizabeth Dillon Ryan Kusnery Brett Scarborough
-Dylan O'Donnell Jukka Kuusisto Roman Sêk
-Jesse Luehrs Jordan Lewis Sigurd
-Mike Drinen Icy Lich Edgar Simo
-Kieron Dunbar Arien Malec Solf
-Elethiomel Shawn M Moore Johan Strandell
-Christopher Evenstar Eva Myers Marc H. Thoben
-Ben Goetter Onia Ninara Matt Titus
-Ciaran Hamilton Erkki Nurmi Steven Wheeler
-Chris Hamons nyra Jeremey Wilson
-R. Dan Henry Yuuma Oohara Zooko
+Warwick Allison Ilyak Lemuel Pitkin
+Juha Arpiainen Mitsuhiro Itakura David Lawrence Ramsey
+Roy Axenov Eino Keskitalo Remsleep
+Alexander Beisig Jarmo Kielosto David Rose
+Erik Inge Bolsø Kornel Kisielewicz Sebastian Salman
+Peter Borgmann Ryan Kusnery Brett Scarborough
+Rachel Elizabeth Dillon Jukka Kuusisto Roman Sêk
+Dylan O'Donnell Jordan Lewis Sigurd
+Jesse Luehrs Icy Lich Edgar Simo
+Mike Drinen Arien Malec Solf
+Kieron Dunbar Shawn M Moore Johan Strandell
+Elethiomel Eva Myers Marc H. Thoben
+Christopher Evenstar Onia Ninara Matt Titus
+Ben Goetter Erkki Nurmi Enne Walker
+Ciaran Hamilton nyra Steven Wheeler
+Chris Hamons Yuuma Oohara Jeremey Wilson
+R. Dan Henry Pedro Zooko
+Benoit Hudson Erik Piper
diff --git a/crawl-ref/INSTALL b/crawl-ref/INSTALL
index 9215f59d08..871eadf95d 100644
--- a/crawl-ref/INSTALL
+++ b/crawl-ref/INSTALL
@@ -1,12 +1,12 @@
Install instructions for Dungeon Crawl Stone Soup (DCSS)
--------------------------------------------------------
-(Last updated on 20070331 for Dungeon Crawl Stone Soup 0.2.)
+(Last updated on 20071030 for Dungeon Crawl Stone Soup 0.3.)
Building Dungeon Crawl Stone Soup
---------------------------------
Crawl Stone Soup is known to compile successfully on the following
-platforms as of version 0.2:
+platforms as of version 0.3:
- Any Unix with a recent gcc (and g++), GNU make and libncurses,
including Linux and Mac OS X. "Recent" is defined as gcc 3.3 or
@@ -71,9 +71,9 @@ Makefile system
---------------
Crawl uses a selector makefile (under source/makefile) to control what
-platform it's building for. Your first step in building Crawl should
-be to edit source/makefile and point it at the correct platform
-makefile. For instance, if you're building for Windows, you'd use
+platform it's building for. Your first step in building Crawl should be
+to edit source/makefile and point it at the correct platform makefile.
+For instance, if you're building for Windows, you'd use
MAKEFILE=makefile.mgw to build with MinGW for Windows (# is used for
comments in makefiles).
@@ -84,6 +84,24 @@ information on building Crawl.
Building on Unix (Linux, *BSD, Solaris, etc.)
---------------------------------------------
+Security:
+
+If you have untrusted local users, we highly recommend you do not
+install Crawl setgid or setuid. Just running "make install" will install
+Crawl setgid games, do *not* do this unless you're sure you trust your
+users.
+
+If you have untrusted users, the correct way to install a multiplayer
+Crawl is using a chrooted game launcher such as dgamelaunch.
+
+
+To install or not to install:
+
+If only one user on the system (you) is going to be playing Crawl, you
+do not need to use "make install". A simple "make" will build Crawl in
+the source directory, where you can run it as "./crawl".
+
+
Prerequisites:
GNU gcc and g++, GNU make, libncurses or libcurses. You need the
@@ -93,10 +111,12 @@ on some Unixes.
flex and bison are optional but highly recommended. Recent versions of
byacc are also fine (edit your makefile appropriately).
-If you have ncursesw and the development headers (usually in the
-/usr/include/ncursesw directory) you can build Crawl with support for
-Unicode display characters in the map by setting UNICODE_GLYPHS = y
-in makefile.unix.
+If you want to use Unicode, you need to link with a curses library that
+understands Unicode characters, usually named libncursesw (the
+development headers for libncursesw are usually in
+/usr/include/ncursesw.) You also need to have a UTF-8 locale installed.
+You can then build Crawl with support for Unicode by setting
+UNICODE_GLYPHS = y in makefile.unix.
Building:
@@ -124,7 +144,7 @@ Building:
* Run make to build the normal (non-wizard) Crawl. On systems such as
Solaris, you may have to use gmake for GNU make. Make sure your make
- identifies itself as GNU make when you do make --version.
+ identifies itself as GNU Make when you do make --version.
* If you're installing Crawl for multiple users, run make install.
Crawl will be copied into the directory specified by INSTALLDIR. The
@@ -132,11 +152,8 @@ Building:
level layout (.des) and help files will be copied to the data
directory.
-* If you'd like users to be able to script Crawl with Lua, you can
- edit AppHdr.h, uncomment
- // #define CLUA_BINDINGS
- clean, and rebuild to compile with user Lua support. See the section
- on Lua (below) for more information.
+* If you do not want players to be able to script Crawl with Lua,
+ edit makefile.unix and remove -DCLUA_BINDINGS from the CFOTHERS line.
Building on Mac OS X
@@ -187,11 +204,11 @@ NT family). If you're on 9x/ME, you can use the Cygwin build
instructions, or build a binary on a Windows NT/2k/XP system (the
binary will run on 9x), or build a DOS binary.
-* Install MinGW from http://www.mingw.org. The MinGW 5.0.2 installer
- is best so you don't have to fiddle with individual packages (you
- can mess with the individual packages if you like to, of course). If
- you want to edit the level compiler, also get the flex and bison
- packages (available from the GnuWin32 project on Sourceforge:
+* Install MinGW from http://www.mingw.org. The MinGW installer
+ is best so you don't have to fiddle with individual packages (you can
+ mess with the individual packages if you like to, of course). If you
+ want to edit the level compiler, also get the flex and bison packages
+ (available from the GnuWin32 project on Sourceforge:
http://gnuwin32.sourceforge.net/).
* Make sure you have g++ and mingw32-make in your path.
@@ -205,7 +222,8 @@ binary will run on 9x), or build a DOS binary.
uncomment this line:
// #define REGEX_PCRE
Note that there are multiple // #define REGEX_PCRE lines in AppHdr.h
- - find the one in the Windows-specific section.
+ - find the one in the Windows-specific section. Also see the section
+ below on obtaining the pcre library to link against.
* If you have flex and bison, edit makefile.mgw and set DOYACC := y.
@@ -350,6 +368,7 @@ not UTF-8, you can force it to UTF-8 on most systems by doing "export
LC_ALL=en_US.UTF-8" or the equivalent, depending on your language
locale and what shell you're using.
-If you're playing Crawl on a remote machine, the character encoding
-needs to be UTF-8 on the server, *and* your local terminal (where
-you're running telnet/ssh) needs to be able to decode UTF-8. \ No newline at end of file
+If you're playing Crawl on a remote machine, the remote Crawl should be
+built with Unicode support, it needs to have a UTF-8 locale installed,
+*and* your local terminal (where you're running telnet/ssh) needs to be
+able to decode UTF-8.
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index c41f6af728..a028d98df0 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3089,6 +3089,9 @@ static bool initialise(void)
const bool newc = new_game();
if (!newc)
restore_game();
+
+ // Fix the mutation definitions for the species we're playing.
+ fixup_mutations();
// Load macros
macro_init();
diff --git a/crawl-ref/source/dat/crypt.des b/crawl-ref/source/dat/crypt.des
index e56cb741fb..4f2acba0d8 100644
--- a/crawl-ref/source/dat/crypt.des
+++ b/crawl-ref/source/dat/crypt.des
@@ -455,7 +455,8 @@ PLACE: Tomb:2
# Can be rotated!
ORIENT: encompass
#
-SHUFFLE: ABCD[, Ww/Yy/Zz, Uu/Vv, Qq/Rr/Ss
+NSUBST: A = [ / '
+SHUFFLE: Ww/Yy/Zz, Uu/Vv, Qq/Rr/Ss
SUBST: W=', w=c, Y=T, y=+, Z=T, z=+
SUBST: U=', u=c, V=T, v=+
SUBST: Q=', q=c, R=T, r=+, S=T, s=+
@@ -521,14 +522,14 @@ xxxxxxxxxxxxxxcccczcc..ccc.........1.........ccc..c''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'ZZZc..ccc...................ccc..c''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxccA'''c..ccc4.................4ccc..c''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'YYYc.............................c''''ccxxxxxxxxxxxxx
-xxxxxxxxxxxxxxccccycc.............................cRRR[ccxxxxxxxxxxxxx
+xxxxxxxxxxxxxxccccycc.............................cRRRAccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'YYYc.............................ccrccccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc''''ccccc+ccccccccccccccc+cccccccccRRR'ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc''''''c'TTTc''''''''''''cTT''''''c'''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'''''WcW''UcU''''''''''VcV''''''ScS''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'''''WwW''UuU''''''''''VvV''''''SsS''''ccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcc'''''WcW''UcU''''''''''VcV''''''ScS''''ccxxxxxxxxxxxxx
-xxxxxxxxxxxxxxccB'''''c''''cC'''''''''''c''''''''c''''Dccxxxxxxxxxxxxx
+xxxxxxxxxxxxxxccA'''''c''''cA'''''''''''c''''''''c''''Accxxxxxxxxxxxxx
xxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxx
xxxxxxxxxxxxxxcccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index bad80a03c9..5ebf7b568e 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2017,7 +2017,8 @@ enum mutation_type
NUM_MUTATIONS,
RANDOM_MUTATION = 100,
- RANDOM_XOM_MUTATION = 101
+ RANDOM_XOM_MUTATION = 101,
+ RANDOM_GOOD_MUTATION = 102
};
enum object_class_type // (unsigned char) mitm[].base_type
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index bb49bc6600..607a49cbeb 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2863,6 +2863,7 @@ void zap_wand(void)
}
const bool alreadyknown = item_type_known(wand);
+ const bool alreadytried = item_type_tried(wand);
if (!alreadyknown)
beam.effect_known = false;
@@ -2973,7 +2974,7 @@ void zap_wand(void)
exercise( SK_EVOCATIONS, 1 );
alert_nearby_monsters();
- if (!alreadyknown && dangerous)
+ if (!alreadyknown && !alreadytried && dangerous)
{
// Xom loves it when you use an unknown wand and there is a
// dangerous monster nearby...
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 391dc013ee..04979117f7 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -816,108 +816,107 @@ const char *lose_mutation[][3] = {
"Your patterned scales recede somewhat."},
};
-static const mutation_def mutation_defs[] = {
- { MUT_TOUGH_SKIN, 10, 3 },
- { MUT_STRONG, 8, 14 },
- { MUT_CLEVER, 8, 14 },
- { MUT_AGILE, 8, 14 },
- { MUT_GREEN_SCALES, 2, 3 },
- { MUT_BLACK_SCALES, 1, 3 },
- { MUT_GREY_SCALES, 2, 3 },
- { MUT_BONEY_PLATES, 1, 3 },
- { MUT_REPULSION_FIELD, 1, 3 },
- { MUT_POISON_RESISTANCE, 4, 1 },
+static mutation_def mutation_defs[] = {
+ { MUT_TOUGH_SKIN, 10, 3, false },
+ { MUT_STRONG, 8, 14, false },
+ { MUT_CLEVER, 8, 14, false },
+ { MUT_AGILE, 8, 14, false },
+ { MUT_GREEN_SCALES, 2, 3, false },
+ { MUT_BLACK_SCALES, 1, 3, false },
+ { MUT_GREY_SCALES, 2, 3, false },
+ { MUT_BONEY_PLATES, 1, 3, false },
+ { MUT_REPULSION_FIELD, 1, 3, false },
+ { MUT_POISON_RESISTANCE, 4, 1, false },
// 10
- { MUT_CARNIVOROUS, 5, 3 },
- { MUT_HERBIVOROUS, 5, 3 },
- { MUT_HEAT_RESISTANCE, 4, 3 },
- { MUT_COLD_RESISTANCE, 4, 3 },
- { MUT_SHOCK_RESISTANCE, 2, 1 },
- { MUT_REGENERATION, 3, 3 },
- { MUT_FAST_METABOLISM, 10, 3 },
- { MUT_SLOW_METABOLISM, 7, 3 },
- { MUT_WEAK, 10, 14 },
- { MUT_DOPEY, 10, 14 },
+ { MUT_CARNIVOROUS, 5, 3, false },
+ { MUT_HERBIVOROUS, 5, 3, true },
+ { MUT_HEAT_RESISTANCE, 4, 3, false },
+ { MUT_COLD_RESISTANCE, 4, 3, false },
+ { MUT_SHOCK_RESISTANCE, 2, 1, false },
+ { MUT_REGENERATION, 3, 3, false },
+ { MUT_FAST_METABOLISM, 10, 3, true },
+ { MUT_SLOW_METABOLISM, 7, 3, false },
+ { MUT_WEAK, 10, 14, true },
+ { MUT_DOPEY, 10, 14, true },
// 20
- { MUT_CLUMSY, 10, 14 },
- { MUT_TELEPORT_CONTROL, 2, 1 },
- { MUT_TELEPORT, 3, 3 },
- { MUT_MAGIC_RESISTANCE, 5, 3 },
- { MUT_FAST, 1, 3 },
- { MUT_ACUTE_VISION, 2, 1 },
- { MUT_DEFORMED, 8, 3 },
- { MUT_TELEPORT_AT_WILL, 2, 3 },
- { MUT_SPIT_POISON, 8, 3 },
- { MUT_MAPPING, 3, 3 },
+ { MUT_CLUMSY, 10, 14, true },
+ { MUT_TELEPORT_CONTROL, 2, 1, false },
+ { MUT_TELEPORT, 3, 3, true },
+ { MUT_MAGIC_RESISTANCE, 5, 3, false },
+ { MUT_FAST, 1, 3, false },
+ { MUT_ACUTE_VISION, 2, 1, false },
+ { MUT_DEFORMED, 8, 3, true },
+ { MUT_TELEPORT_AT_WILL, 2, 3, false },
+ { MUT_SPIT_POISON, 8, 3, false },
+ { MUT_MAPPING, 3, 3, false },
// 30
- { MUT_BREATHE_FLAMES, 4, 3 },
- { MUT_BLINK, 3, 3 },
- { MUT_HORNS, 7, 3 },
- { MUT_STRONG_STIFF, 10, 3 },
- { MUT_FLEXIBLE_WEAK, 10, 3 },
- { MUT_LOST, 6, 3 },
- { MUT_CLARITY, 6, 1 },
- { MUT_BERSERK, 7, 3 },
- { MUT_DETERIORATION, 10, 3 },
- { MUT_BLURRY_VISION, 10, 3 },
+ { MUT_BREATHE_FLAMES, 4, 3, false },
+ { MUT_BLINK, 3, 3, false },
+ { MUT_HORNS, 7, 3, false },
+ { MUT_STRONG_STIFF, 10, 3, false },
+ { MUT_FLEXIBLE_WEAK, 10, 3, false },
+ { MUT_LOST, 6, 3, true },
+ { MUT_CLARITY, 6, 1, false },
+ { MUT_BERSERK, 7, 3, true },
+ { MUT_DETERIORATION, 10, 3, true },
+ { MUT_BLURRY_VISION, 10, 3, true },
// 40
- { MUT_MUTATION_RESISTANCE, 4, 3 },
- { MUT_FRAIL, 10, 3 },
- { MUT_ROBUST, 5, 3 },
+ { MUT_MUTATION_RESISTANCE, 4, 3, false },
+ { MUT_FRAIL, 10, 3, true },
+ { MUT_ROBUST, 5, 3, false },
/* Some demonic powers start here: */
- { MUT_TORMENT_RESISTANCE, 0, 1 },
- { MUT_NEGATIVE_ENERGY_RESISTANCE, 0, 3 },
- { MUT_SUMMON_MINOR_DEMONS, 0, 1 },
- { MUT_SUMMON_DEMONS, 0, 1 },
- { MUT_HURL_HELLFIRE, 0, 1 },
- { MUT_CALL_TORMENT, 0, 1 },
- { MUT_RAISE_DEAD, 0, 1 },
+ { MUT_TORMENT_RESISTANCE, 0, 1, false },
+ { MUT_NEGATIVE_ENERGY_RESISTANCE, 0, 3, false },
+ { MUT_SUMMON_MINOR_DEMONS, 0, 1, false },
+ { MUT_SUMMON_DEMONS, 0, 1, false },
+ { MUT_HURL_HELLFIRE, 0, 1, false },
+ { MUT_CALL_TORMENT, 0, 1, false },
+ { MUT_RAISE_DEAD, 0, 1, false },
// 50
- { MUT_CONTROL_DEMONS, 0, 1 },
- { MUT_PANDEMONIUM, 0, 1 },
- { MUT_DEATH_STRENGTH, 0, 1 },
- { MUT_CHANNEL_HELL, 0, 1 },
- { MUT_DRAIN_LIFE, 0, 1 },
- { MUT_THROW_FLAMES, 0, 1 },
- { MUT_THROW_FROST, 0, 1 },
- { MUT_SMITE, 0, 1 },
- { MUT_CLAWS, 2, 3 },
- { MUT_HOOVES, 1, 1 },
+ { MUT_CONTROL_DEMONS, 0, 1, false },
+ { MUT_PANDEMONIUM, 0, 1, false },
+ { MUT_DEATH_STRENGTH, 0, 1, false },
+ { MUT_CHANNEL_HELL, 0, 1, false },
+ { MUT_DRAIN_LIFE, 0, 1, false },
+ { MUT_THROW_FLAMES, 0, 1, false },
+ { MUT_THROW_FROST, 0, 1, false },
+ { MUT_SMITE, 0, 1, false },
+ { MUT_CLAWS, 2, 3, false },
+ { MUT_HOOVES, 1, 1, false },
// 60
- { MUT_FANGS, 1, 3 },
- { MUT_BREATHE_POISON, 0, 1 },
- { MUT_STINGER, 0, 3 },
- { MUT_BIG_WINGS, 0, 3 },
- { MUT_BLUE_MARKS, 0, 3 },
- { MUT_GREEN_MARKS, 0, 3 },
+ { MUT_FANGS, 1, 3, false },
+ { MUT_BREATHE_POISON, 0, 1, false },
+ { MUT_STINGER, 0, 3, false },
+ { MUT_BIG_WINGS, 0, 1, false },
+ { MUT_BLUE_MARKS, 0, 3, false },
+ { MUT_GREEN_MARKS, 0, 3, false },
// Four placeholders:
- { RANDOM_MUTATION, 0, 3 },
- { RANDOM_MUTATION, 0, 3 },
- { RANDOM_MUTATION, 0, 3 },
- { RANDOM_MUTATION, 0, 3 },
+ { RANDOM_MUTATION, 0, 3, false },
+ { RANDOM_MUTATION, 0, 3, false },
+ { RANDOM_MUTATION, 0, 3, false },
+ { RANDOM_MUTATION, 0, 3, false },
// 70
- { MUT_RED_SCALES, 2, 3 },
- { MUT_NACREOUS_SCALES, 1, 3 },
- { MUT_GREY2_SCALES, 2, 3 },
- { MUT_METALLIC_SCALES, 1, 3 },
- { MUT_BLACK2_SCALES, 2, 3 },
- { MUT_WHITE_SCALES, 2, 3 },
- { MUT_YELLOW_SCALES, 2, 3 },
- { MUT_BROWN_SCALES, 2, 3 },
- { MUT_BLUE_SCALES, 2, 3 },
- { MUT_PURPLE_SCALES, 2, 3 },
+ { MUT_RED_SCALES, 2, 3, false },
+ { MUT_NACREOUS_SCALES, 1, 3, false },
+ { MUT_GREY2_SCALES, 2, 3, false },
+ { MUT_METALLIC_SCALES, 1, 3, false },
+ { MUT_BLACK2_SCALES, 2, 3, false },
+ { MUT_WHITE_SCALES, 2, 3, false },
+ { MUT_YELLOW_SCALES, 2, 3, false },
+ { MUT_BROWN_SCALES, 2, 3, false },
+ { MUT_BLUE_SCALES, 2, 3, false },
+ { MUT_PURPLE_SCALES, 2, 3, false },
// 80
- { MUT_SPECKLED_SCALES, 2, 3 },
- { MUT_ORANGE_SCALES, 2, 3 },
- { MUT_INDIGO_SCALES, 2, 3 },
- { MUT_RED2_SCALES, 1, 3 },
- { MUT_IRIDESCENT_SCALES, 1, 3 },
- { MUT_PATTERNED_SCALES, 1, 3 },
+ { MUT_SPECKLED_SCALES, 2, 3, false },
+ { MUT_ORANGE_SCALES, 2, 3, false },
+ { MUT_INDIGO_SCALES, 2, 3, false },
+ { MUT_RED2_SCALES, 1, 3, false },
+ { MUT_IRIDESCENT_SCALES, 1, 3, false },
+ { MUT_PATTERNED_SCALES, 1, 3, false },
};
#ifdef DEBUG_DIAGNOSTICS
-
void sanity_check_mutation_defs()
{
ASSERT(ARRAYSIZE(mutation_defs) == NUM_MUTATIONS);
@@ -929,9 +928,14 @@ void sanity_check_mutation_defs()
|| mdef.mutation == RANDOM_MUTATION);
}
}
-
#endif
+void fixup_mutations()
+{
+ if (player_genus(GENPC_DRACONIAN))
+ mutation_defs[MUT_BIG_WINGS].rarity = 1;
+}
+
formatted_string describe_mutations()
{
std::string result;
@@ -1322,16 +1326,75 @@ static int calc_mutation_amusement_value(mutation_type which_mutation)
return (amusement);
}
-static bool accept_mutation( mutation_type mutat )
+static bool accept_mutation( mutation_type mutat, bool ignore_rarity = false )
{
if ( you.mutation[mutat] >= mutation_defs[mutat].levels )
- return false;
+ return (false);
+
+ if ( ignore_rarity )
+ return (true);
const int rarity = mutation_defs[mutat].rarity + you.demon_pow[mutat];
// low rarity means unlikely to choose it
return (rarity > random2(10));
}
+static mutation_type get_random_xom_mutation()
+{
+ mutation_type mutat = NUM_MUTATIONS;
+ do
+ {
+ mutat = static_cast<mutation_type>(random2(NUM_MUTATIONS));
+
+ if (one_chance_in(1000))
+ return (NUM_MUTATIONS);
+ if (one_chance_in(5))
+ {
+ switch (random2(8))
+ {
+ case 0: mutat = MUT_WEAK; break;
+ case 1: mutat = MUT_DOPEY; break;
+ case 2: mutat = MUT_CLUMSY; break;
+ case 3: mutat = MUT_DEFORMED; break;
+ case 4: mutat = MUT_LOST; break;
+ case 5: mutat = MUT_DETERIORATION; break;
+ case 6: mutat = MUT_BLURRY_VISION; break;
+ case 7: mutat = MUT_FRAIL; break;
+ }
+ }
+ }
+ while ( !accept_mutation(mutat) );
+
+ return (mutat);
+}
+
+static mutation_type get_random_mutation(bool prefer_good,
+ int preferred_multiplier)
+{
+ int cweight = 0;
+ mutation_type chosen = NUM_MUTATIONS;
+ for (int i = 0; i < NUM_MUTATIONS; ++i)
+ {
+ if (!mutation_defs[i].rarity)
+ continue;
+
+ const mutation_type curr = static_cast<mutation_type>(i);
+ if (!accept_mutation(curr, true))
+ continue;
+
+ const bool weighted = mutation_defs[i].bad != prefer_good;
+ int weight = mutation_defs[i].rarity;
+ if (weighted)
+ weight = weight * preferred_multiplier / 100;
+
+ cweight += weight;
+
+ if (random2(cweight) < weight)
+ chosen = curr;
+ }
+ return (chosen);
+}
+
bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation,
bool demonspawn)
{
@@ -1407,28 +1470,13 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation,
}
else if (which_mutation == RANDOM_XOM_MUTATION)
{
- do
- {
- mutat = static_cast<mutation_type>(random2(NUM_MUTATIONS));
-
- if (one_chance_in(1000))
- return false;
- if (one_chance_in(5))
- {
- switch (random2(8))
- {
- case 0: mutat = MUT_WEAK; break;
- case 1: mutat = MUT_DOPEY; break;
- case 2: mutat = MUT_CLUMSY; break;
- case 3: mutat = MUT_DEFORMED; break;
- case 4: mutat = MUT_LOST; break;
- case 5: mutat = MUT_DETERIORATION; break;
- case 6: mutat = MUT_BLURRY_VISION; break;
- case 7: mutat = MUT_FRAIL; break;
- }
- }
- }
- while ( !accept_mutation(mutat) );
+ if ((mutat = get_random_xom_mutation()) == NUM_MUTATIONS)
+ return (false);
+ }
+ else if (which_mutation == RANDOM_GOOD_MUTATION)
+ {
+ if ((mutat = get_random_mutation(true, 500)) == NUM_MUTATIONS)
+ return (false);
}
else if (you.mutation[mutat] >= 3 &&
mutat != MUT_STRONG && mutat != MUT_CLEVER &&
diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h
index ab63d452d1..615f8beccb 100644
--- a/crawl-ref/source/mutation.h
+++ b/crawl-ref/source/mutation.h
@@ -22,8 +22,13 @@ struct mutation_def
mutation_type mutation;
short rarity; // Rarity of the mutation.
short levels; // The number of levels of the mutation.
+ bool bad; // A mutation that's more bad than good. Xom uses
+ // this to decide which mutations to hand out as
+ // rewards.
};
+void fixup_mutations();
+
// last updated 12may2000 {dlb}
/* ***********************************************************************
* called from: acr - decks - effects - fight - food - it_use2 - items -
@@ -32,7 +37,6 @@ struct mutation_def
bool mutate(mutation_type which_mutation, bool failMsg = true,
bool force_mutation = false, bool demonspawn = false);
-
// last updated 12may2000 {dlb}
/* ***********************************************************************
* called from: acr
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 9d97519a83..c318c7d2e5 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -493,8 +493,8 @@ static bool xom_is_good(int sever)
god_speaks(GOD_XOM,
(temp_rand == 0) ? "\"Serve the mortal, my child!\"" :
- (temp_rand == 1) ? "Xom grants you a demonic assistant."
- : "Xom opens a gate.");
+ (temp_rand == 1) ? "\"Serve the toy, my child!\"" :
+ "Xom opens a gate.");
done = true;
}
}
@@ -542,7 +542,7 @@ static bool xom_is_good(int sever)
int j = random2(4);
while (i < j)
{
- if (mutate(RANDOM_MUTATION, failMsg, true))
+ if (mutate(RANDOM_GOOD_MUTATION, failMsg, true))
done = true;
else
failMsg = false;
@@ -557,8 +557,8 @@ static bool xom_is_good(int sever)
{
temp_rand = random2(3);
god_speaks(GOD_XOM,
- (temp_rand == 0) ? "\"Serve the toy, my child!\"" :
- (temp_rand == 1) ? "Xom grants you a demonic servitor."
+ (temp_rand == 0) ? "Xom grants you a demonic assistant."
+ : (temp_rand == 1) ? "Xom grants you a demonic servitor."
: "Xom opens a gate.");
done = true;
}
@@ -618,8 +618,7 @@ static bool xom_is_bad(int sever)
(temp_rand == 2) ? "Xom's power almost touches on you for a moment."
: "You almost hear Xom's maniacal laughter.");
- miscast_effect( SPTYP_RANDOM, 0, 0, 0,
- "the mischievity of Xom" );
+ miscast_effect( SPTYP_RANDOM, 0, 0, 0, "the mischief of Xom" );
done = true;
}