1 #ifdef REGISTER_MONSTER
4 /* function */ m_slime,
6 /* mins,maxs */ '-16 -16 -24', '16 16 16',
7 /* model */ "slime.dpm",
9 /* fullname */ _("Slime")
12 #define SLIME_SETTINGS(monster) \
13 MON_ADD_CVAR(monster, health) \
14 MON_ADD_CVAR(monster, attack_explode_damage) \
15 MON_ADD_CVAR(monster, speed_stop) \
16 MON_ADD_CVAR(monster, speed_run) \
17 MON_ADD_CVAR(monster, speed_walk)
24 const float slime_anim_walk = 0;
25 const float slime_anim_idle = 1;
26 const float slime_anim_jump = 2;
27 const float slime_anim_fly = 3;
28 const float slime_anim_die = 4;
29 const float slime_anim_pain = 5;
31 void slime_touch_jump()
36 if(vlen(self.velocity) > 200)
38 Damage (self, world, world, MON_CVAR(slime, attack_explode_damage), DEATH_MONSTER_SLIME, self.origin, '0 0 0');
43 if(trace_dphitcontents)
45 self.touch = MonsterTouch;
46 self.movetype = MOVETYPE_WALK;
50 float slime_attack(float attack_type)
54 case MONSTER_ATTACK_MELEE:
55 case MONSTER_ATTACK_RANGED:
57 makevectors(self.angles);
58 if(monster_leap(slime_anim_jump, slime_touch_jump, v_forward * 600 + '0 0 200', 0.5))
68 RadiusDamage(self, self, MON_CVAR(slime, attack_explode_damage), 15, MON_CVAR(slime, attack_explode_damage) * 0.7, world, 250, DEATH_MONSTER_SLIME, world);
69 pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
70 sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
77 self.health = -100; // gibbed
80 Monster_CheckDropCvars (self.netname); // TODO: add a special function to drop items after death
82 self.deadflag = DEAD_DEAD;
83 self.think = Monster_Fade;
84 self.nextthink = time + 0.1;
87 void spawnfunc_monster_slime()
89 self.classname = "monster_slime";
91 self.monster_spawnfunc = spawnfunc_monster_slime;
93 if(Monster_CheckAppearFlags(self))
96 if not(monster_initialize(MON_SLIME, FALSE)) { remove(self); return; }
99 // compatibility with old spawns
100 void spawnfunc_monster_tarbaby() { spawnfunc_monster_slime(); }
102 float m_slime(float req)
108 monster_move(MON_CVAR(slime, speed_run), MON_CVAR(slime, speed_walk), MON_CVAR(slime, speed_stop), slime_anim_walk, slime_anim_walk, slime_anim_idle);
113 self.think = slime_dead;
114 self.nextthink = time;
115 self.event_damage = func_null;
116 self.movetype = MOVETYPE_NONE;
117 self.takedamage = DAMAGE_NO;
121 self.SendFlags |= MSF_MOVE | MSF_STATUS;
127 if not(self.health) self.health = MON_CVAR(slime, health);
129 self.monster_attackfunc = slime_attack;
130 monsters_setframe(slime_anim_idle);
141 MON_CONFIG_SETTINGS(SLIME_SETTINGS(slime))
151 float m_slime(float req)
162 precache_model ("models/monsters/slime.dpm");
171 #endif // REGISTER_MONSTER