+
+float autocvar_g_monster_spider_attack_bite_damage;
+float autocvar_g_monster_spider_attack_bite_delay;
+
+void M_Spider_Attack_Web(entity this);
+
+REGISTER_MUTATOR(spiderweb, true);
+
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
+{
+ SELFPARAM();
+ if (time >= this.spider_slowness)
+ return false;
+ PHYS_MAXSPEED(this) *= 0.5; // half speed while slow from spider
+ PHYS_MAXAIRSPEED(this) *= 0.5;
+ PHYS_AIRSPEEDLIMIT_NONQW(this) *= 0.5;
+ PHYS_AIRSTRAFEACCELERATE(this) *= 0.5;
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)
+{
+ SELFPARAM();
+ if(time < self.spider_slowness)
+ {
+ monster_speed_run *= 0.5;
+ monster_speed_walk *= 0.5;
+ }
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn)
+{
+ SELFPARAM();
+ self.spider_slowness = 0;
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn)
+{
+ SELFPARAM();
+ self.spider_slowness = 0;
+ return false;
+}
+
+SOUND(SpiderAttack_FIRE, W_Sound("electro_fire"));
+METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire))
+{
+ SELFPARAM();
+ TC(SpiderAttack, thiswep);
+ bool isPlayer = IS_PLAYER(actor);
+ if (fire & 1)
+ if ((!isPlayer && time >= actor.spider_web_delay) || weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_monster_spider_attack_web_delay)) {
+ if (!isPlayer) {
+ actor.spider_web_delay = time + 3;
+ setanim(actor, actor.anim_shoot, true, true, true);
+ actor.attack_finished_single[0] = time + (autocvar_g_monster_spider_attack_web_delay);
+ actor.anim_finished = time + 1;
+ }
+ if (isPlayer) actor.enemy = Monster_FindTarget(actor);
+ W_SetupShot_Dir(actor, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0);
+ if (!isPlayer) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
+ M_Spider_Attack_Web(actor);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
+ return;
+ }
+ if (fire & 2)
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, true, 0.5)) {
+ if (isPlayer) {
+ actor.enemy = Monster_FindTarget(actor);
+ actor.attack_range = 60;
+ }
+ Monster_Attack_Melee(actor, actor.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? self.anim_melee : self.anim_shoot), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER.m_id, true);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, 0, w_ready);
+ }
+}
+
+float autocvar_g_monster_spider_health;
+float autocvar_g_monster_spider_damageforcescale = 0.6;