]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/sv_monsters.qh
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_monsters.qh
1 #ifndef SV_MONSTERS_H
2 #define SV_MONSTERS_H
3
4 .string spawnmob;
5 .float monster_attack;
6
7 .entity monster_owner; // new monster owner entity, fixes non-solid monsters
8
9 .float stat_monsters_killed; // stats
10 .float stat_monsters_total;
11 float monsters_total;
12 float monsters_killed;
13 void monsters_setstatus(); // monsters.qc
14 .float monster_moveflags; // checks where to move when not attacking
15
16 .float wander_delay;
17 .float wander_distance;
18
19 .float monster_lifetime;
20
21 .float spider_slowness; // special spider timer
22
23 void monster_remove(entity mon); // removes a monster
24
25 .float(float attack_type) monster_attackfunc;
26 const int MONSTER_ATTACK_MELEE = 1;
27 const int MONSTER_ATTACK_RANGED = 2;
28
29 .float monster_skill;
30 const float MONSTER_SKILL_EASY = 1;
31 const float MONSTER_SKILL_MEDIUM = 3;
32 const float MONSTER_SKILL_HARD = 5;
33 const float MONSTER_SKILL_INSANE = 7;
34 const float MONSTER_SKILL_NIGHTMARE = 10;
35
36 .float fish_wasdrowning; // used to reset a drowning fish's angles if it reaches water again
37
38 .float candrop;
39
40 .float attack_range;
41
42 .float spawn_time; // stop monster from moving around right after spawning
43
44 .string oldtarget2;
45 .float lastshielded;
46
47 .vector oldangles;
48
49 .float m_armor_blockpercent;
50
51 // monster sounds
52 // copied from player sounds
53 .float msound_delay; // temporary antilag system
54 #define ALLMONSTERSOUNDS \
55                 _MSOUND(death) \
56                 _MSOUND(sight) \
57                 _MSOUND(ranged) \
58                 _MSOUND(melee) \
59                 _MSOUND(pain) \
60                 _MSOUND(spawn) \
61                 _MSOUND(idle)
62
63 #define _MSOUND(m) .string monstersound_##m;
64 ALLMONSTERSOUNDS
65 #undef _MSOUND
66
67 float GetMonsterSoundSampleField_notFound;
68
69 const int MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1
70 const int MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2
71 const int MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3
72
73 // new flags
74 const int MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
75 const int MONSTERFLAG_NORESPAWN = 4;
76 const int MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
77 const int MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us
78 const int MONSTERFLAG_MINIBOSS = 64;    // monster spawns as mini-boss (also has a chance of naturally becoming one)
79 const int MONSTERFLAG_INVINCIBLE = 128; // monster doesn't take damage (may be used for map objects & temporary monsters)
80 const int MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters
81 const int MONSTERFLAG_RESPAWNED = 32768; // flag for re-spawned monsters
82
83 .int monster_movestate; // used to tell what the monster is currently doing
84 const int MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still
85 const int MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around
86 const int MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking
87 const int MONSTER_MOVE_NOMOVE = 4; // monster simply stands still
88 const int MONSTER_MOVE_ENEMY = 5; // used only as a movestate
89
90 const int MONSTER_STATE_ATTACK_LEAP = 1;
91 const int MONSTER_STATE_ATTACK_MELEE = 2;
92
93 float monster_initialize(float mon_id);
94 float monster_leap (float anm, void() touchfunc, vector vel, float anim_finished);
95 void monster_makevectors(entity e);
96 float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop);
97 void monster_move(float runspeed, float walkspeed, float stopspeed, float manim_run, float manim_walk, float manim_idle);
98 void monster_setupcolors(entity mon);
99 float Monster_SkillModifier();
100 void MonsterTouch ();
101 #endif