mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-17 01:22:32 +00:00
Added dynamic radio and stopped all radio usage during lca
This commit is contained in:
parent
80f3f92d8a
commit
eda6a9e20f
7 changed files with 85 additions and 20 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.114 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.113 2002/08/03 06:52:35 jbravo
|
||||
// Fixed the plost3 sound in all radiopaks and now damage is only tracked for
|
||||
// players you hit that are not on your team
|
||||
|
@ -1648,6 +1651,7 @@ extern vmCvar_t cg_RQ3_overlaycrosshair;
|
|||
extern vmCvar_t cg_RQ3_tkokAutoPopup;
|
||||
extern vmCvar_t cg_RQ3_radiovoice_male;
|
||||
extern vmCvar_t cg_RQ3_radiovoice_female;
|
||||
extern vmCvar_t cg_RQ3_dynamicRadio;
|
||||
|
||||
// Slicer: for the Anti-Cheat System
|
||||
//extern vmCvar_t cg_RQ3_Auth;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.102 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.101 2002/07/26 22:28:38 jbravo
|
||||
// Fixed the server about menu, made the UI handle illegal models and skins
|
||||
// better.
|
||||
|
@ -384,8 +387,10 @@ vmCvar_t cg_RQ3_overlaycrosshair;
|
|||
|
||||
// JBravo: cvar for tkok popup
|
||||
vmCvar_t cg_RQ3_tkokAutoPopup;
|
||||
// JBravo: radio cvars.
|
||||
vmCvar_t cg_RQ3_radiovoice_male;
|
||||
vmCvar_t cg_RQ3_radiovoice_female;
|
||||
vmCvar_t cg_RQ3_dynamicRadio;
|
||||
|
||||
// Slicer: for the Anti-Cheat System
|
||||
//vmCvar_t cg_RQ3_Auth;
|
||||
|
@ -638,8 +643,9 @@ static cvarTable_t cvarTable[] = { // bk001129
|
|||
{&cg_RQ3_crosshairColorB, "cg_RQ3_crosshairColorB", "1.0", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_crosshairColorA, "cg_RQ3_crosshairColorA", "1.0", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_tkokAutoPopup, "cg_RQ3_tkokAutoPopup", "0", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_radiovoice_male, "cg_RQ3_radiovoice_male", "1", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_radiovoice_female, "cg_RQ3_radiovoice_female", "1", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_radiovoice_male, "cg_RQ3_radiovoice_male", "1", CVAR_USERINFO | CVAR_ARCHIVE},
|
||||
{&cg_RQ3_radiovoice_female, "cg_RQ3_radiovoice_female", "1", CVAR_USERINFO | CVAR_ARCHIVE},
|
||||
{&cg_RQ3_dynamicRadio, "cg_RQ3_dynamicRadio", "1", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_impactEffects, "cg_RQ3_impactEffects", "1", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_laserAssist, "cg_RQ3_laserAssist", "0", CVAR_ARCHIVE},
|
||||
{&cg_RQ3_anouncer, "cg_RQ3_announcer", "1", CVAR_ARCHIVE},
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.60 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.59 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
|
@ -1113,12 +1116,27 @@ void CG_CvarSet(void)
|
|||
|
||||
void CG_Radio(void)
|
||||
{
|
||||
int sound, gender;
|
||||
int sound, gender, set;
|
||||
|
||||
sound = atoi(CG_Argv(2));
|
||||
gender = atoi(CG_Argv(3));
|
||||
set = atoi(CG_Argv(4));
|
||||
|
||||
//Slicer optimization
|
||||
if (!gender) {
|
||||
if (cg_RQ3_dynamicRadio.integer) {
|
||||
if (!gender) {
|
||||
if (set == 0) {
|
||||
CG_AddBufferedSound(cgs.media.male_sounds[sound]);
|
||||
} else if (set == 1) {
|
||||
CG_AddBufferedSound(cgs.media.new_male_sounds[sound]);
|
||||
} else if (set == 2) {
|
||||
CG_AddBufferedSound(cgs.media.pikey_male_sounds[sound]);
|
||||
} else if (set > 2) {
|
||||
CG_AddBufferedSound(cgs.media.pirate_male_sounds[sound]);
|
||||
}
|
||||
} else
|
||||
CG_AddBufferedSound(cgs.media.female_sounds[sound]);
|
||||
} else if (!gender) {
|
||||
if (cg_RQ3_radiovoice_male.integer == 0) {
|
||||
CG_AddBufferedSound(cgs.media.male_sounds[sound]);
|
||||
} else if (cg_RQ3_radiovoice_male.integer == 1) {
|
||||
|
@ -1129,7 +1147,7 @@ void CG_Radio(void)
|
|||
CG_AddBufferedSound(cgs.media.pirate_male_sounds[sound]);
|
||||
}
|
||||
} else {
|
||||
CG_AddBufferedSound(cgs.media.female_sounds[sound]);
|
||||
CG_AddBufferedSound(cgs.media.female_sounds[sound]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.25 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.24 2002/07/13 22:42:18 makro
|
||||
// Semi-working fog hull, semi-working sky portals (cgame code commented out)
|
||||
// Basically, semi-working stuff :P
|
||||
|
@ -1097,7 +1100,7 @@ static void CG_PlayBufferedSounds(void)
|
|||
trap_S_StartLocalSound(cg.soundBuffer[cg.soundBufferOut], CHAN_ANNOUNCER);
|
||||
cg.soundBuffer[cg.soundBufferOut] = 0;
|
||||
cg.soundBufferOut = (cg.soundBufferOut + 1) % MAX_SOUNDBUFFER;
|
||||
cg.soundTime = cg.time + 750;
|
||||
cg.soundTime = cg.time + 1100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.110 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.109 2002/07/26 22:28:38 jbravo
|
||||
// Fixed the server about menu, made the UI handle illegal models and skins
|
||||
// better.
|
||||
|
@ -1107,7 +1110,20 @@ void ClientUserinfoChanged(int clientNum)
|
|||
Q_strncpyz(model, Info_ValueForKey(userinfo, "model"), sizeof(model));
|
||||
Q_strncpyz(headModel, Info_ValueForKey(userinfo, "headmodel"), sizeof(headModel));
|
||||
}
|
||||
//Com_Printf("%s model=(%s)\n",client->pers.netname, model);
|
||||
// JBravo: set the radiosoundset
|
||||
s = Info_ValueForKey(userinfo, "cg_RQ3_radiovoice_male");
|
||||
if (!atoi(s)) {
|
||||
client->radioSetMale = 0;
|
||||
} else {
|
||||
client->radioSetMale = atoi(s);
|
||||
}
|
||||
s = Info_ValueForKey(userinfo, "cg_RQ3_radiovoice_female");
|
||||
if (!atoi(s)) {
|
||||
client->radioSetFemale = 0;
|
||||
} else {
|
||||
client->radioSetFemale = atoi(s);
|
||||
}
|
||||
|
||||
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
|
||||
if (client->sess.sessionTeam == TEAM_RED) {
|
||||
Q_strncpyz(model2, g_RQ3_team1model.string, sizeof(model));
|
||||
|
@ -1628,6 +1644,7 @@ void ClientSpawn(gentity_t * ent)
|
|||
int eventSequence;
|
||||
int savedWeapon, savedItem, savedSpec; // JBravo: to save weapon/item info
|
||||
int savedRadiopower, savedRadiogender; // JBravo: for radio.
|
||||
int savedMaleSet, savedFemaleSet; // JBravo: for soundset saves.
|
||||
camera_t savedCamera; // JBravo: to save camera stuff
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
|
||||
|
@ -1732,6 +1749,8 @@ void ClientSpawn(gentity_t * ent)
|
|||
// JBravo: save radiosettings
|
||||
savedRadiopower = client->radioOff;
|
||||
savedRadiogender = client->radioGender;
|
||||
savedMaleSet = client->radioSetMale;
|
||||
savedFemaleSet = client->radioSetFemale;
|
||||
memcpy(&savedCamera, &client->camera, sizeof(camera_t));
|
||||
|
||||
memset(client, 0, sizeof(*client)); // bk FIXME: Com_Memset?
|
||||
|
@ -1743,6 +1762,8 @@ void ClientSpawn(gentity_t * ent)
|
|||
// JBravo: restore radiosettings
|
||||
client->radioOff = savedRadiopower;
|
||||
client->radioGender = savedRadiogender;
|
||||
client->radioSetMale = savedMaleSet;
|
||||
client->radioSetFemale = savedFemaleSet;
|
||||
memcpy(&client->camera, &savedCamera, sizeof(camera_t));
|
||||
|
||||
client->pers = saved;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.112 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.111 2002/07/24 02:17:38 jbravo
|
||||
// Added a respawn delay for CTB
|
||||
//
|
||||
|
@ -664,6 +667,8 @@ struct gclient_s {
|
|||
int teamplayWeapon;
|
||||
int teamplayItem;
|
||||
int radioGender;
|
||||
int radioSetMale;
|
||||
int radioSetFemale;
|
||||
qboolean radioOff;
|
||||
int team_wounds;
|
||||
int team_wounds_before;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.126 2002/08/07 03:35:57 jbravo
|
||||
// Added dynamic radio and stopped all radio usage during lca
|
||||
//
|
||||
// Revision 1.125 2002/08/03 06:21:04 jbravo
|
||||
// Fixed the Akimbo ammo when akimbos are not the primary weapon
|
||||
//
|
||||
|
@ -1300,11 +1303,11 @@ void RQ3_Cmd_Radio_power_f(gentity_t * ent)
|
|||
if (ent->client->radioOff == qfalse) {
|
||||
ent->client->radioOff = qtrue;
|
||||
trap_SendServerCommand(ent - g_entities, "cp \"Radio switched off\n\"");
|
||||
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i 25 0", RADIO));
|
||||
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i 25 0 0", RADIO));
|
||||
} else {
|
||||
ent->client->radioOff = qfalse;
|
||||
trap_SendServerCommand(ent - g_entities, "cp \"Radio switched on\n\"");
|
||||
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i 25 0", RADIO));
|
||||
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i 25 0 0", RADIO));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1530,20 +1533,25 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
|
|||
char msg[MAX_TOKEN_CHARS];
|
||||
radio_msg_t *radio_msgs;
|
||||
gentity_t *player;
|
||||
int i, x, kills;
|
||||
int i, x, kills, set;
|
||||
|
||||
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR || ent->health <= 0)
|
||||
return;
|
||||
if (trap_Argc() < 2)
|
||||
return;
|
||||
if (g_RQ3_lca.integer)
|
||||
return;
|
||||
if (ent->client->radioOff == qtrue) {
|
||||
trap_SendServerCommand(ent - g_entities, "print \"Your radio is off!\n\"");
|
||||
return;
|
||||
}
|
||||
if (ent->client->radioGender == 0)
|
||||
if (ent->client->radioGender == 0) {
|
||||
radio_msgs = male_radio_msgs;
|
||||
else
|
||||
set = ent->client->radioSetMale;
|
||||
} else {
|
||||
radio_msgs = female_radio_msgs;
|
||||
set = ent->client->radioSetFemale;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
|
||||
|
@ -1567,13 +1575,13 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
|
|||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
if (player->client->sess.sessionTeam == ent->client->sess.sessionTeam)
|
||||
trap_SendServerCommand(player - g_entities,
|
||||
va("rq3_cmd %i %i %i\n", RADIO,
|
||||
kills - 1, ent->client->radioGender));
|
||||
va("rq3_cmd %i %i %i %i\n", RADIO,
|
||||
kills - 1, ent->client->radioGender, set));
|
||||
} else {
|
||||
if (player->client->sess.savedTeam == ent->client->sess.savedTeam)
|
||||
trap_SendServerCommand(player - g_entities,
|
||||
va("rq3_cmd %i %i %i\n", RADIO,
|
||||
kills - 1, ent->client->radioGender));
|
||||
va("rq3_cmd %i %i %i %i\n", RADIO,
|
||||
kills - 1, ent->client->radioGender, set));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1593,8 +1601,8 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
|
|||
radio_msgs[x].msg));
|
||||
else
|
||||
trap_SendServerCommand(player - g_entities,
|
||||
va("rq3_cmd %i %i %i\n", RADIO, x,
|
||||
ent->client->radioGender));
|
||||
va("rq3_cmd %i %i %i %i\n", RADIO, x,
|
||||
ent->client->radioGender, set));
|
||||
}
|
||||
} else {
|
||||
if (player->client->sess.savedTeam == ent->client->sess.savedTeam) {
|
||||
|
@ -1605,8 +1613,8 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
|
|||
radio_msgs[x].msg));
|
||||
else
|
||||
trap_SendServerCommand(player - g_entities,
|
||||
va("rq3_cmd %i %i %i\n", RADIO, x,
|
||||
ent->client->radioGender));
|
||||
va("rq3_cmd %i %i %i %i\n", RADIO, x,
|
||||
ent->client->radioGender, set));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue