X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster.qh;h=5572fe9102d05a1a07174cfc5255a143784e30ce;hp=84253b1e985fcf19c226d74a078dfa28489c580d;hb=cc37ae9ec08cca9f8b17cdbf91e71380d0d6f700;hpb=2ce2f533321210bef1f49b1245a8ea1fda15eea4 diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 84253b1e9..5572fe910 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -1,30 +1,20 @@ -#ifndef MONSTER_H -#define MONSTER_H - -#ifdef SVQC -#include "sv_monsters.qh" -#include "../../server/g_damage.qh" -#include "../../server/bot/bot.qh" -#include "../../server/weapons/common.qh" -#include "../../server/weapons/tracing.qh" -#include "../../server/weapons/weaponsystem.qh" -#include "../mutators/mutator/waypoints/waypointsprites.qh" -#include "../../warpzonelib/server.qh" -#endif +#pragma once // special spawn flags -const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died -const int MONSTER_TYPE_FLY = 32; -const int MONSTER_TYPE_SWIM = 64; -const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced -const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster -const int MON_FLAG_RANGED = 512; // monster shoots projectiles -const int MON_FLAG_MELEE = 1024; -const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes -const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes +const int MONSTER_RESPAWN_DEATHPOINT = BIT(4); // re-spawn where we died +const int MONSTER_TYPE_FLY = BIT(5); +const int MONSTER_TYPE_SWIM = BIT(6); +const int MONSTER_SIZE_BROKEN = BIT(7); // TODO: remove when bad models are replaced +const int MON_FLAG_SUPERMONSTER = BIT(8); // incredibly powerful monster +const int MON_FLAG_RANGED = BIT(9); // monster shoots projectiles +const int MON_FLAG_MELEE = BIT(10); +const int MON_FLAG_CRUSH = BIT(11); // monster can be stomped in special modes +const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes +const int MONSTER_SIZE_QUAKE = BIT(13); +const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies // entity properties of monsterinfo: -.bool(int, entity targ) monster_attackfunc; +.bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc; // animations .vector anim_blockend; @@ -32,41 +22,53 @@ const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes .vector anim_melee1; .vector anim_melee2; .vector anim_melee3; -.vector anim_pain3; -.vector anim_pain4; -.vector anim_pain5; .vector anim_walk; .vector anim_spawn; -/** If you register a new monster, make sure to add it to all.inc */ CLASS(Monster, Object) - ATTRIB(Monster, monsterid, int, 0) + ATTRIB(Monster, monsterid, int, 0); /** attributes */ - ATTRIB(Monster, spawnflags, int, 0) + ATTRIB(Monster, spawnflags, int, 0); /** human readable name */ - ATTRIB(Monster, monster_name, string, "Monster") + ATTRIB(Monster, monster_name, string, "Monster"); /** short name */ - ATTRIB(Monster, netname, string, "") + ATTRIB(Monster, netname, string, ""); /** model */ - ATTRIB(Monster, m_model, entity, NULL) + ATTRIB(Monster, m_model, entity); /** hitbox size */ - ATTRIB(Monster, mins, vector, '-0 -0 -0') + ATTRIB(Monster, mins, vector, '-0 -0 -0'); /** hitbox size */ - ATTRIB(Monster, maxs, vector, '0 0 0') - + ATTRIB(Monster, maxs, vector, '0 0 0'); + /** (SERVER) setup monster data */ - METHOD(Monster, mr_setup, bool(Monster this)) { return false; } + METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; } /** (SERVER) logic to run every frame */ - METHOD(Monster, mr_think, bool(Monster this)) { return false; } + METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; } /** (SERVER) called when monster dies */ - METHOD(Monster, mr_death, bool(Monster this)) { return false; } + METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; } /** (BOTH) precaches models/sounds used by this monster */ - METHOD(Monster, mr_precache, bool(Monster this)) { return false; } + METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; } /** (SERVER) called when monster is damaged */ - METHOD(Monster, mr_pain, bool(Monster this)) { return false; } + METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; } /** (BOTH?) sets animations for monster */ - METHOD(Monster, mr_anim, bool(Monster this)) { return false; } + METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; } ENDCLASS(Monster) + +#ifdef SVQC +#include "sv_monsters.qh" +#include +#include +#include +#include +#include +#include +#include +#endif + +#ifdef GAMEQC +#include "../animdecide.qh" +#include "../anim.qh" +vector animfixfps(entity e, vector a, vector b); #endif