#include "../autocvars.qh"
#include "../defs.qh"
#include "../main.qh"
-#include "../mutators/events.qh"
+#include <client/mutators/_mod.qh>
#include <common/constants.qh>
+#include <common/effects/effect.qh>
+#include <common/effects/all.qh>
#include <common/net_linked.qh>
#include <common/physics/movetypes/movetypes.qh>
+#include <common/mutators/mutator/nades/nades.qh>
+
#include <lib/csqcmodel/interpolate.qh>
#include <lib/warpzone/anglestransform.qh>
}
}
-bool Projectile_isnade(int proj); // TODO: remove
-
void Projectile_Draw(entity this)
{
vector rot;
case PROJECTILE_HOOKBOMB:
rot = '1000 0 0'; // forward
break;
+ case PROJECTILE_ROCKET:
+ rot = '0 0 720'; // spinning
+ break;
default:
break;
}
this.drawmask = MASK_NORMAL;
}
-void loopsound(entity e, int ch, string samp, float vol, float attn)
+void loopsound(entity e, int ch, Sound samp, float vol, float attn)
{
- TC(int, ch);
+ TC(int, ch);
if (e.silent)
return;
- _sound(e, ch, samp, vol, attn);
+ sound(e, ch, samp, vol, attn);
e.snd_looping = ch;
}
if (f & 1)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
if (this.count & 0x80)
{
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
if (f & 0x10)
this.gravity = ReadCoord();
else
}
else
this.colormap = myteam;
+ // TODO: projectiles use glowmaps for their color, not teams
+ #if 0
if(this.colormap > 0)
this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true) * 2;
else
this.glowmod = '1 1 1';
+ #endif
}
if (f & 2)
{
case PROJECTILE_ELECTRO:
// only new engines support sound moving with object
- loopsound(this, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_ELECTRO_FLY, VOL_BASE, ATTEN_NORM);
this.mins = '-4 -4 -4';
this.maxs = '4 4 4';
set_movetype(this, MOVETYPE_BOUNCE);
break;
case PROJECTILE_RPC:
case PROJECTILE_ROCKET:
- loopsound(this, CH_SHOTS_SINGLE, SND(ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_ROCKET_FLY, VOL_BASE, ATTEN_NORM);
this.mins = '-3 -3 -3';
this.maxs = '3 3 3';
break;
settouch(this, func_null);
break;
case PROJECTILE_FIREBALL:
- loopsound(this, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_FIREBALL_FLY2, VOL_BASE, ATTEN_NORM);
this.mins = '-16 -16 -16';
this.maxs = '16 16 16';
break;
case PROJECTILE_FIREMINE:
- loopsound(this, CH_SHOTS_SINGLE, SND(FIREBALL_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_FIREBALL_FLY, VOL_BASE, ATTEN_NORM);
set_movetype(this, MOVETYPE_BOUNCE);
settouch(this, func_null);
this.mins = '-4 -4 -4';
this.maxs = '2 2 2';
break;
case PROJECTILE_SEEKER:
- loopsound(this, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_TAG_ROCKET_FLY, VOL_BASE, ATTEN_NORM);
this.mins = '-4 -4 -4';
this.maxs = '4 4 4';
break;
case PROJECTILE_RAPTORCANNON:
break;
case PROJECTILE_SPIDERROCKET:
- loopsound(this, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_TAG_ROCKET_FLY, VOL_BASE, ATTEN_NORM);
break;
case PROJECTILE_WAKIROCKET:
- loopsound(this, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_TAG_ROCKET_FLY, VOL_BASE, ATTEN_NORM);
break;
/*
case PROJECTILE_WAKICANNON:
break;
case PROJECTILE_BUMBLE_GUN:
// only new engines support sound moving with object
- loopsound(this, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM);
+ loopsound(this, CH_SHOTS_SINGLE, SND_ELECTRO_FLY, VOL_BASE, ATTEN_NORM);
this.mins = '0 0 -4';
this.maxs = '0 0 -4';
this.move_movetype = MOVETYPE_BOUNCE;