int CHudStatusBar :: Draw( float fTime ) { this->ReparseStringIfNeeded(); // Draw the status bar lines for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ ) { int TextHeight, TextWidth; GetConsoleStringSize( m_szStatusBar[i], &TextWidth, &TextHeight ); int Y_START; if ( ScreenHeight() >= 480 ) Y_START = ScreenHeight() - 55; else Y_START = ScreenHeight() - 45; int x = 5; int y = Y_START - ( TextHeight * i ); // draw along bottom of screen // let user set status ID bar centering if ( (i == STATUSBAR_ID_LINE) && CVAR_GET_FLOAT("hud_centerid") ) { x = max( 0, max(2, (ScreenWidth() - TextWidth)) / 2 ); y = (ScreenHeight() / 2) + (TextHeight*CVAR_GET_FLOAT("hud_centerid")); } if ( m_pflNameColors[i] ) DrawSetTextColor( m_pflNameColors[i][0], m_pflNameColors[i][1], m_pflNameColors[i][2] ); DrawConsoleString( x, y, m_szStatusBar[i] ); } return 1; }
/* ================= UI_CreateGame_Begin ================= */ static void UI_CreateGame_Begin( void ) { if( !MAP_IS_VALID( uiCreateGame.mapName[uiCreateGame.mapsList.curItem] )) return; // bad map if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) == 1 ) HOST_ENDGAME( "end of the game" ); CVAR_SET_FLOAT( "deathmatch", 1.0f ); // FIXME CVAR_SET_FLOAT( "maxplayers", atoi( uiCreateGame.maxClients.buffer )); CVAR_SET_STRING( "hostname", uiCreateGame.hostName.buffer ); CVAR_SET_STRING( "defaultmap", uiCreateGame.mapName[uiCreateGame.mapsList.curItem] ); // all done, start server if( uiCreateGame.dedicatedServer.enabled ) { HOST_WRITECONFIG ( CVAR_GET_STRING( "servercfgfile" )); char cmd[128]; sprintf( cmd, "#%s", gMenu.m_gameinfo.gamefolder ); // NOTE: dedicated server will be executed "defaultmap" // from engine after restarting HOST_CHANGEGAME( cmd, "Starting dedicated server...\n" ); } else { HOST_WRITECONFIG ( CVAR_GET_STRING( "lservercfgfile" )); char cmd[128]; sprintf( cmd, "exec %s\nmap %s\n", CVAR_GET_STRING( "lservercfgfile" ), CVAR_GET_STRING( "defaultmap" )); CLIENT_COMMAND( FALSE, cmd ); } }
/* ================= UI_PlayerSetup_GetConfig ================= */ static void UI_PlayerSetup_GetConfig( void ) { int i; strncpy( uiPlayerSetup.name.buffer, CVAR_GET_STRING( "name" ), sizeof( uiPlayerSetup.name.buffer )); // find models UI_PlayerSetup_FindModels(); // select current model for( i = 0; i < uiPlayerSetup.num_models; i++ ) { if( !stricmp( uiPlayerSetup.models[i], CVAR_GET_STRING( "model" ))) { uiPlayerSetup.model.curValue = (float)i; break; } } if( gMenu.m_gameinfo.flags & GFL_NOMODELS ) uiPlayerSetup.model.curValue = 0.0f; // force to default strcpy( uiPlayerSetup.currentModel, uiPlayerSetup.models[(int)uiPlayerSetup.model.curValue] ); uiPlayerSetup.model.maxValue = (float)(uiPlayerSetup.num_models - 1); uiPlayerSetup.topColor.curValue = CVAR_GET_FLOAT( "topcolor" ) / 255; uiPlayerSetup.bottomColor.curValue = CVAR_GET_FLOAT( "bottomcolor" ) / 255; if( CVAR_GET_FLOAT( "cl_himodels" )) uiPlayerSetup.hiModels.enabled = 1; if( CVAR_GET_FLOAT( "ui_showmodels" )) uiPlayerSetup.showModels.enabled = 1; }
static void UI_PromptDialog( void ) { if( !CVAR_GET_FLOAT( "host_serverstate" ) || CVAR_GET_FLOAT( "sv_background" )) { UI_CreateGame_Begin(); return; } // toggle main menu between active\inactive // show\hide quit dialog uiCreateGame.advOptions.generic.flags ^= QMF_INACTIVE; uiCreateGame.done.generic.flags ^= QMF_INACTIVE; uiCreateGame.cancel.generic.flags ^= QMF_INACTIVE; uiCreateGame.maxClients.generic.flags ^= QMF_INACTIVE; uiCreateGame.hostName.generic.flags ^= QMF_INACTIVE; uiCreateGame.password.generic.flags ^= QMF_INACTIVE; uiCreateGame.dedicatedServer.generic.flags ^= QMF_INACTIVE; uiCreateGame.hltv.generic.flags ^= QMF_INACTIVE; uiCreateGame.mapsList.generic.flags ^= QMF_INACTIVE; uiCreateGame.msgBox.generic.flags ^= QMF_HIDDEN; uiCreateGame.dlgMessage1.generic.flags ^= QMF_HIDDEN; uiCreateGame.dlgMessage2.generic.flags ^= QMF_HIDDEN; uiCreateGame.no.generic.flags ^= QMF_HIDDEN; uiCreateGame.yes.generic.flags ^= QMF_HIDDEN; }
int CHud::MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf) { BEGIN_READ( pbuf, iSize ); int newfov = READ_BYTE(); int def_fov = CVAR_GET_FLOAT( "default_fov" ); if ( newfov == 0 ) { m_iFOV = def_fov; } else { m_iFOV = newfov; } // the clients fov is actually set in the client data update section of the hud // Set a new sensitivity if ( m_iFOV == def_fov ) { // reset to saved sensitivity m_flMouseSensitivity = 0; } else { // set a new sensitivity that is proportional to the change from the FOV default m_flMouseSensitivity = sensitivity->value * ((float)newfov / (float)def_fov) * CVAR_GET_FLOAT("zoom_sensitivity_ratio"); } return 1; }
/* ================= UI_GamePad_GetConfig ================= */ static void UI_GamePad_GetConfig( void ) { float side, forward, pitch, yaw; char binding[7] = { 0 }; static char lt_threshold_text[8], rt_threshold_text[8]; strncpy( binding, CVAR_GET_STRING( "joy_axis_binding"), sizeof( binding )); side = CVAR_GET_FLOAT( "joy_side" ); forward = CVAR_GET_FLOAT( "joy_forward" ); pitch = CVAR_GET_FLOAT( "joy_pitch" ); yaw = CVAR_GET_FLOAT( "joy_yaw" ); uiGamePad.side.curValue = fabs( side ); uiGamePad.forward.curValue = fabs( forward ); uiGamePad.pitch.curValue = fabs( pitch ); uiGamePad.yaw.curValue = fabs( yaw ); uiGamePad.invSide.enabled = side < 0.0f ? true: false; uiGamePad.invFwd.enabled = forward < 0.0f ? true: false; uiGamePad.invPitch.enabled = pitch < 0.0f ? true: false; uiGamePad.invYaw.enabled = yaw < 0.0f ? true: false; // I made a monster... for( int i = 0; i < sizeof( binding ) - 1; i++ ) { switch( binding[i] ) { case 's': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_SIDE]; uiGamePad.axisBind[i].curValue = JOY_AXIS_SIDE; break; case 'f': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_FWD]; uiGamePad.axisBind[i].curValue = JOY_AXIS_FWD; break; case 'p': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_PITCH]; uiGamePad.axisBind[i].curValue = JOY_AXIS_PITCH; break; case 'y': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_YAW]; uiGamePad.axisBind[i].curValue = JOY_AXIS_YAW; break; case 'r': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_RT]; uiGamePad.axisBind[i].curValue = JOY_AXIS_RT; break; case 'l': uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_LT]; uiGamePad.axisBind[i].curValue = JOY_AXIS_LT; break; default: uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_NULL]; uiGamePad.axisBind[i].curValue = JOY_AXIS_NULL; } } }
void CBlackHole::RadiusDamage( ) { CBaseEntity *pEntity = NULL; TraceResult tr; float flAdjustedDamage; Vector vecSpot; entvars_t *pevOwner = VARS( pev->owner ); Vector vecSrc = pev->origin + Vector(0,0,1); if ( !pevOwner ) pevOwner = pev; CBaseEntity *pPlayer = CBaseEntity::Instance (pevOwner); // iterate on all entities in the vicinity. while ((pEntity = UTIL_FindEntityInSphere( pEntity, vecSrc, (dmg_chrono_radius.value * (mp_wpn_power.value/100)) )) != NULL) { if ( pEntity->pev->movetype != MOVETYPE_PUSH && pEntity->pev->movetype != MOVETYPE_NONE && pEntity->pev->movetype != MOVETYPE_FOLLOW && pEntity->pev->movetype != MOVETYPE_NOCLIP ) { if (pEntity == this) continue; if (CVAR_GET_FLOAT("mp_noselfdamage")==1 && pEntity->pev == pevOwner ) continue; if (CVAR_GET_FLOAT("mp_noteamdamage")==1 && g_pGameRules->PlayerRelationship(pPlayer, pEntity) == GR_TEAMMATE && pEntity->pev != pevOwner) continue; vecSpot = pEntity->BodyTarget( vecSrc ); UTIL_TraceLine ( vecSrc, vecSpot, ignore_monsters, ENT(pev), &tr ); if ( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) { flAdjustedDamage = ( vecSrc - tr.vecEndPos ).Length(); if ( flAdjustedDamage < 1 ) flAdjustedDamage = 1; Vector m_vel = ( vecSrc - tr.vecEndPos ).Normalize() * ((500 * (dmg_chrono_radius.value * (mp_wpn_power.value/100)) / flAdjustedDamage) + 150); if (m_vel.Length() > 1000) m_vel = m_vel.Normalize() * 1000; pEntity->pev->velocity = m_vel; if (flAdjustedDamage < 200) { if (!(pEntity->Classify() == CLASS_MACHINE || pEntity->IsBot() || pEntity->IsPlayer() || FClassnameIs(pEntity->pev, "laser_dot") || FClassnameIs(pEntity->pev, "laser_spot"))) { pEntity->Killed ( pevOwner, 0 ); return; } } } } } }
// // GLOBALS ASSUMED SET: g_ulFrameCount // void StartFrame( void ) { if ( g_pGameRules ) g_pGameRules->Think(); if ( g_fGameOver ) return; gpGlobals->teamplay = CVAR_GET_FLOAT("teamplay"); g_iSkillLevel = CVAR_GET_FLOAT("skill"); g_ulFrameCount++; }
/* ================= UI_VidOptions_GetConfig ================= */ static void UI_VidOptions_GetConfig( void ) { uiVidOptions.screenSize.curValue = (CVAR_GET_FLOAT( "viewsize" ) - 20.0f ) / 100.0f; uiVidOptions.gammaIntensity.curValue = (CVAR_GET_FLOAT( "vid_gamma" ) - 0.5f) / 1.8f; uiVidOptions.glareReduction.curValue = (CVAR_GET_FLOAT( "r_flaresize" ) - 100.0f ) / 200.0f; if( CVAR_GET_FLOAT( "r_fastsky" )) uiVidOptions.fastSky.enabled = 1; uiVidOptions.outlineWidth = 2; UI_ScaleCoords( NULL, NULL, &uiVidOptions.outlineWidth, NULL ); }
/* ================= UI_NewGame_StartGame ================= */ static void UI_NewGame_StartGame( float skill ) { if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) > 1 ) HOST_ENDGAME( "end of the game" ); CVAR_SET_FLOAT( "skill", skill ); CVAR_SET_FLOAT( "deathmatch", 0.0f ); CVAR_SET_FLOAT( "teamplay", 0.0f ); CVAR_SET_FLOAT( "pausable", 1.0f ); // singleplayer is always allowing pause CVAR_SET_FLOAT( "maxplayers", 1.0f ); CVAR_SET_FLOAT( "coop", 0.0f ); CLIENT_COMMAND( FALSE, "newgame\n" ); }
//========================================================= // GibMonster - create some gore and get rid of a monster's // model. //========================================================= void CBaseMonster :: GibMonster( void ) { TraceResult tr; BOOL gibbed = FALSE; int iszCustomGibs; EMIT_SOUND(ENT(pev), CHAN_WEAPON, "common/bodysplat.wav", 1, ATTN_NORM); if ( iszCustomGibs = HasCustomGibs() ) //LRC - monster_generic can have a custom gibset { if ( CVAR_GET_FLOAT("violence_hgibs") != 0 ) { CGib::SpawnHeadGib( pev, STRING(iszCustomGibs) ); CGib::SpawnRandomGibs( pev, 4, 1, STRING(iszCustomGibs) ); } gibbed = TRUE; } // only humans throw skulls !!!UNDONE - eventually monsters will have their own sets of gibs else if ( HasHumanGibs() ) { if ( CVAR_GET_FLOAT("violence_hgibs") != 0 )// Only the player will ever fail this test { CGib::SpawnHeadGib( pev ); CGib::SpawnRandomGibs( pev, 4, 1 ); // throw some human gibs. } gibbed = TRUE; } else if ( HasAlienGibs() ) { if ( CVAR_GET_FLOAT("violence_agibs") != 0 )// Should never fail this test, but someone might call it directly { CGib::SpawnRandomGibs( pev, 4, 0 ); // Throw alien gibs } gibbed = TRUE; } if ( !IsPlayer() ) { if ( gibbed ) { // don't remove players! SetThink(&CBaseMonster :: SUB_Remove ); SetNextThink( 0 ); } else { FadeMonster(); } } }
/* ================= UI_GameOptions_GetConfig ================= */ static void UI_GameOptions_GetConfig( void ) { uiGameInitial.maxFPS = uiGameOptions.maxFPS.curValue = CVAR_GET_FLOAT( "fps_max" ); if( CVAR_GET_FLOAT( "hand" )) uiGameInitial.hand = uiGameOptions.hand.enabled = 1; if( CVAR_GET_FLOAT( "cl_run" )) uiGameInitial.alwaysRun = uiGameOptions.alwaysRun.enabled = 1; if( CVAR_GET_FLOAT( "sv_allow_download" )) uiGameInitial.allowDownload = uiGameOptions.allowDownload.enabled = 1; UI_GameOptions_UpdateConfig (); }
/* ================= UI_Main_NewGame ================= */ static void UI_Main_NewGame( void ) { if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) > 1 ) HOST_ENDGAME( "end of the game" ); CVAR_SET_FLOAT( "skill", 1.0f ); CVAR_SET_FLOAT( "deathmatch", 0.0f ); CVAR_SET_FLOAT( "teamplay", 0.0f ); CVAR_SET_FLOAT( "pausable", 1.0f ); // singleplayer is always allowing pause CVAR_SET_FLOAT( "coop", 0.0f ); BACKGROUND_TRACK( NULL, NULL ); CLIENT_COMMAND( FALSE, "newgame\n" ); }
//========================================================= // CanHaveWeapon - returns FALSE if the player is not allowed // to pick up this weapon //========================================================= BOOL CHalfLifeMultiplay::CanHavePlayerItem( CBasePlayer *pPlayer, CBasePlayerItem *pItem ) { if ( CVAR_GET_FLOAT("mp_weaponstay") > 0 ) { if ( pItem->iFlags() & ITEM_FLAG_LIMITINWORLD ) return CGameRules::CanHavePlayerItem( pPlayer, pItem ); // check if the player already has this weapon for ( int i = 0 ; i < MAX_ITEM_TYPES ; i++ ) { CBasePlayerItem *it = pPlayer->m_rgpPlayerItems[i]; while ( it != NULL ) { if ( it->m_iId == pItem->m_iId ) { return FALSE; } it = it->m_pNext; } } } return CGameRules::CanHavePlayerItem( pPlayer, pItem ); }
void CFuncMonsterClip::Spawn( void ) { CFuncWall::Spawn(); if ( CVAR_GET_FLOAT("showtriggers") == 0 ) pev->effects = EF_NODRAW; pev->flags |= FL_MONSTERCLIP; }
void RenderScreenGlow() { if (IEngineStudio.IsHardware() != 1) return; if (CVAR_GET_FLOAT("r_glow") == 0) //check the cvar for the glow is on. return; if (CVAR_GET_FLOAT("r_glow") == 1){ //check the mode is shader RenderScreenGlowShader(); //AJH don't need r_glowmode, use r_glow 0/1/2 instead } else if (CVAR_GET_FLOAT("r_glow") == 2){ //If its not a shader its the lowend RenderScreenGlowLowEnd(); //AJH don't need r_glowmode, use r_glow 0/1/2 instead } }
void InitScreenGlow() { if (IEngineStudio.IsHardware() != 1) return; if (CVAR_GET_FLOAT("r_glow") == 0) return; if (CVAR_GET_FLOAT("r_glow") == 1){ InitScreenGlowShader(); //AJH don't need r_glowmode, use r_glow 0/1/2 instead } else if (CVAR_GET_FLOAT("r_glow") == 2){ InitScreenGlowLowEnd(); //AJH don't need r_glowmode, use r_glow 0/1/2 instead } }
/* <1effeb> ../cstrike/dlls/career_tasks.cpp:643 */ void CCareerTaskManager::Reset(bool deleteTasks) { if (deleteTasks) { for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it) { delete (*it); } m_tasks.clear(); m_nextId = 0; } else { for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it) { CCareerTask *pTask = (*it); pTask->Reset(); } } m_finishedTaskTime = 0; m_finishedTaskRound = 0; m_shouldLatchRoundEndMessage = false; m_roundStartTime = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime"); }
int CHudMOTD :: MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) { if( m_iFlags & HUD_ACTIVE ) { Reset(); // clear the current MOTD in prep for this one } BEGIN_READ( pszName, pbuf, iSize ); int is_finished = READ_BYTE(); Q_strcat( m_szMOTD, READ_STRING( )); if( is_finished ) { m_iFlags |= HUD_ACTIVE; MOTD_DISPLAY_TIME = CVAR_GET_FLOAT( "motd_display_time" ); m_flActiveTill = gHUD.m_flTime + MOTD_DISPLAY_TIME; // count the number of lines in the MOTD for( char *sz = m_szMOTD; *sz != 0; sz++ ) if( *sz == '\n' ) m_iLines++; } END_READ(); return 1; }
/* ================= UI_Background_Ownerdraw ================= */ static void UI_Background_Ownerdraw( void *self ) { // map has background if( CVAR_GET_FLOAT( "cl_background" )) return; UI_DrawBackground_Callback( self ); if (uiStatic.m_fHaveSteamBackground || uiStatic.m_fDisableLogo) return; // no logos for steam background if( GetLogoLength() <= 0.05f || GetLogoWidth() <= 32 ) return; // don't draw stub logo (GoldSrc rules) float logoWidth, logoHeight, logoPosY; float scaleX, scaleY; scaleX = ScreenWidth / 640.0f; scaleY = ScreenHeight / 480.0f; logoWidth = GetLogoWidth() * scaleX; logoHeight = GetLogoHeight() * scaleY; logoPosY = 70 * scaleY; // 70 it's empirically determined value (magic number) DRAW_LOGO( "logo.avi", 0, logoPosY, logoWidth, logoHeight ); }
void CParticleEmitter :: TurnOn ( void ) { ALERT(at_console, "CParticleEmitter :: TurnOn, Current Time: %f\n", gpGlobals->time); pev->spawnflags |= SF_START_ON; //the first time the particle spawns // increment the count just in case iID = ++iParticleIDCount; // lets give them everything if ( CVAR_GET_FLOAT("r_particles" ) != 0 ) { MESSAGE_BEGIN(MSG_ALL, gmsgParticles);//enviar a todos... qué importa?? WRITE_SHORT(iID); WRITE_BYTE(0); WRITE_COORD(pev->origin.x); WRITE_COORD(pev->origin.y); WRITE_COORD(pev->origin.z); WRITE_COORD(pev->angles.x); WRITE_COORD(pev->angles.y); WRITE_COORD(pev->angles.z); WRITE_SHORT(0); WRITE_STRING(STRING(pev->message)); WRITE_STRING(sParticleDefintionFile); MESSAGE_END(); } }
bool isModuleActive() { if(!(int)CVAR_GET_FLOAT("dodstats_pause")) return true; return false; }
edict_t *CServer::CreateFakeClient(const char *name) { edict_t *pEdict; pEdict = CREATE_FAKE_CLIENT(name); if (!FNullEnt(pEdict)) { char ptr[128]; // allocate space for message from ClientConnect if (pEdict->pvPrivateData != NULL) FREE_PRIVATE(pEdict); // free our predecessor's private data pEdict->pvPrivateData = NULL; // null out the private data pointer pEdict->v.frags = 0; // reset his frag count // set the max speed for this player pEdict->v.maxspeed = CVAR_GET_FLOAT("sv_maxspeed"); // create the player entity by calling MOD's player function // (from LINK_ENTITY_TO_CLASS for player object) if (g_fIsMetamod) { CALL_GAME_ENTITY(PLID, "player", VARS(pEdict)); } else { player(VARS(pEdict)); } MDLL_ClientConnect(pEdict, "bot", "127.0.0.1", ptr); MDLL_ClientPutInServer(pEdict); // let this bot actually spawn into the game return pEdict; } return NULL; }
//=========================================================== int ClassButton::IsNotValid() { // If this is the main ChangeClass button, remove it if the player's only able to be civilians if ( m_iPlayerClass == -1 ) { if (gViewPort->GetValidClasses(g_iTeamNumber) == -1) return true; return false; } // Is it an illegal class? if ((gViewPort->GetValidClasses(0) & sTFValidClassInts[ m_iPlayerClass ]) || (gViewPort->GetValidClasses(g_iTeamNumber) & sTFValidClassInts[ m_iPlayerClass ])) return true; // Only check current class if they've got autokill on bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; if ( bAutoKill ) { // Is it the player's current class? if ( (gViewPort->IsRandomPC() && m_iPlayerClass == PC_RANDOM) || (!gViewPort->IsRandomPC() && (m_iPlayerClass == g_iPlayerClass)) ) return true; } return false; }
/* ================= UI_UpdateMenu ================= */ void UI_UpdateMenu( float flTime ) { if( !uiStatic.initialized ) return; UI_DrawFinalCredits (); if( !uiStatic.visible ) return; if( !uiStatic.menuActive ) return; uiStatic.realTime = flTime * 1000; uiStatic.framecount++; if( CVAR_GET_FLOAT( "sv_background" ) && !g_engfuncs.pfnClientInGame()) return; // don't draw menu while level is loading if( uiStatic.firstDraw ) { // we loading background so skip SCR_Update if( UI_StartBackGroundMap( )) return; if( uiStatic.menuActive->activateFunc ) uiStatic.menuActive->activateFunc(); } // draw menu if( uiStatic.menuActive->drawFunc ) uiStatic.menuActive->drawFunc(); else UI_DrawMenu( uiStatic.menuActive ); if( uiStatic.firstDraw ) { uiStatic.firstDraw = false; static int first = TRUE; if( first ) { BACKGROUND_TRACK( "gamestartup.mp3", "gamestartup.mp3" ); first = FALSE; } } //CR UI_DrawTitleAnim(); // // draw cursor UI_DrawMouseCursor(); // delay playing the enter sound until after the menu has been // drawn, to avoid delay while caching images if( uiStatic.enterSound > 0.0f && uiStatic.enterSound <= gpGlobals->time ) { UI_StartSound( uiSoundIn ); uiStatic.enterSound = -1; } }
void CParticleEmitter :: TurnOff ( void ) { ALERT(at_console, "CParticleEmitter :: TurnOff Call Treated as MakeAware\n"); // increment the count just in case iID = ++iParticleIDCount; // lets give them everything if ( CVAR_GET_FLOAT("r_particles" ) != 0 ) { MESSAGE_BEGIN(MSG_ALL, gmsgParticles);//enviar a todos... qué importa?? WRITE_SHORT(iID); WRITE_BYTE(0); WRITE_COORD(pev->origin.x); WRITE_COORD(pev->origin.y); WRITE_COORD(pev->origin.z); WRITE_COORD(pev->angles.x); WRITE_COORD(pev->angles.y); WRITE_COORD(pev->angles.z); WRITE_SHORT(0); WRITE_STRING(STRING(pev->message)); WRITE_STRING(sParticleDefintionFile); MESSAGE_END(); } ALERT(at_console, "CParticleEmitter :: DontThink();\n"); DontThink(); }
void HistoryResource::AddToHistory(int iType, const char *szName, int iCount) { if(iType != HISTSLOT_ITEM) return; if((((AMMO_PICKUP_GAP * iCurrentHistorySlot) + AMMO_PICKUP_PICK_HEIGHT) > AMMO_PICKUP_HEIGHT_MAX) || (iCurrentHistorySlot >= MAX_HISTORY)) { // the pic would have to be drawn too high // so start from the bottom iCurrentHistorySlot = 0; } HIST_ITEM *freeslot = &rgAmmoHistory[iCurrentHistorySlot++]; // default to just writing to the first slot // I am really unhappy with all the code in this file int i = gHUD.GetSpriteIndex(szName); if(i == -1) return; // unknown sprite name, don't add it to history freeslot->iId = i; freeslot->type = iType; freeslot->iCount = iCount; HISTORY_DRAW_TIME = CVAR_GET_FLOAT("hud_drawhistory_time"); freeslot->DisplayTime = gHUD.m_flTime + HISTORY_DRAW_TIME; }
void CFuncMonsterClip::Spawn( void ) { CFuncWall::Spawn(); if( CVAR_GET_FLOAT( "showtriggers" ) == 0 ) GetEffects() = EF_NODRAW; GetFlags() |= FL_MONSTERCLIP; }
/* <36b22a> ../cstrike/dlls/bot/cs_bot_manager.cpp:111 */ void CCSBotManager::__MAKE_VHOOK(RestartRound)(void) { // extend CBotManager::RestartRound(); SetLooseBomb(NULL); m_isBombPlanted = false; m_bombDefuser = NULL; m_earliestBombPlantTimestamp = gpGlobals->time + RANDOM_FLOAT(10, 30); IMPLEMENT_ARRAY(m_editCmd) = EDIT_NONE; ResetRadioMessageTimestamps(); m_lastSeenEnemyTimestamp = -9999.9f; m_roundStartTimestamp = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime"); // randomly decide if defensive team wants to "rush" as a whole const float defenseRushChance = 33.3f; // 25.0f; m_isDefenseRushing = (RANDOM_FLOAT(0, 100) <= defenseRushChance) ? true : false; TheBotPhrases->OnRoundRestart(); m_isRoundOver = false; m_isRespawnStarted = false; m_canRespawn = true; }
void CCareerTaskManager::Reset( bool deleteTasks ) { std::list< CCareerTask* >::iterator iter = m_tasks.begin(); CCareerTaskManager *pTask = ( CCareerTaskManager* )( *iter ); if( deleteTasks ) { if( pTask != this ) { for( ; pTask != this; iter++ ) { delete ( *iter ); } } else { // ... m_nextId = 0; } } else { for( ; pTask != this; iter++ ) { // ... } } m_finishedTaskTime = 0; m_finishedTaskRound = 0; m_shouldLatchRoundEndMessage = 0; m_roundStartTime = gpGlobals->time + CVAR_GET_FLOAT( "mp_freezetime" ); }