float tempdb;
float ClientProgsDB;
vector hook_shotorigin[4];
+vector electro_shotorigin[4];
vector lightning_shotorigin[4];
vector gauntlet_shotorigin[4];
case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break;
case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
- case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
+ case ENT_CLIENT_ELECTRO_BEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_ELECTRO_BEAM); break;
+ case ENT_CLIENT_LIGHTNING_BEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LIGHTNING_BEAM); break;
case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
default:
hook_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
hook_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
hook_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
+ electro_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
+ electro_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
+ electro_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
+ electro_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
lightning_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
lightning_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
lightning_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
case ENT_CLIENT_HOOK:
vs = hook_shotorigin[s];
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ vs = electro_shotorigin[s];
+ break;
+ case ENT_CLIENT_LIGHTNING_BEAM:
vs = lightning_shotorigin[s];
break;
case ENT_CLIENT_GAUNTLET:
a = view_origin + view_forward * vs_x + view_right * -vs_y + view_up * vs_z;
b = self.origin;
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ case ENT_CLIENT_LIGHTNING_BEAM:
case ENT_CLIENT_GAUNTLET:
if(self.HookRange)
b = view_origin + view_forward * self.HookRange;
a = self.velocity;
b = self.origin;
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ case ENT_CLIENT_LIGHTNING_BEAM:
case ENT_CLIENT_GAUNTLET:
a = self.origin;
b = self.velocity;
rgb = '.3 1 .3';
}
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ intensity = bound(0.2, 1 + Noise_Pink(self, frametime) * 1 + Noise_Burst(self, frametime, 0.03) * 0.3, 2);
+ offset = Noise_Brown(self, frametime) * 10;
+ tex = "particles/lgbeam";
+ rgb = '1 1 1';
+ break;
+ case ENT_CLIENT_LIGHTNING_BEAM: // todo
intensity = bound(0.2, 1 + Noise_Pink(self, frametime) * 1 + Noise_Burst(self, frametime, 0.03) * 0.3, 2);
offset = Noise_Brown(self, frametime) * 10;
tex = "particles/lgbeam";
self.drawmask = 0;
}
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ case ENT_CLIENT_LIGHTNING_BEAM:
case ENT_CLIENT_GAUNTLET:
setorigin(self, a); // beam origin!
break;
default:
case ENT_CLIENT_HOOK:
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
+ break;
+ case ENT_CLIENT_LIGHTNING_BEAM:
pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
break;
case ENT_CLIENT_GAUNTLET:
case ENT_CLIENT_GAUNTLET:
self.HookRange = 0;
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ case ENT_CLIENT_LIGHTNING_BEAM:
self.HookRange = ReadCoord();
break;
}
setmodel(self, "models/hook.md3");
self.drawmask = MASK_NORMAL;
break;
- case ENT_CLIENT_LGBEAM:
+ case ENT_CLIENT_ELECTRO_BEAM:
+ sound (self, CHAN_PROJECTILE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
+ break;
+ case ENT_CLIENT_LIGHTNING_BEAM:
sound (self, CHAN_PROJECTILE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
break;
case ENT_CLIENT_GAUNTLET:
const float ENT_CLIENT_WARPZONE_CAMERA = 25;
const float ENT_CLIENT_TRIGGER_MUSIC = 26;
const float ENT_CLIENT_HOOK = 27;
-const float ENT_CLIENT_LGBEAM = 28;
-const float ENT_CLIENT_GAUNTLET = 29;
-const float ENT_CLIENT_ACCURACY = 30;
+const float ENT_CLIENT_ELECTRO_BEAM = 28;
+const float ENT_CLIENT_LIGHTNING_BEAM = 29;
+const float ENT_CLIENT_GAUNTLET = 30;
+const float ENT_CLIENT_ACCURACY = 31;
const float ENT_CLIENT_TURRET = 40;
WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[1]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[2]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[3]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[0]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[1]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[2]));
+ WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[3]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[0]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[1]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(gauntlet_shotorigin[2]));
InitGameplayMode();
readlevelcvars();
GrappleHookInit();
+ LightningInit();
ElectroInit();
LaserInit();
g_hook.qh
w_electro.qh
+w_lightning.qh
w_laser.qh
scores.qh
.vector hook_start, hook_end;
float lgbeam_send(entity to, float sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_LGBEAM);
+ WriteByte(MSG_ENTITY, ENT_CLIENT_ELECTRO_BEAM);
sf = sf & 0x7F;
if(sound_allowed(MSG_BROADCAST, self.owner))
sf |= 0x80;
// Declarations =========================
.vector hook_start, hook_end; // used for beam
.entity lightning_beam; // used for beam
-//.float bot_aim_whichfiretype; // ???
.float BUTTON_ATCK_prev; // for better animation control
.float lg_fire_prev; // for better animation control
// Lightning functions =========================
float W_Lightning_Beam_Send(entity to, float sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_LGBEAM);
+ WriteByte(MSG_ENTITY, ENT_CLIENT_LIGHTNING_BEAM);
sf = sf & 0x7F;
if(sound_allowed(MSG_BROADCAST, self.owner))
sf |= 0x80;
self = oldself;
}
-void LightningInit()
-{
- weapon_action(WEP_LIGHTNING, WR_PRECACHE);
- lightning_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 1);
- lightning_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 2);
- lightning_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 3);
- lightning_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 4);
-}
-
-void spawnfunc_weapon_lightning (void)
-{
- weapon_defaultspawnfunc(WEP_LIGHTNING);
-}
-
float w_lightning(float req)
{
if (req == WR_AIM)
}
return TRUE;
};
+
+void LightningInit()
+{
+ weapon_action(WEP_LIGHTNING, WR_PRECACHE);
+ lightning_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 1);
+ lightning_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 2);
+ lightning_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 3);
+ lightning_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 4);
+}
+
+void spawnfunc_weapon_lightning (void) // should this really be here?
+{
+ weapon_defaultspawnfunc(WEP_LIGHTNING);
+}
#endif
#ifdef CSQC
float w_lightning(float req)
{
vector org2;
org2 = w_org + w_backoff * 6;
+
if(w_deathtype & HITTYPE_SECONDARY)
{
pointparticles(particleeffectnum("lightning_ballexplode"), org2, '0 0 0', 1);
}
else
{
- if(w_deathtype & HITTYPE_BOUNCE)
- {
- // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
- pointparticles(particleeffectnum("lightning_combo"), org2, '0 0 0', 1);
- if(!w_issilent)
- sound(self, CHAN_PROJECTILE, "weapons/lightning_impact_combo.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("lightning_impact"), org2, '0 0 0', 1);
- if(!w_issilent)
- sound(self, CHAN_PROJECTILE, "weapons/lightning_impact.wav", VOL_BASE, ATTN_NORM);
- }
+ pointparticles(particleeffectnum("lightning_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/lightning_impact.wav", VOL_BASE, ATTN_NORM);
}
}
else if(req == WR_PRECACHE)
--- /dev/null
+void LightningInit();
+vector lightning_shotorigin[4];