4 float autocvar_g_monster_shambler_health;
5 float autocvar_g_monster_shambler_damageforcescale = 0.1;
6 float autocvar_g_monster_shambler_attack_smash_damage;
7 float autocvar_g_monster_shambler_attack_smash_range;
8 float autocvar_g_monster_shambler_attack_claw_damage;
9 float autocvar_g_monster_shambler_attack_lightning_damage;
10 float autocvar_g_monster_shambler_attack_lightning_damage_zap = 15;
11 float autocvar_g_monster_shambler_attack_lightning_force;
12 float autocvar_g_monster_shambler_attack_lightning_radius;
13 float autocvar_g_monster_shambler_attack_lightning_radius_zap;
14 float autocvar_g_monster_shambler_attack_lightning_speed;
15 float autocvar_g_monster_shambler_attack_lightning_speed_up;
16 float autocvar_g_monster_shambler_speed_stop;
17 float autocvar_g_monster_shambler_speed_run;
18 float autocvar_g_monster_shambler_speed_walk;
32 .float shambler_lastattack;
34 void M_Shambler_Attack_Smash(
entity this)
37 Send_Effect(EFFECT_EXPLOSION_MEDIUM, (this.
origin + (
v_forward * 150)) - (
'0 0 1' * this.
maxs.z),
'0 0 0', 1);
48 void M_Shambler_Attack_Swing(
entity this)
55 void M_Shambler_Attack_Lightning_Explode(
entity this,
entity directhitentity)
58 Send_Effect(EFFECT_ELECTRO_IMPACT, this.
origin,
'0 0 0', 1);
68 RadiusDamage (
this, this.
realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius),
71 FOREACH_ENTITY_RADIUS(this.
origin, autocvar_g_monster_shambler_attack_lightning_radius_zap, it != this.
realowner && it.takedamage,
73 te_csqc_lightningarc(this.origin, it.origin);
74 Damage(it, this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(this), DEATH_MONSTER_SHAMBLER_ZAP.m_id, DMG_NOWEP, it.origin,
'0 0 0');
81 void M_Shambler_Attack_Lightning_Explode_use(
entity this,
entity actor,
entity trigger)
83 M_Shambler_Attack_Lightning_Explode(
this, trigger);
100 void M_Shambler_Attack_Lightning_Touch(
entity this,
entity toucher)
107 void M_Shambler_Attack_Lightning_Think(
entity this)
112 M_Shambler_Attack_Lightning_Explode(
this,
NULL);
117 void M_Shambler_Attack_Lightning(
entity this)
119 entity gren =
new(grenade);
120 gren.owner = gren.realowner =
this;
121 gren.bot_dodge =
true;
122 gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage);
125 gren.projectiledeathtype = DEATH_MONSTER_SHAMBLER_ZAP.m_id;
127 setsize(gren,
'-8 -8 -8',
'8 8 8');
131 gren.nextthink =
time;
132 setthink(gren, M_Shambler_Attack_Lightning_Think);
133 gren.use = M_Shambler_Attack_Lightning_Explode_use;
134 settouch(gren, M_Shambler_Attack_Lightning_Touch);
138 gren.damageforcescale = 0;
139 gren.event_damage = M_Shambler_Attack_Lightning_Damage;
140 gren.damagedbycontents =
true;
146 gren.flags = FL_PROJECTILE;
155 bool M_Shambler_Attack(
int attack_type,
entity actor,
entity targ, .
entity weaponentity)
162 Monster_Delay(actor, swing_cnt, 0.5, M_Shambler_Attack_Swing);
163 actor.anim_finished = actor.attack_finished_single[0] =
time + (0.5 * swing_cnt);
168 float randomness =
random();
170 if(
time >= actor.shambler_lastattack)
172 if(randomness <= 0.5 &&
vdist(actor.enemy.origin - actor.origin, <=, autocvar_g_monster_shambler_attack_smash_range))
174 setanim(actor, actor.anim_melee2,
true,
true,
false);
176 actor.attack_finished_single[0] =
time + 1.1;
177 actor.anim_finished =
time + 1.1;
179 actor.shambler_lastattack =
time + 3 +
random() * 1.5;
182 else if(randomness <= 0.1 &&
vdist(actor.enemy.origin - actor.origin, >=, autocvar_g_monster_shambler_attack_smash_range * 1.5))
184 setanim(actor, actor.anim_shoot,
true,
true,
false);
186 actor.attack_finished_single[0] =
time + 1.1;
187 actor.anim_finished = 1.1;
188 actor.shambler_lastattack =
time + 3 +
random() * 1.5;
213 actor.pain_finished =
time + 0.5;
214 setanim(actor, actor.anim_pain1,
true,
true,
false);
221 setanim(actor, actor.anim_die1,
false,
true,
true);
230 actor.anim_die1 = animfixfps(actor,
'8 1 0.5', none);
231 actor.anim_walk = animfixfps(actor,
'1 1 1', none);
232 actor.anim_idle = animfixfps(actor,
'0 1 1', none);
233 actor.anim_pain1 = animfixfps(actor,
'7 1 2', none);
234 actor.anim_melee1 = animfixfps(actor,
'3 1 5', none);
235 actor.anim_melee2 = animfixfps(actor,
'4 1 5', none);
236 actor.anim_melee3 = animfixfps(actor,
'5 1 5', none);
237 actor.anim_shoot = animfixfps(actor,
'6 1 5', none);
238 actor.anim_run = animfixfps(actor,
'2 1 1', none);
248 if(!actor.attack_range) actor.attack_range = 150;
249 if(!actor.speed) { actor.speed = (autocvar_g_monster_shambler_speed_walk); }
250 if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_shambler_speed_run); }
251 if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_shambler_speed_stop); }
252 if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_shambler_damageforcescale); }
254 actor.monster_loot = ITEM_HealthMega;
255 actor.weapon = WEP_ELECTRO.m_id;
257 setanim(actor, actor.anim_shoot,
false,
true,
true);
258 actor.spawn_time = actor.animstate_endtime;
259 StatusEffects_apply(STATUSEFFECT_SpawnShield, actor, actor.spawn_time, 0);
260 actor.monster_attackfunc = M_Shambler_Attack;
#define PROJECTILE_MAKETRIGGER(e)
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)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
IntrusiveList g_damagedbycontents
void Monster_Delay(entity this, int repeat_count, float defer_amnt, void(entity) func)
spawnfunc(info_player_attacker)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
IntrusiveList g_bot_dodge
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#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.
const int PROJECTILE_SHAMBLER_LIGHTNING
#define MONSTER_SKILLMOD(mon)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
const int MONSTER_ATTACK_MELEE
const int MONSTER_ATTACK_RANGED
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
#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)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
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 sound(e, c, s, v, a)
void set_movetype(entity this, int mt)