diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-26 22:17:15 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-26 22:17:15 +0000 |
commit | a893b18e741d4c8b85731ff03b15d1ff4fdb9d76 (patch) | |
tree | 21fe53b5838df45ad800aac0bc00a0079c5128c9 /crawl-ref/source/mutation.h | |
parent | 2d782466ff57f0296e3e0f7601bd47c38a55ef22 (diff) | |
download | crawl-ref-a893b18e741d4c8b85731ff03b15d1ff4fdb9d76.tar.gz crawl-ref-a893b18e741d4c8b85731ff03b15d1ff4fdb9d76.zip |
Mutations cleanup. Fixes [2641583]. Syncing between the various lists
is no longer necessary. However, holes in the mutation numbering will
cause a crash (random2(NUM_MUTATIONS) is used in a few places.)
Breaks saves badly, sorry.
I tested this somewhat but some bugs might have slipped in.
Fixes a few other bugs (e.g. draconians not having any messages
if their wings disappear) and highlights some unused code (e.g.
no way to get the stinger mutation.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9234 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mutation.h')
-rw-r--r-- | crawl-ref/source/mutation.h | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h index cd6fb9d624..333ff5221f 100644 --- a/crawl-ref/source/mutation.h +++ b/crawl-ref/source/mutation.h @@ -10,7 +10,8 @@ #ifndef MUTATION_H #define MUTATION_H -// for formatted_string +#include <string> + class formatted_string; struct mutation_def @@ -23,63 +24,38 @@ struct mutation_def // rewards. bool physical; // A mutation affecting a character's outward // appearance. + const char* have[3]; // What appears on the 'A' screen. + const char* gain[3]; // Message when you gain the mutation. + const char* lose[3]; // Message when you lose the mutation. + const char* wizname; // For gaining it in wizmode. }; +const mutation_def& get_mutation_def(mutation_type mut); + void fixup_mutations(); -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - decks - effects - fight - food - it_use2 - items - - * mutation - religion - spell - spells - * *********************************************************************** */ + bool mutate(mutation_type which_mutation, bool failMsg = true, bool force_mutation = false, bool god_gift = false, bool stat_gain_potion = false, bool demonspawn = false, bool non_fatal = false); -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: acr - * *********************************************************************** */ void display_mutations(); - bool mutation_is_fully_active(mutation_type mut); - formatted_string describe_mutations(); - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: decks - it_use2 - mutation - spells - * *********************************************************************** */ bool delete_mutation(mutation_type which_mutation, bool failMsg = true, bool force_mutation = false, bool non_fatal = false); -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: chardump - * *********************************************************************** */ -// default of level == -1, means to use the player's current level -const char *mutation_name(mutation_type which_mutat, int level = -1); - -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: items - spells - * *********************************************************************** */ +std::string mutation_name(mutation_type which_mutat, int level = -1, + bool colour = false); + bool give_bad_mutation(bool failMsg = true, bool force_mutation = false, bool non_fatal = false); -// last updated 12may2000 {dlb} -/* *********************************************************************** - * called from: player - * *********************************************************************** */ void demonspawn(); bool perma_mutate(mutation_type which_mut, int how_much); int how_mutated(bool all = false, bool levels = false); -#ifdef DEBUG_DIAGNOSTICS -void sanity_check_mutation_defs(); -#endif - #endif |