00001
00002
00003
00004
00005
00006
00007 #ifndef BRANCH_H
00008 #define BRANCH_H
00009
00010 #include "enum.h"
00011
00012 struct fog_machine_data;
00013
00014 enum branch_flag_type
00015 {
00016 BFLAG_NONE = 0,
00017
00018 BFLAG_NO_TELE_CONTROL = (1 << 0),
00019 BFLAG_NOT_MAPPABLE = (1 << 1),
00020 BFLAG_NO_MAGIC_MAP = (1 << 2),
00021 BFLAG_HAS_ORB = (1 << 3),
00022
00023 BFLAG_ISLANDED = (1 << 4),
00024 };
00025
00026 struct Branch
00027 {
00028 branch_type id;
00029 branch_type parent_branch;
00030
00031 int mindepth;
00032 int maxdepth;
00033
00034 int depth;
00035 int startdepth;
00036
00037 uint32_t branch_flags;
00038 uint32_t default_level_flags;
00039 dungeon_feature_type entry_stairs;
00040 dungeon_feature_type exit_stairs;
00041 const char* shortname;
00042 const char* longname;
00043 const char* abbrevname;
00044 const char* entry_message;
00045 bool has_uniques;
00046 uint8_t floor_colour;
00047 uint8_t rock_colour;
00048 int (*mons_rarity_function)(int);
00049 int (*mons_level_function)(int);
00050 int (*num_traps_function)(int);
00051 trap_type (*rand_trap_function)(int);
00052 int (*num_fogs_function)(int);
00053 void (*rand_fog_function)(int,fog_machine_data&);
00054 int travel_shortcut;
00055 bool any_upstair_exits;
00056 bool dangerous_bottom_level;
00057 int ambient_noise;
00058 };
00059
00060 extern Branch branches[];
00061
00062 Branch& your_branch();
00063
00064 bool at_branch_bottom();
00065 bool is_hell_subbranch(branch_type branch);
00066 level_id branch_entry_level(branch_type branch);
00067 level_id current_level_parent();
00068
00069 branch_type str_to_branch(const std::string &branch,
00070 branch_type err = NUM_BRANCHES);
00071
00072 int current_level_ambient_noise();
00073
00074 const char *level_area_type_name(int level_type);
00075 level_area_type str_to_level_area_type(const std::string &s);
00076
00077 bool set_branch_flags(uint32_t flags, bool silent = false,
00078 branch_type branch = NUM_BRANCHES);
00079 bool unset_branch_flags(uint32_t flags, bool silent = false,
00080 branch_type branch = NUM_BRANCHES);
00081 uint32_t get_branch_flags(branch_type branch = NUM_BRANCHES);
00082
00083 #endif