## 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_medicMinAmmo : The minimum maximum number of ammo clips a medic can have for MP40/Thompson default : 1 g_medicMaxAmmo : The maximum maximum number of ammo clips a medic can have for MP40/Thompson default : 3 Note that with this modification, a medic will get one extra clip for achieving medic lvl 1 and *another* extra clip for achieving light weapon lvl 1. To restore the default ET behavior, set g_medicMinAmmo to 3 and g_medicMaxAmmo to 4. Note for coders : if you didn't apply g_medicMaxHealth.txt you need to add : src\game\bg_misc.c (line 10) **** BEFORE #include "q_shared.h" **** ADD #ifndef CGAMEDLL #include "g_local.h" #endif g_etbot_interface.cpp has been modified for OB 0.6 ------------------------- MODIFICATION STARTS HERE src\game\bg_misc.c : (line 2930) **** REPLACE qboolean BG_AddMagicAmmo( playerState_t *ps, int *skill, int teamNum, int numOfClips ) { **** WITH qboolean BG_AddMagicAmmo( playerState_t *ps, int *skill, int teamNum, int numOfClips, int player_class ) { (line 3168) **** REPLACE qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps, int *skill, int teamNum ) { **** WITH qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps, int *skill, int teamNum, int player_class ) { (line 3184) **** REPLACE return BG_AddMagicAmmo( (playerState_t *)ps, skill, teamNum, 0); // Arnout: had to cast const away **** WITH return BG_AddMagicAmmo( (playerState_t *)ps, skill, teamNum, 0, player_class ); // Arnout: had to cast const away (line 3013) **** REPLACE maxammo = BG_MaxAmmoForWeapon( weapon, skill ); **** WITH maxammo = BG_MaxAmmoForWeapon( weapon, skill, player_class ); (line 4555) **** REPLACE int BG_MaxAmmoForWeapon( weapon_t weaponNum, int *skill ) { switch( weaponNum ) { **** WITH int BG_MaxAmmoForWeapon( weapon_t weaponNum, int *skill, int player_class ) { int currentmax = GetAmmoTableData(weaponNum)->maxammo; int weaponclip = GetAmmoTableData(weaponNum)->maxclip; switch( weaponNum ) { (a bit after) **** REPLACE case WP_MP40: case WP_THOMPSON: if( skill[SK_FIRST_AID] >= 1 || skill[SK_LIGHT_WEAPONS] >= 1 ) return( GetAmmoTableData(weaponNum)->maxammo + GetAmmoTableData(weaponNum)->maxclip ); else return( GetAmmoTableData(weaponNum)->maxammo ); break; **** WITH case WP_MP40: case WP_THOMPSON: if( player_class==PC_MEDIC ){ currentmax = weaponclip*g_medicMinAmmo.integer; if( skill[SK_FIRST_AID] >= 1 ){ currentmax+= weaponclip; } } if( skill[SK_LIGHT_WEAPONS] >= 1 ) currentmax += weaponclip; if( player_class==PC_MEDIC && currentmax>weaponclip*g_medicMaxAmmo.integer) currentmax = weaponclip*g_medicMaxAmmo.integer; if( currentmax < 0 ) currentmax = 0; return currentmax; break; src\game\bg_public.h (line 2313) **** REPLACE int BG_MaxAmmoForWeapon( weapon_t weaponNum, int *skill ); **** WITH int BG_MaxAmmoForWeapon( weapon_t weaponNum, int *skill, int player_class ); (line 1704) **** REPLACE qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps, int *skill, int teamNum ); **** WITH qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps, int *skill, int teamNum, int player_class ); (line 1797) **** REPLACE qboolean BG_AddMagicAmmo ( playerState_t *ps, int *skill, int teamNum, int numOfClips ); **** WITH qboolean BG_AddMagicAmmo ( playerState_t *ps, int *skill, int teamNum, int numOfClips, int player_class ); src\game\g_etbot_interface.cpp (line 1675) **** REPLACE _max = maxclip + BG_MaxAmmoForWeapon((weapon_t)_ammotype, bot->client->sess.skill); **** WITH _max = maxclip + BG_MaxAmmoForWeapon((weapon_t)_ammotype, bot->client->sess.skill, bot->client->sess.playerType); (line 2738) **** REPLACE BG_CanItemBeGrabbed(&pFlagEnt->s, &pEnt->client->ps, pEnt->client->sess.skill, pEnt->client->sess.sessionTeam) ? True : False; **** WITH BG_CanItemBeGrabbed(&pFlagEnt->s, &pEnt->client->ps, pEnt->client->sess.skill, pEnt->client->sess.sessionTeam, pEnt->client->sess.playerType) ? True : False; src\game\g_items.c (line 306) **** REPLACE int maxammo = BG_MaxAmmoForWeapon( ammoweap, ent->client->sess.skill ); **** WITH int maxammo = BG_MaxAmmoForWeapon( ammoweap, ent->client->sess.skill, ent->client->sess.playerType ); (line 380) **** REPLACE return BG_AddMagicAmmo(&receiver->client->ps, receiver->client->sess.skill, receiver->client->sess.sessionTeam, numOfClips); **** WITH return BG_AddMagicAmmo(&receiver->client->ps, receiver->client->sess.skill, receiver->client->sess.sessionTeam, numOfClips, receiver->client->sess.playerType); (line 883) **** REPLACE if ( !BG_CanItemBeGrabbed( &ent->s, &other->client->ps, other->client->sess.skill, other->client->sess.sessionTeam ) ) { **** WITH if ( !BG_CanItemBeGrabbed( &ent->s, &other->client->ps, other->client->sess.skill, other->client->sess.sessionTeam, other->client->sess.playerType ) ) { src\game\g_local.h : (line 2154) **** AFTER extern vmCvar_t g_spawnInvul; **** ADD extern vmCvar_t g_medicMinAmmo; extern vmCvar_t g_medicMaxAmmo; src\game\g_main.c : (line 257) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_medicMinAmmo; vmCvar_t g_medicMaxAmmo; (line 755) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_medicMinAmmo, "g_medicMinAmmo", "1", 0 }, { &g_medicMaxAmmo, "g_medicMaxAmmo", "3", 0 }, ------------------------- PERSONAL NOTES cf g_fops_AmmoRegen client->sess.playerType == PC_MEDIC BG_CanItemBeGrabbed BG_AddMagicAmmo g_items.c BG_MaxAmmoForWeapon int Add_Ammo(gentity_t *ent, int weapon, int count, qboolean fillClip) { if( client->sess.sessionTeam != TEAM_ALLIES && client->sess.sessionTeam != TEAM_AXIS ) { return WP_NONE; } g_cmds.c Add_Ammo(ent, i, 9999, qtrue); bg_misc.c ammoTableMP GetAmmoTableData(weaponNum) bg_public.h #define PC_SOLDIER 0 // shoot stuff #define PC_MEDIC 1 // heal stuff #define PC_ENGINEER 2 // build stuff #define PC_FIELDOPS 3 // bomb stuff #define PC_COVERTOPS 4 // sneak about ;o