X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fmage.qc;h=2418bfc0c248479213799c0de61e7c15a9043d38;hb=8b38ad6987192a2129a7aa55410fd6d729425a28;hp=3adc59a3020c8fc7cc1c8da0341284672dbf41bd;hpb=6ca9598bd85dac9bd2f84eb870b62e537e1594e7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 3adc59a30..2418bfc0c 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -1,15 +1,19 @@ -#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; @@ -55,17 +59,17 @@ void() mage_shield; 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) { @@ -75,7 +79,7 @@ float friend_needshelp(entity e) case 3: return (e.health > 0); } - return FALSE; + return false; } void mage_spike_explode() @@ -86,7 +90,7 @@ void mage_spike_explode() 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); @@ -139,9 +143,9 @@ void mage_spike_think() { // 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)); @@ -187,17 +191,17 @@ void mage_attack_spike() 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)) { @@ -228,11 +232,11 @@ void mage_heal() 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); @@ -250,7 +254,7 @@ void mage_push() { sound(self, CH_SHOTS, "weapons/tagexp1.wav", 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); @@ -267,7 +271,7 @@ void mage_teleport() 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; @@ -300,10 +304,10 @@ float mage_attack(float attack_type) if(random() <= 0.7) { mage_push(); - return TRUE; + return true; } - return FALSE; + return false; } case MONSTER_ATTACK_RANGED: { @@ -312,32 +316,32 @@ float mage_attack(float attack_type) 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 @@ -350,13 +354,13 @@ float m_mage(float req) 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; } @@ -375,12 +379,12 @@ float m_mage(float req) 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: { @@ -390,18 +394,18 @@ float m_mage(float req) 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; + return true; } } - return TRUE; + return true; } #endif // SVQC @@ -412,12 +416,11 @@ float m_mage(float req) { case MR_PRECACHE: { - return TRUE; + return true; } } - return TRUE; + return true; } #endif // CSQC -#endif // REGISTER_MONSTER