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

C++ GetClassPtr函数代码示例

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

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



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

示例1: GetClassPtr

CGrenade *CGrenade::ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, unsigned short usEvent)
{
	CGrenade *pGrenade = GetClassPtr((CGrenade *)NULL);
	pGrenade->Spawn();

	UTIL_SetOrigin(pGrenade->pev, vecStart);
	pGrenade->pev->velocity = vecVelocity;
	pGrenade->pev->angles = pevOwner->angles;
	pGrenade->pev->owner = ENT(pevOwner);
	pGrenade->m_usEvent = usEvent;
	pGrenade->m_bLightSmoke = false;
	pGrenade->m_bDetonated = false;
	pGrenade->SetTouch(&CGrenade::BounceTouch);
	pGrenade->pev->dmgtime = gpGlobals->time + time;
	pGrenade->SetThink(&CGrenade::SG_TumbleThink);
	pGrenade->pev->nextthink = gpGlobals->time + 0.1;

	if (time < 0.1)
	{
		pGrenade->pev->nextthink = gpGlobals->time;
		pGrenade->pev->velocity = Vector(0, 0, 0);
	}

	pGrenade->pev->sequence = RANDOM_LONG(3, 6);
	pGrenade->pev->framerate = 1;
	pGrenade->m_bJustBlew = true;
	pGrenade->pev->gravity = 0.5;
	pGrenade->pev->friction = 0.8;
	pGrenade->m_SGSmoke = 0;

	SET_MODEL(ENT(pGrenade->pev), "models/w_smokegrenade.mdl");
	pGrenade->pev->dmg = 35;
	return pGrenade;
}
开发者ID:RomkaZVO,项目名称:cs16-client,代码行数:34,代码来源:ggrenade.cpp


示例2: ASSERT

void AvHUmbraGun::FireProjectiles(void)
{
	#ifdef AVH_SERVER
	
	// Make sure we have enough points to shoot this thing
	AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(this->m_pPlayer);
	ASSERT(thePlayer);

	// Create umbra projectile
	AvHUmbraProjectile* theUmbra = GetClassPtr((AvHUmbraProjectile*)NULL );
	theUmbra->Spawn();
	
	UTIL_MakeVectors(this->m_pPlayer->pev->v_angle);
	
	Vector vecAiming = gpGlobals->v_forward;
	Vector vecSrc = this->m_pPlayer->GetGunPosition( ) + vecAiming;
	
	UTIL_SetOrigin(theUmbra->pev, vecSrc);
	
	VectorScale(vecAiming, kShootCloudVelocity, theUmbra->pev->velocity);
	
	// Set projectile team and owner
	theUmbra->pev->owner = ENT(this->m_pPlayer->pev);
	
	// Set Umbra's team :)
	theUmbra->pev->team = this->m_pPlayer->pev->team;
	
	#endif	
}
开发者ID:Arkshine,项目名称:NS,代码行数:29,代码来源:AvHUmbraGun.cpp


示例3: Spawn

void CTankBSP :: Spawn( void )
{
	Precache();

	pev->solid			= SOLID_BSP;
	pev->movetype		= MOVETYPE_PUSH;

	SET_MODEL( ENT(pev), STRING(pev->model) );
	
	UTIL_SetSize( pev, pev->mins, pev->maxs );
	UTIL_SetOrigin( pev, pev->origin );

	pev->flags			|= FL_MONSTER;
	pev->takedamage		= DAMAGE_YES;
	pev->rendermode		= kRenderTransTexture;
	pev->renderamt		= 0;
	pev->view_ofs		= Vector ( 0,0,100 );

	pev->health			= TANK_LIFE;

	m_pTankModel = GetClassPtr( (CTank*)NULL );
	UTIL_SetOrigin( m_pTankModel->pev, pev->origin );
	m_pTankModel->pev->angles = pev->angles;
	m_pTankModel->m_pTankBSP = this;
	m_pTankModel->Spawn();


	SetThink ( TankThink );
	SetTouch ( TouchPlayer );
	pev->nextthink = pev->ltime + 0xFF;

}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:32,代码来源:tank.cpp


示例4: GetClassPtr

