Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ You'll notice some differences and things that the original Bid For Power didn't
- 3d particles for bubbles, antigrav rock and rock debris, that can be enabled with `cg_3dparticles` cvar. For 3d rock particles, you need 3 models inside models/effects/ directory: `pebble1.md3`, `pebble2.md3` and `pebble3.md3`; otherwise, it will appear the standard ones. That option is included in BFP OPTIONS menu in VIEW & FX, also with a new explosion type option in EXPLOSIONS: Ultra Hardcore
- piercing weapons, like Razor disk, emit spark particles when hitting a player
- beam struggle emits spark particles in the middle of both beams (in original BFP, emits in the zeroed origin)
- new particles: charge smoke, which appears when charging ki near the ground
- new cool missile trails (that replaces original Q3 missile smoke trails), includes rainbow option (it can be disabled by setting `cg_oldRocketTrail 1`). These trails are quite similar to the Rocket pod weapon from [Bazooka Q3 (BQ3)](https://planetquake.gamespy.com/View10ca.html?view=Articles.Detail&id=693) mod
- new charge smoke particle, which appears when charging ki near the ground
- new cool missile trails (it can be disabled by setting `cg_oldRocketTrail 1` to see Q3 missile smoke trails back). These trails are quite similar to the Rocket pod weapon from [Bazooka Q3 (BQ3)](https://planetquake.gamespy.com/View10ca.html?view=Articles.Detail&id=693) mod

#### PMOVE:
- balanced player pmove physics:
Expand Down Expand Up @@ -135,6 +135,13 @@ You'll notice some differences and things that the original Bid For Power didn't
- some Q3e patches are applied, like events and function stuff...
- ...

### NEW FEATURES (BFPR):

- `missileArch [0/1]`: the projectile, with missile or rdmissile attack type, moves like an arch across the crosshair
- `missileDlightRainbow [0/1]` to see rainbow dynamic rainbow light effect, and `missileTrailRainbow [0/1]` to see rainbow trail effect, in the skin config
- new confetti particle, use `explosionConfetti <number of confetti leafs>` in the skin config for the explosion


# How to build

### Introduction
Expand Down
9 changes: 7 additions & 2 deletions source/cgame/cg_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,8 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir, bfpAttackSkinConfig_t *skinA
skinAtkCfg->missileSoundPath, skinAtkCfg->missileSound, skinAtkCfg->chargeSoundPath, skinAtkCfg->chargeSound );
Com_Printf( " ^6flashSound^7=^3'%s'^7 (sfx^7=^3%d^7) ^6firingSound^7=^3'%s'^7 (sfx^7=^3%d^7)\n",
skinAtkCfg->flashSoundPath, skinAtkCfg->flashSound, skinAtkCfg->firingSoundPath, skinAtkCfg->firingSound );
Com_Printf( " ^6missileDlight^7=^3%d^7, ^6color^7=(^3%f^7,^3%f^7,^3%f^7)\n",
skinAtkCfg->missileDlight, skinAtkCfg->missileDlightColor[0], skinAtkCfg->missileDlightColor[1], skinAtkCfg->missileDlightColor[2] );
Com_Printf( " ^6missileDlight^7=^3%d^7, ^6color^7=(^3%f^7,^3%f^7,^3%f^7)^7, ^6rainbow^7=^3%d^7\n",
skinAtkCfg->missileDlight, skinAtkCfg->missileDlightColor[0], skinAtkCfg->missileDlightColor[1], skinAtkCfg->missileDlightColor[2], skinAtkCfg->missileDlightRainbow );
Com_Printf( " ^6missileTrailFunc^7=^3%d^7, ^6trailTime^7=^3%d^7, ^6trailRadius^7=^3%d\n",
skinAtkCfg->missileTrailFunc, skinAtkCfg->missileTrailTime, skinAtkCfg->missileTrailRadius );
Com_Printf( " ^6beamShader^7=^3'%s'^7 (shader^7=^3%d^7) ^6spiralBeamShader^7=^3'%s'^7 (shader^7=^3%d^7)\n",
Expand Down Expand Up @@ -957,6 +957,9 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir, bfpAttackSkinConfig_t *skinA
leRing = CG_SpawnExplosionModel( origin, dir, LE_EXPLOSION_RING, cgs.media.ringFlashModel, cgs.media.railExplosionShader, 500 );
}
CG_SmokeExplosion( origin, dir, skinAtkCfg ); // BFP - Explosion smoke
if ( skinAtkCfg->explosionConfetti > 0 ) { // BFPR - Confetti particles
CG_ParticleConfetti( cgs.media.whiteShader, origin, dir, skinAtkCfg->explosionConfetti, 5, 700.0f );
}

{
const float MAX_SCALE = 25.0f, MAX_SCALEFACTOR = 6.0f; // limits to prevent too large scaling
Expand Down Expand Up @@ -995,6 +998,8 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir, bfpAttackSkinConfig_t *skinA
leSphere->lightColor[0] = missileDlightColor[0];
leSphere->lightColor[1] = missileDlightColor[1];
leSphere->lightColor[2] = missileDlightColor[2];
// BFPR - Missile dynamic rainbow light color
leSphere->lightRainbow = skinAtkCfg->missileDlightRainbow;
}

if ( cg_bigExplosions.integer > 0 ) { // BFP - Big explosions
Expand Down
11 changes: 9 additions & 2 deletions source/cgame/cg_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,15 @@ static void CG_Missile( centity_t *cent ) {
*/
// add dynamic light
if ( skinAtkCfg->missileDlight ) {
trap_R_AddLightToScene(cent->lerpOrigin, skinAtkCfg->missileDlight,
skinAtkCfg->missileDlightColor[0], skinAtkCfg->missileDlightColor[1], skinAtkCfg->missileDlightColor[2] );
if ( skinAtkCfg->missileDlightRainbow ) { // BFPR - Missile dynamic rainbow light color
float rf, gf, bf;
float elapsed = ( cg.time + cent->currentState.pos.trTime + cent->currentState.number * 97 ) * 0.0006f;
CG_HSVtoRGB( elapsed, 1.0f, 1.0f, &rf, &gf, &bf );
trap_R_AddLightToScene( cent->lerpOrigin, skinAtkCfg->missileDlight, rf, gf, bf );
} else {
trap_R_AddLightToScene( cent->lerpOrigin, skinAtkCfg->missileDlight,
skinAtkCfg->missileDlightColor[0], skinAtkCfg->missileDlightColor[1], skinAtkCfg->missileDlightColor[2] );
}
}

// add missile sound
Expand Down
7 changes: 7 additions & 0 deletions source/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ typedef struct localEntity_s {

float light;
vec3_t lightColor;
qboolean lightRainbow; // BFPR - Cycle lightColor through rainbow hues (missileDlightRainbow), overrides lightColor

leMarkType_t leMarkType; // mark to leave on fragment impact
leBounceSoundType_t leBounceSoundType;
Expand Down Expand Up @@ -341,11 +342,13 @@ typedef struct {
// dynamic light
int missileDlight; // missile dynamic light
vec3_t missileDlightColor; // missile dynamic light color
qboolean missileDlightRainbow; // BFPR: missile dynamic light cycles through rainbow hues, overrides missileDlightColor

// trail
int missileTrailFunc; // missile trail function: "beam" / "rocket" / "spiralbeam" / "none"
int missileTrailTime; // missile trail time (rocket trail only)
int missileTrailRadius; // missile trail radius (rocket trail only)
qboolean missileTrailRainbow; // BFPR: missile trail cycles through rainbow hues, ignoring trail's fixed color

// beam
char beamShaderName[MAX_QPATH]; // beam shader
Expand Down Expand Up @@ -385,6 +388,7 @@ typedef struct {
qboolean explosionShell; // show explosion shell model
int explosionRocks; // number of rocks
int explosionSparks; // number of sparks
int explosionConfetti; // BFPR - number of confetti/leaf-like pieces
int explosionSmoke; // number of smokes
int explosionSmokeRadius; // explosion smoke radius
int explosionSmokeLife; // explosion smoke duration
Expand Down Expand Up @@ -1489,6 +1493,7 @@ void CG_KiTrail( int entityNum, vec3_t origin, qboolean remove, qhandle_t hShade
void CG_BeamTrail( int entityNum, vec3_t origin, vec3_t muzzleOrigin, qhandle_t hShader );
void CG_CorkscrewTrail( int entityNum, vec3_t origin, vec3_t muzzleOrigin, qhandle_t beamShader, qhandle_t corkscrewShader );
void CG_MissileTrail( int entityNum, vec3_t origin, float radius, qhandle_t hShader, vec3_t color, qboolean rainbow );
void CG_HSVtoRGB( float h, float s, float v, float *r, float *g, float *b ); // BFPR - Missile trails rainbow
void CG_DrawMissileTrails( void );

//
Expand Down Expand Up @@ -1747,3 +1752,5 @@ void CG_ParticleSparks (qhandle_t pshader, vec3_t origin, vec3_t vel);
void CG_ParticleChargeSmoke (centity_t *cent, qhandle_t pshader, vec3_t origin, float size, float radialVel, float baseRadius);
// BFP - Beam struggle spark particle
void CG_ParticleBeamStruggleSpark (qhandle_t pshader, vec3_t origin, vec3_t vel);
// BFPR - Confetti particle
void CG_ParticleConfetti (qhandle_t pshader, vec3_t origin, vec3_t dir, int num, float size, float speed);
28 changes: 27 additions & 1 deletion source/cgame/cg_localents.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ CG_AddExplosion
*/
static void CG_AddExplosion( localEntity_t *ex ) {
refEntity_t *ent;
vec3_t rainbowColor = { 0, 0, 0 }; // BFPR - For missileDlightRainbow

ent = &ex->refEntity;

Expand Down Expand Up @@ -543,12 +544,29 @@ static void CG_AddExplosion( localEntity_t *ex ) {
VectorScale( ent->axis[2], scale, ent->axis[2] );
}

// BFPR - missileDlightRainbow
if ( ex->lightRainbow ) {
float posOffset = ex->refEntity.origin[0] + ex->refEntity.origin[1] + ex->refEntity.origin[2];
float elapsed = ( cg.time + ex->startTime + posOffset ) * 0.0006f;
CG_HSVtoRGB( elapsed, 1.0f, 1.0f, &rainbowColor[0], &rainbowColor[1], &rainbowColor[2] );
}

// BFPR - missileDlightRainbow, tint the explosion sphere shader with the rainbow color too,
// so the model itself cycles in sync with its dynamic light
if ( ex->leType == LE_EXPLOSION_SPHERE && ex->lightRainbow ) {
ent->shaderRGBA[0] = rainbowColor[0] * 0xff;
ent->shaderRGBA[1] = rainbowColor[1] * 0xff;
ent->shaderRGBA[2] = rainbowColor[2] * 0xff;
ent->shaderRGBA[3] = 0xff;
}

// add the entity
trap_R_AddRefEntityToScene(ent);

// add the dlight
if ( cg_lightExplosions.integer > 0 ) { // BFP - Dynamic explosion lights
float light;
vec3_t lightColor;

light = (float)( cg.time - ex->startTime ) / ( ex->endTime - ex->startTime );
if ( light < 0.5 ) {
Expand All @@ -557,7 +575,15 @@ static void CG_AddExplosion( localEntity_t *ex ) {
light = 1.0 - ( light - 0.5 ) * 2;
}
light = ex->light * light;
trap_R_AddLightToScene(ent->origin, light, ex->lightColor[0], ex->lightColor[1], ex->lightColor[2] );

// BFPR - missileDlightRainbow
if ( ex->lightRainbow ) {
VectorCopy( rainbowColor, lightColor );
} else {
VectorCopy( ex->lightColor, lightColor );
}

trap_R_AddLightToScene( ent->origin, light, lightColor[0], lightColor[1], lightColor[2] );
}
}

Expand Down
Loading