]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monsters.qh
Remove includes from most headers
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monsters.qh
index 59ed8f2f097f3828ea7ad75a88219a0b658464c7..c21b237bfd2b255a037c6a89fd392d4ad9e7bc93 100644 (file)
@@ -1,21 +1,23 @@
+#ifndef MONSTERS_H
+#define MONSTERS_H
+
 // monster requests
-#define MR_SETUP          1 // (SERVER) setup monster data
-#define MR_THINK                 2 // (SERVER) logic to run every frame
-#define MR_DEATH          3 // (BOTH) called when monster dies
-#define MR_INIT           4 // (BOTH) precaches models/sounds used by this monster
-#define MR_CONFIG         5 // (ALL)
+const int MR_SETUP = 1; // (SERVER) setup monster data
+const int MR_THINK = 2; // (SERVER) logic to run every frame
+const int MR_DEATH = 3; // (SERVER) called when monster dies
+const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster
 
 // functions:
 entity get_monsterinfo(float id);
 
 // special spawn flags
-const float MONSTER_RESPAWN_DEATHPOINT = 2; // re-spawn where we died
-const float MONSTER_TYPE_FLY = 4;
-const float MONSTER_TYPE_SWIM = 8;
-const float MONSTER_SIZE_BROKEN = 16; // TODO: remove when bad models are replaced
-const float MON_FLAG_SUPERMONSTER = 32; // incredibly powerful monster
-const float MON_FLAG_RANGED = 64; // monster shoots projectiles
-const float MON_FLAG_MELEE = 128;
+const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
+const int MONSTER_TYPE_FLY = 32;
+const int MONSTER_TYPE_SWIM = 64;
+const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
+const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
+const int MON_FLAG_RANGED = 512; // monster shoots projectiles
+const int MON_FLAG_MELEE = 1024;
 
 // entity properties of monsterinfo:
 .float monsterid; // MON_...
@@ -24,41 +26,28 @@ const float MON_FLAG_MELEE = 128;
 .float(float) monster_func; // m_...
 .string mdl; // currently a copy of the model
 .string model; // full name of model
-.float spawnflags;
-
-// csqc linking
-#ifndef MENUQC
-.float anim_start_time;
-
-float MSF_UPDATE               = 2;
-float MSF_STATUS               = 4;
-float MSF_SETUP                        = 8;
-float MSF_ANG                  = 16;
-float MSF_MOVE                 = 32;
-float MSF_ANIM                 = 64;
-
-float MSF_FULL_UPDATE  = 16777215;
-#endif
+.int spawnflags;
+.vector mins, maxs; // monster hitbox size
 
 // other useful macros
 #define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest)
 #define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name
 
 // =====================
-//  Monster Registration
+//     Monster Registration
 // =====================
 
 float m_null(float dummy);
 void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname);
 void register_monsters_done();
 
-const float MON_MAXCOUNT = 24;
-#define MON_FIRST 1
-float MON_COUNT;
-float MON_LAST;
+const int MON_MAXCOUNT = 24;
+const int MON_FIRST = 1;
+int MON_COUNT;
+int MON_LAST;
 
 #define REGISTER_MONSTER_2(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
-       float id; \
+       int id; \
        float func(float); \
        void RegisterMonsters_##id() \
        { \
@@ -67,24 +56,16 @@ float MON_LAST;
                register_monster(id,func,monsterflags,min_s,max_s,modelname,shortname,mname); \
        } \
        ACCUMULATE_FUNCTION(RegisterMonsters, RegisterMonsters_##id)
+#ifdef MENUQC
+#define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
+       REGISTER_MONSTER_2(MON_##id,m_null,monsterflags,min_s,max_s,modelname,shortname,mname)
+#else
 #define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
        REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname)
-
-#define MON_DUPECHECK(dupecheck,cvar) \
-       #ifndef dupecheck \
-               #define dupecheck \
-               float cvar; \
-       #else \
-               #error DUPLICATE MONSTER CVAR: cvar \
-       #endif
-
-#define MON_ADD_CVAR(monster,name) \
-               MON_DUPECHECK(MON_CVAR_##monster##_##name, autocvar_g_monster_##monster##_##name)
-
-#define MON_CVAR(monster,name) autocvar_g_monster_##monster##_##name
+#endif
 
 #include "all.qh"
 
-#undef MON_ADD_CVAR
 #undef REGISTER_MONSTER
-ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done)
+ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done);
+#endif
\ No newline at end of file