• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ HL2MPRules函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中HL2MPRules函数的典型用法代码示例。如果您正苦于以下问题:C++ HL2MPRules函数的具体用法?C++ HL2MPRules怎么用?C++ HL2MPRules使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了HL2MPRules函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetFireRate

		float		GetFireRate(void)		{ 
#ifdef MFS
#ifdef CLIENT_DLL
			CHL2MPRules *pRules = HL2MPRules();
			if (pRules->IsFlash() == true)
#else
			if (HL2MPRules()->IsFlash() == true)
#endif
			{
				CHL2MP_Player *pOwner = ToHL2MPPlayer(GetOwner());
				return KNIFE_REFIRE - KNIFE_REFIRE * (pOwner->speed_modifier / 2000 - pOwner->speed_modifier / 4000); //An insane Refire Rate
			}
#endif
#ifdef CLIENT_DLL
#ifdef MFS
			else
#endif
			if (pRules->IsKnifeFight() == true)
#else
#ifdef MFS
			else
#endif
			if (HL2MPRules()->IsKnifeFight() == true)
#endif
				return KNIFE_REFIRE*0.7;
			else
				return KNIFE_REFIRE;
		}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:28,代码来源:weapon_knife.cpp


示例2: SetNextThink

void CGameDomCaptureZone::SoundThink(void)
{
	SetNextThink(gpGlobals->curtime + 0.1f);

	// Si ça appartient à aucune équipe, pas de son (genre points neutres en début de map)
	if(HL2MPRules()->m_iDomZones[m_iZoneID] != TEAM_PINK && HL2MPRules()->m_iDomZones[m_iZoneID] != TEAM_GREEN)
		return;

	// Score toutes les 5 secondes, faut synchroniser le son avec
	// float flDomScoreTimer = (HL2MPRules()->GetForceDomScoreTimer() != -1)?HL2MPRules()->GetForceDomScoreTimer():mp_dom_scoretime.GetFloat();
	if(gpGlobals->curtime < (m_flLastScore + 5))
		return;
	m_flLastScore = gpGlobals->curtime;

	int iScoreLeft = mp_scorelimit_dom.GetInt() - g_Teams[HL2MPRules()->m_iDomZones[m_iZoneID]]->GetScore();
	int pitch = (pow(1.019f,-iScoreLeft+260))+30;
	pitch = clamp(pitch, 30, 163);

	CPASAttenuationFilter filter( this, 0.8 );
	EmitSound_t ep;
	ep.m_nChannel = CHAN_STATIC;
	ep.m_pSoundName = "gameplay/domscore.wav";
	ep.m_flVolume = 1.0f;
	ep.m_SoundLevel = SNDLVL_80dB;
	ep.m_nPitch = pitch;

	EmitSound( filter, entindex(), ep );
}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:28,代码来源:game_entities.cpp


示例3: HL2MPRules

void CGameFortsInfoZone::AddPlayerToInfosList(CBasePlayer *pPlayer)
{
	if(pPlayer == NULL)
		return;

	if(pPlayer->GetTeamNumber() == TEAM_PINK)
	{
		for(int i = 0; i < FORTS_MAX_INFOS; i++)
		{
			if(HL2MPRules()->m_apFortsInfosPink[i] == NULL)
			{
				HL2MPRules()->m_apFortsInfosPink[i] = pPlayer;
				break;
			}
		}
	}
	else
	{
		for(int i = 0; i < FORTS_MAX_INFOS; i++)
		{
			if(HL2MPRules()->m_apFortsInfosGreen[i] == NULL)
			{
				HL2MPRules()->m_apFortsInfosGreen[i] = pPlayer;
				break;
			}
		}
	}
}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:28,代码来源:game_entities.cpp


示例4: WorldSpaceCenter

