## 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_friendlyPlant : bitflag : 1 - allow to plant dyno/satchel on a friendly objective or constructible 2 - can damage/destroy friendly constructibles (vehicle, barriers...) with nades, arti, dyno, etc as if they were enemy stuff 4 - dyno can destroy a friendly objective 8 - an eng can build opfor objectives default : 11 (ET default would be 0) ------------------------- MODIFICATION STARTS HERE src\game\g_weapon.c : (line 2051) **** REPLACE //bani if( friendlyObj && !enemyObj ) { **** WITH //bani if( friendlyObj && !enemyObj && !(g_friendlyPlant.integer & FRIENDLYPLANT_PLANT) ) { (line 1049) **** REPLACE // see if we are in a trigger_objective_info targetting a func_constructible if( constructible->s.eType == ET_CONSTRUCTIBLE && constructible->s.teamNum == ent->client->sess.sessionTeam ) { **** WITH // see if we are in a trigger_objective_info targetting a func_constructible if( constructible->s.eType == ET_CONSTRUCTIBLE && (constructible->s.teamNum == ent->client->sess.sessionTeam || (g_friendlyPlant.integer & FRIENDLYPLANT_BUILD)) ) { (line 2114) **** REPLACE // rain - spawnflags 128 = disabled (#309) if (!(hit->spawnflags & 128) && (((hit->spawnflags & AXIS_OBJECTIVE) && (ent->client->sess.sessionTeam == TEAM_ALLIES)) || ((hit->spawnflags & ALLIED_OBJECTIVE) && (ent->client->sess.sessionTeam == TEAM_AXIS))) ) { **** WITH // rain - spawnflags 128 = disabled (#309) if (!(hit->spawnflags & 128) && (((hit->spawnflags & AXIS_OBJECTIVE) && (ent->client->sess.sessionTeam == TEAM_ALLIES)) || ((hit->spawnflags & ALLIED_OBJECTIVE) && (ent->client->sess.sessionTeam == TEAM_AXIS)) || (g_friendlyPlant.integer & FRIENDLYPLANT_BLOW)) ) { (line 2187) **** REPLACE if( hit->s.teamNum == traceEnt->s.teamNum ) { //bani - er, didnt we just pass this check earlier? // G_FreeEntity( traceEnt ); // trap_SendServerCommand( ent-g_entities, "cp \"You cannot arm dynamite near a friendly construction!\" 1"); // return; continue; } **** WITH if( hit->s.teamNum == traceEnt->s.teamNum && !(g_friendlyPlant.integer & FRIENDLYPLANT_HURT) ) { //bani - er, didnt we just pass this check earlier? // G_FreeEntity( traceEnt ); // trap_SendServerCommand( ent-g_entities, "cp \"You cannot arm dynamite near a friendly construction!\" 1"); // return; continue; } (line 2218) **** REPLACE if( (!(hit->parent->spawnflags & OBJECTIVE_DESTROYED)) && hit->s.teamNum && (hit->s.teamNum == ent->client->sess.sessionTeam) ) { // ==, as it's inverse AddScore(traceEnt->parent, WOLF_DYNAMITE_PLANT); // give drop score to guy who dropped it **** WITH if( (!(hit->parent->spawnflags & OBJECTIVE_DESTROYED)) && hit->s.teamNum && (hit->s.teamNum == ent->client->sess.sessionTeam || (g_friendlyPlant.integer & FRIENDLYPLANT_BLOW)) ) { // ==, as it's inverse AddScore(traceEnt->parent, WOLF_DYNAMITE_PLANT); // give drop score to guy who dropped it src\game\g_missile.c : (line 429) **** REPLACE if ( ((hit->spawnflags & AXIS_OBJECTIVE) && (ent->s.teamNum == TEAM_ALLIES)) || ((hit->spawnflags & ALLIED_OBJECTIVE) && (ent->s.teamNum == TEAM_AXIS)) ) { if( ent->parent->client && G_GetWeaponClassForMOD( MOD_DYNAMITE ) >= hit->target_ent->constructibleStats.weaponclass ) { G_AddKillSkillPointsForDestruction( ent->parent, MOD_DYNAMITE, &hit->target_ent->constructibleStats ); } G_UseTargets( hit, ent ); hit->think = G_FreeEntity; hit->nextthink = level.time + FRAMETIME; } **** WITH if ( ((hit->spawnflags & AXIS_OBJECTIVE) && (ent->s.teamNum == TEAM_ALLIES)) || ((hit->spawnflags & ALLIED_OBJECTIVE) && (ent->s.teamNum == TEAM_AXIS)) || (g_friendlyPlant.integer & FRIENDLYPLANT_BLOW) ) { if( ent->parent->client && G_GetWeaponClassForMOD( MOD_DYNAMITE ) >= hit->target_ent->constructibleStats.weaponclass ) { G_AddKillSkillPointsForDestruction( ent->parent, MOD_DYNAMITE, &hit->target_ent->constructibleStats ); } G_UseTargets( hit, ent ); hit->think = G_FreeEntity; hit->nextthink = level.time + FRAMETIME; } src\game\g_combat.c : (line 1659, 1667 & 1699) **** REPACE if( G_GetTeamFromEntity( inflictor ) == G_GetTeamFromEntity( targ ) ) { **** WITH if( (G_GetTeamFromEntity( inflictor ) == G_GetTeamFromEntity( targ )) && !(g_friendlyPlant.integer & FRIENDLYPLANT_HURT) ) { src\game\g_local.h : (line 2154) **** AFTER extern vmCvar_t g_spawnInvul; **** ADD extern vmCvar_t g_friendlyPlant; src\game\g_main.c : (line 257) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_friendlyPlant; (line 755) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_friendlyPlant, "g_friendlyPlant", "11", 0 }, src\game\bg_public.h : (line 915) **** AFTER #define MEDIC_NOSELFADREN 256 **** ADD // g_friendlyPlant // can plant on friendly obj #define FRIENDLYPLANT_PLANT 1 // can damage friendly constructibles (vehicle, barriers...) with nades, arti, dyno, etc #define FRIENDLYPLANT_HURT 2 // can blow friendly primary obj #define FRIENDLYPLANT_BLOW 4 // can build opfor obj #define FRIENDLYPLANT_BUILD 8 ------------------------- PERSONAL NOTES qboolean BG_CanUseWeapon(int classNum, int teamNum, weapon_t weapon) { int GetTargetExplosives( team_t team, qboolean ignoreDynamite ); dans void G_CheckForCursorHints( gentity_t *ent ) { : if( checkEnt->parent && checkEnt->parent->s.eType == ET_OID_TRIGGER ) { if( ( (ent->client->sess.sessionTeam == TEAM_AXIS) && (checkEnt->parent->spawnflags & ALLIED_OBJECTIVE) ) || ( (ent->client->sess.sessionTeam == TEAM_ALLIES) && (checkEnt->parent->spawnflags & AXIS_OBJECTIVE) ) ) { hintDist = CH_BREAKABLE_DIST * 2; hintType = HINT_BREAKABLE_DYNAMITE; hintVal = ps->serverCursorHintVal = 0; // no health for dynamite } } dans g_missile.c : //bani - #238 } else if (ent->s.weapon == WP_DYNAMITE && ( ent->etpro_misc_1 & 1 ) ) { // do some scoring // check if dynamite is in trigger_objective_info field et plus loin if ( ((hit->spawnflags & AXIS_OBJECTIVE) && (ent->s.teamNum == TEAM_ALLIES)) || ((hit->spawnflags & ALLIED_OBJECTIVE) && (ent->s.teamNum == TEAM_AXIS)) ) { if( ent->parent->client && G_GetWeaponClassForMOD( MOD_DYNAMITE ) >= hit->target_ent->constructibleStats.weaponclass ) { G_AddKillSkillPointsForDestruction( ent->parent, MOD_DYNAMITE, &hit->target_ent->constructibleStats ); } dans g_trigger.c : // Arnout: spawn a constructible indicator void constructible_indicator_think( gentity_t *ent ) { gentity_t *parent; gentity_t *constructible; parent = &g_entities[ent->r.ownerNum]; constructible = parent->target_ent; if( parent->chain ) { // use the target that has the same team as the indicator if( constructible->s.teamNum != ent->s.teamNum ) { constructible = parent->chain; } } AXIS_CONSTRUCTIBLE AXIS_OBJECTIVE ALLIED_CONSTRUCTIBLE ALLIED_OBJECTIVE TEAM_ALLIES TEAM_AXIS TryConstructing Weapon_Engineer func_constructible_explode G_UseEntity G_AllowTeamsAllowed // JPW NERVE -- in multiplayer, dynamite becomes strategic, so start timer @ 30 seconds OnSameTeam -> bof search dynamite : g_missile.c(393) trigger_objective_info : TEAM_AXIS : g_script_actions.c(3026) g_main.c(1574): affichage de hints si destructible, etc, selon l'équipe g_weapon.c(2096): attribue des points à celui qui a planté