您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ASWGameRules函数代码示例

51自学网 2021-06-01 19:38:14
  C++
这篇教程C++ ASWGameRules函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ASWGameRules

//------------------------------------------------------------------------------// Purpose: // Input  : // Output : //------------------------------------------------------------------------------bool CAI_ASW_MeleeBehavior::BehaviorHandleAnimEvent( animevent_t *pEvent ){	int nEvent = pEvent->Event();	if ( nEvent == AE_ALIEN_MELEE_HIT )	{		float flMinDamage = ASWGameRules()->ModifyAlienDamageBySkillLevel( m_flMinDamage );		float flMaxDamage = ASWGameRules()->ModifyAlienDamageBySkillLevel( m_flMaxDamage );		flMinDamage = ( flMinDamage < 1.0f ? 1.0f : flMinDamage );		flMaxDamage = ( flMaxDamage < 1.0f ? 1.0f : flMaxDamage );		HullAttack( m_flMaxRange, RandomFloat( flMinDamage, flMaxDamage ), m_flForce, m_AttackHitSound, m_MissHitSound );		return true;	}/*		case BEHAVIOR_EVENT_MELEE1_SPHERE_ATTACK:			{				float flMinDamage = ASWGameRules()->ModifyAlienDamageBySkillLevel( m_flMinDamage );				float flMaxDamage = ASWGameRules()->ModifyAlienDamageBySkillLevel( m_flMaxDamage );				flMinDamage = ( flMinDamage < 1.0f ? 1.0f : flMinDamage );				flMaxDamage = ( flMaxDamage < 1.0f ? 1.0f : flMaxDamage );				SphereAttack( m_flMaxRange, RandomFloat( flMinDamage, flMaxDamage ), m_flForce, m_AttackHitSound, m_MissHitSound );				return true;			}			break;			*/		return false;}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:38,


示例2: FrameUpdatePostEntityThink

