00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MUTATION_H
00009 #define MUTATION_H
00010
00011 #include <string>
00012
00013 class formatted_string;
00014
00015 struct body_facet_def
00016 {
00017 equipment_type eq;
00018 mutation_type mut;
00019 int level_lost;
00020 };
00021
00022 struct facet_def
00023 {
00024 int tier;
00025 mutation_type muts[3];
00026 int tiers[3];
00027 };
00028
00029 struct demon_mutation_info
00030 {
00031 mutation_type mut;
00032 int tier;
00033 int facet;
00034
00035 demon_mutation_info(mutation_type m, int t, int f)
00036 : mut(m), tier(t), facet(f) { }
00037 };
00038
00039 struct mutation_def
00040 {
00041 mutation_type mutation;
00042 short rarity;
00043 short levels;
00044 bool bad;
00045
00046
00047 bool physical;
00048
00049 const char* short_desc;
00050 const char* have[3];
00051 const char* gain[3];
00052 const char* lose[3];
00053 const char* wizname;
00054 };
00055
00056 void init_mut_index();
00057
00058 bool is_valid_mutation(mutation_type mut);
00059 bool is_body_facet(mutation_type mut);
00060 const mutation_def& get_mutation_def(mutation_type mut);
00061
00062 void fixup_mutations();
00063
00064 bool mutate(mutation_type which_mutation, bool failMsg = true,
00065 bool force_mutation = false, bool god_gift = false,
00066 bool stat_gain_potion = false, bool demonspawn = false);
00067
00068 inline bool give_bad_mutation(bool failMsg = true, bool force_mutation = false)
00069 {
00070 return (mutate(RANDOM_BAD_MUTATION, failMsg, force_mutation,
00071 false, false, false));
00072 }
00073
00074 void display_mutations();
00075 bool mutation_is_fully_active(mutation_type mut);
00076 formatted_string describe_mutations();
00077
00078 bool delete_mutation(mutation_type which_mutation, bool failMsg = true,
00079 bool force_mutation = false, bool god_gift = false,
00080 bool disallow_mismatch = false);
00081
00082 bool delete_all_mutations();
00083
00084 std::string mutation_name(mutation_type which_mutat, int level = -1,
00085 bool colour = false);
00086
00087 void roll_demonspawn_mutations();
00088
00089 bool perma_mutate(mutation_type which_mut, int how_much);
00090 int how_mutated(bool all = false, bool levels = false);
00091
00092 void check_demonic_guardian();
00093 void check_antennae_detect();
00094 int handle_pbd_corpses(bool do_rot);
00095
00096 #endif