X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fweapons%2Fprojectile.qc;h=2ece66e9dda37a428a285ab9da33a496598bdcb7;hb=12d69d4f4aad59619b4e24f0024abebbc581515f;hp=6d58ac77a2d1a01f72688513ecc2708750d93622;hpb=4d9a40898926a8da83b788f9a862f35cdd4c8905;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 6d58ac77a..2ece66e9d 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -6,6 +6,7 @@ #include "../mutators/events.qh" #include +#include #include #include @@ -108,6 +109,9 @@ void Projectile_Draw(entity this) case PROJECTILE_HOOKBOMB: rot = '1000 0 0'; // forward break; + case PROEJCTILE_ROCKET: + rot = '0 0 720'; // spinning + break; default: break; } @@ -163,13 +167,13 @@ void Projectile_Draw(entity this) 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); if (e.silent) return; - _sound(e, ch, samp, vol, attn); + sound(e, ch, samp, vol, attn); e.snd_looping = ch; } @@ -263,7 +267,26 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.fade_rate = 0; } - this.team = ReadByte() - 1; + int myteam = ReadByte(); + this.team = myteam - 1; + + if(teamplay) + { + if(myteam) + this.colormap = (this.team) * 0x11; // note: team - 1 on server (client uses different numbers) + else + this.colormap = 0x00; + this.colormap |= BIT(10); // RENDER_COLORMAPPED + } + 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) @@ -337,7 +360,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) { 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); @@ -347,7 +370,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) 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; @@ -394,12 +417,12 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) 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'; @@ -414,7 +437,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) 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; @@ -427,17 +450,17 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) 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;