]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/sv_monsters.qh
Attempt to improve monster skill based damage calculation
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_monsters.qh
1 .string spawnmob;
2 .float monster_attack;
3
4 .entity monster_owner; // new monster owner entity, fixes non-solid monsters
5 .float monstercount; // per player monster count
6
7 .float stat_monsters_killed; // stats
8 .float stat_monsters_total;
9 float monsters_total;
10 float monsters_killed;
11 void monsters_setstatus(); // monsters.qc
12 .float monster_moveflags; // checks where to move when not attacking
13
14 void monster_remove(entity mon); // removes a monster
15
16 .float(float attack_type) monster_attackfunc;
17 const float MONSTER_ATTACK_MELEE = 1;
18 const float MONSTER_ATTACK_RANGED = 2;
19
20 .float monster_skill;
21 const float MONSTER_SKILL_EASY = 1;
22 const float MONSTER_SKILL_MEDIUM = 3;
23 const float MONSTER_SKILL_HARD = 5;
24 const float MONSTER_SKILL_INSANE = 7;
25 const float MONSTER_SKILL_NIGHTMARE = 10;
26
27 .float fish_wasdrowning; // used to reset a drowning fish's angles if it reaches water again
28
29 .float candrop;
30
31 .float attack_range;
32
33 .float spawn_time; // stop monster from moving around right after spawning
34
35 .string oldtarget2;
36 .float lastshielded;
37
38 .vector oldangles;
39
40 .float m_armor_blockpercent;
41
42 // monster sounds
43 // copied from player sounds
44 .float msound_delay; // temporary antilag system
45 #define ALLMONSTERSOUNDS \
46                 _MSOUND(death) \
47                 _MSOUND(sight) \
48                 _MSOUND(ranged) \
49                 _MSOUND(melee) \
50                 _MSOUND(pain) \
51                 _MSOUND(spawn) \
52                 _MSOUND(idle) 
53
54 #define _MSOUND(m) .string monstersound_##m;
55 ALLMONSTERSOUNDS
56 #undef _MSOUND
57
58 float GetMonsterSoundSampleField_notFound;
59
60 .float monster_respawned; // used to make sure we're not recounting respawned monster stats
61
62 const float MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1
63 const float MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2
64 const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3
65
66 // new flags
67 const float MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
68 const float MONSTERFLAG_NORESPAWN = 4;
69 const float MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
70 const float MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us
71 const float MONSTERFLAG_MINIBOSS = 64;  // monster spawns as mini-boss (also has a chance of naturally becoming one)
72 const float MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters
73
74 .void() monster_spawnfunc;
75
76 .float monster_movestate; // used to tell what the monster is currently doing
77 const float MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still
78 const float MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around
79 const float MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking
80 const float MONSTER_MOVE_NOMOVE = 4; // monster simply stands still
81 const float MONSTER_MOVE_ENEMY = 5; // used only as a movestate
82
83 const float MONSTER_STATE_ATTACK_LEAP = 1;
84 const float MONSTER_STATE_ATTACK_MELEE = 2;
85