## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 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_engiPCR : bitflag 1 - Bullet-proof flak jacket carries over 2 - Bullet-proof flak jacket reduces the HP given by medpacks by (100-g_flakBullet)% 4 - Bullet-proof flak jacket reduces the HP given by med cabinets by (100-g_flakBullet)% default : 6 g_flakBullet : integer Percent of damage taken from non-explosive weapons non-headshot when a player has bullet-proof flak jacket. Eg 80 means that if you shoot an eng with MP40 and not in the head, he will take 80% of the damage he would if he didn't have the jacket. default : 80 (set it to 100 to restore default ET behavior) g_flakBoom : integer Percent of damage taken from explosive weapons when a player has normal (standard ET) flak jacket. default : 65 (set it to 50 to restore default ET behavior) ------------------------- MODIFICATION STARTS HERE src\game\g_combat.c (line 1757) **** MOVE headShot = IsHeadShot(attacker, targ, dir, point, mod); **** FROM BEFORE if ( headShot ) { // Perro: Allow tunables to work with both traditional and new damage code **** TO BEFORE (line 1720) // save some from flak jacket if( targ->client && targ->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (targ->client->sess.playerType == PC_ENGINEER || (g_skills.integer & SKILLS_FLAK))) { (line 1721) **** REPLACE // save some from flak jacket if( targ->client && targ->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (targ->client->sess.playerType == PC_ENGINEER || (g_skills.integer & SKILLS_FLAK))) { if( mod == MOD_GRENADE || mod == MOD_GRENADE_LAUNCHER || mod == MOD_ROCKET || mod == MOD_GRENADE_PINEAPPLE || mod == MOD_MAPMORTAR || mod == MOD_MAPMORTAR_SPLASH || mod == MOD_EXPLOSIVE || mod == MOD_LANDMINE || mod == MOD_GPG40 || mod == MOD_M7 || mod == MOD_SATCHEL || mod == MOD_ARTY || mod == MOD_AIRSTRIKE || mod == MOD_DYNAMITE || mod == MOD_MORTAR || mod == MOD_PANZERFAUST || mod == MOD_MAPMORTAR ) { take -= take * .5f; } } **** WITH // save some from flak jacket if( targ->client && targ->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (targ->client->sess.playerType == PC_ENGINEER || (g_skills.integer & SKILLS_FLAK))) { if( mod == MOD_GRENADE || mod == MOD_GRENADE_LAUNCHER || mod == MOD_ROCKET || mod == MOD_GRENADE_PINEAPPLE || mod == MOD_MAPMORTAR || mod == MOD_MAPMORTAR_SPLASH || mod == MOD_EXPLOSIVE || mod == MOD_LANDMINE || mod == MOD_GPG40 || mod == MOD_M7 || mod == MOD_SATCHEL || mod == MOD_ARTY || mod == MOD_AIRSTRIKE || mod == MOD_DYNAMITE || mod == MOD_MORTAR || mod == MOD_PANZERFAUST || mod == MOD_MAPMORTAR ) { take *= g_flakBoom.integer*.01f; } } // PCR : bullet-proof flak jacket if( targ->client && targ->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (targ->client->sess.playerType == PC_ENGINEER || (g_engiPCR.integer & PCR_FLAKB_CARRY))) { if( !(mod == MOD_GRENADE || mod == MOD_GRENADE_LAUNCHER || mod == MOD_ROCKET || mod == MOD_GRENADE_PINEAPPLE || mod == MOD_MAPMORTAR || mod == MOD_MAPMORTAR_SPLASH || mod == MOD_EXPLOSIVE || mod == MOD_LANDMINE || mod == MOD_GPG40 || mod == MOD_M7 || mod == MOD_SATCHEL || mod == MOD_ARTY || mod == MOD_AIRSTRIKE || mod == MOD_DYNAMITE || mod == MOD_MORTAR || mod == MOD_PANZERFAUST || mod == MOD_MAPMORTAR) && !headShot ) { take *= g_flakBullet.integer*.01f; } } src\game\g_items.c (line 756) **** REPLACE other->health += ent->item->quantity; // unpoison ourself if we pick up meds other->client->pmext.poisoned = qfalse; other->client->ps.viewlocked = 0; other->client->ps.viewlocked_entNum = 0; **** WITH if( other->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (other->client->sess.playerType == PC_ENGINEER || (g_engiPCR.integer & PCR_FLAKB_CARRY)) && (g_engiPCR.integer & PCR_FLAKB_LESSHP_MED)) { other->health += (ent->item->quantity)*g_flakBullet.integer*.01f; if((ent->item->quantity)*g_flakBullet.integer*.01f < 1) other->health++; } else { other->health += ent->item->quantity; } // unpoison ourself if we pick up meds other->client->pmext.poisoned = qfalse; other->client->ps.viewlocked = 0; other->client->ps.viewlocked_entNum = 0; src\game\g_trigger.c (line 528) **** REPLACE touchClients[i]->health += healvalue; // unpoison ourself if we pick up meds **** WITH if( touchClients[i]->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (touchClients[i]->client->sess.playerType == PC_ENGINEER || (g_engiPCR.integer & PCR_FLAKB_CARRY)) && (g_engiPCR.integer & PCR_FLAKB_LESSHP_CAB)) { touchClients[i]->health += healvalue*g_flakBullet.integer*.01f; if(healvalue*g_flakBullet.integer*.01f < 1) touchClients[i]->health++; } else { touchClients[i]->health += healvalue; } // unpoison ourself if we pick up meds src\game\g_local.h : (line 2182) **** AFTER extern vmCvar_t g_spawnInvul; **** ADDED extern vmCvar_t g_engiPCR; extern vmCvar_t g_flakBullet; extern vmCvar_t g_flakBoom; src\game\g_main.c : (line 259) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_engiPCR; vmCvar_t g_flakBullet; vmCvar_t g_flakBoom; (line 789) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_engiPCR, "g_engiPCR", "6", 0 }, { &g_flakBullet, "g_flakBullet", "80", 0 }, { &g_flakBoom, "g_flakBoom", "65", 0 }, src\game\bg_public.h : (line 915) **** AFTER #define MEDIC_NOSELFADREN 256 **** ADD // g_engiPCR // Bullet-proof flak jacket carries over #define PCR_FLAKB_CARRY 1 // Bullet-proof flak jacket reduces HP from medpacks #define PCR_FLAKB_LESSHP_MED 2 // Bullet-proof flak jacket reduces HP from med cabinets #define PCR_FLAKB_LESSHP_CAB 4 ------------------------- PERSONAL NOTES // save some from flak jacket if( targ->client && targ->client->sess.skill[SK_EXPLOSIVES_AND_CONSTRUCTION] >= 4 && (targ->client->sess.playerType == PC_ENGINEER || (g_skills.integer & SKILLS_FLAK))) { void heal_touch : pour ramasser un medpack sur cabinet int Pickup_Health (gentity_t *ent, gentity_t *other) { : ramasser un medpack par terre