void CFlechette::DoAOEDamage()
{
	CBaseEntity *ppEnts[256];
	Vector vecCenter = WorldSpaceCenter();
	 
	float flRadius = flechette_radius.GetFloat();
	vecCenter.z -= flRadius * 0.8f;
	int nEntCount = UTIL_EntitiesInSphere( ppEnts, 256, vecCenter, flRadius, 0 );
	int i;
	for ( i = 0; i < nEntCount; i++ )
	{
		if ( ppEnts[i] == NULL )
			continue;
		bool bDoDamage = true;
		if(ppEnts[i]->IsPlayer() || ppEnts[i]->IsNPC())
		{
			CBasePlayer *pOtherPlayer  = ToBasePlayer(ppEnts[i]);
			CBasePlayer *pPlayer  = ToBasePlayer(GetOwnerEntity());
			if(pOtherPlayer != NULL && pPlayer != NULL)
			{
				if((HL2MPRules()->IsTeamplay() && (pPlayer->GetTeamNumber() == pOtherPlayer->GetTeamNumber()))
					|| HL2MPRules()->GetGameType() == GAME_COOP)
				{
					const int oldHealth = pOtherPlayer->GetHealth();
					pOtherPlayer->TakeHealth( HEAL_AMOUNT, DMG_GENERIC );
					bDoDamage = false;
					if(oldHealth <= HEAL_AMOUNT)
						pOtherPlayer->PlayAutovocal(HEALED,0);
					if(oldHealth != pOtherPlayer->GetHealth()) // Si on a vraiment heal
						pOtherPlayer->EmitSound("Tranqu.Heal");
				}
			}
			if(bDoDamage && ppEnts[i] != GetOwnerEntity())
			{
				int iApplyDamage = 0;
				if(ppEnts[i]->IsNPC())
					iApplyDamage = 70;
				else
				{
					if(ppEnts[i]->GetHealth() < m_iDamage + 10)
						iApplyDamage = 100;
					else
						iApplyDamage = ppEnts[i]->GetHealth() - m_iDamage;
				}

				CTakeDamageInfo	dmgInfo( this, GetOwnerEntity(), GetOwnerEntity(), iApplyDamage, DMG_POISON | DMG_NEVERGIB );
				//CalculateMeleeDamageForce( &dmgInfo, vecNormalizedVel, tr.endpos, 0.7f );
				dmgInfo.SetDamagePosition( vecCenter );
				ppEnts[i]->TakeDamage(dmgInfo);
				//ppEnts[i]->DispatchTraceAttack( dmgInfo, vecNormalizedVel, &tr );
			}
		}

		ApplyMultiDamage();

	}
}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:57,代码来源:weapon_tranquilizer.cpp


示例5: Q_snprintf