CDisc *CDisc::CreateDisc( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner, CDiscWeapon *pLauncher, bool bDecapitator, int iPowerupFlags )
{
	CDisc *pDisc = GetClassPtr( (CDisc *)NULL );

	UTIL_SetOrigin( pDisc->pev, vecOrigin );
	pDisc->m_iPowerupFlags = iPowerupFlags;
	// Hard shots always decapitate
	if ( pDisc->m_iPowerupFlags & POW_HARD )
		pDisc->m_bDecapitate = TRUE;
	else
		pDisc->m_bDecapitate = bDecapitator;

	pDisc->pev->angles = vecAngles;
	pDisc->pev->owner = pOwner->edict();
	pDisc->pev->team = pOwner->pev->team;
	pDisc->pev->iuser4 = pOwner->pev->iuser4;

	// Set the Group Info
	pDisc->pev->groupinfo = pOwner->pev->groupinfo;

	pDisc->m_pLauncher = pLauncher; 

	pDisc->Spawn();

	return pDisc;
}
开发者ID:Skumek,项目名称:hlsdk,代码行数:26,代码来源:disc_weapon_disc.cpp


示例5: GetClassPtr

//=========================================================
CQuakeRocket *CQuakeRocket::CreateRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner )
{
	CQuakeRocket *pRocket = GetClassPtr( (CQuakeRocket *)NULL );
	
	UTIL_SetOrigin( pRocket->pev, vecOrigin );
	SET_MODEL(ENT(pRocket->pev), "models/rocket.mdl");
	pRocket->Spawn();
	pRocket->pev->classname = MAKE_STRING("missile");
	pRocket->pev->owner = pOwner->edict();

	// Setup
	pRocket->pev->movetype = MOVETYPE_FLYMISSILE;
	pRocket->pev->solid = SOLID_BBOX;
		
	// Velocity
	pRocket->pev->velocity = vecAngles * 1000;
	pRocket->pev->angles = UTIL_VecToAngles( vecAngles );
	
	// Touch
	pRocket->SetTouch( CQuakeRocket::RocketTouch );

	// Safety Remove
	pRocket->pev->nextthink = gpGlobals->time + 5;
	pRocket->SetThink( SUB_Remove );

	// Effects
//	pRocket->pev->effects |= EF_LIGHT;

	PLAYBACK_EVENT_FULL (FEV_GLOBAL, pRocket->edict(), g_sTrail, 0.0, 
	(float *)&pRocket->pev->origin, (float *)&pRocket->pev->angles, 0.7, 0.0, pRocket->entindex(), ROCKET_TRAIL, 0, 0);

	return pRocket;
} 
开发者ID:CecilHarvey,项目名称:RealBot,代码行数:34,代码来源:quake_rocket.cpp


示例6: ClientUserInfoChanged

/*
========================
ClientUserInfoChanged

called after the player changes
userinfo - gives dll a chance to modify it before
it gets sent into the rest of the engine.
========================
*/
void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
{
	// Is the client spawned yet?
	if ( !pEntity->pvPrivateData )
		return;

	// msg everyone if someone changes their name,  and it isn't the first time (changing no name to current name)
	if ( pEntity->v.netname && STRING(pEntity->v.netname)[0] != 0 && !FStrEq( STRING(pEntity->v.netname), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" )) )
	{
		char sName[256];
		char *pName = g_engfuncs.pfnInfoKeyValue( infobuffer, "name" );
		strncpy( sName, pName, sizeof(sName) - 1 );
		sName[ sizeof(sName) - 1 ] = '\0';

		// First parse the name and remove any %'s
		for ( char *pApersand = sName; pApersand != NULL && *pApersand != 0; pApersand++ )
		{
			// Replace it with a space
			if ( *pApersand == '%' )
				*pApersand = ' ';
		}

		// Set the name
		g_engfuncs.pfnSetClientKeyValue( ENTINDEX(pEntity), infobuffer, "name", sName );

		char text[256];
		sprintf( text, "* %s changed name to %s\n", STRING(pEntity->v.netname), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) );
		MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL );
		WRITE_BYTE( ENTINDEX(pEntity) );
		WRITE_STRING( text );
		MESSAGE_END();
	}

	g_pGameRules->ClientUserInfoChanged( GetClassPtr((CBasePlayer *)&pEntity->v), infobuffer );
}
开发者ID:mittorn,项目名称:csdm,代码行数:44,代码来源:client.cpp


示例7: if

CInOutRegister *CInOutRegister::Add( CBaseEntity *pValue )
{
	if (m_hValue == pValue)
	{
		// it's already in the list, don't need to do anything
		return this;
	}
	else if (m_pNext)
	{
		// keep looking
		m_pNext = m_pNext->Add( pValue );
		return this;
	}
	else
	{
		// reached the end of the list; add the new entry, and trigger
		CInOutRegister *pResult = GetClassPtr( (CInOutRegister*)NULL );
		pResult->m_hValue = pValue;
		pResult->m_pNext = this;
		pResult->m_pField = m_pField;
		pResult->pev->classname = MAKE_STRING("zoneent");
		m_pField->FireOnEntry( pValue );
		return pResult;
	}
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:25,代码来源:basetrigger.cpp


示例8: while

void CHostage::SendHostageEventMsg(void)
{
	CBaseEntity *pEntity = NULL;

	while ((pEntity = UTIL_FindEntityByClassname(pEntity, "player")) != NULL)
	{
		if (FNullEnt(pEntity->edict()))
			break;

		if (!pEntity->IsPlayer())
			continue;

		if (pEntity->pev->flags == FL_DORMANT)
			continue;

		CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pEntity->pev);

		if (pPlayer->pev->deadflag == DEAD_NO && pPlayer->m_iTeam == TEAM_CT)
		{
			MESSAGE_BEGIN(MSG_ONE, gmsgHostageK, NULL, pPlayer->pev);
			WRITE_BYTE(m_iHostageIndex);
			MESSAGE_END();
		}

		if (pPlayer->pev->deadflag == DEAD_NO)
			pPlayer->SendHostageIcons();
	}
}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:28,代码来源:hostage.cpp


示例9: TrackTouch

//=========================================================
// Tracking Hornet hit something
//=========================================================
void CMHornet :: TrackTouch ( edict_t *pOther )
{
	if ( (pOther == pev->owner) || pOther->v.modelindex == pev->modelindex )
	{// bumped into the guy that shot it.
		pev->solid = SOLID_NOT;
		return;
	}

   // is this NOT a player and IS a monster?
   if (!UTIL_IsPlayer(pOther) && (pOther->v.euser4 != NULL))
   {
		CMBaseMonster *pMonster = GetClassPtr((CMBaseMonster *)VARS(pOther));

		if ( IRelationship( pMonster ) <= R_NO )
		{
			// hit something we don't want to hurt, so turn around.

			pev->velocity = pev->velocity.Normalize();

			pev->velocity.x *= -1;
			pev->velocity.y *= -1;

			pev->origin = pev->origin + pev->velocity * 4; // bounce the hornet off a bit.
			pev->velocity = pev->velocity * m_flFlySpeed;

			return;
		}
	}

	DieTouch( pOther );
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:34,代码来源:hornet.cpp


示例10: UTIL_MakeVectors

// Overridden for Gargantua because his swing starts lower as
// a percentage of his height (otherwise he swings over the
// players head)
//=========================================================
edict_t* CMGargantua::GargantuaCheckTraceHullAttack(float flDist, int iDamage, int iDmgType)
{
	TraceResult tr;

	UTIL_MakeVectors( pev->angles );
	Vector vecStart = pev->origin;
	vecStart.z += 64;
	Vector vecEnd = vecStart + (gpGlobals->v_forward * flDist) - (gpGlobals->v_up * flDist * 0.3);

	UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT(pev), &tr );
	
	if ( tr.pHit)
	{
		if ( iDamage > 0 )
		{
			if (UTIL_IsPlayer(tr.pHit))
			{
				UTIL_TakeDamage( tr.pHit,pev, pev, iDamage, iDmgType );
			}
			else if (tr.pHit->v.euser4 != NULL)
			{
				CMBaseMonster *pMonster = GetClassPtr((CMBaseMonster *)VARS(tr.pHit));
				pMonster->TakeDamage(pev, pev,iDamage, iDmgType);
			}
		}

		return tr.pHit;
	}

	return NULL;
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:35,代码来源:gargantua.cpp


示例11: CONSOLE_ECHO

void CLocalNav::RequestNav(CHostage *pOwner)
{
	if (nodeval > 17 || tot_inqueue)
	{
		if (tot_inqueue >= MAX_HOSTAGES)
		{
			CONSOLE_ECHO("queue full\n");
			return;
		}

		int i = qptr;

		for (int j = 0; j < tot_inqueue; j++)
		{
			CHostage *pHostage = GetClassPtr((CHostage *)queue[i]->pev);

			if (pHostage == pOwner)
				return;

			if (++i == MAX_HOSTAGES)
				i = 0;
		}

		queue[i] = pOwner;
		tot_inqueue++;
	}
	else
		pOwner->NavReady();
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:29,代码来源:hostage_localnav.cpp


示例12: ShootSatchelCharge

CGrenade * CGrenade :: ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity )
{
	CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );
	pGrenade->pev->movetype = MOVETYPE_BOUNCE;
	pGrenade->pev->classname = MAKE_STRING( "grenade" );
	
	pGrenade->pev->solid = SOLID_BBOX;

	SET_MODEL(ENT(pGrenade->pev), "models/grenade.mdl");	// Change this to satchel charge model

	UTIL_SetSize(pGrenade->pev, Vector( 0, 0, 0), Vector(0, 0, 0));

	pGrenade->pev->dmg = 200;
	UTIL_SetOrigin( pGrenade->pev, vecStart );
	pGrenade->pev->velocity = vecVelocity;
	pGrenade->pev->angles = g_vecZero;
	pGrenade->pev->owner = ENT(pevOwner);
	
	// Detonate in "time" seconds
	pGrenade->SetThink( &CGrenade::SUB_DoNothing );
	pGrenade->SetUse( &CGrenade::DetonateUse );
	pGrenade->SetTouch( &CGrenade::SlideTouch );
	pGrenade->pev->spawnflags = SF_DETONATE;

	pGrenade->pev->friction = 0.9;

	return pGrenade;
}
开发者ID:6779660,项目名称:halflife,代码行数:28,代码来源:ggrenade.cpp


示例13: FEnvSoundInRange

bool FEnvSoundInRange( entvars_t *pev, entvars_t *pevTarget, float *pflRange )
{
	CEnvSound *pSound = GetClassPtr( ( CEnvSound * ) pev );
	Vector vecSpot1 = pev->origin + pev->view_ofs;
	Vector vecSpot2 = pevTarget->origin + pevTarget->view_ofs;
	Vector vecRange;
	float flRange;
	TraceResult tr;

	UTIL_TraceLine( vecSpot1, vecSpot2, ignore_monsters, ENT( pev ), &tr );

	// check if line of sight crosses water boundary, or is blocked

	if( ( tr.fInOpen && tr.fInWater ) || tr.flFraction != 1 )
		return false;

	// calc range from sound entity to player

	vecRange = tr.vecEndPos - vecSpot1;
	flRange = vecRange.Length();

	if( pSound->m_flRadius < flRange )
		return false;

	if( pflRange )
		*pflRange = flRange;

	return true;
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:29,代码来源:CEnvSound.cpp


示例14: switch

void CMHornet::DieTouch ( edict_t *pOther )
{
	if ( pOther && pOther->v.takedamage )
	{// do the damage

		switch (RANDOM_LONG(0,2))
		{// buzz when you plug someone
			case 0:	EMIT_SOUND( ENT(pev), CHAN_VOICE, "hornet/ag_hornethit1.wav", 1, ATTN_NORM);	break;
			case 1:	EMIT_SOUND( ENT(pev), CHAN_VOICE, "hornet/ag_hornethit2.wav", 1, ATTN_NORM);	break;
			case 2:	EMIT_SOUND( ENT(pev), CHAN_VOICE, "hornet/ag_hornethit3.wav", 1, ATTN_NORM);	break;
		}

		if (UTIL_IsPlayer(pOther))
			UTIL_TakeDamage( pOther, pev, VARS( pev->owner ), pev->dmg, DMG_BULLET );
		else if (pOther->v.euser4 != NULL)
		{
			CMBaseMonster *pMonster = GetClassPtr((CMBaseMonster *)VARS(pOther));
			pMonster->TakeDamage( pev, VARS( pev->owner ), pev->dmg, DMG_BULLET );
		}
	}

	pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid
	pev->solid = SOLID_NOT;

	SetThink ( SUB_Remove );
	pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish!
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:27,代码来源:hornet.cpp


示例15: GetClassPtr

CGrenade *CGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity )
{
	CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );
	pGrenade->Spawn();
	// contact grenades arc lower
	pGrenade->pev->gravity = 0.5;// lower gravity since grenade is aerodynamic and engine doesn't know it.
	UTIL_SetOrigin( pGrenade->pev, vecStart );
	pGrenade->pev->velocity = vecVelocity;
	pGrenade->pev->angles = UTIL_VecToAngles (pGrenade->pev->velocity);
	pGrenade->pev->owner = ENT(pevOwner);
	
	// make monsters afaid of it while in the air
	pGrenade->SetThink( &CGrenade::DangerSoundThink );
	pGrenade->pev->nextthink = gpGlobals->time;
	
	// Tumble in air
	pGrenade->pev->avelocity.x = RANDOM_FLOAT ( -100, -500 );
	
	// Explode on contact
	pGrenade->SetTouch( &CGrenade::ExplodeTouch );

	pGrenade->pev->dmg = gSkillData.plrDmgM203Grenade;

	return pGrenade;
}
开发者ID:6779660,项目名称:halflife,代码行数:25,代码来源:ggrenade.cpp


示例16: GetClassPtr

CGrenade* CGrenade::ShootTimed2( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, int team, unsigned short usEvent )
{
    CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );

    pGrenade->Spawn();
    UTIL_SetOrigin( pGrenade->pev, vecStart );

    pGrenade->pev->velocity	= vecVelocity;
    pGrenade->pev->angles	= pevOwner->angles;
    pGrenade->pev->owner	= ENT( pevOwner );

    pGrenade->m_usEvent	= usEvent;

    pGrenade->SetTouch( &CGrenade::BounceTouch );
    pGrenade->SetThink( &CGrenade::TumbleThink );

    pGrenade->pev->dmgtime	= gpGlobals->time + time;
    pGrenade->pev->nextthink= gpGlobals->time + 0.1;

    pGrenade->pev->sequence	= RANDOM_LONG( 3, 6 );
    pGrenade->pev->framerate= 1.0;

    pGrenade->m_fJustBlew	= TRUE;
    pGrenade->m_iTeam		= team;

    pGrenade->pev->gravity	= 0.55;
    pGrenade->pev->friction = 0.70;
    pGrenade->pev->dmg		= 100;

    SET_MODEL( ENT( pGrenade->pev ), "models/w_hegrenade.mdl" );

    return pGrenade;
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:33,代码来源:ggrenade.cpp


示例17: Think

void CTriggerHurt :: Think( void )
{
	edict_t *pentPlayer;
	CBasePlayer *pPlayer = NULL;
	float flRange;
	entvars_t *pevTarget;
	Vector vecSpot1;
	Vector vecSpot2;
	Vector vecRange;
	Vector origin;
	Vector view_ofs;

	origin = pev->origin;
	view_ofs = pev->view_ofs;

	pev->origin = (pev->absmin + pev->absmax) * 0.5;
	pev->view_ofs = pev->view_ofs * 0.0;
	pentPlayer = FIND_CLIENT_IN_PVS(edict());

	pev->origin = origin;
	pev->view_ofs = view_ofs;

	if (!FNullEnt(pentPlayer))
	{
		pPlayer = GetClassPtr( (CBasePlayer *)VARS(pentPlayer));
		pevTarget = VARS(pentPlayer);
		vecSpot1 = (pev->absmin + pev->absmax) * 0.5;
		vecSpot2 = (pevTarget->absmin + pevTarget->absmax) * 0.5;
		vecRange = vecSpot1 - vecSpot2;
		flRange = vecRange.Length();
		if (pPlayer->m_flgeigerRange >= flRange) pPlayer->m_flgeigerRange = flRange;
	}
	SetNextThink( 0.25 );
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:34,代码来源:basetrigger.cpp


示例18: GetClassPtr

CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity)	// Last check: 2013, May 28
{
	CGrenade *pGrenade = GetClassPtr((CGrenade*)NULL);

	pGrenade->pev->movetype	= MOVETYPE_TOSS;
	pGrenade->pev->solid	= SOLID_BBOX;

	if (pGrenade->pev->classname)
		RemoveEntityHashValue(pGrenade->pev, STRING(pGrenade->pev->classname), CLASSNAME);

	pGrenade->pev->classname = MAKE_STRING("grenade");

	AddEntityHashValue(pGrenade->pev, STRING(pGrenade->pev->classname), CLASSNAME);

	SET_MODEL(ENT(pGrenade->pev), "models/w_c4.mdl");

	UTIL_SetSize(pGrenade->pev, Vector(3, 6, 8), Vector(-3, -6, 0));
	UTIL_SetOrigin(pGrenade->pev, vecStart);

	pGrenade->pev->dmg		= 100;
	pGrenade->pev->angles	= vecVelocity;
	pGrenade->pev->velocity = g_vecZero;
	pGrenade->pev->owner	= ENT(pevOwner);

	pGrenade->SetThink(&CGrenade::C4Think);
	pGrenade->SetTouch(&CGrenade::C4Touch);

	pGrenade->pev->spawnflags = SF_DETONATE;
	pGrenade->pev->nextthink  = gpGlobals->time + 0.1;

	pGrenade->m_flC4Blow			= gpGlobals->time + g_pGameRules->m_iC4Timer;
	pGrenade->m_flNextFreqInterval	= g_pGameRules->m_iC4Timer / 4;
	pGrenade->m_flNextFreq			= gpGlobals->time;
	pGrenade->m_flNextBeep			= gpGlobals->time + 0.5;
	pGrenade->m_flNextBlink			= gpGlobals->time + 2.0;

	pGrenade->m_iCurWave	= 0;
	pGrenade->m_fAttenu		= 0;
	pGrenade->m_sBeepName	= NULL;

	pGrenade->m_fNextDefuse = 0;

	pGrenade->m_bIsC4		= true;
	pGrenade->m_bStartDefuse= false;
	pGrenade->m_bJustBlew	= false;

	pGrenade->pev->friction = 0.9;

	if (!FNullEnt(pevOwner))
	{
		CBasePlayer *pPlayer = (CBasePlayer*)Instance(pevOwner);

		if (pPlayer->IsPlayer())
			pGrenade->m_pentCurBombTarget = pPlayer->m_pentCurBombTarget;
	}
	else
		pGrenade->m_pentCurBombTarget = NULL;

	return pGrenade;
}
开发者ID:Chuvi-w,项目名称:CSSDK,代码行数:60,代码来源:ggrenade.cpp


