#ifdef SVQC
+.float spider_slowness; // effect time of slowness inflicted by spiders
+
.float spider_web_delay;
float autocvar_g_monster_spider_attack_web_damagetime;
void M_Spider_Attack_Web();
+REGISTER_MUTATOR(spiderweb, true);
+
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
+{
+ if (time >= self.spider_slowness)
+ return false;
+ PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider
+ PHYS_MAXAIRSPEED(self) *= 0.5;
+ PHYS_AIRSPEEDLIMIT_NONQW(self) *= 0.5;
+ PHYS_AIRSTRAFEACCELERATE(self) *= 0.5;
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)
+{
+ if(time < self.spider_slowness)
+ {
+ monster_speed_run *= 0.5;
+ monster_speed_walk *= 0.5;
+ }
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn)
+{
+ self.spider_slowness = 0;
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn)
+{
+ 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)) {
bool isPlayer = IS_PLAYER(actor);
runspeed = bound(0, monster_speed_run * MONSTER_SKILLMOD(self), runspeed * 2.5); // limit maxspeed to prevent craziness
walkspeed = bound(0, monster_speed_walk * MONSTER_SKILLMOD(self), walkspeed * 2.5); // limit maxspeed to prevent craziness
- if(time < self.spider_slowness)
- {
- runspeed *= 0.5;
- walkspeed *= 0.5;
- }
-
if(teamplay)
if(autocvar_g_monsters_teams)
if(DIFF_TEAM(self.monster_follow, self))
self.deadflag = DEAD_NO;
self.noalign = ((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM));
self.spawn_time = time;
- self.spider_slowness = 0;
self.gravity = 1;
self.monster_moveto = '0 0 0';
self.monster_face = '0 0 0';
// other properties
.bool monster_attack; // indicates whether an entity can be attacked by monsters
-.float spider_slowness; // effect time of slowness inflicted by spiders
// monster state declarations
const int MONSTER_MOVE_FOLLOW = 1; // monster will follow if in range, or stand still
#endif
}
-void PM_check_spider()
-{SELFPARAM();
-#ifdef SVQC
- if (time >= self.spider_slowness)
- return;
- PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider
- PHYS_MAXAIRSPEED(self) *= 0.5;
- PHYS_AIRSPEEDLIMIT_NONQW(self) *= 0.5;
- PHYS_AIRSTRAFEACCELERATE(self) *= 0.5;
-#endif
-}
-
// predict frozen movement, as frozen players CAN move in some cases
void PM_check_frozen()
{SELFPARAM();
viewloc_PlayerPhysics();
- PM_check_spider();
-
PM_check_frozen();
PM_check_blocked();