void CHL2MP_Player::ChangeTeam( int iTeam )
{
    /*	if ( GetNextTeamChangeTime() >= gpGlobals->curtime )
    	{
    		char szReturnString[128];
    		Q_snprintf( szReturnString, sizeof( szReturnString ), "Please wait %d more seconds before trying to switch teams again.\n", (int)(GetNextTeamChangeTime() - gpGlobals->curtime) );

    		ClientPrint( this, HUD_PRINTTALK, szReturnString );
    		return;
    	}*/
#ifndef GE_DLL
    bool bKill = false;

    if ( HL2MPRules()->IsTeamplay() != true && iTeam != TEAM_SPECTATOR )
    {
        //don't let them try to join combine or rebels during deathmatch.
        iTeam = TEAM_UNASSIGNED;
    }

    if ( HL2MPRules()->IsTeamplay() == true )
    {
        if ( iTeam != GetTeamNumber() && GetTeamNumber() != TEAM_UNASSIGNED )
        {
            bKill = true;
        }
    }

    BaseClass::ChangeTeam( iTeam );

    m_flNextTeamChangeTime = gpGlobals->curtime + TEAM_CHANGE_INTERVAL;

    if ( HL2MPRules()->IsTeamplay() == true )
    {
        SetPlayerTeamModel();
    }
    else
    {
        SetPlayerModel();
    }

    if ( iTeam == TEAM_SPECTATOR )
    {
        RemoveAllItems( true );

        State_Transition( STATE_OBSERVER_MODE );
    }

    if ( bKill == true )
    {
        CommitSuicide();
    }
#else
    BaseClass::ChangeTeam( iTeam );
#endif
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:55,代码来源:hl2mp_player.cpp


示例6: HL2MPRules

void CPlayerFortsTimerProxy::OnBind( void *pC_BaseEntity )
{
	if(HL2MPRules()->GetGameType() != GAME_FORTS)
		return;

	float flPhaseLimit = HL2MPRules()->GetLastFortsPhaseTime();
	flPhaseLimit += HL2MPRules()->IsFortsBuildPhase() ? mp_forts_buildtime.GetFloat() * 60 : mp_forts_fighttime.GetFloat() * 60;

	// Produit en croix
	//  ?  | curtime
	// 360 | phaselimit

	SetFloatResult( ceil( gpGlobals->curtime * m_RangeMax.GetFloat() / flPhaseLimit ));
}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:14,代码来源:proxyplayer.cpp


示例7: ToBasePlayer

void CGameDomCaptureZone::CaptureZoneTouch(CBaseEntity *pEntity)
{
	CBasePlayer *pPlayer = ToBasePlayer(pEntity);
	if(!pPlayer)
		return;
	if(pPlayer->m_lifeState != LIFE_ALIVE)
		return;
	if(m_iZoneID == -1)
		return;

	if(HL2MPRules()->m_iDomZones[m_iZoneID] == pPlayer->GetTeamNumber())
		return; // Déjà capturé par cette équipe

	if(gpGlobals->curtime < m_flLastCapture + 2.0f)
		return;
	m_flLastCapture = gpGlobals->curtime;
	HL2MPRules()->ResetDomTimer();
	EmitSound("Gameplay.Domambient");

	// Petite boucle moche pour reset toutes les zones
	CBaseEntity *pEntity2 = gEntList.FirstEnt();
	while( pEntity2 )
	{
		if(FClassnameIs(pEntity2, "game_dom_capturezone"))
		{
			CGameDomCaptureZone *pZone = dynamic_cast<CGameDomCaptureZone*>(pEntity2);
			pZone->ResetScoreTimer();
		}

		pEntity2 = gEntList.NextEnt( pEntity2 );
	}

	HL2MPRules()->m_iDomZones[m_iZoneID] = pPlayer->GetTeamNumber();
	if(pPlayer->GetTeamNumber() == TEAM_PINK)
		m_OnPinkCapture.FireOutput(pPlayer, this);
	else
		m_OnGreenCapture.FireOutput(pPlayer, this);

	DevMsg("Zone %d captured by team %d\n", m_iZoneID, pPlayer->GetTeamNumber());

	IGameEvent *event = gameeventmanager->CreateEvent( "player_death" );
	if( event )
	{
		event->SetInt("userid", 0 );
		event->SetInt("attacker", pPlayer->GetUserID() );
		event->SetString("weapon", "domcapture" );
		gameeventmanager->FireEvent( event );
	}
}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:49,代码来源:game_entities.cpp


示例8: GetOwner

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponTranquilizer::CreateLaserPointer( void )
{
#ifndef CLIENT_DLL
	if ( m_hLaserDot != NULL )
		return;

	CBaseCombatCharacter *pOwner = GetOwner();
	
	if ( pOwner == NULL )
		return;

	if ( pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0 )
		return;

	m_hLaserDot = CLaserDot::Create( GetAbsOrigin(), GetOwner() );
	m_hLaserDot->TurnOff();
	m_hLaserDot->SetRenderMode(kRenderWorldGlow);
	if(HL2MPRules()->IsTeamplay())
	{
		if(pOwner->GetTeamNumber() == TEAM_PINK)
			m_hLaserDot->SetRenderColor(255,100,255,255);
		else
			m_hLaserDot->SetRenderColor(153,255,153,255);
	}
	else
		m_hLaserDot->SetRenderColor(255,0,0,255);

	UpdateLaserPosition();
#endif
}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:33,代码来源:weapon_tranquilizer.cpp


示例9: EmitSound

void CWeaponHL2MPBase::Materialize( void )
{
	if ( IsEffectActive( EF_NODRAW ) )
	{
		// changing from invisible state to visible.
		EmitSound( "AlyxEmp.Charge" );
		
		RemoveEffects( EF_NODRAW );
		DoMuzzleFlash();
	}

	if ( HasSpawnFlags( SF_NORESPAWN ) == false )
	{
		VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, false );
		SetMoveType( MOVETYPE_VPHYSICS );

		HL2MPRules()->AddLevelDesignerPlacedObject( this );
	}

	if ( HasSpawnFlags( SF_NORESPAWN ) == false )
	{
		if ( GetOriginalSpawnOrigin() == vec3_origin )
		{
			m_vOriginalSpawnOrigin = GetAbsOrigin();
			m_vOriginalSpawnAngles = GetAbsAngles();
		}
	}

	SetPickupTouch();

	SetThink (NULL);
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:32,代码来源:weapon_hl2mpbase.cpp


示例10: EmitSound

//====================================================================================
// WEAPON SPAWNING
//====================================================================================
//-----------------------------------------------------------------------------
// Purpose: Make a weapon visible and tangible
//-----------------------------------------------------------------------------// 
void CBaseCombatWeapon::Materialize( void )
{
	if ( IsEffectActive( EF_NODRAW ) )
	{
		// changing from invisible state to visible.
#ifdef HL2MP
		EmitSound( "AlyxEmp.Charge" );
#else
		EmitSound( "BaseCombatWeapon.WeaponMaterialize" );
#endif
		
		RemoveEffects( EF_NODRAW );
		DoMuzzleFlash();
	}
#ifdef HL2MP
	if ( HasSpawnFlags( SF_NORESPAWN ) == false )
	{
		VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, false );
		SetMoveType( MOVETYPE_VPHYSICS );

		HL2MPRules()->AddLevelDesignerPlacedObject( this );
	}
#else
	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_TRIGGER );
