コード例 #1
0
ファイル: ios_camera.cpp プロジェクト: rain2372/IOS-1
void C_Camera::Init()
{
	ListenForGameEvent( "game_newmap" );
	ListenForGameEvent( "hltv_message" );
	
	Reset();
}
コード例 #2
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent( "player_hurt" );
		ListenForGameEvent( "player_death" );
		ListenForGameEvent( "round_start" );
		VarInit();
	}
コード例 #3
0
	virtual void ListenForEvents()
	{
		m_bDD44Only = true;

		ListenForGameEvent( "player_hurt" );
		ListenForGameEvent( "round_start" );
		CGEAchBaseAwardType::ListenForEvents();
	}
コード例 #4
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFWinPanel::Init()
{
	// listen for events
	ListenForGameEvent( "teamplay_win_panel" );
	ListenForGameEvent( "teamplay_round_start" );
	ListenForGameEvent( "teamplay_game_over" );
	ListenForGameEvent( "tf_game_over" );

	m_bShouldBeVisible = false;

	CHudElement::Init();
}
コード例 #5
0
ファイル: sdk_eventlog.cpp プロジェクト: Au-heppa/swarm-sdk
	bool Init()
	{
		BaseClass::Init();

		ListenForGameEvent( "player_death" );
		ListenForGameEvent( "player_hurt" );
#if defined ( SDK_USE_PLAYERCLASSES )
		ListenForGameEvent( "player_changeclass" );
#endif // SDK_USE_PLAYERCLASSES

		return true;
	}
