17 #define SPECENUM_NAME disaster_effect_id
18 #define SPECENUM_VALUE0 DE_DESTROY_BUILDING
19 #define SPECENUM_VALUE0NAME "DestroyBuilding"
20 #define SPECENUM_VALUE1 DE_REDUCE_POP
21 #define SPECENUM_VALUE1NAME "ReducePopulation"
22 #define SPECENUM_VALUE2 DE_EMPTY_FOODSTOCK
23 #define SPECENUM_VALUE2NAME "EmptyFoodStock"
24 #define SPECENUM_VALUE3 DE_EMPTY_PRODSTOCK
25 #define SPECENUM_VALUE3NAME "EmptyProdStock"
26 #define SPECENUM_VALUE4 DE_POLLUTION
27 #define SPECENUM_VALUE4NAME "Pollution"
28 #define SPECENUM_VALUE5 DE_FALLOUT
29 #define SPECENUM_VALUE5NAME "Fallout"
30 #define SPECENUM_VALUE6 DE_REDUCE_DESTROY
31 #define SPECENUM_VALUE6NAME "ReducePopDestroy"
32 #define SPECENUM_COUNT DE_COUNT
33 #define SPECENUM_BITVECTOR bv_disaster_effects
34 #include "specenum_gen.h"
36 #define DISASTER_BASE_RARITY 1000000
42 struct requirement_vector
reqs;
65 enum disaster_effect_id
effect);
68 const struct city *pcity);
70 #define disaster_type_iterate(_p) \
73 for (_i_ = 0; _i_ < game.control.num_disaster_types; _i_++) { \
74 struct disaster_type *_p = disaster_by_number(_i_);
76 #define disaster_type_iterate_end \
struct disaster_type * disaster_by_number(Disaster_type_id id)
Return disaster type of given id.
bool can_disaster_happen(const struct disaster_type *pdis, const struct city *pcity)
Whether disaster can happen in given city.
const char * disaster_rule_name(struct disaster_type *pdis)
Return untranslated name of this disaster type.
Disaster_type_id disaster_number(const struct disaster_type *pdis)
Return the disaster id.
Disaster_type_id disaster_index(const struct disaster_type *pdis)
Return the disaster index.
bool disaster_has_effect(const struct disaster_type *pdis, enum disaster_effect_id effect)
Check if disaster provides effect.
void disaster_types_init()
Initialize disaster_type structures.
void disaster_types_free()
Free the memory associated with disaster types.
const char * disaster_name_translation(struct disaster_type *pdis)
Return translated name of this disaster type.
struct name_translation name
struct requirement_vector reqs
bv_disaster_effects effects