00001 #ifndef MGEN_DATA_H
00002 #define MGEN_DATA_H
00003
00004 #include "mgen_enum.h"
00005 #include "player.h"
00006
00007
00008
00009 const std::string TUKIMA_WEAPON = "tukima-weapon";
00010
00011
00012 struct mgen_data
00013 {
00014
00015 monster_type cls;
00016
00017
00018
00019
00020 monster_type base_type;
00021
00022
00023
00024
00025
00026 beh_type behaviour;
00027
00028
00029
00030 actor* summoner;
00031
00032
00033
00034
00035 int abjuration_duration;
00036
00037
00038
00039
00040 int summon_type;
00041
00042
00043 coord_def pos;
00044
00045
00046
00047
00048
00049
00050
00051 dungeon_feature_type preferred_grid_feature;
00052
00053
00054
00055
00056
00057
00058 unsigned short foe;
00059
00060
00061 uint32_t flags;
00062
00063
00064
00065
00066 god_type god;
00067
00068
00069
00070
00071
00072
00073 int number;
00074
00075
00076 int colour;
00077
00078
00079
00080
00081 int power;
00082
00083
00084
00085 proximity_type proximity;
00086
00087
00088
00089 level_area_type level_type;
00090
00091
00092
00093
00094
00095
00096
00097
00098 unsigned map_mask;
00099
00100
00101 int hd;
00102 int hp;
00103
00104
00105
00106 uint64_t extra_flags;
00107
00108
00109 std::string mname;
00110
00111
00112
00113 std::string non_actor_summoner;
00114
00115
00116 CrawlHashTable props;
00117
00118 mgen_data(monster_type mt = RANDOM_MONSTER,
00119 beh_type beh = BEH_HOSTILE,
00120 actor* sner = 0,
00121 int abj = 0,
00122 int st = 0,
00123 const coord_def &p = coord_def(-1, -1),
00124 unsigned short mfoe = MHITNOT,
00125 uint32_t genflags = 0,
00126 god_type which_god = GOD_NO_GOD,
00127 monster_type base = MONS_NO_MONSTER,
00128 int monnumber = 0,
00129 int moncolour = BLACK,
00130 int monpower = you.absdepth0,
00131 proximity_type prox = PROX_ANYWHERE,
00132 level_area_type ltype = you.level_type,
00133 int mhd = 0, int mhp = 0,
00134 uint64_t extflags = 0,
00135 std::string monname = "",
00136 std::string nas = "")
00137
00138 : cls(mt), base_type(base), behaviour(beh), summoner(sner),
00139 abjuration_duration(abj), summon_type(st), pos(p),
00140 preferred_grid_feature(DNGN_UNSEEN), foe(mfoe), flags(genflags),
00141 god(which_god), number(monnumber), colour(moncolour),
00142 power(monpower), proximity(prox), level_type(ltype), map_mask(0),
00143 hd(mhd), hp(mhp), extra_flags(extflags), mname(monname),
00144 non_actor_summoner(nas), props()
00145 {
00146 ASSERT(summon_type == 0 || (abj >= 1 && abj <= 6)
00147 || mt == MONS_BALL_LIGHTNING || mt == MONS_ORB_OF_DESTRUCTION);
00148 }
00149
00150 bool permit_bands() const { return (flags & MG_PERMIT_BANDS); }
00151 bool force_place() const { return (flags & MG_FORCE_PLACE); }
00152 bool needs_patrol_point() const { return (flags & MG_PATROLLING); }
00153
00154
00155
00156 bool use_position() const;
00157
00158 bool summoned() const { return (abjuration_duration > 0); }
00159
00160 static mgen_data sleeper_at(monster_type what,
00161 const coord_def &where,
00162 unsigned genflags = 0)
00163 {
00164 return mgen_data(what, BEH_SLEEP, 0, 0, 0, where, MHITNOT, genflags);
00165 }
00166
00167 static mgen_data hostile_at(monster_type mt,
00168 std::string nsummoner,
00169 bool alert = false,
00170 int abj = 0,
00171 int st = 0,
00172 const coord_def &p = coord_def(-1, -1),
00173 uint32_t genflags = 0,
00174 god_type ngod = GOD_NO_GOD,
00175 monster_type base = MONS_NO_MONSTER)
00176
00177 {
00178 return mgen_data(mt, BEH_HOSTILE, 0, abj, st, p,
00179 alert ? MHITYOU : MHITNOT,
00180 genflags, ngod, base, 0, BLACK, you.absdepth0,
00181 PROX_ANYWHERE, you.level_type, 0, 0, 0, "", nsummoner);
00182 }
00183 };
00184
00185 #endif