Skip to content

Commit

Permalink
update: improved PAC rail graphics, refined ESR lightning bolt beam s…
Browse files Browse the repository at this point in the history
…egment logic.
  • Loading branch information
Subject9x committed Sep 19, 2024
1 parent 977b4d2 commit 31bdd2f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion client/util/headers/particle_sys.qh
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ float PTC_WRECK_SMOKE;
.vector beamEnd;
.float beamWidth;
.float beamTime;
.float beamAlpha;
//===================================

void() particle_sys_ini_globals;
Expand All @@ -178,7 +179,6 @@ vector() te_read_angle;
void( float randomBool ) ai_voice_ini;

void (vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg) Draw_CylindricLine;
void (vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg) Draw_CrossPlanesLine;

//ported from effectinfo_api
void( vector org, vector windVel ) te_mech_crit;
Expand Down
20 changes: 13 additions & 7 deletions common/data/item/weapon/data_electro_repeater.qc
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,30 @@ void() data_ini_attack_electro_repeater_;

#ifdef CSQC
void() te_beam_esr={
local float segCount;
local vector bAngl;
local float segment;
local vector segOrg;
local vector nexOrg;
local float itr;
local float width;

segCount = 6;
width = self.beamWidth;
segment = rint(vlen(self.beamEnd - self.wepFireOffset) / segCount);
segOrg = self.wepFireOffset;

bAngl = vectoangles(self.beamEnd - self.wepFireOffset);
bAngl_x = bAngl_x * -1;

makevectors(bAngl);

segment = rint(vlen(self.beamEnd - self.wepFireOffset) / 6);
segOrg = self.wepFireOffset;
width = self.beamWidth;
nexOrg = self.wepFireOffset + (v_forward * segment) + (v_right * crandom() * 4) + (v_up * crandom() * 6);
Draw_CylindricLine(self.wepFireOffset, nexOrg, width, "particles/electro_beam", 0.1, time * 0.1, '0.17 0.33 1.0', 1.0, DRAWFLAG_NORMAL | DRAWFLAG_MIPMAP, CLIENT_vis_org);
segOrg = nexOrg;
segCount = segCount - 1;

for( itr = 0; itr < 6; itr = itr + 1){
nexOrg = self.wepFireOffset + (v_forward * segment * itr) + (v_right * random() * 6) + (v_up * random() * 6);
for( itr = segCount; itr < (segment-2); itr = itr + 1){
nexOrg = self.wepFireOffset + (v_forward * segment * itr) + (v_right * crandom() * 2) + (v_up * crandom() * 4);

Draw_CylindricLine(segOrg, nexOrg, width, "particles/electro_beam", 0.1, time * 0.1, '0.17 0.33 1.0', 1.0, DRAWFLAG_NORMAL | DRAWFLAG_MIPMAP, CLIENT_vis_org);

Expand Down Expand Up @@ -170,7 +176,7 @@ void() te_muzzle_esr={
self.beamTime = time + 0.05;
self.beamOrg = startOrg;
self.beamEnd = endOrg;
self.beamWidth = 5.0;
self.beamWidth = 4.0;
self.beamActive = TRUE;
};
#endif
Expand Down
18 changes: 15 additions & 3 deletions common/data/item/weapon/data_particle_cannon.qc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ void() data_ini_attack_particle_cannon_;
#endif

#ifdef CSQC
void() te_pac_beam={

self.beamWidth = self.beamWidth + (3 * frametime);
self.beamAlpha = self.beamAlpha - (0.1 * frametime);
Draw_CylindricLine(self.wepFireOffset, self.beamEnd, self.beamWidth, "particles/pac_beam", 1.0, time * -3.0, '0.98 0.68 0.23', self.beamAlpha, DRAWFLAG_NORMAL | DRAWFLAG_MIPMAP, CLIENT_vis_org);

};
void() te_muzzle_pac={
local vector startOrg;
local vector endOrg;
Expand All @@ -27,16 +34,14 @@ void() te_muzzle_pac={
endOrg = trace_endpos;
norm = normalize(endOrg - startOrg);

//pointsound( startOrg, "sound/weapons/pac_fire.ogg", 1, ATTN_NORM);

if( vlen(endOrg - startOrg) >= 1500 ){
sound7(self, CHAN_AUTO, self.fire_sound, 1, ATTN_NORM, (0.33 + (random() * 0.67)) * 185, 0 );
}
else{
sound7(self, CHAN_AUTO, self.fire_sound, 1, ATTN_NORM, (0.2 + (random() * 0.8)) * 100, 0 );
}

trailparticles( world, particleeffectnum("TE_PAC_RAIL"), startOrg, endOrg );
//trailparticles( world, particleeffectnum("TE_PAC_RAIL"), startOrg, endOrg );

if( particleDraw < PARTICLE_HAZ_DISTANCE / 2){
pointparticles( particleeffectnum("TE_PAC_MUZZLE"), startOrg, norm * 2, 1);
Expand All @@ -51,6 +56,12 @@ void() te_muzzle_pac={
pointparticles(PTC_HIT_DIRT_ENE_LRG, endOrg, trace_plane_normal * -1, 1);
}
}

self.beamActive = TRUE;
self.beamEnd = endOrg;
self.beamWidth = 3.0;
self.beamTime = time + 1.0;
self.beamAlpha = 0.8;
};
#endif
void() data_ini_particle_cannon_={
Expand Down Expand Up @@ -86,6 +97,7 @@ void() data_ini_particle_cannon_={
self.description = "+ Instant-impact weapon. + Bypasses a % of target shields. + Lower shields on target yields higher armor damage.";
self.icon = "gfx/ui/wep_icons/wi_pac.png";
self.itemMuzzleFlash = te_muzzle_pac;
self.effect_beam = te_pac_beam;
#endif

#ifdef SSQC
Expand Down

0 comments on commit 31bdd2f

Please sign in to comment.