#endif

	SetPickupTouch();

	SetThink (NULL);
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:37,代码来源:basecombatweapon.cpp


示例11: Q_strncpy

void CHL2MP_Player::CheckChatText( char *p, int bufsize )
{
	//Look for escape sequences and replace

	char *buf = new char[bufsize];
	int pos = 0;

	// Parse say text for escape sequences
	for ( char *pSrc = p; pSrc != NULL && *pSrc != 0 && pos < bufsize-1; pSrc++ )
	{
		// copy each char across
		buf[pos] = *pSrc;
		pos++;
	}

	buf[pos] = '\0';

	// copy buf back into p
	Q_strncpy( p, buf, bufsize );

	delete[] buf;	

	const char *pReadyCheck = p;

	HL2MPRules()->CheckChatForReadySignal( this, pReadyCheck );
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:26,代码来源:hl2mp_player.cpp


示例12: AddMultiDamage

void C_HL2MP_Player::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
{
	Vector vecOrigin = ptr->endpos - vecDir * 4;

	float flDistance = 0.0f;
	
	if ( info.GetAttacker() )
	{
		flDistance = (ptr->endpos - info.GetAttacker()->GetAbsOrigin()).Length();
	}

	if ( m_takedamage )
	{
		AddMultiDamage( info, this );

		int blood = BloodColor();
		
		CBaseEntity *pAttacker = info.GetAttacker();

		if ( pAttacker )
		{
			if ( HL2MPRules()->IsTeamplay() && pAttacker->InSameTeam( this ) == true )
				return;
		}

		if ( blood != DONT_BLEED )
		{
			SpawnBlood( vecOrigin, vecDir, blood, flDistance );// a little surface blood.
			TraceBleed( flDistance, vecDir, ptr, info.GetDamageType() );
		}
	}
}
开发者ID:uunx,项目名称:quakelife2,代码行数:32,代码来源:c_hl2mp_player.cpp


示例13: SetNextThink

//-----------------------------------------------------------------------------
// Purpose: Items that have just spawned run this think to catch them when 
//			they hit the ground. Once we're sure that the object is grounded, 
//			we change its solid type to trigger and set it in a large box that 
//			helps the player get it.
//-----------------------------------------------------------------------------
void CItem::FallThink ( void )
{
	SetNextThink( gpGlobals->curtime + 0.1f );

	bool shouldMaterialize = false;
	IPhysicsObject *pPhysics = VPhysicsGetObject();
	if ( pPhysics )
	{
		shouldMaterialize = pPhysics->IsAsleep();
	}
	else
	{
		shouldMaterialize = (GetFlags() & FL_ONGROUND) ? true : false;
	}

	if ( shouldMaterialize )
	{
		SetThink ( NULL );

		m_vOriginalSpawnOrigin = GetAbsOrigin();
		m_vOriginalSpawnAngles = GetAbsAngles();

		HL2MPRules()->AddLevelDesignerPlacedObject( this );
	}
}
开发者ID:Denzeriko,项目名称:hl2-mod,代码行数:31,代码来源:item_world.cpp


示例14: UTIL_GetNearestPlayer

bool CNPC_Zombine::AllowedToSprint( void )
{
	if ( IsOnFire() )
		return false;
	
	//If you're sprinting then there's no reason to sprint again.
	if ( IsSprinting() )
		return false;

	int iChance = SPRINT_CHANCE_VALUE;

	//Secobmod FixMe ?? also changed to HL2MPRules
	CHL2_Player *pPlayer = dynamic_cast <CHL2_Player*> ( UTIL_GetNearestPlayer(GetAbsOrigin() ));
	//CHL2MP_Player *pPlayer = dynamic_cast<CHL2MP_Player *>( UTIL_GetNearestPlayer(GetAbsOrigin() );

	if ( pPlayer )
	{
#ifdef MFS
		if ( HL2MPRules()->IsAlyxInDarknessMode() && pPlayer->FlashlightIsOn() == false )
#else
		if (IsAlyxInDarknessMode() && pPlayer->FlashlightIsOn() == false)
#endif
		{
			iChance = SPRINT_CHANCE_VALUE_DARKNESS;
		}

		//Bigger chance of this happening if the player is not looking at the zombie
		if ( pPlayer->FInViewCone( this ) == false )
		{
			iChance *= 2;
		}
	}

	if ( HasGrenade() ) 
	{
		iChance *= 4;
	}

	//Below 25% health they'll always sprint
	if ( ( GetHealth() > GetMaxHealth() * 0.5f ) )
	{
		if ( IsStrategySlotRangeOccupied( SQUAD_SLOT_ZOMBINE_SPRINT1, SQUAD_SLOT_ZOMBINE_SPRINT2 ) == true )
			return false;
		
		if ( random->RandomInt( 0, 100 ) > iChance )
			return false;
		
		if ( m_flSprintRestTime > gpGlobals->curtime )
			return false;
	}

	float flLength = ( GetEnemy()->WorldSpaceCenter() - WorldSpaceCenter() ).Length();

	if ( flLength > MAX_SPRINT_DISTANCE )
		return false;

	return true;
}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:58,代码来源:npc_zombine.cpp


示例15: SetTouch

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pOther - 
//-----------------------------------------------------------------------------
void CItem::ItemTouch( CBaseEntity *pOther )
{
	// Vehicles can touch items + pick them up
	if ( pOther->GetServerVehicle() )
	{
		pOther = pOther->GetServerVehicle()->GetPassenger();
		if ( !pOther )
			return;
	}

	// if it's not a player, ignore
	if ( !pOther->IsPlayer() )
		return;

	// Can I even pick stuff up?
	if ( pOther->IsEFlagSet( EFL_NO_WEAPON_PICKUP ) )
		return;

	CBasePlayer *pPlayer = (CBasePlayer *)pOther;

	// ok, a player is touching this item, but can he have it?
	if ( !g_pGameRules->CanHaveItem( pPlayer, this ) )
	{
		// no? Ignore the touch.
		return;
	}

	// Must be a valid pickup scenario (no blocking)
	if ( ItemCanBeTouchedByPlayer( pPlayer ) == false )
		return;

	if ( MyTouch( pPlayer ) )
	{
		m_OnPlayerTouch.FireOutput(pOther, this);

		SetTouch( NULL );
		SetThink( NULL );

		// player grabbed the item. 
		g_pGameRules->PlayerGotItem( pPlayer, this );
		if ( g_pGameRules->ItemShouldRespawn( this ) == GR_ITEM_RESPAWN_YES )
		{
			Respawn(); 
		}
		else
		{
			UTIL_Remove( this );

#ifdef HL2MP
			HL2MPRules()->RemoveLevelDesignerPlacedObject( this );
#endif
		}
	}
	else if (gEvilImpulse101)
	{
		UTIL_Remove( this );
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:62,代码来源:item_world.cpp


示例16: CreateRagdollEntity

void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info )
{
	//update damage info with our accumulated physics force
	CTakeDamageInfo subinfo = info;
	subinfo.SetDamageForce( m_vecTotalBulletForce );

	//BP empêche de créer un ragdoll si on change de team en mode spectateur
	if(GetTeamNumber() != TEAM_SPECTATOR)
		CreateRagdollEntity();

	BaseClass::Event_Killed( subinfo );

	if ( info.GetDamageType() & DMG_DISSOLVE )
		if ( m_hRagdoll )
			m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );

	CBaseEntity *pAttacker = info.GetAttacker();
	if ( pAttacker )
	{
		int iScoreToAdd = 1;

		if ( pAttacker == this)
		{
			if(HL2MPRules()->GetGameType() == GAME_TDM)
				iScoreToAdd = 0;
			else
				iScoreToAdd = -1;
		}

		if((HL2MPRules()->GetGameType() == GAME_FORTS) || (HL2MPRules()->GetGameType() == GAME_PUSH))
			iScoreToAdd = 0;

		GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd );
	}

	FlashlightTurnOff();

	m_lifeState = LIFE_DEAD;

	RemoveEffects( EF_NODRAW );	// still draw player body
	StopZooming();
	DetonateTripmines();
//BP enregistre le tueur
	SetKiller(info.GetAttacker());
}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:45,代码来源:hl2mp_player.cpp