示例19: CalcLocus_Position

void CLocusVariable::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	Vector vecPos = g_vecZero;
	Vector vecDir = g_vecZero;
	float fRatio = 0;
	if (m_iszPosition)
		vecPos = CalcLocus_Position(this, pActivator, STRING(m_iszPosition));
	if (m_iszVelocity)
		vecDir = CalcLocus_Velocity(this, pActivator, STRING(m_iszVelocity));
	if (m_iszRatio)
		fRatio = CalcLocus_Ratio(pActivator, STRING(m_iszRatio));

	if (m_iszTargetName)
	{
		CMark *pMark = GetClassPtr( (CMark*)NULL );
		pMark->pev->classname = MAKE_STRING("mark");
		pMark->pev->origin = vecPos;
		pMark->pev->movedir = vecDir;
		pMark->pev->frags = fRatio;
		pMark->pev->targetname = m_iszTargetName;
		pMark->SetNextThink(m_fDuration);

		FireTargets(STRING(m_iszFireOnSpawn), pMark, this, USE_TOGGLE, 0);
	}
	else
	{
		pev->origin = vecPos;
		pev->movedir = vecDir;
		pev->frags = fRatio;

		FireTargets(STRING(m_iszFireOnSpawn), this, this, USE_TOGGLE, 0);
	}
}
开发者ID:RichardRohac,项目名称:hl-amnesia-src,代码行数:33,代码来源:locus.cpp


示例20: ScriptEntityCancel

void ScriptEntityCancel(edict_t *pentCine)
{
	// make sure they are a scripted_sequence
	if(FClassnameIs(pentCine, CLASSNAME))
	{
		CCineMonster *pCineTarget = GetClassPtr((CCineMonster *)VARS(pentCine));
		// make sure they have a monster in mind for the script
		CBaseEntity * pEntity = pCineTarget->m_hTargetEnt;
		CBaseMonster *pTarget = NULL;
		if(pEntity)
			pTarget = pEntity->MyMonsterPointer();

		if(pTarget)
		{
			// make sure their monster is actually playing a script
			if(pTarget->m_MonsterState == MONSTERSTATE_SCRIPT)
			{
				// tell them do die
				pTarget->m_scriptState = CCineMonster::SCRIPT_CLEANUP;
				// do it now
				pTarget->CineCleanup();
			}
		}
	}
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:25,代码来源:Scripted.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetClassname函数代码示例发布时间:2022-05-30
下一篇:
C++ GetClassName函数代码示例发布时间: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