X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster.qh;h=f1a5ee3d46f473a558e67f4ac1ec7beb67789707;hb=118e6c304a242d2de95978fdbf593a62c9d86073;hp=75eccd95d36902804380441850cee371813d1edf;hpb=ae2c1407ec9a05e4f501a6604a7cce8e1030df9f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 75eccd95d..f1a5ee3d4 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -1,16 +1,73 @@ #ifndef MONSTER_H #define MONSTER_H -bool m_null(int) { return false; } +#ifdef SVQC +#include "sv_monsters.qh" +#include +#include +#include +#include +#include +#include +#include +#endif + +// special spawn flags +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; +const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes +const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes +const int MONSTER_SIZE_QUAKE = 8192; + +// entity properties of monsterinfo: +.bool(int, entity actor, entity targ) monster_attackfunc; + +// animations +.vector anim_blockend; +.vector anim_blockstart; +.vector anim_melee1; +.vector anim_melee2; +.vector anim_melee3; +.vector anim_pain3; +.vector anim_pain4; +.vector anim_pain5; +.vector anim_walk; +.vector anim_spawn; -#include "../oo.qh" /** If you register a new monster, make sure to add it to all.inc */ CLASS(Monster, Object) ATTRIB(Monster, monsterid, int, 0) - ATTRIB(Monster, classname, string, "monster_info") + /** attributes */ + ATTRIB(Monster, spawnflags, int, 0) /** human readable name */ - ATTRIB(Monster, monster_name, string, string_null) - ATTRIB(Monster, monster_func, bool(int), m_null) + ATTRIB(Monster, monster_name, string, "Monster") + /** short name */ + ATTRIB(Monster, netname, string, "") + /** model */ + ATTRIB(Monster, m_model, entity, NULL) + /** hitbox size */ + ATTRIB(Monster, mins, vector, '-0 -0 -0') + /** hitbox size */ + ATTRIB(Monster, maxs, vector, '0 0 0') + + /** (SERVER) setup monster data */ + METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; } + /** (SERVER) logic to run every frame */ + METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; } + /** (SERVER) called when monster dies */ + METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; } + /** (BOTH) precaches models/sounds used by this monster */ + METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; } + /** (SERVER) called when monster is damaged */ + METHOD(Monster, mr_pain, bool(Monster this, entity actor)) { TC(Monster, this); return false; } + /** (BOTH?) sets animations for monster */ + METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; } + ENDCLASS(Monster) #endif