X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster.qh;h=8540d5cc2a4be8f564d4a17301eeec5a8cf58ace;hb=8cb2cb16bb4e54acd682ad3714bbb70535a6afc1;hp=9ba1cde12941ac1777aa98c4a2f5868f8aa3a825;hpb=0f91a71ce7434276a96bcb5fec24bf5702369749;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 9ba1cde12..8540d5cc2 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -1,22 +1,4 @@ -#ifndef MONSTER_H -#define MONSTER_H - -#ifdef SVQC -#include "sv_monsters.qh" -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifndef MENUQC -#include "../animdecide.qh" -#include "../anim.qh" -vector animfixfps(entity e, vector a, vector b); -#endif +#pragma once // special spawn flags const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died @@ -31,7 +13,7 @@ const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes const int MONSTER_SIZE_QUAKE = 8192; // entity properties of monsterinfo: -.bool(int, entity actor, entity targ) monster_attackfunc; +.bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc; // animations .vector anim_blockend; @@ -46,19 +28,19 @@ const int MONSTER_SIZE_QUAKE = 8192; .vector anim_spawn; 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, entity actor)) { TC(Monster, this); return false; } @@ -69,10 +51,26 @@ CLASS(Monster, Object) /** (BOTH) precaches models/sounds used by this monster */ 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, entity actor)) { TC(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, 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