コード例 #6
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFFreezePanel::Init()
{
	// listen for events
	ListenForGameEvent( "show_freezepanel" );
	ListenForGameEvent( "hide_freezepanel" );
	ListenForGameEvent( "freezecam_started" );
	ListenForGameEvent( "player_death" );
	ListenForGameEvent( "teamplay_win_panel" );
	
	Hide();

	CHudElement::Init();
}
コード例 #7
0
ファイル: tf_hltvdirector.cpp プロジェクト: zxz41/TF2Classic
void CTFHLTVDirector::SetHLTVServer( IHLTVServer *hltv )
{
    BaseClass::SetHLTVServer( hltv );

    if ( m_pHLTVServer )
    {
        // mod specific events the director uses to find interesting shots
        ListenForGameEvent( "teamplay_point_captured" );
        ListenForGameEvent( "teamplay_capture_blocked" );
        ListenForGameEvent( "teamplay_point_startcapture" );
        ListenForGameEvent( "teamplay_flag_event" );
        ListenForGameEvent( "ctf_flag_captured" );
    }
}
コード例 #8
0
ファイル: c_asw_jukebox.cpp プロジェクト: Cre3per/hl2sdk-csgo
bool CASWJukeboxPlaylist::Init()
{
	m_pCombatMusic = NULL;
	m_iCurrentTrack = -1;

	// Load the saved playlist
	LoadPlaylistKV();

	ListenForGameEvent( "jukebox_play_random" );
	ListenForGameEvent( "jukebox_stop" );


	return true;
}
コード例 #9
0
void CGenericClassBasedReplay::OnBeginRecording()
{
	BaseClass::OnBeginRecording();

	Assert( gameeventmanager );
	ListenForGameEvent( "player_death" );
}
コード例 #10
0
ファイル: hud_basechat.cpp プロジェクト: Epic-xx/impending
void CBaseHudChat::Init( void )
{
	if ( IsXbox() )
		return;

	ListenForGameEvent( "hltv_chat" );
}
コード例 #11
0
//=========================================================
// Inicializa al Instructor
//=========================================================
bool C_GameInstructor::Init()
{
//	if ( &GetGameInstructor() == this )
	//	return true;
 
	// Instructor desactivado, no inicializar.
	if ( !gameinstructor_enable.GetBool() || sv_gameinstructor_disable.GetBool() )
		return true;
 
	if ( gameinstructor_verbose.GetInt() > 0 )
	{
		ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "[INSTRUCTOR]: " );
		ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Initialization...\n" );
	}
 
	m_bNoDraw					= false;
	m_bHiddenDueToOtherElements = false;
 
	m_iCurrentPriority			= 0;
	m_hLastSpectatedPlayer		= NULL;
	m_bSpectatedPlayerChanged	= false;
 
	m_szPreviousStartSound[0]	= '\0';
	m_fNextStartSoundTime		= 0;
 
	ReadLessonsFromFile( GAMEINSTRUCTOR_MOD_SCRIPT_FILE );
	ReadLessonsFromFile( GAMEINSTRUCTOR_SCRIPT_FILE );
 
	InitLessonPrerequisites();
	ReadSaveData();
 
	ListenForGameEvent("gameinstructor_draw");
	ListenForGameEvent("gameinstructor_nodraw");
 
	ListenForGameEvent("round_end");
	ListenForGameEvent("round_start");
	ListenForGameEvent("player_death");
	ListenForGameEvent("player_team");
	ListenForGameEvent("player_disconnect");
	ListenForGameEvent("map_transition");
	ListenForGameEvent("game_newmap");
	ListenForGameEvent("set_instructor_group_enabled");
 
	EvaluateLessonsForGameRules();
	return true;
}
コード例 #12
0
void CHudLessonPanel::Init()
{
	HOOK_HUD_MESSAGE( CHudLessonPanel, HintText );
	HOOK_MESSAGE( LessonLearned );

	// listen for client side events
	ListenForGameEvent( "player_hintmessage" );
}
コード例 #13
0
CPlayerSpawnCache::CPlayerSpawnCache()
{
	// Clear the cache
	Reset();

	// The only event we care about
	ListenForGameEvent( "game_newmap" );
}
コード例 #14
0
ファイル: hltvdirector.cpp プロジェクト: Au-heppa/swarm-sdk
void CHLTVDirector::SetHLTVServer( IHLTVServer *hltv )
{
	RemoveEventsFromHistory(-1); // all

	if ( hltv ) 
	{
		m_pHLTVClient = UTIL_PlayerByIndex( hltv->GetHLTVSlot() + 1 );

		if ( m_pHLTVClient && m_pHLTVClient->IsHLTV() )
		{
			m_pHLTVServer = hltv;
		}
		else
		{
			m_pHLTVServer  = NULL;
			Error( "Couldn't find HLTV client player." );
		}

		// register for events the director needs to know
		ListenForGameEvent( "player_hurt" );
		ListenForGameEvent( "player_death" );
		ListenForGameEvent( "round_end" );
		ListenForGameEvent( "round_start" );
		ListenForGameEvent( "hltv_cameraman" );
		ListenForGameEvent( "hltv_rank_entity" );
		ListenForGameEvent( "hltv_rank_camera" );
	}
	else
	{
		// deactivate HLTV director
		m_pHLTVServer = NULL;
	}
}
コード例 #15
0
void CDODDeathStatsPanel::Init()
{
	Hide();

	ListenForGameEvent( "player_death" );

	m_iMaterialTexture = vgui::surface()->CreateNewTextureID();

	CHudElement::Init();
}
コード例 #16
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFStatPanel::Init()
{
	// listen for events
	HOOK_HUD_MESSAGE( CTFStatPanel, PlayerStatsUpdate );
	ListenForGameEvent( "player_spawn" );
	
	Hide();

	CHudElement::Init();
}
コード例 #17
0
ファイル: mumble.cpp プロジェクト: Au-heppa/source-sdk-2013
bool CMumbleSystem::Init()
{
	m_bHasSetPlayerUniqueId = false;
	m_nTeamSetInUniqueId = 0;
	m_szSteamIDCurrentServer[0] = '\0';
	m_cubSteamIDCurrentServer = 0;

	ListenForGameEvent( "server_spawn" );

	return true;
}
コード例 #18
0
ファイル: EventLog.cpp プロジェクト: BG2-Dev-Team/BG2-Code
bool CEventLog::Init()
{
	ListenForGameEvent( "player_changename" );
	ListenForGameEvent( "player_activate" );
	ListenForGameEvent( "player_death" );
	ListenForGameEvent( "player_team" );
	ListenForGameEvent( "player_disconnect" );
	ListenForGameEvent( "player_connect" );
	ListenForGameEvent("player_hurt"); //BG2 - Added - HairyPotter

	return true;
}
コード例 #19
0
bool CEventLog::Init()
{
	ListenForGameEvent( "player_changename" );
	ListenForGameEvent( "player_activate" );
	ListenForGameEvent( "player_death" );
	ListenForGameEvent( "player_team" );
	ListenForGameEvent( "player_disconnect" );
	ListenForGameEvent( "player_connect" );

	return true;
}
コード例 #20
0
ファイル: mom_player.cpp プロジェクト: Asunaya/game
CMomentumPlayer::CMomentumPlayer() : 
      m_duckUntilOnGround(false), m_flStamina(0), m_flTicksOnGround(0), m_flLastVelocity(0), m_flLastSyncVelocity(0),
      m_nPerfectSyncTicks(0), m_nStrafeTicks(0), m_nAccelTicks(0), m_bPrevTimerRunning(false), m_nPrevButtons(0),
      m_nTicksInAir(0), m_flTweenVelValue(1.0f)
{
    m_flPunishTime = -1;
    m_iLastBlock = -1;
    m_RunData.m_iRunFlags = 0;
    m_iShotsFired = 0;
    m_iDirection = 0;
    m_bResumeZoom = false;
    m_iLastZoom = 0;
    m_bDidPlayerBhop = false;
    m_iSuccessiveBhops = 0;
    m_bHasPracticeMode = false;

    ListenForGameEvent("mapfinished_panel_closed");
}
コード例 #21
0
ファイル: fish.cpp プロジェクト: AluminumKen/hl2sb-src
//-------------------------------------------------------------------------------------------------------------
CFishPool::CFishPool( void )
{
	m_fishCount = 0;
	m_maxRange = 255.0f;
	m_swimDepth = 0.0f;
	m_isDormant = false;

	m_visTimer.Start( 0.5f );

	ListenForGameEvent( "player_shoot" );
	ListenForGameEvent( "player_footstep" );
	ListenForGameEvent( "weapon_fire" );
	ListenForGameEvent( "hegrenade_detonate" );
	ListenForGameEvent( "flashbang_detonate" );
	ListenForGameEvent( "smokegrenade_detonate" );
	ListenForGameEvent( "bomb_exploded" );
}
コード例 #22
0
/*
LINK_ENTITY_TO_CLASS( team_train_watcher_master, CTeamTrainWatcherMaster );
PRECACHE_REGISTER( team_train_watcher_master );

CTeamTrainWatcherMaster::CTeamTrainWatcherMaster()
{
	m_pBlueWatcher = NULL;
	m_pRedWatcher = NULL;

	m_flBlueProgress = 0.0f;
	m_flRedProgress = 0.0f;

	ListenForGameEvent( "teamplay_round_start" );
	ListenForGameEvent( "teamplay_round_win" );
}

CTeamTrainWatcherMaster::~CTeamTrainWatcherMaster()
{
	if ( g_hTeamTrainWatcherMaster.Get() == this )
	{
		g_hTeamTrainWatcherMaster = NULL;
	}
}

void CTeamTrainWatcherMaster::Precache( void )
{
	PrecacheScriptSound( TWM_FIRSTSTAGEOUTCOME01 );
	PrecacheScriptSound( TWM_FIRSTSTAGEOUTCOME02 );
	PrecacheScriptSound( TWM_RACEGENERAL01 );
	PrecacheScriptSound( TWM_RACEGENERAL02 );
	PrecacheScriptSound( TWM_RACEGENERAL03 );
	PrecacheScriptSound( TWM_RACEGENERAL04 );
	PrecacheScriptSound( TWM_RACEGENERAL05 );
	PrecacheScriptSound( TWM_RACEGENERAL08 );
	PrecacheScriptSound( TWM_RACEGENERAL06 );
	PrecacheScriptSound( TWM_RACEGENERAL07 );
	PrecacheScriptSound( TWM_RACEGENERAL09 );
	PrecacheScriptSound( TWM_RACEGENERAL12 );
	PrecacheScriptSound( TWM_RACEGENERAL13 );
	PrecacheScriptSound( TWM_RACEGENERAL14 );
	PrecacheScriptSound( TWM_RACEGENERAL15 );
	PrecacheScriptSound( TWM_RACEGENERAL10 );
	PrecacheScriptSound( TWM_RACEGENERAL11 );
	PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME01 );
	PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME04 );
	PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME02 );
	PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME03 );
	PrecacheScriptSound( TWM_FINALSTAGEOUTCOME01 );
	PrecacheScriptSound( TWM_FINALSTAGEOUTCOME02 );
	PrecacheScriptSound( TWM_FINALSTAGESTART01 );
	PrecacheScriptSound( TWM_FINALSTAGESTART04 );
	PrecacheScriptSound( TWM_FINALSTAGESTART08 );
	PrecacheScriptSound( TWM_FINALSTAGESTART09 );
	PrecacheScriptSound( TWM_FINALSTAGESTART07 );
	PrecacheScriptSound( TWM_FINALSTAGESTART02 );
	PrecacheScriptSound( TWM_FINALSTAGESTART03 );
	PrecacheScriptSound( TWM_FINALSTAGESTART05 );
	PrecacheScriptSound( TWM_FINALSTAGESTART06 );

	BaseClass::Precache();
}

bool CTeamTrainWatcherMaster::FindTrainWatchers( void )
{
	m_pBlueWatcher = NULL;
	m_pRedWatcher = NULL;

	// find the train_watchers for this round
	CTeamTrainWatcher *pTrainWatcher = (CTeamTrainWatcher *)gEntList.FindEntityByClassname( NULL, "team_train_watcher" );
	while ( pTrainWatcher )
	{
		if ( pTrainWatcher->IsDisabled() == false )
		{
			if ( pTrainWatcher->GetTeamNumber() == TF_TEAM_BLUE )
			{
				m_pBlueWatcher = pTrainWatcher;
			}
			else if ( pTrainWatcher->GetTeamNumber() == TF_TEAM_RED )
			{
				m_pRedWatcher = pTrainWatcher;
			}
		}

		pTrainWatcher = (CTeamTrainWatcher *)gEntList.FindEntityByClassname( pTrainWatcher, "team_train_watcher" );
	}

	return ( m_pBlueWatcher && m_pRedWatcher );
}

void CTeamTrainWatcherMaster::TWMThink( void )
{
	if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->State_Get() != GR_STATE_RND_RUNNING )
	{
		// the next time we 'think'
		SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK );
		return;
	}



	// the next time we 'think'
	SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK );
}

void CTeamTrainWatcherMaster::FireGameEvent( IGameEvent *event )
{
	const char *eventname = event->GetName();`

	if ( FStrEq( "teamplay_round_start", eventname ) )
	{
		if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->HasMultipleTrains() )
		{
			if ( FindTrainWatchers() )
			{
				// we found train watchers so start thinking
				SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK );
			}
		}
	}
	else if ( FStrEq( "teamplay_round_win", eventname ) )
	{
		if ( TeamplayRoundBasedRules() )
		{
			int iWinningTeam = event->GetInt( "team" );
			int iLosingTeam = ( iWinningTeam == TF_TEAM_RED ) ? TF_TEAM_BLUE : TF_TEAM_RED;
			bool bFullRound = event->GetBool( "full_round" );

			CTeamRecipientFilter filterWinner( iWinningTeam, true );
			CTeamRecipientFilter filterLoser( iLosingTeam, true );

			if ( bFullRound )
			{
				EmitSound( filterWinner, entindex(), TWM_FINALSTAGEOUTCOME01 );
				EmitSound( filterLoser, entindex(), TWM_FINALSTAGEOUTCOME02 );
			}
			else
			{
				EmitSound( filterWinner, entindex(), TWM_FIRSTSTAGEOUTCOME01 );
				EmitSound( filterLoser, entindex(), TWM_FIRSTSTAGEOUTCOME02 );
			}
		}
	}
}
*/
CTeamTrainWatcher::CTeamTrainWatcher()
{
	m_bDisabled = false;
	m_flRecedeTime = 0;
	m_bWaitingToRecede = false;
	m_bCapBlocked = false;

	m_flNextSpeakForwardConceptTime = 0;
	m_hAreaCap = NULL;

	m_bTrainCanRecede = true;
	m_bAlarmPlayed = false;
	m_pAlarm = NULL;
	m_flAlarmEndTime = -1;

	m_bHandleTrainMovement = false;
	m_flSpeedForwardModifier = 1.0f;
	m_iCurrentHillType = HILL_TYPE_NONE;
	m_flCurrentSpeed = 0.0f;
	m_bReceding = false;

	m_flTrainDistanceFromStart = 0.0f;

	m_nTrainRecedeTime = 0;

#ifdef GLOWS_ENABLE
	m_hGlowEnt.Set( NULL );
#endif // GLOWS_ENABLE

#ifdef TF_DLL
	ChangeTeam( TF_TEAM_BLUE );
#else
	ChangeTeam( TEAM_UNASSIGNED );
#endif
/*
	// create a CTeamTrainWatcherMaster entity
	if ( g_hTeamTrainWatcherMaster.Get() == NULL )
	{
		g_hTeamTrainWatcherMaster = CreateEntityByName( "team_train_watcher_master" );
	}
*/
	ListenForGameEvent( "path_track_passed" );
}
コード例 #23
0
ファイル: hltvcamera.cpp プロジェクト: Au-heppa/swarm-sdk
void C_HLTVCamera::Init()
{
	ListenForGameEvent( "game_newmap" );
	ListenForGameEvent( "hltv_cameraman" );
	ListenForGameEvent( "hltv_fixed" );
	ListenForGameEvent( "hltv_chase" );
	ListenForGameEvent( "hltv_message" );
	ListenForGameEvent( "hltv_title" );
	ListenForGameEvent( "hltv_status" );
	
	Reset();

	m_nNumSpectators = 0;
	m_szTitleText[0] = 0;

	// get a handle to the engine convar
	tv_transmitall = cvar->FindVar( "tv_transmitall" );
}
コード例 #24
0
void ClientModeDODNormal::Init()
{
	BaseClass::Init();

	ListenForGameEvent( "dod_round_start" );
	ListenForGameEvent( "dod_broadcast_audio" );
	ListenForGameEvent( "player_team" );
	ListenForGameEvent( "dod_bomb_planted" );
	ListenForGameEvent( "dod_bomb_defused" );
	ListenForGameEvent( "dod_timer_flash" );

	usermessages->HookMessage( "KillCam", MsgFunc_KillCam );

	m_szLastRadioSound[0] = '\0';
}
コード例 #25
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent( "round_end" );
	}
コード例 #26
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent("player_hurt");
		VarInit();
	}
コード例 #27
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent( "weapon_event" );
		ListenForGameEvent( "player_spawn" );
		VarInit();
	}
コード例 #28
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
C_VoteController::C_VoteController()
{
	ResetData();

	ListenForGameEvent( "vote_cast" );
}
コード例 #29
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent( "flare_ignite_npc" );
	}
コード例 #30
0
	virtual void ListenForEvents()
	{
		ListenForGameEvent( "physgun_pickup" );
	}