@ -1414,6 +1414,17 @@ enum EGON_FIREMODE
@@ -1414,6 +1414,17 @@ enum EGON_FIREMODE
BEAM * pBeam ;
BEAM * pBeam2 ;
TEMPENTITY * pFlare ; // Vit_amiN: egon's beam flare
void EV_EgonFlareCallback ( struct tempent_s * ent , float frametime , float currenttime )
{
float delta = currenttime - ent - > tentOffset . z ; // time past since the last scale
if ( delta > = ent - > tentOffset . y )
{
ent - > entity . curstate . scale + = ent - > tentOffset . x * delta ;
ent - > tentOffset . z = currenttime ;
}
}
void EV_EgonFire ( event_args_t * args )
{
@ -1451,7 +1462,7 @@ void EV_EgonFire( event_args_t *args )
@@ -1451,7 +1462,7 @@ void EV_EgonFire( event_args_t *args )
if ( EV_IsLocal ( idx ) )
gEngfuncs . pEventAPI - > EV_WeaponAnimation ( g_fireAnims1 [ gEngfuncs . pfnRandomLong ( 0 , 3 ) ] , 1 ) ;
if ( iStartup = = 1 & & EV_IsLocal ( idx ) & & ! pBeam & & ! pBeam2 & & cl_lw - > value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
if ( iStartup = = 1 & & EV_IsLocal ( idx ) & & ! ( pBeam | | pBeam2 | | pFlare ) & & cl_lw - > value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
{
vec3_t vecSrc , vecEnd , angles , forward , right , up ;
pmtrace_t tr ;
@ -1499,8 +1510,16 @@ void EV_EgonFire( event_args_t *args )
@@ -1499,8 +1510,16 @@ void EV_EgonFire( event_args_t *args )
pBeam - > flags | = ( FBEAM_SINENOISE ) ;
pBeam2 = gEngfuncs . pEfxAPI - > R_BeamEntPoint ( idx | 0x1000 , tr . endpos , iBeamModelIndex , 99999 , 5.0 , 0.08 , 0.7 , 25 , 0 , 0 , r , g , b ) ;
// Vit_amiN: egon beam flare
pFlare = gEngfuncs . pEfxAPI - > R_TempSprite ( tr . endpos , vec3_origin , 1.0 , gEngfuncs . pEventAPI - > EV_FindModelIndex ( EGON_FLARE_SPRITE ) , kRenderGlow , kRenderFxNoDissipation , 1.0 , 99999 , FTENT_SPRCYCLE | FTENT_PERSIST ) ;
}
}
if ( pFlare ) // Vit_amiN: store the last mode for EV_EgonStop()
{
pFlare - > tentOffset . x = ( iFireMode = = FIRE_WIDE ) ? 1.0f : 0.0f ;
}
}
void EV_EgonStop ( event_args_t * args )
@ -1529,6 +1548,26 @@ void EV_EgonStop( event_args_t *args )
@@ -1529,6 +1548,26 @@ void EV_EgonStop( event_args_t *args )
pBeam2 - > die = 0.0 ;
pBeam2 = NULL ;
}
if ( pFlare ) // Vit_amiN: egon beam flare
{
pFlare - > die = gEngfuncs . GetClientTime ( ) ;
if ( gEngfuncs . GetMaxClients ( ) = = 1 | | ! ( pFlare - > flags & FTENT_NOMODEL ) )
{
if ( pFlare - > tentOffset . x ! = 0.0f ) // true for iFireMode == FIRE_WIDE
{
pFlare - > callback = & EV_EgonFlareCallback ;
pFlare - > fadeSpeed = 2.0 ; // fade out will take 0.5 sec
pFlare - > tentOffset . x = 10.0 ; // scaling speed per second
pFlare - > tentOffset . y = 0.1 ; // min time between two scales
pFlare - > tentOffset . z = pFlare - > die ; // the last callback run time
pFlare - > flags = FTENT_FADEOUT | FTENT_CLIENTCUSTOM ;
}
}
pFlare = NULL ;
}
}
}
//======================