X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fspider.qc;h=90b1d3218a46b6474035cee00865b19ac75f3ce0;hb=323105d51f8eb6dea47c063965be5e34ad57f987;hp=a29f20b398842b36b0a9d0ab53b60b5f3b0f3984;hpb=f53cfd3a6161ba8b7a62bd953d18e689f051b337;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index a29f20b39..90b1d3218 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -6,8 +6,6 @@ #ifdef SVQC -.float spider_slowness; // effect time of slowness inflicted by spiders - .float spider_web_delay; float autocvar_g_monster_spider_attack_web_damagetime; @@ -27,7 +25,7 @@ MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics_UpdateStats) { entity player = M_ARGV(0, entity); - if(time < player.spider_slowness) + if(StatusEffects_active(STATUSEFFECT_Webbed, player)) STAT(MOVEVARS_HIGHSPEED, player) *= 0.5; } @@ -35,28 +33,13 @@ MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove) { entity mon = M_ARGV(0, entity); - if(time < mon.spider_slowness) + if(StatusEffects_active(STATUSEFFECT_Webbed, mon)) { M_ARGV(1, float) *= 0.5; // run speed M_ARGV(2, float) *= 0.5; // walk speed } } -MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn) -{ - entity player = M_ARGV(0, entity); - - player.spider_slowness = 0; - return false; -} - -MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn) -{ - entity mon = M_ARGV(0, entity); - - mon.spider_slowness = 0; -} - SOUND(SpiderAttack_FIRE, W_Sound("electro_fire")); METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire)) { @@ -114,7 +97,7 @@ void M_Spider_Attack_Web_Explode(entity this) FOREACH_ENTITY_RADIUS(this.origin, 25, it != this && it.takedamage && !IS_DEAD(it) && GetResource(it, RES_HEALTH) > 0 && it.monsterdef != MON_SPIDER, { - it.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime); + StatusEffects_apply(STATUSEFFECT_Webbed, it, time + autocvar_g_monster_spider_attack_web_damagetime, 0); }); delete(this);