]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/monster.qh
Merge branch 'master' into Mario/fullbright_skins
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster.qh
1 #ifndef MONSTER_H
2 #define MONSTER_H
3
4 #ifdef SVQC
5 #include "sv_monsters.qh"
6 #include <server/g_damage.qh>
7 #include <server/bot/bot.qh>
8 #include <server/weapons/common.qh>
9 #include <server/weapons/tracing.qh>
10 #include <server/weapons/weaponsystem.qh>
11 #include <common/mutators/mutator/waypoints/waypointsprites.qh>
12 #include <lib/warpzone/server.qh>
13 #endif
14
15 #ifndef MENUQC
16 #include "../animdecide.qh"
17 #include "../anim.qh"
18 vector animfixfps(entity e, vector a, vector b);
19 #endif
20
21 // special spawn flags
22 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
23 const int MONSTER_TYPE_FLY = 32;
24 const int MONSTER_TYPE_SWIM = 64;
25 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
26 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
27 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
28 const int MON_FLAG_MELEE = 1024;
29 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
30 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
31 const int MONSTER_SIZE_QUAKE = 8192;
32
33 // entity properties of monsterinfo:
34 .bool(int, entity actor, entity targ) monster_attackfunc;
35
36 // animations
37 .vector anim_blockend;
38 .vector anim_blockstart;
39 .vector anim_melee1;
40 .vector anim_melee2;
41 .vector anim_melee3;
42 .vector anim_pain3;
43 .vector anim_pain4;
44 .vector anim_pain5;
45 .vector anim_walk;
46 .vector anim_spawn;
47
48 CLASS(Monster, Object)
49     ATTRIB(Monster, monsterid, int, 0)
50     /** attributes */
51     ATTRIB(Monster, spawnflags, int, 0)
52     /** human readable name */
53     ATTRIB(Monster, monster_name, string, "Monster")
54     /** short name */
55     ATTRIB(Monster, netname, string, "")
56     /** model */
57     ATTRIB(Monster, m_model, entity, NULL)
58     /** hitbox size */
59     ATTRIB(Monster, mins, vector, '-0 -0 -0')
60     /** hitbox size */
61     ATTRIB(Monster, maxs, vector, '0 0 0')
62
63     /** (SERVER) setup monster data */
64     METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
65     /** (SERVER) logic to run every frame */
66     METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
67     /** (SERVER) called when monster dies */
68     METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
69     /** (BOTH) precaches models/sounds used by this monster */
70     METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; }
71     /** (SERVER) called when monster is damaged */
72     METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; }
73     /** (BOTH?) sets animations for monster */
74     METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
75
76 ENDCLASS(Monster)
77
78 #endif