1 #ifdef REGISTER_MONSTER
3 /* MON_##id */ SHAMBLER,
4 /* function */ m_shambler,
5 /* spawnflags */ MONSTER_SIZE_BROKEN,
6 /* mins,maxs */ '-41 -41 -31', '41 41 65',
7 /* model */ "shambler.mdl",
8 /* netname */ "shambler",
9 /* fullname */ _("Shambler")
12 #define SHAMBLER_SETTINGS(monster) \
13 MON_ADD_CVAR(monster, health) \
14 MON_ADD_CVAR(monster, attack_smash_damage) \
15 MON_ADD_CVAR(monster, attack_claw_damage) \
16 MON_ADD_CVAR(monster, attack_lightning_damage) \
17 MON_ADD_CVAR(monster, speed_run) \
18 MON_ADD_CVAR(monster, speed_walk)
21 SHAMBLER_SETTINGS(shambler)
25 const float shambler_anim_stand = 0;
26 const float shambler_anim_walk = 1;
27 const float shambler_anim_run = 2;
28 const float shambler_anim_smash = 3;
29 const float shambler_anim_swingr = 4;
30 const float shambler_anim_swingl = 5;
31 const float shambler_anim_magic = 6;
32 const float shambler_anim_pain = 7;
33 const float shambler_anim_death = 8;
37 monster_melee(self.enemy, MON_CVAR(shambler, attack_smash_damage), 0.3, DEATH_MONSTER_SHAMBLER_SMASH, TRUE);
40 void shambler_delayedsmash()
42 monsters_setframe(shambler_anim_smash);
43 defer(0.7, shambler_smash);
44 self.attack_finished_single = time + 1.1;
49 float r = (random() < 0.5);
50 monsters_setframe((r) ? shambler_anim_swingr : shambler_anim_swingl);
51 monster_melee(self.enemy, MON_CVAR(shambler, attack_claw_damage), 0.3, DEATH_MONSTER_SHAMBLER_CLAW, TRUE);
52 self.attack_finished_single = time + 0.8;
54 defer(0.5, shambler_swing);
59 local vector org, dir;
62 self.effects |= EF_MUZZLEFLASH;
64 org = self.origin + '0 0 40';
66 dir = self.enemy.origin + '0 0 16' - org;
67 dir = normalize (dir);
69 traceline (org, self.origin + dir * 1000, TRUE, self);
71 FireRailgunBullet (org, org + dir * 1000, MON_CVAR(shambler, attack_lightning_damage) * monster_skill, 0, 0, 0, 0, 0, DEATH_MONSTER_SHAMBLER_ZAP);
73 // teamcolor / hit beam effect
74 //v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
75 //WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), org, v);
77 te_csqc_lightningarc(org, trace_endpos);
80 float shambler_attack(float attack_type)
84 case MONSTER_ATTACK_MELEE:
86 float chance = random();
89 shambler_delayedsmash();
95 case MONSTER_ATTACK_RANGED:
97 monsters_setframe(shambler_anim_magic);
98 self.attack_finished_single = time + 1.1;
99 defer(0.6, CastLightning);
108 void spawnfunc_monster_shambler()
110 self.classname = "monster_shambler";
112 self.monster_spawnfunc = spawnfunc_monster_shambler;
114 if(Monster_CheckAppearFlags(self))
117 if not(monster_initialize(MON_SHAMBLER, FALSE)) { remove(self); return; }
120 float m_shambler(float req)
126 monster_move(MON_CVAR(shambler, speed_run), MON_CVAR(shambler, speed_walk), 300, shambler_anim_run, shambler_anim_walk, shambler_anim_stand);
131 monsters_setframe(shambler_anim_death);
136 if not(self.health) self.health = MON_CVAR(shambler, health);
138 self.monster_attackfunc = shambler_attack;
139 monsters_setframe(shambler_anim_stand);
140 self.weapon = WEP_NEX;
151 MON_CONFIG_SETTINGS(SHAMBLER_SETTINGS(shambler))
161 float m_shambler(float req)
172 precache_model ("models/monsters/shambler.mdl");
181 #endif // REGISTER_MONSTER