void CASW_Director::FrameUpdatePostEntityThink(){	// only think when we're in-game	if ( !ASWGameRules() || ASWGameRules()->GetGameState() != ASW_GS_INGAME )		return;	UpdateIntensity();	if ( ASWSpawnManager() )	{		ASWSpawnManager()->Update();	}	UpdateMarineRooms();	if ( !asw_spawning_enabled.GetBool() )		return;	UpdateHorde();	UpdateSpawningState();	bool bWanderersEnabled = m_bWanderersEnabled || asw_wanderer_override.GetBool();	if ( bWanderersEnabled )	{		UpdateWanderers();	}}
开发者ID:BenLubar,项目名称:riflemod,代码行数:28,


示例3: ASW_TestRoute_cc

void ASW_TestRoute_cc(const CCommand &args){	if ( args.ArgC() < 3 )	{		Warning( "Usage: ASW_TestRoute [start mission index] [end mission index]/n" );		return;	}	if (!ASWGameRules() || !ASWGameRules()->GetCampaignSave())	{		Msg("Must be playing a campaign game!/n");		return;	}	int iStart = atoi(args[1]);	int iEnd = atoi(args[2]);	CASW_Campaign_Save* pSave = ASWGameRules()->GetCampaignSave();	bool bFound = pSave->BuildCampaignRoute(iStart, iEnd);	if (bFound)	{				Msg("Found route:/n");		pSave->DebugBuiltRoute();	}	else	{		Msg("No route found!/n");	}}
开发者ID:jtanx,项目名称:ch1ckenscoop,代码行数:26,


示例4: asw_mission_complete_f

void asw_mission_complete_f(){	if (!ASWGameRules())		return;		ASWGameRules()->CheatCompleteMission();}
开发者ID:Nightgunner5,项目名称:Jastian-Summer,代码行数:7,


示例5: AllMarinesKnockedOut

bool CASW_Mission_Manager::AllMarinesKnockedOut(){	if (!ASWGameRules() || !ASWGameResource())		return false;	// can't be all dead if we haven't left briefing yet!	if (ASWGameRules()->GetGameState() < ASW_GS_INGAME)		return false;	int iMax = ASWGameResource()->GetMaxMarineResources();	for (int i=0;i<iMax;i++)	{		CASW_Marine_Resource *pMarineResource = ASWGameResource()->GetMarineResource(i);		if (pMarineResource)		{			CASW_Marine *m = pMarineResource->GetMarineEntity();			if (m)			{				if (!m->m_bKnockedOut)				{					return false;				}			}		}	}	return true;}
开发者ID:BenLubar,项目名称:riflemod,代码行数:27,


示例6: Msg

void CASW_Campaign_Save::MoveThink(){	if (m_iMoveDestination != -1)	{		if (m_iMoveDestination == m_iCurrentPosition)		{			Msg("arrived!/n");			// notify game rules that we've arrived, so it can do any mission launching it desires			if (ASWGameRules())				ASWGameRules()->RequestCampaignLaunchMission(m_iCurrentPosition);		}		else		{			// build a route to the dest from current position			bool bRoute = BuildCampaignRoute(m_iMoveDestination, m_iCurrentPosition);			if (!bRoute)			{				Msg("Couldn't build route to dest/n");				SetThink(NULL);			}			else			{				// we've got a route, move ourselves to the next step in the route				campaign_route_node_t* pNode = FindMissionInClosedList(m_iRouteDest);				if (pNode)					pNode = FindMissionInClosedList(pNode->iParentMission);				MoveTo(pNode->iMission);				SetNextThink(gpGlobals->curtime + 1.0f);	// move again in 1 second			}		}	}}
开发者ID:jtanx,项目名称:ch1ckenscoop,代码行数:32,


示例7: ASWSpawnManager

void CASW_Director::OnMissionStarted(){	// if we have wanders turned on, spawn a couple of encounters	if ( asw_wanderer_override.GetBool() && ASWGameRules() )	{		ASWSpawnManager()->SpawnRandomShieldbug();		int nParasites = 1;		switch( ASWGameRules()->GetSkillLevel() )		{			case 1: nParasites = RandomInt( 4, 6 ); break;			default:			case 2: nParasites = RandomInt( 4, 6 ); break;			case 3: nParasites = RandomInt( 5, 7 ); break;			case 4: nParasites = RandomInt( 5, 9 ); break;			case 5: nParasites = RandomInt( 5, 10 ); break;		}		while ( nParasites > 0 )		{			int nParasitesInThisPack = RandomInt( 3, 6 );			if ( ASWSpawnManager()->SpawnRandomParasitePack( nParasitesInThisPack ) )			{				nParasites -= nParasitesInThisPack;			}			else			{				break;			}		}	}}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:31,


示例8: ASWGameRules

// NOTE: This function breaks IBriefing abstractionbool CNB_Skill_Panel::CanSpendPoint(){	if ( !ASWGameRules() || m_nProfileIndex == -1 )		return false;	return ASWGameRules()->CanSpendPoint( C_ASW_Player::GetLocalASWPlayer(), m_nProfileIndex, m_nSkillSlot );}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:8,


示例9: SetHullType

void CASW_Parasite::Spawn( void ){		SetHullType(HULL_TINY);	BaseClass::Spawn();	SetModel( SWARM_PARASITE_MODEL);	if (FClassnameIs(this, "asw_parasite_defanged"))	{		m_bDefanged = true;		m_iHealth	= ASWGameRules()->ModifyAlienHealthBySkillLevel(10);		SetBodygroup( 0, 1 );		m_fSuicideTime = gpGlobals->curtime + 60;	}	else	{		m_bDefanged = false;		m_iHealth	= ASWGameRules()->ModifyAlienHealthBySkillLevel(25);		SetBodygroup( 0, 0 );		m_fSuicideTime = 0;	}	SetMoveType( MOVETYPE_STEP );	SetHullType(HULL_TINY);	SetCollisionGroup( ASW_COLLISION_GROUP_PARASITE );	SetViewOffset( Vector(6, 0, 11) ) ;		// Position of the eyes relative to NPC's origin.	m_NPCState	= NPC_STATE_NONE;	CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 );	m_bInfesting = false;	}
开发者ID:detoxhby,项目名称:SwarmDirector2,代码行数:35,


示例10: ShouldDraw

//-----------------------------------------------------------------------------// Purpose: Hide all the ASW hud in certain cases//-----------------------------------------------------------------------------bool CASW_HudElement::ShouldDraw( void ){	if (!CHudElement::ShouldDraw())		return false;	if (engine->IsLevelMainMenuBackground())		return false;	if (ASWGameRules())	{		if (ASWGameRules()->IsIntroMap() || ASWGameRules()->IsOutroMap())			return false;	}	C_ASW_Player *pASWPlayer = C_ASW_Player::GetLocalASWPlayer();	C_ASW_Marine *pMarine = pASWPlayer ? pASWPlayer->GetViewMarine() : NULL;	// hide things due to turret control	if ( ( m_iHiddenBits & HIDEHUD_REMOTE_TURRET ) && pMarine && pMarine->IsControllingTurret() )		return false;	if ( ( m_iHiddenBits & HIDEHUD_PLAYERDEAD ) && ( !pMarine || pMarine->GetHealth() <= 0 ) )		return false;	if ( !asw_draw_hud.GetBool() )		return false;	return true;}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:30,


示例11: GetCommander

void CASW_Weapon_Hornet_Barrage::FireRocket(){	CASW_Player *pPlayer = GetCommander();	CASW_Marine *pMarine = GetMarine();	if ( !pPlayer || !pMarine || pMarine->GetHealth() <= 0 )	{		m_iRocketsToFire = 0;		return;	}	WeaponSound(SINGLE);	// tell the marine to tell its weapon to draw the muzzle flash	pMarine->DoMuzzleFlash();	pMarine->DoAnimationEvent( PLAYERANIMEVENT_FIRE_GUN_PRIMARY );	Vector vecSrc	 = GetRocketFiringPosition();	m_iRocketsToFire = m_iRocketsToFire.Get() - 1;	m_flNextLaunchTime = gpGlobals->curtime + m_flFireInterval.Get();#ifndef CLIENT_DLL	float fGrenadeDamage = MarineSkills()->GetSkillBasedValueByMarine(pMarine, ASW_MARINE_SKILL_GRENADES, ASW_MARINE_SUBSKILL_GRENADE_HORNET_DMG );	CASW_Rocket::Create( fGrenadeDamage, vecSrc, GetRocketAngle(), pMarine, this );	if ( ASWGameRules() )	{		ASWGameRules()->m_fLastFireTime = gpGlobals->curtime;	}	pMarine->OnWeaponFired( this, 1 );#endif}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:35,


示例12: GetAbsAngles

void CASW_Boomer_Blob::Touch( CBaseEntity *pOther ){	if ( !pOther || pOther == GetOwnerEntity() )	{		return;	}	if ( !pOther->IsSolid() || pOther->IsSolidFlagSet( FSOLID_VOLUME_CONTENTS ) )	{		return;	}/*	if ( pOther == GetWorldEntity() )	{		// lay flat		QAngle angMortar = GetAbsAngles();		SetAbsAngles( QAngle( 0, angMortar.x, 0 ) );		SetAbsVelocity( vec3_origin );	}*/	if ( m_bExplodeOnWorldContact )	{		Detonate();	}	// make sure we don't die on things we shouldn't	if ( !ASWGameRules() || !ASWGameRules()->ShouldCollide( GetCollisionGroup(), pOther->GetCollisionGroup() ) )	{		return;	}	if ( pOther->m_takedamage == DAMAGE_NO )	{		if (GetAbsVelocity().Length2D() > 60)		{			EmitSound("Grenade.ImpactHard");		}	}	// can't detonate yet?	if ( gpGlobals->curtime < m_fEarliestTouchDetonationTime )	{		return;	}	// we don't want the mortar grenade to explode on impact of marine's because 	// it's more fun to have them avoid the area it landed in than to take blind damage	/*	if ( pOther->m_takedamage != DAMAGE_NO )	{		if ( pOther->IsNPC() && pOther->Classify() != CLASS_PLAYER_ALLY_VITAL )		{			Detonate();		}	}*/}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:59,


示例13: ASWGameRules

bool CASW_Briefing::UsingFixedSkillPoints(){	if ( !IsCampaignGame() || !ASWGameRules() || !ASWGameRules()->GetCampaignSave() )	{		return false;	}	return ASWGameRules()->GetCampaignSave()->UsingFixedSkillPoints();}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:8,


示例14: Approach

//-----------------------------------------------------------------------------// Purpose://-----------------------------------------------------------------------------void CASWInput::CalculateCameraShift( C_ASW_Player *pPlayer, float flDeltaX, float flDeltaY, float &flShiftX, float &flShiftY ){	// Init.	flShiftX = 0.0f;	flShiftY = 0.0f;	if ( !asw_cam_marine_shift_enable.GetBool() )		return;	if ( m_bCameraFixed || Holdout_Resupply_Frame::HasResupplyFrameOpen() || g_asw_iPlayerListOpen > 0 || ( pPlayer && pPlayer->GetSpectatingMarine() ) )	{		m_fShiftFraction = Approach( 0.0f, m_fShiftFraction, gpGlobals->frametime );	}	else	{		m_fShiftFraction = Approach( 1.0f, m_fShiftFraction, gpGlobals->frametime );	}	if ( ASWGameRules() )	{		m_fShiftFraction = m_fShiftFraction * ( 1.0f - ASWGameRules()->GetMarineDeathCamInterp() );	}	flShiftX = flDeltaX * asw_cam_marine_shift_maxx.GetFloat() * m_fShiftFraction;	float camshifty = (flDeltaY < 0) ? asw_cam_marine_shift_maxy.GetFloat() : asw_cam_marine_shift_maxy_south.GetFloat();	flShiftY = flDeltaY * camshifty * m_fShiftFraction;	return;	// Calculate the shift, spherically, based on the cursor distance from the player.	float flDistance = FastSqrt( flDeltaX * flDeltaX + flDeltaY * flDeltaY );	if ( flDistance > asw_cam_marine_sphere_min.GetFloat() )	{		flDistance -= asw_cam_marine_sphere_min.GetFloat();		float flRatio = 1.0f;		if ( m_flCurrentCameraDist < asw_cam_marine_dist.GetFloat() )		{			flRatio = ( m_flCurrentCameraDist / asw_cam_marine_dist.GetFloat() ) * 0.8f;		}		float flTemp = flDistance / ( asw_cam_marine_sphere_max.GetFloat() * flRatio );		flTemp = clamp( flTemp, 0.0f, 1.0f );		float flAngle = atan2( (float)flDeltaY, (float)flDeltaX );		flShiftX = cos( flAngle ) * flTemp * ( asw_cam_marine_shift_maxx.GetFloat() * flRatio );		if ( flDeltaY < 0 )		{			flShiftY = sin( flAngle ) * flTemp * ( asw_cam_marine_shift_maxy.GetFloat() * flRatio );		}		else		{			flShiftY = sin( flAngle ) * flTemp * ( asw_cam_marine_shift_maxy_south.GetFloat() * flRatio );		}	}}
开发者ID:LlamaSlayers,项目名称:SwarmReloaded,代码行数:60,


示例15: ASWGameResource

void DifficultyStats_t::PrepStatsForSend( CASW_Player *pPlayer ){	if( !steamapicontext )		return;	// Update stats from the briefing screen	if( !GetDebriefStats() || !ASWGameResource() )		return;	CASW_Marine_Resource *pMR = ASWGameResource()->GetFirstMarineResourceForPlayer( pPlayer );	if ( pMR )	{		int iMarineIndex = ASWGameResource()->GetMarineResourceIndex( pMR );		if ( iMarineIndex != -1 )		{			m_iKillsTotal += GetDebriefStats()->GetKills( iMarineIndex );			m_iFFTotal += GetDebriefStats()->GetFriendlyFire( iMarineIndex );			m_iDamageTotal += GetDebriefStats()->GetDamageTaken( iMarineIndex );			m_iShotsFiredTotal += GetDebriefStats()->GetShotsFired( iMarineIndex );			m_iHealingTotal += GetDebriefStats()->GetHealthHealed( iMarineIndex );			m_iShotsHitTotal += GetDebriefStats()->GetShotsHit( iMarineIndex );			m_fAccuracyAvg = ( m_iShotsFiredTotal > 0 ) ? ( m_iShotsHitTotal / (float)m_iShotsFiredTotal * 100.0f ) : 0;			m_iGamesTotal++;			m_iGamesSuccess += ASWGameRules()->GetMissionSuccess() ? 1 : 0;			m_fGamesSuccessPercent = m_iGamesSuccess / (float)m_iGamesTotal * 100.0f;		}	}	char* szDifficulty = NULL;	int iDifficulty = ASWGameRules()->GetSkillLevel();	switch( iDifficulty )	{	case 1: szDifficulty = "easy"; 		break;	case 2: szDifficulty = "normal";		break;	case 3: szDifficulty = "hard";		break;	case 4: szDifficulty = "insane";		break;	case 5: szDifficulty = "imba";		break;	}	if( szDifficulty )	{		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szGamesTotal ), m_iGamesTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szGamesSuccess ), m_iGamesSuccess );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szGamesSuccessPercent ), m_fGamesSuccessPercent );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szKillsTotal ), m_iKillsTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szDamageTotal ), m_iDamageTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szFFTotal ), m_iFFTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szAccuracy ), m_fAccuracyAvg );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szShotsHit ), m_iShotsHitTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szShotsTotal ), m_iShotsFiredTotal );		SEND_STEAM_STATS( CFmtStr( "%s%s", szDifficulty, szHealingTotal ), m_iHealingTotal );	}}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:57,


示例16: GetCommander

void CASW_Weapon_Freeze_Grenades::DelayedAttack( void ){	m_bShotDelayed = false;		CASW_Player *pPlayer = GetCommander();	if ( !pPlayer )		return;	CASW_Marine *pMarine = GetMarine();	if ( !pMarine || pMarine->GetWaterLevel() == 3 )		return;	#ifndef CLIENT_DLL			Vector vecSrc = pMarine->GetOffhandThrowSource();	Vector vecDest = pPlayer->GetCrosshairTracePos();	Vector newVel = UTIL_LaunchVector( vecSrc, vecDest, GetThrowGravity() ) * 28.0f;		float fGrenadeRadius = GetBoomRadius( pMarine );	if (asw_debug_marine_damage.GetBool())	{		Msg( "Freeze grenade radius = %f /n", fGrenadeRadius );	}	pMarine->GetMarineSpeech()->Chatter( CHATTER_GRENADE );	// freeze aliens completely, plus the freeze duration	float flFreezeAmount = 1.0f + MarineSkills()->GetSkillBasedValueByMarine(pMarine, ASW_MARINE_SKILL_GRENADES, ASW_MARINE_SUBSKILL_GRENADE_FREEZE_DURATION);	if (ASWGameRules())		ASWGameRules()->m_fLastFireTime = gpGlobals->curtime;	CASW_Grenade_Freeze *pGrenade = CASW_Grenade_Freeze::Freeze_Grenade_Create( 		1.0f,		flFreezeAmount,		fGrenadeRadius,		0,		vecSrc, pMarine->EyeAngles(), newVel, AngularImpulse(0,0,0), pMarine, this );	if ( pGrenade )	{		pGrenade->SetGravity( GetThrowGravity() );		pGrenade->SetExplodeOnWorldContact( true );	}	#endif		// decrement ammo	m_iClip1 -= 1;#ifndef CLIENT_DLL	DestroyIfEmpty( true );#endif	m_flSoonestPrimaryAttack = gpGlobals->curtime + ASW_FLARES_FASTEST_REFIRE_TIME;	if (m_iClip1 > 0)		// only force the fire wait time if we have ammo for another shot		m_flNextPrimaryAttack = gpGlobals->curtime + GetFireRate();	else		m_flNextPrimaryAttack = gpGlobals->curtime;}
开发者ID:detoxhby,项目名称:SwarmDirector2,代码行数:57,


示例17: ASWGameRules

int CASW_Sentry_Top::GetSentryDamage(){	float flDamage = 10.0f;	if ( ASWGameRules() )	{		ASWGameRules()->ModifyAlienDamageBySkillLevel( flDamage );	}	return flDamage * ( GetSentryBase() ? GetSentryBase()->m_fDamageScale : 1.0f );}
开发者ID:Nightgunner5,项目名称:Jastian-Summer,代码行数:10,


示例18: ASWGameRules

void CASW_Weapon_Stim::PrimaryAttack( void ){	if (!ASWGameRules())		return;	float fStimEndTime = ASWGameRules()->GetStimEndTime();	if ( fStimEndTime <= gpGlobals->curtime + 1.0f )	{		InjectStim();	}}
开发者ID:BenLubar,项目名称:riflemod,代码行数:10,


示例19: SetPaintBackgroundEnabled

void CampaignFrame::ApplySchemeSettings(vgui::IScheme *scheme){	BaseClass::ApplySchemeSettings(scheme);	SetPaintBackgroundEnabled(false);	if (ASWGameRules() && ASWGameRules()->IsIntroMap())	{		SetBgColor(Color(0,0,0,0));	}}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:10,


示例20: HACK_GETLOCALPLAYER_GUARD

//-----------------------------------------------------------------------------// Purpose: Don't allow recentering the mouse//-----------------------------------------------------------------------------void CASWInput::ResetMouse( void ){	HACK_GETLOCALPLAYER_GUARD( "Mouse behavior is tied to a specific player's status - splitscreen player would depend on which player (if any) is using mouse control" );	if ( MarineControllingTurret() || ( !asw_controls.GetBool() && ( !ASWGameRules() || ASWGameRules()->GetMarineDeathCamInterp() <= 0.0f ) && ( !C_ASW_Marine::GetLocalMarine() || !C_ASW_Marine::GetLocalMarine()->IsUsingComputerOrButtonPanel() ) ) )	{		int x, y;		GetWindowCenter( x, y );		SetMousePos( x, y );	}}
开发者ID:detoxhby,项目名称:SwarmDirector2,代码行数:13,


示例21: Approach

void ClientModeSDK::OnColorCorrectionWeightsReset( void ){	C_ColorCorrection *pNewColorCorrection = NULL;	C_ColorCorrection *pOldColorCorrection = m_pCurrentColorCorrection;	C_HL2WarsPlayer *pPlayer = C_HL2WarsPlayer::GetLocalHL2WarsPlayer();	if ( pPlayer )	{		pNewColorCorrection = pPlayer->GetActiveColorCorrection();	}#if 0	if ( m_CCFailedHandle != INVALID_CLIENT_CCHANDLE && ASWGameRules() )	{		m_fFailedCCWeight = Approach( TechMarineFailPanel::s_pTechPanel ? 1.0f : 0.0f, m_fFailedCCWeight, gpGlobals->frametime * ( 1.0f / FAILED_CC_FADE_TIME ) );		g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCFailedHandle, m_fFailedCCWeight );		// If the mission was failed due to a dead tech, disable the environmental color correction in favor of the mission failed color correction		if ( m_fFailedCCWeight != 0.0f && m_pCurrentColorCorrection )		{			m_pCurrentColorCorrection->EnableOnClient( false );			m_pCurrentColorCorrection = NULL;		}	}	if ( m_CCInfestedHandle != INVALID_CLIENT_CCHANDLE && ASWGameRules() )	{		C_ASW_Marine *pMarine = C_ASW_Marine::GetLocalMarine();		m_fInfestedCCWeight = Approach( pMarine && pMarine->IsInfested() ? 1.0f : 0.0f, m_fInfestedCCWeight, gpGlobals->frametime * ( 1.0f / INFESTED_CC_FADE_TIME ) );		g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCInfestedHandle, m_fInfestedCCWeight );		// If the mission was failed due to a dead tech, disable the environmental color correction in favor of the mission failed color correction		if ( m_fInfestedCCWeight != 0.0f && m_pCurrentColorCorrection )		{			m_pCurrentColorCorrection->EnableOnClient( false );			m_pCurrentColorCorrection = NULL;		}	}#endif // 0	// Only blend between environmental color corrections if there is no failure/infested-induced color correction	if ( pNewColorCorrection != pOldColorCorrection /*&& m_fFailedCCWeight == 0.0f && m_fInfestedCCWeight == 0.0f*/ )	{		if ( pOldColorCorrection )		{			pOldColorCorrection->EnableOnClient( false );		}		if ( pNewColorCorrection )		{			pNewColorCorrection->EnableOnClient( true, pOldColorCorrection == NULL );		}		m_pCurrentColorCorrection = pNewColorCorrection;	}}
开发者ID:jimbomcb,项目名称:hl2wars_asw_dev,代码行数:55,


示例22: GetMarine

void CASW_Weapon_Electrified_Armor::PrimaryAttack( void ){	if ( !ASWGameRules() )		return;		CASW_Marine *pMarine = GetMarine();	if ( !pMarine || pMarine->IsElectrifiedArmorActive() )		return;#ifndef CLIENT_DLL	bool bThisActive = (pMarine->GetActiveASWWeapon() == this);#endif	// sets the animation on the marine holding this weapon	//pMarine->SetAnimation( PLAYER_ATTACK1 );#ifndef CLIENT_DLL	float flDuration = asw_electrified_armor_duration.GetFloat();	pMarine->AddElectrifiedArmor( flDuration );	// stun aliens within the radius	ASWGameRules()->ShockNearbyAliens( pMarine, this );	// 	CTakeDamageInfo info( this, GetOwnerEntity(), 5, DMG_SHOCK );// 	info.SetDamageCustom( DAMAGE_FLAG_NO_FALLOFF );// 	RadiusDamage( info, GetAbsOrigin(), flRadius, CLASS_ASW_MARINE, NULL );	DispatchParticleEffect( "electrified_armor_burst", pMarine->GetAbsOrigin(), QAngle( 0, 0, 0 ) );		// count as a shot fired	if ( pMarine->GetMarineResource() )	{		pMarine->GetMarineResource()->UsedWeapon( this , 1 );		pMarine->OnWeaponFired( this, 1 );	}#endif	// decrement ammo	m_iClip1 -= 1;	m_flNextPrimaryAttack = gpGlobals->curtime + 4.0f;	if (!m_iClip1 && pMarine->GetAmmoCount(m_iPrimaryAmmoType) <= 0)	{		// weapon is lost when all stims are gone#ifndef CLIENT_DLL		if (pMarine)		{			pMarine->Weapon_Detach(this);			if (bThisActive)				pMarine->SwitchToNextBestWeapon(NULL);		}		Kill();#endif	}}
开发者ID:jtanx,项目名称:ch1ckenscoop,代码行数:55,


示例23: FrameUpdatePostEntityThink

void CASW_Arena::FrameUpdatePostEntityThink(){	// only think when we're in-game	if ( !ASWGameRules() || ASWGameRules()->GetGameState() != ASW_GS_INGAME )		return;	if ( asw_arena.GetBool() )	{		UpdateArena();	}}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:11,


示例24: SetHealth

void CASW_Parasite::SetHealthByDifficultyLevel(){	if (FClassnameIs(this, "asw_parasite_defanged"))	{				SetHealth(ASWGameRules()->ModifyAlienHealthBySkillLevel(10));	}	else	{		SetHealth(ASWGameRules()->ModifyAlienHealthBySkillLevel(30));	}}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:11,


示例25: MarineSkills

// traditional Swarm hackingvoid CASW_Button_Area::MarineUsing(CASW_Marine* pMarine, float deltatime){	if (m_bIsInUse && m_bIsLocked && ( (asw_simple_hacking.GetBool() || ASWGameRules()->m_iFastHack) || !pMarine->IsInhabited()))	{		float fTime = (deltatime * (1.0f/((float)m_iHackLevel)));		// boost fTime by the marine's hack skill		fTime *= MarineSkills()->GetSkillBasedValueByMarine(pMarine, ASW_MARINE_SKILL_HACKING, ASW_MARINE_SUBSKILL_HACKING_SPEED_SCALE);		fTime *= ASWGameRules()->m_iFastHack == 1 ? 1 : asw_ai_button_hacking_scale.GetFloat();		SetHackProgress(m_fHackProgress + fTime, pMarine);	}}
开发者ID:BenLubar,项目名称:riflemod,代码行数:12,


示例26: clamp

void CASW_Spawn_Manager::SelectSpawnSet(){	int iDifficulty = 1;	if (ASWGameRules())	{		iDifficulty = clamp(ASWGameRules()->GetMissionDifficulty(), 1, 99);	}	if (asw_director_debug.GetBool())	{		Msg("Mission difficulty: %d/n", iDifficulty);	}#define FIND_SPAWN_SET(pConfig, pszConfigName) /	if ((pConfig)) /		{ /		for (KeyValues *pSpawnSet = pConfig; pSpawnSet; pSpawnSet = pSpawnSet->GetNextTrueSubKey()) /		{ /			if (V_stricmp(pSpawnSet->GetName(), "SpawnSet")) /			{ /				Warning("Spawn Manager %s config should only have SpawnSet keys, but it has a %s key./n", pszConfigName, pSpawnSet->GetName()); /				continue; /			} /			/			if ((!V_stricmp(pSpawnSet->GetString("Map"), "*") || !V_stricmp(pSpawnSet->GetString("Map"), STRING(gpGlobals->mapname))) && /				pSpawnSet->GetInt("MinDifficulty", 1) <= iDifficulty && pSpawnSet->GetInt("MaxDifficulty", 99) >= iDifficulty) /			{ /				if (asw_director_debug.GetBool()) /				{ /					Msg("Spawn Manager candidate SpawnSet: %s/n", pSpawnSet->GetString("Name", "[unnamed]")); /				} /				m_pSpawnSet = pSpawnSet; /			} /		} /	}	FIND_SPAWN_SET(m_pGlobalConfig, "global");	FIND_SPAWN_SET(m_pMissionConfig, "mission");#undef FIND_SPAWN_SET	Assert(m_pSpawnSet);	if (!m_pSpawnSet)	{		Warning("Spawn Manager could not find any spawn config!!!/n");	}	else if (asw_director_debug.GetBool())	{		KeyValuesDumpAsDevMsg(m_pSpawnSet);		if (!V_stricmp(m_pSpawnSet->GetString("Map", "*"), "*"))		{			Warning("Spawn Manager using default SpawnSet./n");		}		Msg("Spawn Manager using SpawnSet: %s/n", m_pSpawnSet->GetString("Name", "[unnamed]"));	}}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:53,


示例27: while

void PlayerListPanel::OnThink(){    // make sure we have enough line panels per player and that each line knows the index of the player its displaying    int iNumPlayersInGame = 0;    bool bNeedsLayout = false;    for ( int j = 1; j <= gpGlobals->maxClients; j++ )    {        if ( g_PR->IsConnected( j ) )        {            iNumPlayersInGame++;            while (m_PlayerLine.Count() <= iNumPlayersInGame)            {                // temp comment                m_PlayerLine.AddToTail(new PlayerListLine(this, "PlayerLine"));            }            if ( m_PlayerLine.Count() > ( iNumPlayersInGame - 1 ) && m_PlayerLine[ iNumPlayersInGame - 1 ] )            {                m_PlayerLine[iNumPlayersInGame-1]->SetVisible(true);                if (m_PlayerLine[iNumPlayersInGame-1]->SetPlayerIndex(j))                {                    bNeedsLayout = true;                }            }        }    }    // hide any extra ones we might have    for (int i=iNumPlayersInGame; i<m_PlayerLine.Count(); i++)    {        m_PlayerLine[i]->SetVisible(false);    }    UpdateVoteButtons();    UpdateKickLeaderTicks();    if (gpGlobals->curtime > m_fUpdateDifficultyTime)    {        MissionStatsPanel::SetMissionLabels(m_pMissionLabel, m_pDifficultyLabel);        m_fUpdateDifficultyTime = gpGlobals->curtime + 1.0f;    }    C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();    bool bShowRestart = pPlayer && ASWGameResource() && (ASWGameResource()->GetLeaderEntIndex() == pPlayer->entindex());    if ( ASWGameRules() && ASWGameRules()->IsIntroMap() )        bShowRestart = false;    //Msg("bLeader = %d leaderentindex=%d player entindex=%d/n", bLeader, ASWGameResource()->GetLeaderEntIndex(), pPlayer->entindex());    m_pRestartMissionButton->SetVisible(bShowRestart);    m_pLeaderButtonsBackground->SetVisible(bShowRestart);    UpdateServerName();    if (bNeedsLayout)        InvalidateLayout(true);}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:53,


示例28: ASWGameRules

void CNB_Vote_Panel::UpdateProgressBar(){	float flProgress = 1.0f;	if ( m_VotePanelStatus == VPS_VOTE )	{		flProgress = (float) ASWGameRules()->GetCurrentVoteTimeLeft() / asw_vote_duration.GetFloat();	}	else if ( m_VotePanelStatus == VPS_RESTART || m_VotePanelStatus == VPS_TECH_FAIL )	{		flProgress = (float) ( ASWGameRules()->GetRestartingMissionTime() - gpGlobals->curtime ) / 5.9f;	}	m_pProgressBar->SetProgress( flProgress );}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:14,


示例29: ASWGameRules

void CASW_Intro_Control::LaunchCampaignMap(){    if (m_bLaunchedCampaignMap || !ASWGameRules())        return;    ASWGameRules()->SetGameState(ASW_GS_CAMPAIGNMAP);    CReliableBroadcastRecipientFilter filter;    UserMessageBegin( filter, "LaunchCampaignMap" );    MessageEnd();    m_bLaunchedCampaignMap = true;}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:14,


示例30: GetMousePos

//-----------------------------------------------------------------------------// Purpose: ApplyMouse -- applies mouse deltas to CUserCmd// Input  : viewangles - //			*cmd - //			mouse_x - //			mouse_y - //-----------------------------------------------------------------------------void CASWInput::ApplyMouse( int nSlot, QAngle& viewangles, CUserCmd *cmd, float mouse_x, float mouse_y ){	int current_posx, current_posy;		GetMousePos(current_posx, current_posy);	if ( ASWInput()->ControllerModeActive() )		return;			if ( asw_controls.GetBool() && !MarineControllingTurret() )	{		TurnTowardMouse( viewangles, cmd );		// Re-center the mouse.		// force the mouse to the center, so there's room to move		ResetMouse();		SetMousePos( current_posx, current_posy );	// asw - swarm wants it unmoved (have to reset to stop buttons locking)	}	else	{		if ( MarineControllingTurret() )		{								// accelerate up the mouse intertia			static float mouse_x_accumulated = 0;			static float mouse_y_accumulated = 0;			// decay it			mouse_x_accumulated *= 0.95f;			mouse_y_accumulated *= 0.95f;			mouse_x_accumulated += mouse_x * 0.04f;			mouse_y_accumulated += mouse_y * 0.04f;			// clamp it			mouse_x_accumulated = clamp(mouse_x_accumulated, -500.0f,500.0f);			mouse_y_accumulated = clamp(mouse_y_accumulated, -500.0f,500.0f);			// move with our inertia style			mouse_x = mouse_x_accumulated;			mouse_y = mouse_y_accumulated;		}		if ( ( !ASWGameRules() || ASWGameRules()->GetMarineDeathCamInterp() <= 0.0f ) && ( !C_ASW_Marine::GetLocalMarine() || !C_ASW_Marine::GetLocalMarine()->IsUsingComputerOrButtonPanel() ) )			CInput::ApplyMouse( nSlot, viewangles, cmd, mouse_x, mouse_y );		// force the mouse to the center, so there's room to move		ResetMouse();	}}
开发者ID:detoxhby,项目名称:SwarmDirector2,代码行数:56,



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


C++ AS_UINT32函数代码示例
C++ AST_APP_OPTION函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。