#include "spider.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
.float spider_slowness; // effect time of slowness inflicted by spiders
REGISTER_MUTATOR(spiderweb, true);
-MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics_UpdateStats)
{
- entity player = M_ARGV(0, entity);
-
- if (time >= player.spider_slowness)
- return false;
- PHYS_MAXSPEED(player) *= 0.5; // half speed while slow from spider
- PHYS_MAXAIRSPEED(player) *= 0.5;
- PHYS_AIRSPEEDLIMIT_NONQW(player) *= 0.5;
- PHYS_AIRSTRAFEACCELERATE(player) *= 0.5;
+ entity player = M_ARGV(0, entity);
+
+ if(time < player.spider_slowness)
+ STAT(MOVEVARS_HIGHSPEED, player) *= 0.5;
}
MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
proj.damagedbycontents = true;
+ IL_PUSH(g_damagedbycontents, proj);
proj.bouncefactor = 0.3;
proj.bouncestop = 0.05;
CSQCProjectile(proj, true, PROJECTILE_ELECTRO, true);
}
-bool M_Spider_Attack(int attack_type, entity actor, entity targ)
+bool M_Spider_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
{
- .entity weaponentity = weaponentities[0];
switch(attack_type)
{
Weapon wep = WEP_SPIDER_ATTACK;
return false;
}
-spawnfunc(monster_spider) { Monster_Spawn(this, MON_SPIDER.monsterid); }
+spawnfunc(monster_spider) { Monster_Spawn(this, true, MON_SPIDER.monsterid); }
#endif // SVQC
#ifdef SVQC
}
#endif
#ifdef SVQC
-spawnfunc(item_health_medium);
METHOD(Spider, mr_setup, bool(Spider this, entity actor))
{
TC(Spider, this);
if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); }
if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_spider_damageforcescale); }
- actor.monster_loot = spawnfunc_item_health_medium;
+ actor.monster_loot = ITEM_HealthMedium;
actor.monster_attackfunc = M_Spider_Attack;
return true;
}
-
-METHOD(Spider, mr_precache, bool(Spider this))
-{
- TC(Spider, this);
- return true;
-}
-#endif
-
#endif