X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fzombie.qc;h=d5011c7f35ca726b0e074244d871b985a881caa0;hb=cf5201f8f1ee6008289df50610a9fb8fa1bfbac6;hp=79b83b63e9aeeda4ffd6e39590b443ebe089f35b;hpb=bf094df0de66898cb15780dbf136bf93b0761857;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster/zombie.qc b/qcsrc/common/monsters/monster/zombie.qc index 79b83b63e..d5011c7f3 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -1,30 +1,4 @@ -#ifndef ZOMBIE_H -#define ZOMBIE_H - -#ifdef GAMEQC -MODEL(MON_ZOMBIE, M_Model("zombie.dpm")); -#endif - -CLASS(Zombie, Monster) - ATTRIB(Zombie, spawnflags, int, MON_FLAG_MELEE | MON_FLAG_RIDE); - ATTRIB(Zombie, mins, vector, '-18 -18 -25'); - ATTRIB(Zombie, maxs, vector, '18 18 47'); -#ifdef GAMEQC - ATTRIB(Zombie, m_model, Model, MDL_MON_ZOMBIE); -#endif - ATTRIB(Zombie, netname, string, "zombie"); - ATTRIB(Zombie, monster_name, string, _("Zombie")); -ENDCLASS(Zombie) - -REGISTER_MONSTER(ZOMBIE, NEW(Zombie)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} - -#endif - -#ifdef IMPLEMENTATION +#include "zombie.qh" #ifdef SVQC float autocvar_g_monster_zombie_health; @@ -120,7 +94,7 @@ bool M_Zombie_Defend_Block(entity this) return true; } -bool M_Zombie_Attack(int attack_type, entity actor, entity targ) +bool M_Zombie_Attack(int attack_type, entity actor, entity targ, .entity weaponentity) { switch(attack_type) { @@ -151,7 +125,7 @@ bool M_Zombie_Attack(int attack_type, entity actor, entity targ) return false; } -spawnfunc(monster_zombie) { Monster_Spawn(this, MON_ZOMBIE.monsterid); } +spawnfunc(monster_zombie) { Monster_Spawn(this, true, MON_ZOMBIE.monsterid); } #endif // SVQC #ifdef SVQC @@ -214,9 +188,11 @@ METHOD(Zombie, mr_setup, bool(Zombie this, entity actor)) if(actor.spawnflags & MONSTERFLAG_NORESPAWN) actor.spawnflags &= ~MONSTERFLAG_NORESPAWN; // zombies always respawn + actor.spawnflags &= ~MONSTERFLAG_APPEAR; // once it's appeared, it will respawn quickly, we don't want it to appear + actor.spawnflags |= MONSTER_RESPAWN_DEATHPOINT; - actor.monster_loot = spawnfunc_item_health_medium; + actor.monster_loot = ITEM_HealthMedium; actor.monster_attackfunc = M_Zombie_Attack; actor.spawnshieldtime = actor.spawn_time; actor.respawntime = 0.2; @@ -227,12 +203,4 @@ METHOD(Zombie, mr_setup, bool(Zombie this, entity actor)) return true; } - -METHOD(Zombie, mr_precache, bool(Zombie this)) -{ - TC(Zombie, this); - return true; -} -#endif - #endif