1 /**
2  * @file
3  * @brief God-granted abilities.
4 **/
5 
6 #pragma once
7 
8 #include "ability-type.h"
9 #include "beh-type.h"
10 #include "enum.h"
11 #include "god-type.h"
12 #include "item-prop-enum.h" // brand_type
13 #include "los-type.h"
14 #include "recite-eligibility.h"
15 #include "recite-type.h"
16 #include "spl-cast.h"
17 
18 class dist;
19 
20 #define BEOGH_RANGE_WPN_GIFT_KEY "given beogh range weapon"
21 #define BEOGH_MELEE_WPN_GIFT_KEY "given beogh melee weapon"
22 #define BEOGH_ARM_GIFT_KEY "given beogh armour"
23 #define BEOGH_SH_GIFT_KEY "given beogh shield"
24 
25 #define AVAILABLE_SAC_KEY "available_sacrifices"
26 #define HEALTH_SAC_KEY "current_health_sacrifice"
27 #define ESSENCE_SAC_KEY "current_essence_sacrifice"
28 #define PURITY_SAC_KEY "current_purity_sacrifice"
29 #define ARCANA_SAC_KEY "current_arcane_sacrifices"
30 
31 #define RU_SACRIFICE_PROGRESS_KEY "ru_progress_to_next_sacrifice"
32 #define RU_SACRIFICE_DELAY_KEY "ru_sacrifice_delay"
33 #define RU_SACRIFICE_PENALTY_KEY "ru_sacrifice_penalty"
34 #define RU_SAC_XP_LEVELS 2
35 
36 const char * const GOZAG_POTIONS_KEY = "gozag_potions%d";
37 const char * const GOZAG_PRICE_KEY = "gozag_price%d";
38 
39 const char * const GOZAG_SHOPKEEPER_NAME_KEY = "gozag_shopkeeper_%d";
40 const char * const GOZAG_SHOP_TYPE_KEY       = "gozag_shop_type_%d";
41 const char * const GOZAG_SHOP_SUFFIX_KEY     = "gozag_shop_suffix_%d";
42 const char * const GOZAG_SHOP_COST_KEY       = "gozag_shop_cost_%d";
43 
44 #define GOZAG_GOLD_AURA_KEY "gozag_gold_aura_amount"
45 #define GOZAG_POTION_PETITION_AMOUNT 400
46 #define GOZAG_SHOP_BASE_MULTIPLIER 100
47 #define GOZAG_SHOP_MOD_MULTIPLIER 25
48 #define GOZAG_BRIBE_AMOUNT 3000
49 #define GOZAG_MAX_BRIBABILITY 8
50 #define GOZAG_MAX_POTIONS 3
51 #define GOZAG_MAX_SHOPS 3
52 
53 #define USKAYAW_AUDIENCE_TIMER "uskayaw_audience_timer"
54 #define USKAYAW_BOND_TIMER "uskayaw_bond_timer"
55 #define USKAYAW_NUM_MONSTERS_HURT "uskayaw_num_monsters_hurt"
56 #define USKAYAW_MONSTER_HURT_VALUE "uskayaw_monster_hurt_value"
57 #define USKAYAW_AUT_SINCE_PIETY_GAIN "uskayaw_aut_since_piety_gain"
58 
59 #define WU_JIAN_HEAVENLY_STORM_KEY "wu_jian_heavenly_storm_amount"
60 #define WU_JIAN_HEAVENLY_STORM_INITIAL 5
61 #define WU_JIAN_HEAVENLY_STORM_MAX 15
62 
63 #define AVAILABLE_CURSE_KEY "available_curses"
64 #define CURSE_KNOWLEDGE_KEY "current_curse_offer"
65 
66 #define ASHENZARI_CURSE_PROGRESS_KEY "ashenzari_progress_to_next_curse"
67 #define ASHENZARI_CURSE_DELAY_KEY "ashenzari_curse_delay"
68 #define ASHENZARI_BASE_PIETY 2
69 #define ASHENZARI_PIETY_SCALE 168
70 
71 struct bolt;
72 class stack_iterator;
73 
74 typedef FixedVector<int, NUM_RECITE_TYPES> recite_counts;
75 
76 bool can_do_capstone_ability(god_type god);
77 bool bless_weapon(god_type god, brand_type brand, colour_t colour);
78 bool zin_donate_gold();
79 string zin_recite_text(const int seed, const int prayertype, int step);
80 bool zin_check_able_to_recite(bool quiet = false);
81 recite_eligibility zin_check_recite_to_single_monster(const monster *mon,
82                                                   recite_counts &eligibility,
83                                                   bool quiet = false);
84 int zin_check_recite_to_monsters(bool quiet = false);
85 bool zin_recite_to_single_monster(const coord_def& where);
86 int zin_recite_power();
87 bool zin_vitalisation();
88 void zin_remove_divine_stamina();
89 bool zin_remove_all_mutations();
90 void zin_sanctuary();
91 
92 void tso_divine_shield();
93 void tso_remove_divine_shield();
94 
95 void elyvilon_purification();
96 bool elyvilon_divine_vigour();
97 void elyvilon_remove_divine_vigour();
98 
99 bool vehumet_supports_spell(spell_type spell);
100 
101 void sif_do_channel_energy(int pow);
102 
103 void trog_do_trogs_hand(int power);
104 void trog_remove_trogs_hand();
105 
106 bool jiyva_remove_bad_mutation();
107 
108 bool given_gift(const monster* mons);
109 bool beogh_can_gift_items_to(const monster* mons, bool quiet = true);
110 bool beogh_gift_item();
111 bool beogh_resurrect();
112 
113 bool yred_injury_mirror();
114 bool yred_can_enslave_soul(monster* mon);
115 void yred_make_enslaved_soul(monster* mon, bool force_hostile = false);
116 
117 bool kiku_receive_corpses(int pow);
118 bool kiku_take_corpse();
119 bool kiku_gift_capstone_spells();
120 
121 bool fedhas_passthrough_class(const monster_type mc);
122 bool fedhas_passthrough(const monster* target);
123 bool fedhas_passthrough(const monster_info* target);
124 int fedhas_rain(const coord_def &target);
125 
126 void lugonu_bend_space();
127 
128 void cheibriados_time_bend(int pow);
129 void cheibriados_temporal_distortion();
130 bool cheibriados_slouch();
131 void cheibriados_time_step(int pow);
132 
133 void ashenzari_offer_new_curse();
134 bool ashenzari_curse_item();
135 bool ashenzari_uncurse_item();
136 string desc_curse_skills(const CrawlStoreValue& curse);
137 string curse_abbr(const CrawlStoreValue& curse);
138 string curse_name(const CrawlStoreValue& curse);
139 const vector<skill_type>& curse_skills(const CrawlStoreValue& curse);
140 
141 bool can_convert_to_beogh();
142 void spare_beogh_convert();
143 
144 bool dithmenos_shadow_step();
145 
146 bool gozag_setup_potion_petition(bool quiet = false);
147 bool gozag_potion_petition();
148 int gozag_price_for_shop(bool max = false);
149 bool gozag_setup_call_merchant(bool quiet = false);
150 bool gozag_call_merchant();
151 branch_type gozag_fixup_branch(branch_type branch);
152 int gozag_type_bribable(monster_type type);
153 bool gozag_branch_bribable(branch_type branch);
154 void gozag_deduct_bribe(branch_type br, int amount);
155 bool gozag_check_bribe_branch(bool quiet = false);
156 bool gozag_bribe_branch();
157 
158 spret qazlal_upheaval(coord_def target, bool quiet = false,
159                            bool fail = false, dist *player_target=nullptr);
160 spret qazlal_elemental_force(bool fail);
161 bool qazlal_disaster_area();
162 
163 void init_sac_index();
164 int get_sacrifice_piety(ability_type sac, bool include_skill = true);
165 void ru_offer_new_sacrifices();
166 string ru_sac_text(ability_type sac);
167 string ru_sacrifice_description(ability_type sac);
168 bool ru_do_sacrifice(ability_type sac);
169 bool ru_reject_sacrifices(bool forced_rejection = false);
170 void ru_reset_sacrifice_timer(bool clear_timer = false,
171                               bool faith_penalty = false);
172 bool will_ru_retaliate();
173 void ru_do_retribution(monster* mons, int damage);
174 void ru_draw_out_power();
175 bool ru_power_leap();
176 int cell_has_valid_target(coord_def where);
177 bool ru_apocalypse();
178 string ru_sacrifice_vector(ability_type sac);
179 
180 bool uskayaw_stomp();
181 bool uskayaw_line_pass();
182 spret uskayaw_grand_finale(bool fail);
183 
184 bool hepliaklqana_choose_ancestor_type(int ancestor_type);
185 spret hepliaklqana_idealise(bool fail);
186 spret hepliaklqana_transference(bool fail);
187 void hepliaklqana_choose_identity();
188 
189 bool wu_jian_can_wall_jump_in_principle(const coord_def& target);
190 bool wu_jian_can_wall_jump(const coord_def& target, string &error_ret);
191 bool wu_jian_do_wall_jump(coord_def targ);
192 spret wu_jian_wall_jump_ability();
193 void wu_jian_heavenly_storm();
194 
195 void okawaru_remove_heroism();
196 void okawaru_remove_finesse();
197