]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/spider.qc
Merge branch 'master' into Lyberta/KillSound
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / spider.qc
index a122865321f0a5a69897245c38f69b9df00a4b11..a6551392075891911a85a9893a8e8c2cdf0dc62c 100644 (file)
@@ -18,16 +18,12 @@ void M_Spider_Attack_Web(entity this);
 
 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)
@@ -170,9 +166,8 @@ void M_Spider_Attack_Web(entity this)
        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;
@@ -229,7 +224,6 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor))
 }
 #endif
 #ifdef SVQC
-spawnfunc(item_health_medium);
 METHOD(Spider, mr_setup, bool(Spider this, entity actor))
 {
     TC(Spider, this);
@@ -239,15 +233,9 @@ METHOD(Spider, mr_setup, bool(Spider this, entity actor))
     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