9 .float spider_web_delay;
11 float autocvar_g_monster_spider_attack_web_damagetime;
12 float autocvar_g_monster_spider_attack_web_speed;
13 float autocvar_g_monster_spider_attack_web_speed_up;
14 float autocvar_g_monster_spider_attack_web_delay;
16 float autocvar_g_monster_spider_attack_bite_damage;
17 float autocvar_g_monster_spider_attack_bite_delay;
19 void M_Spider_Attack_Web(
entity this);
27 if(StatusEffects_active(STATUSEFFECT_Webbed, player))
28 STAT(MOVEVARS_HIGHSPEED, player) *= 0.5;
35 if(StatusEffects_active(STATUSEFFECT_Webbed, mon))
48 if ((!isPlayer &&
time >= actor.spider_web_delay) ||
weapon_prepareattack(thiswep, actor, weaponentity,
false, autocvar_g_monster_spider_attack_web_delay)) {
50 actor.spider_web_delay =
time + 3;
51 setanim(actor, actor.anim_shoot,
true,
true,
true);
52 actor.attack_finished_single[0] =
time + (autocvar_g_monster_spider_attack_web_delay);
53 actor.anim_finished =
time + 1;
59 M_Spider_Attack_Web(actor);
67 actor.attack_range = 60;
69 Monster_Attack_Melee(actor, actor.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((
random() > 0.5) ? actor.anim_melee : actor.anim_shoot), actor.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER.m_id,
true);
74 float autocvar_g_monster_spider_health;
75 float autocvar_g_monster_spider_damageforcescale = 0.6;
76 float autocvar_g_monster_spider_speed_stop;
77 float autocvar_g_monster_spider_speed_run;
78 float autocvar_g_monster_spider_speed_walk;
87 void M_Spider_Attack_Web_Explode(
entity this)
91 Send_Effect(EFFECT_ELECTRO_IMPACT, this.
origin,
'0 0 0', 1);
92 RadiusDamage(
this, this.
realowner, 0, 0, 25,
NULL,
NULL, 25, this.
projectiledeathtype,
DMG_NOWEP,
NULL);
96 StatusEffects_apply(STATUSEFFECT_Webbed, it, time + autocvar_g_monster_spider_attack_web_damagetime, 0);
105 M_Spider_Attack_Web_Explode(
this);
108 void M_Spider_Attack_Web_Touch(
entity this,
entity toucher)
112 M_Spider_Attack_Web_Explode(
this);
115 void M_Spider_Attack_Web(
entity this)
119 entity proj =
new(plasma);
120 proj.owner = proj.realowner =
this;
121 proj.use = M_Spider_Attack_Web_Explode_use;
123 proj.bot_dodge =
true;
124 proj.bot_dodgerating = 0;
125 proj.nextthink =
time + 5;
127 proj.projectiledeathtype = DEATH_MONSTER_SPIDER.m_id;
134 settouch(proj, M_Spider_Attack_Web_Touch);
135 setsize(proj,
'-4 -4 -4',
'4 4 4');
137 proj.damageforcescale = 0;
140 proj.flags = FL_PROJECTILE;
143 proj.damagedbycontents =
true;
146 proj.bouncefactor = 0.3;
147 proj.bouncestop = 0.05;
153 bool M_Spider_Attack(
int attack_type,
entity actor,
entity targ, .
entity weaponentity)
155 Weapon wep = WEP_SPIDER_ATTACK;
160 wep.wr_think(wep, actor, weaponentity, 2);
165 wep.wr_think(wep, actor, weaponentity, 1);
192 setanim(actor, actor.anim_melee,
false,
true,
true);
193 actor.angles_x = 180;
202 actor.anim_walk = animfixfps(actor,
'1 1 1', none);
203 actor.anim_idle = animfixfps(actor,
'0 1 1', none);
204 actor.anim_melee = animfixfps(actor,
'2 1 5', none);
205 actor.anim_shoot = animfixfps(actor,
'3 1 5', none);
206 actor.anim_run = animfixfps(actor,
'1 1 1', none);
215 if(!actor.speed) { actor.speed = (autocvar_g_monster_spider_speed_walk); }
216 if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_spider_speed_run); }
217 if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); }
218 if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_spider_damageforcescale); }
220 actor.monster_loot = ITEM_HealthMedium;
221 actor.monster_attackfunc = M_Spider_Attack;
entity Monster_FindTarget(entity this)
#define PROJECTILE_MAKETRIGGER(e)
#define REGISTER_MUTATOR(id, dependence)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
bool Monster_Attack_Melee(entity this, entity targ, float damg, vector anim, float er, float animtime, int deathtype, bool dostop)
IntrusiveList g_damagedbycontents
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
spawnfunc(info_player_attacker)
string W_Sound(string w_snd)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
IntrusiveList g_bot_dodge
#define PROJECTILE_TOUCH(e, t)
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
const int MONSTER_ATTACK_MELEE
const int MONSTER_ATTACK_RANGED
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
void monster_makevectors(entity this, entity targ)
#define CENTER_OR_VIEWOFS(ent)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool Monster_Spawn(entity this, bool check_appear, Monster mon)
const int PROJECTILE_ELECTRO
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
#define MUTATOR_HOOKFUNCTION(...)
void adaptor_think2use_hittype_splash(entity this)
#define sound(e, c, s, v, a)
#define SOUND(name, path)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
void set_movetype(entity this, int mt)