00001
00002
00003
00004
00005
00006
00007
00008 #ifndef CLOUD_H
00009 #define CLOUD_H
00010
00011 #include "externs.h"
00012
00013 enum fog_machine_type
00014 {
00015 FM_GEYSER,
00016 FM_SPREAD,
00017 FM_BROWNIAN,
00018 NUM_FOG_MACHINE_TYPES,
00019 };
00020
00021 struct fog_machine_data
00022 {
00023 fog_machine_type fm_type;
00024 cloud_type cl_type;
00025 int size;
00026 int power;
00027 };
00028
00029 cloud_type random_smoke_type();
00030
00031 cloud_type cloud_type_at(const coord_def &pos);
00032
00033 void delete_cloud(int cloud);
00034 void delete_cloud_at(coord_def p);
00035 void move_cloud(int cloud, const coord_def& newpos);
00036 void move_cloud_to(coord_def src, coord_def dest);
00037 void swap_clouds(coord_def p1, coord_def p2);
00038
00039 void check_place_cloud(cloud_type cl_type, const coord_def& p, int lifetime,
00040 const actor *agent, int spread_rate = -1,
00041 int colour = -1,
00042 std::string name = "", std::string tile = "");
00043 void place_cloud(cloud_type cl_type, const coord_def& ctarget,
00044 int cl_range, const actor *agent,
00045 int spread_rate = -1, int colour = -1, std::string name = "",
00046 std::string tile = "");
00047
00048 void manage_clouds(void);
00049
00050 bool is_opaque_cloud(int cloud_idx);
00051 int steam_cloud_damage(const cloud_struct &cloud);
00052 int steam_cloud_damage(int decay);
00053
00054 cloud_type beam2cloud(beam_type flavour);
00055 beam_type cloud2beam(cloud_type flavour);
00056
00057 int resist_fraction(int resist, int bonus_res = 0);
00058 int max_cloud_damage(cloud_type cl_type, int power = -1);
00059 int actor_apply_cloud(actor *act);
00060
00061 std::string cloud_name_at_index(int cloudno);
00062 std::string cloud_type_name(cloud_type type, bool terse = true);
00063 int get_cloud_colour(int cloudno);
00064 coord_def get_cloud_originator(const coord_def& pos);
00065
00066 bool actor_cloud_immune(const actor *act, const cloud_struct &cloud,
00067 bool temp = true);
00068 bool is_damaging_cloud(cloud_type type, bool temp = false);
00069 bool is_harmless_cloud(cloud_type type);
00070 bool in_what_cloud (cloud_type type);
00071 cloud_type in_what_cloud();
00072
00073
00074 void place_fog_machine(fog_machine_type fm_type, cloud_type cl_type,
00075 int x, int y, int size, int power);
00076
00077 void place_fog_machine(fog_machine_data data, int x, int y);
00078
00079 bool valid_fog_machine_data(fog_machine_data data);
00080
00081 int num_fogs_for_place(int level_number = -1,
00082 const level_id &place = level_id::current());
00083 fog_machine_data random_fog_for_place(int level_number = -1,
00084 const level_id &place = level_id::current());
00085
00086 int fogs_pan_number(int level_number = -1);
00087 fog_machine_data fogs_pan_type(int level_number = -1);
00088
00089 int fogs_abyss_number(int level_number = -1);
00090 fog_machine_data fogs_abyss_type(int level_number = -1);
00091
00092 int fogs_lab_number(int level_number = -1);
00093 fog_machine_data fogs_lab_type(int level_number = -1);
00094
00095 #endif