-#ifdef REGISTER_MONSTER
-REGISTER_MONSTER(
+#ifndef MENUQC
+bool m_mage(int);
+#endif
+REGISTER_MONSTER_SIMPLE(
/* MON_##id */ MAGE,
-/* function */ m_mage,
/* spawnflags */ MON_FLAG_MELEE | MON_FLAG_RANGED,
/* mins,maxs */ '-36 -36 -24', '36 36 50',
/* model */ "mage.dpm",
/* netname */ "mage",
/* fullname */ _("Mage")
-);
+) {
+#ifndef MENUQC
+ this.monster_func = m_mage;
+#endif
+}
-#else
#ifdef SVQC
float autocvar_g_monster_mage_health;
float autocvar_g_monster_mage_attack_spike_damage;
float friend_needshelp(entity e)
{
if(e == world)
- return FALSE;
+ return false;
if(e.health <= 0)
- return FALSE;
+ return false;
if(DIFF_TEAM(e, self) && e != self.monster_owner)
- return FALSE;
+ return false;
if(e.frozen)
- return FALSE;
+ return false;
if(!IS_PLAYER(e))
- return ((e.flags & FL_MONSTER) && e.health < e.max_health);
- if(e.items & IT_INVINCIBLE)
- return FALSE;
+ return (IS_MONSTER(e) && e.health < e.max_health);
+ if(e.items & ITEM_Shield.m_itemid)
+ return false;
switch(self.skin)
{
case 3: return (e.health > 0);
}
- return FALSE;
+ return false;
}
void mage_spike_explode()
{
self.event_damage = func_null;
- sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM);
self.realowner.mage_spike = world;
- pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
+ Send_Effect("explosion_small", self.origin, '0 0 0', 1);
RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
remove (self);
{
// Is it a better idea (shorter distance) to trace to the target itself?
if ( vlen(self.origin + olddir * self.wait) < dist)
- traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
+ traceline(self.origin, self.origin + olddir * self.wait, false, self);
else
- traceline(self.origin, eorg, FALSE, self);
+ traceline(self.origin, eorg, false, self);
// Setup adaptive tracelength
self.wait = bound((autocvar_g_monster_mage_attack_spike_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = (autocvar_g_monster_mage_attack_spike_smart_trace_max));
self.mage_spike = missile;
- CSQCProjectile(missile, TRUE, PROJECTILE_MAGE_SPIKE, TRUE);
+ CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
}
void mage_heal()
{
entity head;
- float washealed = FALSE;
+ float washealed = false;
for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain) if(friend_needshelp(head))
{
- washealed = TRUE;
+ washealed = true;
string fx = "";
if(IS_PLAYER(head))
{
break;
}
- pointparticles(particleeffectnum(fx), head.origin, '0 0 0', 1);
+ Send_Effect(fx, head.origin, '0 0 0', 1);
}
else
{
- pointparticles(particleeffectnum("healing_fx"), head.origin, '0 0 0', 1);
+ Send_Effect("healing_fx", head.origin, '0 0 0', 1);
head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE))
WaypointSprite_UpdateHealth(head.sprite, head.health);
void mage_push()
{
- sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
+ sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM);
RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
- pointparticles(particleeffectnum("TE_EXPLOSION"), self.origin, '0 0 0', 1);
+ Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1);
self.frame = mage_anim_attack;
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay);
if(trace_fraction < 1)
return;
- pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1);
+ Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1);
setorigin(self, self.enemy.origin + ((v_forward * -1) * 200));
self.attack_finished_single = time + 0.2;
if(random() <= 0.7)
{
mage_push();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
case MONSTER_ATTACK_RANGED:
{
if(random() <= 0.4)
{
mage_teleport();
- return TRUE;
+ return true;
}
else
{
self.frame = mage_anim_attack;
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
defer(0.2, mage_attack_spike);
- return TRUE;
+ return true;
}
}
if(self.mage_spike)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
void spawnfunc_monster_mage()
{
self.classname = "monster_mage";
- if(!monster_initialize(MON_MAGE)) { remove(self); return; }
+ if(!monster_initialize(MON_MAGE.monsterid)) { remove(self); return; }
}
// compatibility with old spawns
case MR_THINK:
{
entity head;
- float need_help = FALSE;
+ float need_help = false;
for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain)
if(head != self)
if(friend_needshelp(head))
{
- need_help = TRUE;
+ need_help = true;
break;
}
mage_shield();
monster_move((autocvar_g_monster_mage_speed_run), (autocvar_g_monster_mage_speed_walk), (autocvar_g_monster_mage_speed_stop), mage_anim_walk, mage_anim_run, mage_anim_idle);
- return TRUE;
+ return true;
}
case MR_DEATH:
{
self.frame = mage_anim_death;
- return TRUE;
+ return true;
}
case MR_SETUP:
{
self.monster_attackfunc = mage_attack;
self.frame = mage_anim_walk;
- return TRUE;
+ return true;
}
case MR_PRECACHE:
{
precache_model("models/monsters/mage.dpm");
- precache_sound ("weapons/grenade_impact.wav");
- precache_sound ("weapons/tagexp1.wav");
- return TRUE;
+ precache_sound (W_Sound("grenade_impact"));
+ precache_sound (W_Sound("tagexp1"));
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // SVQC
{
case MR_PRECACHE:
{
- return TRUE;
+ return true;
}
}
- return TRUE;
+ return true;
}
#endif // CSQC
-#endif // REGISTER_MONSTER