Skip to content

Commit c60cc4c

Browse files
cgame: Change spawning bubble particles in one point when using ki boost or projectiles and some properties for the player monster on Monster gamemode
1 parent 37b11b7 commit c60cc4c

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

source/cgame/cg_particles.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,9 +1012,12 @@ void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_
10121012
p->endtime = timenonscaled + turbtime;
10131013
p->height = p->width = (rand() % 1) + size;
10141014

1015-
p->org[0] += (crandom() * range);
1016-
p->org[1] += (crandom() * range);
1017-
p->org[2] += (rand() % (int)20);
1015+
// BFP - Monster gamemode, player monster bubble particles has different spawning origin
1016+
if ( cgs.gametype == GT_MONSTER
1017+
&& ( cent->currentState.eFlags & EF_MONSTER ) ) {
1018+
p->org[0] += (crandom() * range);
1019+
p->org[1] += (crandom() * range);
1020+
}
10181021

10191022
VectorSet( p->vel,
10201023
(rand() % 521) - 250,
@@ -1033,10 +1036,14 @@ void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_
10331036
}
10341037
else
10351038
{
1039+
// spawn in one point
1040+
float angle = random() * M_PI * 2;
1041+
float radius = random() * range * 1.5;
1042+
10361043
p->type = P_BUBBLE;
10371044

1038-
p->org[0] += (crandom() * range);
1039-
p->org[1] += (crandom() * range);
1045+
p->org[0] += cos( angle ) * radius;
1046+
p->org[1] += sin( angle ) * radius;
10401047
p->org[2] += (crandom() * 5);
10411048

10421049
VectorSet( p->vel,
@@ -1048,7 +1055,7 @@ void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_
10481055
VectorSet( p->accel,
10491056
crandom() * 10,
10501057
crandom() * 10,
1051-
900 );
1058+
1000 );
10521059
}
10531060

10541061
p->snum = 3 - (crandom() * 6); // used to randomize where the bubbles stop when these touches the surface

source/cgame/cg_players.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,7 @@ static void CG_Aura( centity_t *cent, int clientNum, clientInfo_t *ci, int rende
26772677
VectorCopy( legs.origin, bubbleOrigin );
26782678
trap_CM_BoxTrace( &trace, start, bubbleOrigin, NULL, NULL, 0, CONTENTS_WATER );
26792679

2680-
bubbleOrigin[2] += -15; // put the origin below the character's feet
2680+
bubbleOrigin[2] += -17; // put the origin below the character's feet
26812681

26822682
// BFP - Monster gamemode, player monster bubble particle size, range and position
26832683
if ( cent->currentState.eFlags & EF_MONSTER ) {
@@ -2689,6 +2689,7 @@ static void CG_Aura( centity_t *cent, int clientNum, clientInfo_t *ci, int rende
26892689

26902690
if ( ( cent->currentState.legsAnim & ~ANIM_TOGGLEBIT ) == LEGS_FLYA
26912691
|| ( cent->currentState.legsAnim & ~ANIM_TOGGLEBIT ) == LEGS_FLYB ) {
2692+
bubbleOrigin[2] += 6; // put the origin near the player origin point
26922693
CG_ParticleBubble( cent, cgs.media.waterBubbleShader, bubbleOrigin, trace.endpos, 700, bubbleRange, bubbleSize );
26932694
CG_ParticleBubble( cent, cgs.media.waterBubbleShader, bubbleOrigin, trace.endpos, 700, bubbleRange, bubbleSize );
26942695
CG_ParticleBubble( cent, cgs.media.waterBubbleShader, bubbleOrigin, trace.endpos, 700, bubbleRange, bubbleSize );

0 commit comments

Comments
 (0)