From e0576e7091644b98630ef4ad0cdcf93637f84055 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Mar 2020 14:06:51 +0200 Subject: Global ceasefire --- src/cgame/cg_draw.c | 18 ++++++------ src/game/g_active.c | 3 ++ src/game/g_buildable.c | 77 +++++++++++++++++++++++++------------------------- src/game/g_combat.c | 8 ++++-- src/game/g_local.h | 1 + src/game/g_team.c | 5 +--- src/game/g_utils.c | 4 +-- 7 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index e5e1894..379a95d 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -1639,9 +1639,9 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, if( cg.intermissionStarted ) { Com_sprintf( s, MAX_TOKEN_CHARS, - "Stage %d" //PH34R MY MAD-LEET CODING SKILLZ - " " - "Stage %d", + "Stage %d cancer" //PH34R MY MAD-LEET CODING SKILLZ + " " + "Stage %d cancer", cgs.alienStage + 1, cgs.humanStage + 1 ); } else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) @@ -1649,12 +1649,12 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, kills = cgs.alienNextStageThreshold - cgs.alienKills; if( cgs.alienNextStageThreshold < 0 ) - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d", cgs.alienStage + 1 ); + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer", cgs.alienStage + 1 ); else if( kills == 1 ) - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d, %d kill for next stage", + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer, %d death for next stage", cgs.alienStage + 1, kills ); else - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d, %d kills for next stage", + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer, %d deaths for next stage", cgs.alienStage + 1, kills ); } else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) @@ -1662,12 +1662,12 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, kills = cgs.humanNextStageThreshold - cgs.humanKills; if( cgs.humanNextStageThreshold < 0 ) - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d", cgs.humanStage + 1 ); + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer", cgs.humanStage + 1 ); else if( kills == 1 ) - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d, %d kill for next stage", + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer, %d death for next stage", cgs.humanStage + 1, kills ); else - Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d, %d kills for next stage", + Com_sprintf( s, MAX_TOKEN_CHARS, "Stage %d cancer, %d deaths for next stage", cgs.humanStage + 1, kills ); } diff --git a/src/game/g_active.c b/src/game/g_active.c index 1dd27f4..bc4a5b6 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -967,6 +967,9 @@ void ClientTimerActions( gentity_t *ent, int msec ) } } } + + if ( client->man_bad > 0 ) + client->man_bad--; } while( client->time10000 >= 10000 ) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index c685606..f1c2202 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -482,7 +482,7 @@ static void G_CreepSlow( gentity_t *self ) if( enemy->flags & FL_NOTARGET || g_practise.integer ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && + if( enemy->client && enemy->client->man_bad && enemy->client->ps.groundEntityNum != ENTITYNUM_NONE && G_Visible( self, enemy ) ) { @@ -669,7 +669,7 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( qfalse ) // attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { if( self->s.modelindex == BA_A_OVERMIND ) G_AddCreditToClient( attacker->client, OVERMIND_VALUE, qtrue ); @@ -684,7 +684,9 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int attacker->client->pers.netname ) ); G_LogOnlyPrintf("%s ^3DESTROYED^7 by teammate %s^7\n", BG_FindHumanNameForBuildable( self->s.modelindex ), - attacker->client->pers.netname ); + attacker->client->pers.netname ); + + attacker->client->man_bad += 15; } G_LogPrintf( "Decon: %i %i %i: %s^7 destroyed %s by %s\n", attacker->client->ps.clientNum, self->s.modelindex, mod, @@ -725,8 +727,7 @@ void ASpawn_Think( gentity_t *self ) G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE ); return; } - else if( g_antiSpawnBlock.integer && ent->client && - ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + else if( g_antiSpawnBlock.integer && ent->client ) { //spawnblock protection if( self->spawnBlockTime && level.time - self->spawnBlockTime > 10000 ) @@ -777,7 +778,7 @@ void ASpawn_Pain( gentity_t *self, gentity_t *attacker, int damage ) G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); if ( self->s.modelindex == BA_A_OVERMIND && self->health > 0 && - attacker && attacker->client && attacker->client->pers.teamSelection == PTE_ALIENS ) + attacker && attacker->client ) G_TeamCommand( PTE_ALIENS, va( "print \"Overmind ^3DAMAGED^7 by ^1TEAMMATE^7 %s^7\n\"", attacker->client->pers.netname )); } @@ -825,7 +826,7 @@ void AOvermind_Think( gentity_t *self ) if( enemy->flags & FL_NOTARGET || g_practise.integer ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( enemy->client && enemy->client->man_bad ) { self->timestamp = level.time; G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, @@ -1040,7 +1041,7 @@ void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, i VectorCopy( self->s.angles, new->angles ); VectorCopy( self->s.origin2, new->origin2 ); VectorCopy( self->s.angles2, new->angles2 ); - new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ? BF_TEAMKILLED : BF_DESTROYED; + new->fate = ( attacker && attacker->client ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); @@ -1060,7 +1061,7 @@ void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, i if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if ( qtrue ) //( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { G_TeamCommand( PTE_ALIENS, va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", @@ -1068,7 +1069,9 @@ void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, i attacker->client->pers.netname ) ); G_LogOnlyPrintf("%s ^3DESTROYED^7 by teammate %s^7\n", BG_FindHumanNameForBuildable( self->s.modelindex ), - attacker->client->pers.netname ); + attacker->client->pers.netname ); + + attacker->client->man_bad += 15; } G_LogPrintf( "Decon: %i %i %i: %s^7 destroyed %s by %s\n", attacker->client->ps.clientNum, self->s.modelindex, mod, @@ -1132,7 +1135,7 @@ void ABarricade_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) gclient_t *client = other->client; int client_z, min_z; - if( !client || client->pers.teamSelection != PTE_ALIENS ) + if( !client || client->man_bad ) return; // Client must be high enough to pass over. Note that STEPSIZE (18) is @@ -1228,7 +1231,7 @@ void AAcidTube_Think( gentity_t *self ) if( !G_Visible( self, enemy ) ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( enemy->client && enemy->client->man_bad ) { if( level.paused || enemy->client->pers.paused ) continue; @@ -1304,7 +1307,7 @@ void AHive_Think( gentity_t *self ) if( !G_Visible( self, enemy ) ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( enemy->client && enemy->client->man_bad ) { if( level.paused || enemy->client->pers.paused ) continue; @@ -1531,7 +1534,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int VectorCopy( self->s.angles, new->angles ); VectorCopy( self->s.origin2, new->origin2 ); VectorCopy( self->s.angles2, new->angles2 ); - new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ? BF_TEAMKILLED : BF_DESTROYED; + new->fate = ( attacker && attacker->client ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); @@ -1583,7 +1586,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( qfalse ) // attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { G_TeamCommand( PTE_ALIENS, va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", @@ -1591,7 +1594,9 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int attacker->client->pers.netname ) ); G_LogOnlyPrintf("%s ^3DESTROYED^7 by teammate %s^7\n", BG_FindHumanNameForBuildable( self->s.modelindex ), - attacker->client->pers.netname ); + attacker->client->pers.netname ); + + attacker->client->man_bad += 15; } G_LogPrintf( "Decon: %i %i %i: %s^7 destroyed %s by %s\n", attacker->client->ps.clientNum, self->s.modelindex, mod, @@ -1630,7 +1635,7 @@ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) if( !client ) return; - if( client && client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( client && client->man_bad ) return; client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; @@ -1682,7 +1687,7 @@ void ABooster_Think( gentity_t *self ) if( !client ) continue; - if( client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + if( client->man_bad ) continue; if( Distance( client->ps.origin, self->r.currentOrigin ) > REGEN_BOOST_RANGE ) @@ -1772,7 +1777,7 @@ qboolean ATrapper_CheckTarget( gentity_t *self, gentity_t *target, int range ) return qfalse; if( target->flags & FL_NOTARGET || g_practise.integer ) // is the target cheating? return qfalse; - if( target->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) // one of us? + if( target->client->man_bad ) // one of us? return qfalse; if( target->client->sess.sessionTeam == TEAM_SPECTATOR ) // is the target alive? return qfalse; @@ -1964,7 +1969,7 @@ void HReactor_Think( gentity_t *self ) if( enemy->flags & FL_NOTARGET || g_practise.integer ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( enemy->client && enemy->client->man_bad ) { if( level.paused || enemy->client->pers.paused ) continue; @@ -2009,9 +2014,6 @@ void HReactor_Pain( gentity_t *self, gentity_t *attacker, int damage) if (!attacker || !attacker->client) return; - if (attacker->client->pers.teamSelection != PTE_HUMANS) - return; - G_TeamCommand(PTE_HUMANS, va( "print \"Reactor ^3DAMAGED^7 by ^1TEAMMATE^7 %s^7\n\"", attacker->client->pers.netname)); } @@ -2032,7 +2034,7 @@ void HArmoury_Activate( gentity_t *self, gentity_t *other, gentity_t *activator if( self->spawned ) { //only humans can activate this - if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) + if( activator->client->man_bad ) return; //if this is powered then call the armoury menu @@ -2137,7 +2139,7 @@ void HMedistat_Think( gentity_t *self ) { player = &g_entities[ entityList[ i ] ]; - if( player->client && player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( player->client && player->client->man_bad ) { if( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] && player->client->ps.pm_type != PM_DEAD && @@ -2155,7 +2157,7 @@ void HMedistat_Think( gentity_t *self ) { player = &g_entities[ entityList[ i ] ]; - if( player->client && player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( player->client && player->client->man_bad ) { if( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] && player->client->ps.pm_type != PM_DEAD ) @@ -2342,7 +2344,7 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target, qboolean ign if( !traceEnt->client ) return qfalse; - if( traceEnt->client && traceEnt->client->ps.stats[ STAT_PTEAM ] != PTE_ALIENS ) + if( traceEnt->client && !traceEnt->client->man_bad ) return qfalse; return qtrue; @@ -2374,7 +2376,7 @@ void HMGTurret_FindEnemy( gentity_t *self ) { target = &g_entities[ entityList[ i ] ]; - if( target->client && target->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( target->client && target->client->man_bad ) { //if target is not valid keep searching if( !HMGTurret_CheckTarget( self, target, qfalse ) ) @@ -2393,7 +2395,7 @@ void HMGTurret_FindEnemy( gentity_t *self ) { target = &g_entities[ entityList[ i ] ]; - if( target->client && target->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( target->client && target->client->man_bad ) { //if target is not valid keep searching if( !HMGTurret_CheckTarget( self, target, qtrue ) ) @@ -2541,7 +2543,7 @@ void HTeslaGen_Think( gentity_t *self ) if( enemy->flags & FL_NOTARGET || g_practise.integer ) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && + if( enemy->client && enemy->client->man_bad && enemy->health > 0 && !level.paused && !enemy->client->pers.paused && Distance( enemy->s.pos.trBase, self->s.pos.trBase ) <= TESLAGEN_RANGE ) @@ -2656,7 +2658,7 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int VectorCopy( self->s.angles, new->angles ); VectorCopy( self->s.origin2, new->origin2 ); VectorCopy( self->s.angles2, new->angles2 ); - new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) ? BF_TEAMKILLED : BF_DESTROYED; + new->fate = ( attacker && attacker->client ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); @@ -2684,7 +2686,7 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker && attacker->client ) { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + if( qfalse )//( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { if( self->s.modelindex == BA_H_REACTOR ) G_AddCreditToClient( attacker->client, REACTOR_VALUE, qtrue ); @@ -2699,7 +2701,9 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int attacker->client->pers.netname ) ); G_LogOnlyPrintf("%s ^3DESTROYED^7 by teammate %s^7\n", BG_FindHumanNameForBuildable( self->s.modelindex ), - attacker->client->pers.netname ); + attacker->client->pers.netname ); + + attacker->client->man_bad += 15; } G_LogPrintf( "Decon: %i %i %i: %s^7 destroyed %s by %s\n", attacker->client->ps.clientNum, self->s.modelindex, mod, @@ -2743,8 +2747,7 @@ void HSpawn_Think( gentity_t *self ) G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE ); return; } - else if( g_antiSpawnBlock.integer && ent->client && - ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + else if( g_antiSpawnBlock.integer && ent->client ) { //spawnblock protection if( self->spawnBlockTime && level.time - self->spawnBlockTime > 10000 ) @@ -4718,10 +4721,6 @@ void G_BaseSelfDestruct( pTeam_t team ) continue; if( ent->s.eType != ET_BUILDABLE ) continue; - if( team == PTE_HUMANS && ent->biteam != BIT_HUMANS ) - continue; - if( team == PTE_ALIENS && ent->biteam != BIT_ALIENS ) - continue; G_Damage( ent, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE ); } } diff --git a/src/game/g_combat.c b/src/game/g_combat.c index aef76d1..4d5d3d3 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -231,6 +231,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int G_LogOnlyPrintf("%s^7 was killed by ^1TEAMMATE^7 %s^7 (Did %d damage to %d max)\n", self->client->pers.netname, attacker->client->pers.netname, self->client->tkcredits[ attacker->s.number ], self->client->ps.stats[ STAT_MAX_HEALTH ] ); G_TeamKill_Repent( attacker ); + + attacker->client->man_bad += 30; } self->enemy = attacker; @@ -433,7 +435,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int // if players did more than DAMAGE_FRACTION_FOR_KILL increment the stage counters if( !OnSameTeam( self, attacker ) && totalDamage >= ( self->client->ps.stats[ STAT_MAX_HEALTH ] * DAMAGE_FRACTION_FOR_KILL ) ) { - if( self->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { trap_Cvar_Set( "g_alienKills", va( "%d", g_alienKills.integer + 1 ) ); if( g_alienStage.integer < 2 ) @@ -442,7 +444,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int level.humanStatsCounters.feeds++; } } - else if( self->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + else if( self->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { trap_Cvar_Set( "g_humanKills", va( "%d", g_humanKills.integer + 1 ) ); if( g_humanStage.integer < 2 ) @@ -1147,7 +1149,7 @@ dflags these flags are used to control how T_Damage works void G_SelectiveDamage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int team ) { - if( targ->client && ( team != targ->client->ps.stats[ STAT_PTEAM ] ) ) + //if( targ->client && ( team != targ->client->ps.stats[ STAT_PTEAM ] ) ) G_Damage( targ, inflictor, attacker, dir, point, damage, dflags, mod ); } diff --git a/src/game/g_local.h b/src/game/g_local.h index ded4d63..43c2c1a 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -570,6 +570,7 @@ struct gclient_s adminRangeBoosts_t newRange; + int man_bad; }; diff --git a/src/game/g_team.c b/src/game/g_team.c index 1d8d102..e825543 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -55,10 +55,7 @@ qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 ) if( !ent1->client || !ent2->client ) return qfalse; - if( ent1->client->pers.teamSelection == ent2->client->pers.teamSelection ) - return qtrue; - - return qfalse; + return qtrue; } /* diff --git a/src/game/g_utils.c b/src/game/g_utils.c index a74df3f..79eae71 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -162,9 +162,9 @@ void G_TeamCommand( pTeam_t team, char *cmd ) { if( level.clients[ i ].pers.connected == CON_CONNECTED ) { - if( level.clients[ i ].pers.teamSelection == team || + /*if( level.clients[ i ].pers.teamSelection == team || ( level.clients[ i ].pers.teamSelection == PTE_NONE && - G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) ) + G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) )*/ trap_SendServerCommand( i, cmd ); } } -- cgit