Xonotic
monster.qh
Go to the documentation of this file.
1 #pragma once
2 
3 // special spawn flags
4 const int MONSTER_RESPAWN_DEATHPOINT = BIT(4); // re-spawn where we died
5 const int MONSTER_TYPE_FLY = BIT(5);
6 const int MONSTER_TYPE_SWIM = BIT(6);
7 const int MONSTER_SIZE_BROKEN = BIT(7); // TODO: remove when bad models are replaced
8 const int MON_FLAG_SUPERMONSTER = BIT(8); // incredibly powerful monster
9 const int MON_FLAG_RANGED = BIT(9); // monster shoots projectiles
10 const int MON_FLAG_MELEE = BIT(10);
11 const int MON_FLAG_CRUSH = BIT(11); // monster can be stomped in special modes
12 const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes
13 const int MONSTER_SIZE_QUAKE = BIT(13);
14 const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies
15 const int MONSTER_TYPE_UNDEAD = BIT(15); // monster is by most definitions a zombie (doesn't fully die unless gibbed)
16 const int MON_FLAG_HIDDEN = BIT(16);
17 
18 // entity properties of monsterinfo:
19 .bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc;
20 .entity monsterdef;
21 
22 // animations
23 .vector anim_blockend;
25 .vector anim_melee1;
26 .vector anim_melee2;
27 .vector anim_melee3;
28 .vector anim_walk;
29 .vector anim_spawn;
30 
32  ATTRIB(Monster, monsterid, int, 0);
34  ATTRIB(Monster, spawnflags, int, 0);
36  ATTRIB(Monster, monster_name, string, "Monster");
38  ATTRIB(Monster, netname, string, "");
40  ATTRIB(Monster, m_model, entity);
42  ATTRIB(Monster, m_mins, vector, '-0 -0 -0');
44  ATTRIB(Monster, m_maxs, vector, '0 0 0');
45 
47  METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
49  METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
51  METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
53  METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; }
55  METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
56 
58 
59 
60 #ifdef SVQC
61 #include "sv_monsters.qh"
62 #include <server/damage.qh>
63 #include <server/bot/api.qh>
64 #include <server/weapons/common.qh>
68 #include <lib/warpzone/server.qh>
69 #endif
70 
71 #ifdef GAMEQC
72 #include "../animdecide.qh"
73 #include "../anim.qh"
74 vector animfixfps(entity e, vector a, vector b);
75 #endif
const int MON_FLAG_HIDDEN
Definition: monster.qh:16
vector anim_walk
Definition: monster.qh:28
const int MONSTER_SIZE_QUAKE
Definition: monster.qh:13
const int MON_FLAG_CRUSH
Definition: monster.qh:11
CLASS(Object) Object
Definition: oo.qh:318
vector anim_blockstart
Definition: monster.qh:24
const int MON_FLAG_RANGED
Definition: monster.qh:9
entity() spawn
string netname
Definition: powerups.qc:20
const int MONSTER_SIZE_BROKEN
Definition: monster.qh:7
vector anim_melee3
Definition: monster.qh:27
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
const int MONSTER_TYPE_FLY
Definition: monster.qh:5
float spawnflags
Definition: progsdefs.qc:191
vector anim_melee1
Definition: monster.qh:25
#define ATTRIB(...)
Definition: oo.qh:136
vector anim_blockend
Definition: monster.qh:23
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
const int MONSTER_TYPE_UNDEAD
Definition: monster.qh:15
const int MON_FLAG_RIDE
Definition: monster.qh:12
#define TC(T, sym)
Definition: _all.inc:82
entity this
Definition: self.qh:83
entity monsterdef
Definition: monster.qh:20
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int MONSTER_TYPE_PASSIVE
Definition: monster.qh:14
const int MON_FLAG_MELEE
Definition: monster.qh:10
#define ENDCLASS(cname)
Definition: oo.qh:269
const int MONSTER_TYPE_SWIM
Definition: monster.qh:6
const int MONSTER_RESPAWN_DEATHPOINT
Definition: monster.qh:4
const int MON_FLAG_SUPERMONSTER
Definition: monster.qh:8
vector anim_melee2
Definition: monster.qh:26
vector anim_spawn
Definition: monster.qh:29