## 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_medicMaxHealth : Maxhealth for medics = g_medicMaxHealth% * other classes Known bug : display bug (we should modifiy the client side too) default : 112 (same as ET default) ------------------------- MODIFICATION STARTS HERE src\game\g_items.c (line 725) **** IN int Pickup_Health (gentity_t *ent, gentity_t *other) **** REPLACE if( other->client->sess.playerType == PC_MEDIC ) { max *= 1.12f; } **** WITH if(other->client->sess.playerType == PC_MEDIC) { max *= g_medicMaxHealth.integer*0.01f; } src\game\g_active.c (line 813) **** REPLACE // regenerate // tjw: dead players can't regenerate if( client->sess.playerType == PC_MEDIC && !(client->ps.eFlags & EF_DEAD) ) { if( ent->health < client->ps.stats[STAT_MAX_HEALTH]) { ent->health += regenRate1; if ( ent->health > client->ps.stats[STAT_MAX_HEALTH] * 1.1){ ent->health = client->ps.stats[STAT_MAX_HEALTH] * 1.1; } } else if( ent->health < client->ps.stats[STAT_MAX_HEALTH] * 1.12) { ent->health += regenRate2; if( ent->health > client->ps.stats[STAT_MAX_HEALTH] * 1.12 ) { ent->health = client->ps.stats[STAT_MAX_HEALTH] * 1.12; } } **** WITH // regenerate // tjw: dead players can't regenerate if( client->sess.playerType == PC_MEDIC && !(client->ps.eFlags & EF_DEAD) ) { if( ent->health < client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.009) { ent->health += regenRate1; if ( ent->health > client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.0095){ ent->health = client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.0095; } } else if( ent->health < client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.01) { ent->health += regenRate2; if( ent->health > client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.01) { ent->health = client->ps.stats[STAT_MAX_HEALTH]*g_medicMaxHealth.integer*0.01; } } src\game\bg_misc.c (line 10) **** BEFORE #include "q_shared.h" **** ADD #ifndef CGAMEDLL #include "g_local.h" #endif (line 3198) **** IN qboolean BG_CanItemBeGrabbed **** REPLACE // Gordon: medics can go up to 12% extra on max health as they have perm. regen if( ps->stats[STAT_HEALTH] >= (int)(ps->stats[STAT_MAX_HEALTH] * 1.12) ) { **** WITH // Gordon: medics can go up to g_medicMaxHealth% extra on max health if(ps->stats[STAT_HEALTH] >= (int)((ps->stats[STAT_MAX_HEALTH])*g_medicMaxHealth.integer*0.01 - 0.5)) { src\game\g_local.h : (line 2154) **** AFTER extern vmCvar_t g_spawnInvul; **** ADD extern vmCvar_t g_medicMaxHealth; src\game\g_main.c : (line 257) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_medicMaxHealth; (line 755) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_medicMaxHealth, "g_medicMaxHealth", "112", 0 }, ------------------------- PERSONAL NOTES cf g_medicsPCR