Skip to content

Commit

Permalink
New variables for rocket explosion blood color:
Browse files Browse the repository at this point in the history
  r_rlbloodcolor_small
  r_rlbloodcolor_big

These work like r_lgbloodcolor.
  • Loading branch information
foobar-qw committed Oct 18, 2023
1 parent e1a76d6 commit dcf8abc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
22 changes: 17 additions & 5 deletions help_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -16108,15 +16108,27 @@
}
]
},
"r_sgbloodColor": {
"default": "73",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with weapons other than the lightning gun.",
"r_lgbloodColor": {
"default": "225",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with the lightning gun.",
"group-id": "8",
"type": "integer"
},
"r_lgbloodColor": {
"r_rlbloodColor_small": {
"default": "225",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with the lightning gun.",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with the rocket launcher. Requires the rocket explosion to be small blood (cl_explosiontype 3. Default value is 225.",
"group-id": "8",
"type": "integer"
},
"r_rlbloodColor_big": {
"default": "73",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with the rocket launcher. Requires the rocket explosion to be big blood (cl_explosiontype 4. Default value is 73.",
"group-id": "8",
"type": "integer"
},
"r_sgbloodColor": {
"default": "73",
"desc": "Determines the (palletized) color of the blood particles emitted when hitting entities with weapons other than the lightning gun.",
"group-id": "8",
"type": "integer"
},
Expand Down
12 changes: 8 additions & 4 deletions src/cl_tent.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ static model_t *cl_explo_mod, *cl_bolt1_mod, *cl_bolt2_mod, *cl_bolt3_mod, *cl_b

sfx_t *cl_sfx_wizhit, *cl_sfx_knighthit, *cl_sfx_tink1, *cl_sfx_ric1, *cl_sfx_ric2, *cl_sfx_ric3, *cl_sfx_r_exp3;

cvar_t r_sgbloodColor = {"r_sgbloodColor", "73"};
cvar_t r_lgbloodColor = {"r_lgbloodColor", "225"};
cvar_t r_rlbloodColor_small = {"r_rlbloodColor_small", "225"};
cvar_t r_rlbloodColor_big = {"r_rlbloodColor_big", "73"};
cvar_t r_sgbloodColor = {"r_sgbloodColor", "73"};
cvar_t r_shiftbeam = {"r_shiftbeam", "0"};

void CL_InitTEnts(void)
Expand All @@ -83,8 +85,10 @@ void CL_InitTEnts(void)
void CL_InitTEntsCvar(void)
{
Cvar_SetCurrentGroup(CVAR_GROUP_EYECANDY);
Cvar_Register(&r_sgbloodColor);
Cvar_Register(&r_lgbloodColor);
Cvar_Register(&r_rlbloodColor_small);
Cvar_Register(&r_rlbloodColor_big);
Cvar_Register(&r_sgbloodColor);
Cvar_Register(&r_shiftbeam);
Cvar_ResetCurrentGroup();
}
Expand Down Expand Up @@ -428,11 +432,11 @@ static void CL_Parse_TE_EXPLOSION(vec3_t pos)
}
else if (r_explosiontype.value == 3) {
// lightning blood
R_RunParticleEffect(pos, vec3_origin, 225, 50);
R_RunParticleEffect(pos, vec3_origin, r_rlbloodColor_small.value ? r_rlbloodColor_small.integer : 225, 50);
}
else if (r_explosiontype.value == 4) {
// Big blood
R_RunParticleEffect(pos, vec3_origin, 73, 20 * 32);
R_RunParticleEffect(pos, vec3_origin, r_rlbloodColor_big.value ? r_rlbloodColor_big.integer : 73, 20 * 32);
}
else if (r_explosiontype.value == 5) {
// Double gunshot
Expand Down

0 comments on commit dcf8abc

Please sign in to comment.