// Josh: Won't gib if already in limbo, same as shrub void G_CensorPenalize(gentity_t *ent) { if (!ent->client) { return; } // forty - #127 - Burn a potty mouth if (g_censorPenalty.integer & CNSRPNLTY_BURN) { if ( ent->client->sess.sessionTeam != TEAM_SPECTATOR && !(ent->client->ps.pm_flags & PMF_LIMBO) && ent->health >= 0 && level.match_pause == PAUSE_NONE ) { G_BurnMeGood(ent, ent, NULL); AP(va("chat \"^7%s ^7burnt his fingers.\" -1", ent->client->pers.netname)); } } // forty - #127 - censor xp penalty if (g_censorPenalty.integer & CNSRPNLTY_XP) { if (ent->client->sess.sessionTeam != TEAM_SPECTATOR) { CPx(ent - g_entities, va("chat \"^1Warning^7: Watch you mouth!^* You have Lost %d XP.\"", g_censorXP.integer)); G_LoseSkillPoints(ent, BG_ClassSkillForClass(ent->client->sess.playerType), g_censorXP.integer); } } if (g_censorPenalty.integer & CNSRPNLTY_TMPMUTE) { ent->client->sess.auto_unmute_time = (level.time + 1000 * (g_censorMuteTime.integer)); CPx(ent - g_entities, va("print \"^5You've been auto-muted for %d seconds for language.\n\"", g_censorMuteTime.integer)); AP(va("chat \"%s^7 has been auto-muted for %d seconds for language.\" -1", ent->client->pers.netname, g_censorMuteTime.integer)); } if (g_censorPenalty.integer & CNSRPNLTY_KILL) { Force_Suicide(ent); return; } if (g_censorPenalty.integer & CNSRPNLTY_NOGIB) { // KILL, don't GIB ent->flags &= ~FL_GODMODE; ent->client->ps.stats[STAT_HEALTH] = ent->health = 0; ent->client->ps.persistant[PERS_HWEAPON_USE] = 0; // TTimo - if at MG42 player_die(ent, ent, ent, 135, MOD_UNKNOWN); } }
skillType_t CG_ClassSkillForPosition(clientInfo_t *ci, int pos) { switch (pos) { case 0: return BG_ClassSkillForClass(ci->cls); case 1: return SK_BATTLE_SENSE; case 2: return SK_LIGHT_WEAPONS; } return SK_BATTLE_SENSE; }
void CG_DrawFireTeamOverlay( rectDef_t* rect ) { int x = rect->x; int y = rect->y + 1; // +1, jitter it into place in 1024 :) int boxWidth = 204; int bestWidth = -1; char *locStr[MAX_FIRETEAM_MEMBERS]; vec2_t loc; float h; clientInfo_t* ci = NULL; char buffer[64]; fireteamData_t* f = NULL; int i; vec4_t clr1 = { .16f, .2f, .17f, .8f }; vec4_t clr2 = { 0.f, 0.f, 0.f, .2f }; vec4_t clr3 = { 0.25f, 0.f, 0.f, 153/255.f }; vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f }; vec4_t bgColor = { 0.0f, 0.0f, 0.0f, 0.6f }; // window vec4_t borderColor = { 0.5f, 0.5f, 0.5f, 0.5f }; // window centity_t* cent; bgColor[3] = cg_fireteamAlpha.value; if(cg.hudEditor.showHudEditor) { //draw a fake fireteam box... CG_DrawFakeFireTeamOverlay(rect); return; } else if(!(f = CG_IsOnFireteam( cg.clientNum ))) { return; } h = 12 + 2 + 2; for(i = 0; i < MAX_FIRETEAM_MEMBERS; i++) { int locwidth; vec3_t origin; ci = CG_SortedFireTeamPlayerForPosition( i ); if(!ci) { break; } h += FT_BAR_HEIGHT + FT_BAR_YSPACING; loc[0] = ci->location[0]; loc[1] = ci->location[1]; if(cg_locations.integer > 0) { qboolean locValid = qtrue; cent = &cg_entities[ci->clientNum]; // Dens: use lerpOrigin for now origin[0] = cent->lerpOrigin[0]; origin[1] = cent->lerpOrigin[1]; origin[2] = cent->lerpOrigin[2]; locStr[i] = va( "^3%s", CG_GetLocationMsg(origin)); if (!Q_stricmp( locStr[i], "^3Unknown")){ locStr[i] = va( "^3(%s)", BG_GetLocationString( loc )); locValid = qfalse; } if(cg_locations.integer > 1 && locValid) Q_strcat( locStr[i], 64, va(" ^3(%s)", BG_GetLocationString( loc )) ); } else { locStr[i] = va( "^3(%s)", BG_GetLocationString( loc )); } if( !locStr[i][1] || !*locStr[i] ) locStr[i] = " "; locwidth = CG_Text_Width_Ext( locStr[i], 0.2f, 0, &cgs.media.font3 ); if(locwidth > bestWidth) bestWidth = locwidth; } boxWidth += bestWidth; CG_DrawRect( x, y, boxWidth, h, 1, borderColor); CG_FillRect( x + 1, y + 1, boxWidth - 2, h - 2, bgColor); x += 2; y += 2; CG_FillRect( x, y, boxWidth - 4, 12, clr1 ); Com_sprintf( buffer, 64, "Fireteam: %s", bg_fireteamNames[f->ident] ); //sprintf( buffer, "Fireteam: %s", bg_fireteamNames[f->ident] ); Q_strupr( buffer ); CG_Text_Paint_Ext( x + 3, y + FT_BAR_HEIGHT, .19f, .19f, tclr, buffer, 0, 0, 0, &cgs.media.font1 ); x += 2; //y += 2; for(i = 0; i < MAX_FIRETEAM_MEMBERS; i++) { y += FT_BAR_HEIGHT + FT_BAR_YSPACING; x = rect->x + 2; ci = CG_SortedFireTeamPlayerForPosition( i ); if(!ci) { break;; } if( ci->selected ) { CG_FillRect( x, y + FT_BAR_YSPACING, boxWidth - 4, FT_BAR_HEIGHT, clr3 ); } else { CG_FillRect( x, y + FT_BAR_YSPACING, boxWidth - 4, FT_BAR_HEIGHT, clr2 ); } x += 4; //draw class if(cg_drawClassIcons.integer & CLASSICON_FIRETEAM){ trap_R_SetColor( colorWhite ); CG_DrawPic(x-2, y+2, FT_BAR_HEIGHT, FT_BAR_HEIGHT, cgs.media.skillPics[BG_ClassSkillForClass( ci->cls )]); trap_R_SetColor( NULL ); }else{ CG_Text_Paint_Ext( x, y + FT_BAR_HEIGHT, .2f, .2f, colorWhite, BG_ClassLetterForNumber( ci->cls ), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } x += 10; // quad: draw latched class // pheno: not with an old server, that doesn't send the latched class if( ci->cls != ci->latchClass ) { //draw separator CG_Text_Paint_Ext( x, y + FT_BAR_HEIGHT, .2f, .2f, colorYellow, ">", 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); x += 10; //draw class if(cg_drawClassIcons.integer & CLASSICON_FIRETEAM) { trap_R_SetColor( colorYellow ); CG_DrawPic(x - 2, y + 2, FT_BAR_HEIGHT, FT_BAR_HEIGHT, cgs.media.skillPics[BG_ClassSkillForClass(ci->latchClass)]); trap_R_SetColor(NULL); } else { CG_Text_Paint_Ext( x, y + FT_BAR_HEIGHT, .2f, .2f, colorYellow, BG_ClassLetterForNumber( ci->latchClass ), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } x += 10; } else x += 20; CG_Text_Paint_Ext( x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, ci->team == TEAM_AXIS ? miniRankNames_Axis[ci->rank] : miniRankNames_Allies[ci->rank], 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); x += 22; CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, ci->name, 0, 17, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); x += 90; /* CG_DrawPic(x + 2, y + 2, FT_BAR_HEIGHT - 4, FT_BAR_HEIGHT - 4, cgs.media.movementAutonomyIcons[0]); x += FT_BAR_HEIGHT; CG_DrawPic(x + 2, y + 2, FT_BAR_HEIGHT - 4, FT_BAR_HEIGHT - 4, cgs.media.weaponAutonomyIcons[0]); x += FT_BAR_HEIGHT; x += 4;*/ /* if( isLeader ) { CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, va("%i", i+4), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); }*/ x += 20; if( ci->health > 80 ) { CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, va("%i", ci->health < 0 ? 0 : ci->health ), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } else if( ci->health > 0 ) { CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, colorYellow, va("%i", ci->health < 0 ? 0 : ci->health ), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } else { CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, colorRed, va("0%s", ci->health < 0 ? "" : "*" ), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } x += 30; CG_Text_Paint_Ext( x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, locStr[i], 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.font3 ); } }