示例17: PickDefaultSpawnTeam

//-----------------------------------------------------------------------------
// Purpose: Sets HL2 specific defaults.
//-----------------------------------------------------------------------------
void CHL2MP_Player::Spawn(void)
{
#ifdef GE_DLL
    m_bSpawnInterpCounter = !m_bSpawnInterpCounter;
    BaseClass::Spawn();
#else
    m_flNextModelChangeTime = 0.0f;
    m_flNextTeamChangeTime = 0.0f;

    PickDefaultSpawnTeam();

    BaseClass::Spawn();

    if ( !IsObserver() )
    {
        pl.deadflag = false;
        RemoveSolidFlags( FSOLID_NOT_SOLID );

        RemoveEffects( EF_NODRAW );

        GiveDefaultItems();
    }

    RemoveEffects( EF_NOINTERP );

    m_nRenderFX = kRenderNormal;

    m_Local.m_iHideHUD = 0;

    AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round.

    m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE;

    if ( HL2MPRules()->IsIntermission() )
    {
        AddFlag( FL_FROZEN );
    }
    else
    {
        RemoveFlag( FL_FROZEN );
    }

    m_bSpawnInterpCounter = !m_bSpawnInterpCounter;

    m_Local.m_bDucked = false;

    SetPlayerUnderwater(false);

    m_bReady = false;
#endif
    //Tony; do the spawn animevent
    DoAnimationEvent( PLAYERANIMEVENT_SPAWN );

    SetContextThink( &CHL2MP_Player::HL2MPPushawayThink, gpGlobals->curtime + PUSHAWAY_THINK_INTERVAL, HL2MP_PUSHAWAY_THINK_CONTEXT );
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:58,代码来源:hl2mp_player.cpp


示例18: AreInfosSlotsFilled

bool CGameFortsInfoZone::AreInfosSlotsFilled(int team)
{
	if(team != TEAM_PINK && team != TEAM_GREEN)
		return false;

	if(team == TEAM_PINK)
		for(int i = 0; i < FORTS_MAX_INFOS; i++)
		{
			if(HL2MPRules()->m_apFortsInfosPink[i] == NULL)
				return false;
		}
	else
		for(int i = 0; i < FORTS_MAX_INFOS; i++)
		{
			if(HL2MPRules()->m_apFortsInfosGreen[i] == NULL)
				return false;
		}

	return true;

}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:21,代码来源:game_entities.cpp


示例19: PickDefaultSpawnTeam

//-----------------------------------------------------------------------------
// Purpose: Sets HL2 specific defaults.
//-----------------------------------------------------------------------------
void CHL2MP_Player::Spawn(void)
{
    m_flNextModelChangeTime = 0.0f;
    m_flNextTeamChangeTime = 0.0f;

    PickDefaultSpawnTeam();

    BaseClass::Spawn();

    pl.deadflag = false;
    m_lifeState = LIFE_ALIVE;
    RemoveSolidFlags( FSOLID_NOT_SOLID );

    RemoveEffects( EF_NODRAW );

    //BP On donne par défaut les armes correspondantes au mode de jeu
    //GiveDefaultItems();
    GiveAllItems();

    RemoveEffects( EF_NOINTERP );

    m_nRenderFX = kRenderNormal;

    m_Local.m_iHideHUD = 0;

    AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round.

    m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE;

    if ( HL2MPRules()->IsIntermission() )
        AddFlag( FL_FROZEN );
    else
        RemoveFlag( FL_FROZEN );

    m_bSpawnInterpCounter = !m_bSpawnInterpCounter;

    m_Local.m_bDucked = false;

    SetPlayerUnderwater(false);

    m_bReady = false;

    m_hKiller.Set(NULL);

    //Tony; do the spawn animevent
    DoAnimationEvent( PLAYERANIMEVENT_SPAWN );

    SetContextThink( &CHL2MP_Player::HL2MPPushawayThink, gpGlobals->curtime + PUSHAWAY_THINK_INTERVAL, HL2MP_PUSHAWAY_THINK_CONTEXT );

    if ( GetTeamNumber() != TEAM_SPECTATOR )
        StopObserverMode();
}
开发者ID:SCell555,项目名称:bisonours-party,代码行数:55,代码来源:hl2mp_player.cpp


示例20: UTIL_PlayerByIndex

void CHoldout::HoldoutThink( void )
{
#ifdef MFS
	for (int i = 1; i <= gpGlobals->maxClients; i++)
	{
		CBasePlayer *pPlayer = UTIL_PlayerByIndex(i);

		if (!pPlayer)
		{
			SetNextThink(gpGlobals->curtime + 0.1f);
			return;
		}

		if (m_Owner == TEAM_COMBINE)
		{
			if (pPlayer->GetBlueTime() >= 0.1f)
			{
				pPlayer->m_BlueTime = pPlayer->GetBlueTime() - 0.1f;
			}
			else
			{
				HL2MPRules()->GoToIntermission();
			}
		}
		else if (m_Owner == TEAM_REBELS)
		{
			if (pPlayer->GetRedTime() >= 0.1f)
			{
				pPlayer->m_RedTime = pPlayer->GetRedTime() - 0.1f;
			}
			else
			{
				HL2MPRules()->GoToIntermission();
			}
		}
	}
	SetNextThink(gpGlobals->curtime + 0.1f);
#endif
}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:39,代码来源:prop_holdout.cpp



注:本文中的HL2MPRules函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HLEMemory_Get_Pointer函数代码示例发布时间:2022-05-30
下一篇:
C++ HK_OFFSET_OF函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap