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