Skip to content

Commit

Permalink
[jaPRO/Force] New jaPRO force drain effect for levels 1/2 (`cg_drainF…
Browse files Browse the repository at this point in the history
…X 2`)
  • Loading branch information
taysta committed May 31, 2024
1 parent c727285 commit a75b482
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 1 deletion.
105 changes: 105 additions & 0 deletions assets/japro/effects/mp/drain_japro.efx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
repeatDelay 300

Electricity
{
flags useModel useBBox usePhysics

spawnFlags rgbComponentInterpolation

count 1 2

life 50 60

bounce 0.8 2

origin2 500 -16 -2 524 16 2

rgb
{
end 1 0 0
}

alpha
{
end 0 1
flags linear
}

size
{
start 2 5
flags linear
}

shaders
[
gfx/misc/rline
]
}

Particle
{
flags useAlpha

spawnFlags rgbComponentInterpolation

life 30

rotation 0 360

rgb
{
start 1 0 0 1 1 1
end 1 0 0
}

size
{
start 10 18
flags random
}

shaders
[
gfx/misc/lightningFlash
]
}

Electricity
{
name Copy of Unnamed Electricity 0

flags useModel useBBox usePhysics useAlpha

spawnFlags rgbComponentInterpolation

count 1 2

life 50 60

bounce 0.8 2

origin2 500 -16 -2 524 16 2

rgb
{
start 1 0 0 1 1 1
end 1 0 0
}

alpha
{
start 0 1
}

size
{
start 8 10
flags linear
}

shaders
[
gfx/misc/rline
]
}
1 change: 1 addition & 0 deletions codemp/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,7 @@ typedef struct cgEffects_s {
fxHandle_t forceLightningWide;

fxHandle_t forceDrain;
fxHandle_t forceDrainJaPRO;
fxHandle_t forceDrainWide;
fxHandle_t forceDrainWideJaPRO;//japro
fxHandle_t forceDrained;
Expand Down
1 change: 1 addition & 0 deletions codemp/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,7 @@ static void CG_RegisterGraphics( void ) {
cgs.effects.forceLightning = trap->FX_RegisterEffect( "effects/force/lightning.efx" );
cgs.effects.forceLightningWide = trap->FX_RegisterEffect( "effects/force/lightningwide.efx" );
cgs.effects.forceDrain = trap->FX_RegisterEffect( "effects/mp/drain.efx" );
cgs.effects.forceDrainJaPRO = trap->FX_RegisterEffect("effects/mp/drain_japro.efx");
cgs.effects.forceDrainWide = trap->FX_RegisterEffect( "effects/mp/drainwide.efx" );
cgs.effects.forceDrainWideJaPRO = trap->FX_RegisterEffect( "effects/mp/drainwide_japro.efx" );

Expand Down
5 changes: 4 additions & 1 deletion codemp/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -11737,7 +11737,10 @@ void CG_Player( centity_t *cent ) {
{//line
//trap->FX_PlayEffectID( cgs.effects.forceLightning, efOrg, fxDir );
//trap->FX_PlayEntityEffectID(cgs.effects.forceDrain, efOrg, axis, cent->boltInfo, cent->currentState.number, -1, -1);
trap->FX_PlayEntityEffectID(cgs.effects.forceDrain, efOrg, axis, -1, -1, -1, -1);
if (cg_drainFX.integer == 1)
trap->FX_PlayEntityEffectID(cgs.effects.forceDrain, efOrg, axis, -1, -1, -1, -1);
else if (cg_drainFX.integer == 2)
trap->FX_PlayEntityEffectID(cgs.effects.forceDrainJaPRO, efOrg, axis, -1, -1, -1, -1);
}

/*
Expand Down

0 comments on commit a75b482

Please sign in to comment.