## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License ## Derivative works may only be done if they are distributed with their source code. ## ## The original etpub_pcr_ah source and binaries can be found around http://www.patheticcockroach.com/etserver/etpub_pcr.php ## ## Note : ETPub PCR alpha hacks are just small modifications for ETPub (http://www.etpub.org) g_covertShotcost : Sets how many percents will be removed from the charge bar on shooting a weapon that should remove the disguise of a covert. For instance 50 will remove half (50%) the charge bar when shooting an FG42 under disguise IF g_coverts is 512 and/or not 32 and/or not 64 (I'm not sure about the priorities). If you want to restore the default ET behavior, set this value to 101 (or more). default : 30 See also : g_coverts (32, 64 and 512) ------------------------- MODIFICATION STARTS HERE src\game\g_weapon.c : (line 4605) **** BEFORE // covert ops disguise handling related to weapon fire void G_DisguisedCovertFire(gentity_t *ent) **** ADD // covert charge bar removal : lower charge bar if we keep the disguise qboolean G_DisguisedCovertFire_Bar(gentity_t *ent, qboolean keepUni) { if (!keepUni) { if (level.time - ent->client->ps.classWeaponTime > level.covertopsChargeTime[ent->client->sess.sessionTeam-1]) ent->client->ps.classWeaponTime = level.time - level.covertopsChargeTime[ent->client->sess.sessionTeam-1]; if (level.time - ent->client->ps.classWeaponTime >= level.covertopsChargeTime[ent->client->sess.sessionTeam-1]*0.01*g_covertShotcost.integer) { ent->client->ps.classWeaponTime += level.covertopsChargeTime[ent->client->sess.sessionTeam-1]*0.01*g_covertShotcost.integer; keepUni = qtrue; } } return keepUni; } (line 4667) **** REPLACE if (!keepUni) { // no uniform for you..... NEXT!! ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; } **** WITH if (!G_DisguisedCovertFire_Bar(ent, keepUni)) { // no uniform for you..... NEXT!! ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; } (line 4763) **** IN FireWeapon **** FIND // tjw: handle possible uniform loss if(ent->client->ps.powerups[PW_OPS_DISGUISED]) G_DisguisedCovertFire(ent); **** AND MOVE IT JUST BEFORE // Omni-bot - Send a fire event. if(ent->r.svFlags & SVF_BOT) src\game\g_active.c : (line 1038) **** REPLACE if (!(g_coverts.integer & COVERTF_KEEP_UNI_NONSIL)) { ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; } **** WITH if (!(g_coverts.integer & COVERTF_KEEP_UNI_NONSIL) && !G_DisguisedCovertFire_Bar(ent, qfalse)) { ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; } **** DO THE SAME AROUND 20 LINES AFTER src\game\g_cmds.c : (line 4541) **** REPLACE if(!(g_coverts.integer & COVERTF_NO_MG_EXPOSURE)) ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; **** WITH if(!(g_coverts.integer & COVERTF_NO_MG_EXPOSURE) && !G_DisguisedCovertFire_Bar(ent, qfalse)) ent->client->ps.powerups[PW_OPS_DISGUISED] = 0; src\game\g_local.h : (line 1636) **** AFTER qboolean G_AimAtNearest( gentity_t *ent , int weapon); **** ADD qboolean G_DisguisedCovertFire_Bar(gentity_t *ent, qboolean keepUni); (line 2154) **** AFTER extern vmCvar_t g_spawnInvul; **** ADD extern vmCvar_t g_covertShotcost; src\game\g_main.c : (line 257) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_covertShotcost; (line 755) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_covertShotcost, "g_covertShotcost", "30", 0 },