Apply the new ground_level method.
[crawl.git] / crawl-ref / source / mutation.h
blob553298e0c1f22e713fc053686f900c614d7c8737
1 /*
2 * File: mutation.cc
3 * Summary: Functions for handling player mutations.
4 * Written by: Linley Henzell
5 */
8 #ifndef MUTATION_H
9 #define MUTATION_H
11 #include <string>
13 class formatted_string;
15 struct body_facet_def
17 equipment_type eq;
18 mutation_type mut;
19 int level_lost;
22 struct facet_def
24 int tier;
25 mutation_type muts[3];
26 int tiers[3];
29 struct demon_mutation_info
31 mutation_type mut;
32 int tier;
33 int facet;
35 demon_mutation_info(mutation_type m, int t, int f)
36 : mut(m), tier(t), facet(f) { }
39 struct mutation_def
41 mutation_type mutation;
42 short rarity; // Rarity of the mutation.
43 short levels; // The number of levels of the mutation.
44 bool bad; // A mutation that's more bad than good. Xom uses
45 // this to decide which mutations to hand out as
46 // rewards.
47 bool physical; // A mutation affecting a character's outward
48 // appearance.
49 const char* short_desc;// What appears on the '%' screen.
50 const char* have[3]; // What appears on the 'A' screen.
51 const char* gain[3]; // Message when you gain the mutation.
52 const char* lose[3]; // Message when you lose the mutation.
53 const char* wizname; // For gaining it in wizmode.
56 void init_mut_index();
58 bool is_valid_mutation(mutation_type mut);
59 bool is_body_facet(mutation_type mut);
60 const mutation_def& get_mutation_def(mutation_type mut);
62 void fixup_mutations();
64 bool mutate(mutation_type which_mutation, bool failMsg = true,
65 bool force_mutation = false, bool god_gift = false,
66 bool stat_gain_potion = false, bool demonspawn = false);
68 inline bool give_bad_mutation(bool failMsg = true, bool force_mutation = false)
70 return (mutate(RANDOM_BAD_MUTATION, failMsg, force_mutation,
71 false, false, false));
74 void display_mutations();
75 bool mutation_is_fully_active(mutation_type mut);
76 formatted_string describe_mutations();
78 bool delete_mutation(mutation_type which_mutation, bool failMsg = true,
79 bool force_mutation = false, bool god_gift = false,
80 bool disallow_mismatch = false);
82 bool delete_all_mutations();
84 std::string mutation_name(mutation_type which_mutat, int level = -1,
85 bool colour = false);
87 void roll_demonspawn_mutations();
89 bool perma_mutate(mutation_type which_mut, int how_much);
90 int how_mutated(bool all = false, bool levels = false);
92 void check_demonic_guardian();
93 void check_antennae_detect();
94 int handle_pbd_corpses(bool do_rot);
96 #endif