X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fsv_monsters.qh;h=f6b149816e27725278d9f781e9bf8aff956034cb;hb=4dd3c23aa51dd6fe855d8c5d97126a12a372eb3b;hp=65331207279af26037e6a9084253e4cb7d8ebc45;hpb=79af1d0a6a91cc42a4359ecdae84a9fa72593731;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index 653312072..f6b149816 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -1,8 +1,10 @@ +#ifndef SV_MONSTERS_H +#define SV_MONSTERS_H + .string spawnmob; .float monster_attack; .entity monster_owner; // new monster owner entity, fixes non-solid monsters -.float monstercount; // per player monster count .float stat_monsters_killed; // stats .float stat_monsters_total; @@ -11,13 +13,18 @@ float monsters_killed; void monsters_setstatus(); // monsters.qc .float monster_moveflags; // checks where to move when not attacking +.float wander_delay; +.float wander_distance; + +.float monster_lifetime; + .float spider_slowness; // special spider timer void monster_remove(entity mon); // removes a monster .float(float attack_type) monster_attackfunc; -const float MONSTER_ATTACK_MELEE = 1; -const float MONSTER_ATTACK_RANGED = 2; +const int MONSTER_ATTACK_MELEE = 1; +const int MONSTER_ATTACK_RANGED = 2; .float monster_skill; const float MONSTER_SKILL_EASY = 1; @@ -59,27 +66,36 @@ ALLMONSTERSOUNDS float GetMonsterSoundSampleField_notFound; -const float MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1 -const float MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2 -const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3 +const int MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1 +const int MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2 +const int MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3 // new flags -const float MONSTERFLAG_APPEAR = 2; // delay spawn until triggered -const float MONSTERFLAG_NORESPAWN = 4; -const float MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically -const float MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us -const float MONSTERFLAG_MINIBOSS = 64; // monster spawns as mini-boss (also has a chance of naturally becoming one) -const float MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters -const float MONSTERFLAG_RESPAWNED = 32768; // flag for re-spawned monsters - -.void() monster_spawnfunc; - -.float monster_movestate; // used to tell what the monster is currently doing -const float MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still -const float MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around -const float MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking -const float MONSTER_MOVE_NOMOVE = 4; // monster simply stands still -const float MONSTER_MOVE_ENEMY = 5; // used only as a movestate - -const float MONSTER_STATE_ATTACK_LEAP = 1; -const float MONSTER_STATE_ATTACK_MELEE = 2; +const int MONSTERFLAG_APPEAR = 2; // delay spawn until triggered +const int MONSTERFLAG_NORESPAWN = 4; +const int MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically +const int MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us +const int MONSTERFLAG_MINIBOSS = 64; // monster spawns as mini-boss (also has a chance of naturally becoming one) +const int MONSTERFLAG_INVINCIBLE = 128; // monster doesn't take damage (may be used for map objects & temporary monsters) +const int MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters +const int MONSTERFLAG_RESPAWNED = 32768; // flag for re-spawned monsters + +.int monster_movestate; // used to tell what the monster is currently doing +const int MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still +const int MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around +const int MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking +const int MONSTER_MOVE_NOMOVE = 4; // monster simply stands still +const int MONSTER_MOVE_ENEMY = 5; // used only as a movestate + +const int MONSTER_STATE_ATTACK_LEAP = 1; +const int MONSTER_STATE_ATTACK_MELEE = 2; + +float monster_initialize(float mon_id); +float monster_leap (float anm, void() touchfunc, vector vel, float anim_finished); +void monster_makevectors(entity e); +float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop); +void monster_move(float runspeed, float walkspeed, float stopspeed, float manim_run, float manim_walk, float manim_idle); +void monster_setupcolors(entity mon); +float Monster_SkillModifier(); +void MonsterTouch (); +#endif