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

C++ edict函数代码示例

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

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



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

示例1: Vector

void CLeech::RecalculateWaterlevel( void )
{
	// Calculate boundaries
	Vector vecTest = pev->origin - Vector(0,0,400);

	TraceResult tr;

	UTIL_TraceLine(pev->origin, vecTest, missile, edict(), &tr);
	if ( tr.flFraction != 1.0 )
		m_bottom = tr.vecEndPos.z + 1;
	else
		m_bottom = vecTest.z;

	m_top = UTIL_WaterLevel( pev->origin, pev->origin.z, pev->origin.z + 400 ) - 1;

	// Chop off 20% of the outside range
	float newBottom = m_bottom * 0.8 + m_top * 0.2;
	m_top = m_bottom * 0.2 + m_top * 0.8;
	m_bottom = newBottom;
	m_height = RANDOM_FLOAT( m_bottom, m_top );
	m_waterTime = gpGlobals->time + RANDOM_FLOAT( 5, 7 );
}
开发者ID:HoLyCoWzOrZ,项目名称:sing-engine,代码行数:22,代码来源:leech.cpp


示例2: LeapTouch

//=========================================================
// LeapTouch - this is the headcrab's touch function when it
// is in the air
//=========================================================
void CHeadCrab :: LeapTouch ( CBaseEntity *pOther )
{
	if ( !pOther->pev->takedamage )
	{
		return;
	}

	if ( pOther->Classify() == Classify() )
	{
		return;
	}

	// Don't hit if back on ground
	if ( !FBitSet( pev->flags, FL_ONGROUND ) )
	{
		EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY(pBiteSounds), GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() );
		
		pOther->TakeDamage( pev, pev, GetDamageAmount(), DMG_SLASH );
	}

	SetTouch( NULL );
}
开发者ID:NonPIayerCharacter,项目名称:hlsdk-xash3d,代码行数:26,代码来源:headcrab.cpp


示例3: HandleAnimEvent

//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CHellKnight :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
	switch( pEvent->event )
	{
	case HKNIGHT_IDLE_SOUND:
		if( m_Activity == ACT_RUN )
			CheckForCharge ();

		if( RANDOM_FLOAT( 0.0f, 1.0f ) < 0.1f )
			EMIT_SOUND( edict(), CHAN_VOICE, "hknight/idle.wav", 1.0, ATTN_IDLE );
		break;
	case HKNIGHT_SHOT_SPIKES:
		ShootSpike( atof( pEvent->options ));
		break;
	case HKNIGHT_MELEE_ATTACK:
		AI_Melee ();
		break;
	default:
		CQuakeMonster::HandleAnimEvent( pEvent );
		break;
	}
}
开发者ID:nekonomicon,项目名称:QuakeRemakeDevkit,代码行数:26,代码来源:hellknight.cpp


示例4: ShamblerClaw

void CShambler :: ShamblerClaw( float side )
{
	if (m_hEnemy == NULL)
		return;

	AI_Charge(10);

	Vector delta = m_hEnemy->pev->origin - pev->origin;

	if (delta.Length() > 100)
		return;
		
	float ldmg = (RANDOM_FLOAT(0,1) + RANDOM_FLOAT(0,1) + RANDOM_FLOAT(0,1)) * 20;
	m_hEnemy->TakeDamage( pev, pev, ldmg, DMG_SLASH);
	EMIT_SOUND( edict(), CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM);

	if (side)
	{
		UTIL_MakeVectors( pev->angles );
		SpawnMeatSpray (pev->origin + gpGlobals->v_forward * 16, side * gpGlobals->v_right);
	}
}
开发者ID:nekonomicon,项目名称:QuakeRemakeDevkit,代码行数:22,代码来源:shambler.cpp


示例5: BounceGibTouch

//
// Gib bounces on the ground or wall, sponges some blood down, too!
//
void CGib :: BounceGibTouch ( CBaseEntity *pOther )
{
	Vector	vecSpot;
	TraceResult	tr;
	
	//if ( RANDOM_LONG(0,1) )
	//	return;// don't bleed everytime

	if (pev->flags & FL_ONGROUND)
	{
		pev->velocity = pev->velocity * 0.9;
		pev->angles.x = 0;
		pev->angles.z = 0;
		pev->avelocity.x = 0;
		pev->avelocity.z = 0;
	}
	else
	{
		if ( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED )
		{
			vecSpot = pev->origin + Vector ( 0 , 0 , 8 );//move up a bit, and trace down.
			UTIL_TraceLine ( vecSpot, vecSpot + Vector ( 0, 0, -24 ),  ignore_monsters, ENT(pev), & tr);

			UTIL_BloodDecalTrace( &tr, m_bloodColor );

			m_cBloodDecals--; 
		}

		if ( m_material != matNone && RANDOM_LONG(0,2) == 0 )
		{
			float volume;
			float zvel = fabs(pev->velocity.z);
		
			volume = 0.8 * min(1.0, ((float)zvel) / 450.0);

			CBreakable::MaterialSoundRandom( edict(), (Materials)m_material, volume );
		}
	}
}
开发者ID:mittorn,项目名称:csdm,代码行数:42,代码来源:combat.cpp


示例6: FlameCreate

void CGargantua :: FlameCreate( void )
{
	int			i;
	Vector		posGun, angleGun;
	TraceResult trace;

	UTIL_MakeVectors( GetAbsAngles() );
	
	for ( i = 0; i < 4; i++ )
	{
		if ( i < 2 )
			m_pFlame[i] = CBeam::BeamCreate( GARG_BEAM_SPRITE_NAME, 240 );
		else
			m_pFlame[i] = CBeam::BeamCreate( GARG_BEAM_SPRITE2, 140 );
		if ( m_pFlame[i] )
		{
			int attach = i%2;
			// attachment is 0 based in GetAttachment
			GetAttachment( attach+1, posGun, angleGun );

			Vector vecEnd = (gpGlobals->v_forward * GARG_FLAME_LENGTH) + posGun;
			UTIL_TraceLine( posGun, vecEnd, dont_ignore_monsters, edict(), &trace );

			m_pFlame[i]->PointEntInit( trace.vecEndPos, entindex() );
			if ( i < 2 )
				m_pFlame[i]->SetColor( 255, 130, 90 );
			else
				m_pFlame[i]->SetColor( 0, 120, 255 );
			m_pFlame[i]->SetBrightness( 190 );
			m_pFlame[i]->SetBeamFlags( BEAM_FSHADEIN );
			m_pFlame[i]->SetScrollRate( 20 );
			// attachment is 1 based in SetEndAttachment
			m_pFlame[i]->SetEndAttachment( attach + 2 );
			CSoundEnt::InsertSound( bits_SOUND_COMBAT, posGun, 384, 0.3 );
		}
	}
	EMIT_SOUND_DYN ( this, CHAN_BODY, pBeamAttackSounds[ 1 ], 1.0, ATTN_NORM, 0, PITCH_NORM );
	EMIT_SOUND_DYN ( this, CHAN_WEAPON, pBeamAttackSounds[ 2 ], 1.0, ATTN_NORM, 0, PITCH_NORM );
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:39,代码来源:CGargantua.cpp


示例7: Precache

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

	m_iId = WEAPON_P90;
	SET_MODEL(edict(), "models/w_p90.mdl");

	m_iDefaultAmmo = P90_DEFAULT_GIVE;
	m_flAccuracy = 0.2f;
	m_iShotsFired = 0;
	m_bDelayFire = false;

#ifdef REGAMEDLL_API
	CSPlayerWeapon()->m_flBaseDamage = P90_DAMAGE;
#endif

	// Get ready to fall down
	FallInit();

	// extend
	CBasePlayerWeapon::Spawn();
}
开发者ID:s1lentq,项目名称:ReGameDLL_CS,代码行数:22,代码来源:wpn_p90.cpp


示例8: edict

BOOL CWeaponBox::PackWeapon( CBasePlayerWeapon *pWeapon )
{
	// is one of these weapons already packed in this box?
	if ( HasWeapon( pWeapon ) ) return FALSE;// box can only hold one of each weapon type

	if ( pWeapon->m_pPlayer )
	{
		// failed to unhook the weapon from the player!
		if ( !pWeapon->m_pPlayer->RemovePlayerItem( pWeapon ) ) return FALSE;
	}

	int iWeaponSlot = pWeapon->iItemSlot();
	
	if ( m_rgpPlayerItems[ iWeaponSlot ] )
	{
		// there's already one weapon in this slot, so link this into the slot's column
		pWeapon->m_pNext = m_rgpPlayerItems[ iWeaponSlot ];	
		m_rgpPlayerItems[ iWeaponSlot ] = pWeapon;
	}
	else
	{
		// first weapon we have for this slot
		m_rgpPlayerItems[ iWeaponSlot ] = pWeapon;
		pWeapon->m_pNext = NULL;	
	}

	pWeapon->pev->spawnflags |= SF_NORESPAWN;// never respawn
	pWeapon->pev->movetype = MOVETYPE_NONE;
	pWeapon->pev->solid = SOLID_NOT;
	pWeapon->pev->effects = EF_NODRAW;
	pWeapon->pev->modelindex = 0;
	pWeapon->pev->model = iStringNull;
	pWeapon->pev->owner = edict();
	pWeapon->SetThink( NULL );// crowbar may be trying to swing again, etc.
	pWeapon->SetTouch( NULL );
	pWeapon->m_pPlayer = NULL;

	return TRUE;
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:39,代码来源:baseitem.cpp


示例9: DoorGoDown

//
// Causes the door to "do its thing", i.e. start moving, and cascade activation.
//
int CBaseDoor::DoorActivate( )
{
	if ( CHalfLifeRules *rules = dynamic_cast<CHalfLifeRules *>( g_pGameRules ) ) {
		if ( rules->EntityShouldBePrevented( edict() ) ) {
			return 0;
		}
	}

	if (!UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
		return 0;

	if (FBitSet(pev->spawnflags, SF_DOOR_NO_AUTO_RETURN) && m_toggle_state == TS_AT_TOP)
	{// door should close
		DoorGoDown();
	}
	else
	{// door should open

		if ( m_hActivator != NULL && m_hActivator->IsPlayer() )
		{// give health if player opened the door (medikit)
		// VARS( m_eoActivator )->health += m_bHealthValue;
	
			m_hActivator->TakeHealth( m_bHealthValue, DMG_GENERIC );

		}

		// play door unlock sounds
		PlayLockSounds(pev, &m_ls, FALSE, FALSE);
		
		DoorGoUp();
	}

	if ( CHalfLifeRules *singlePlayerRules = dynamic_cast< CHalfLifeRules * >( g_pGameRules ) ) {
		singlePlayerRules->HookModelIndex( this->edict() );
	}

	return 1;
}
开发者ID:suXinjke,项目名称:HalfPayne,代码行数:41,代码来源:doors.cpp


示例10: RunTask

void CZombie :: RunTask ( Task_t *pTask )
{
	switch ( pTask->iTask )
	{
	case TASK_CHECK_FOR_NOBODY_AROUND:
		{
			CBaseEntity *pEnt = NULL;

			while (pEnt = UTIL_FindEntityInSphere(pEnt, pev->origin + Vector(0, 0, 20), 18))
			{
				if (pEnt->edict() == edict()) continue;

				if (!pEnt->IsAlive()) continue;

				if (pEnt->pev->solid == SOLID_NOT || pEnt->pev->solid == SOLID_TRIGGER) continue;

				return;
			}

			TaskComplete();
		}
		break;

	case TASK_AWAKE_FROM_DEAD:
		{
			if ( pev->frame >= 255 )
			{
				ReSpawn();
				TaskComplete();
			}
		}
		break;

	default:
		CBaseMonster::RunTask(pTask);
		break;
	}
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:38,代码来源:mon_zombie.cpp


示例11: FireRocket

void CApache :: FireRocket( void )
{
	static float side = 1.0;
	static int count;

	if (m_iRockets <= 0)
		return;

	UTIL_MakeAimVectors( pev->angles );
	Vector vecSrc = pev->origin + 1.5 * (gpGlobals->v_forward * 21 + gpGlobals->v_right * 70 * side + gpGlobals->v_up * -79);

	switch( m_iRockets % 5)
	{
	case 0:	vecSrc = vecSrc + gpGlobals->v_right * 10; break;
	case 1: vecSrc = vecSrc - gpGlobals->v_right * 10; break;
	case 2: vecSrc = vecSrc + gpGlobals->v_up * 10; break;
	case 3: vecSrc = vecSrc - gpGlobals->v_up * 10; break;
	case 4: break;
	}

	MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSrc );
		WRITE_BYTE( TE_SMOKE );
		WRITE_COORD( vecSrc.x );
		WRITE_COORD( vecSrc.y );
		WRITE_COORD( vecSrc.z );
		WRITE_SHORT( g_sModelIndexSmoke );
		WRITE_BYTE( 20 ); // scale * 10
		WRITE_BYTE( 12 ); // framerate
	MESSAGE_END();

	CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() );
	if (pRocket)
		pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100;

	m_iRockets--;

	side = - side;
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:38,代码来源:npc_apache.cpp


示例12: EMIT_SOUND

/* <24674f> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:419 */
void CC4::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
	if (m_pPlayer != NULL)
	{
		return;
	}

	CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(1));

	if (pPlayer != NULL)
	{
		edict_t *m_pentOldCurBombTarget = pPlayer->m_pentCurBombTarget;
		pPlayer->m_pentCurBombTarget = NULL;

		if (pev->speed != 0 && g_pGameRules)
		{
			g_pGameRules->m_iC4Timer = (int)pev->speed;
		}

		EMIT_SOUND(edict(), CHAN_WEAPON, "weapons/c4_plant.wav", VOL_NORM, ATTN_NORM);

		CGrenade::ShootSatchelCharge(m_pPlayer->pev, m_pPlayer->pev->origin, Vector(0, 0, 0));

		CGrenade *pC4 = NULL;
		while ((pC4 = (CGrenade *)UTIL_FindEntityByClassname(pC4, "grenade")) != NULL)
		{
			if (pC4->m_bIsC4 && pC4->m_flNextFreq == gpGlobals->time)
			{
				pC4->pev->target = pev->target;
				pC4->pev->noise1 = pev->noise1;
				break;
			}
		}

		pPlayer->m_pentCurBombTarget = m_pentOldCurBombTarget;
		SUB_Remove();
	}
}
开发者ID:coolmans,项目名称:ReGameDLL_CS,代码行数:39,代码来源:wpn_c4.cpp


示例13: UTIL_MakeAimVectors

void CFuncTankMortar::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker )
{
	if ( m_fireLast != 0 )
	{
		int bulletCount = (gpGlobals->time - m_fireLast) * m_fireRate;
		// Only create 1 explosion
		if ( bulletCount > 0 )
		{
			TraceResult tr;

			// TankTrace needs gpGlobals->v_up, etc.
			UTIL_MakeAimVectors(pev->angles);

			TankTrace( barrelEnd, forward, gTankSpread[m_spread], tr );

			ExplosionCreate( tr.vecEndPos, pev->angles, edict(), pev->impulse, TRUE );

			CFuncTank::Fire( barrelEnd, forward, pev );
		}
	}
	else
		CFuncTank::Fire( barrelEnd, forward, pev );
}
开发者ID:Xash3DLinux,项目名称:xash3dlinux,代码行数:23,代码来源:func_tank.cpp


示例14: Spawn

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

	SET_MODEL( ENT(pev), "models/tree.mdl" );
	pev->movetype	= MOVETYPE_NONE;
	pev->solid		= SOLID_BBOX;

	pev->takedamage = DAMAGE_YES;

	UTIL_SetSize( pev, Vector(-30,-30,0), Vector(30,30,188));
	SetActivity( ACT_IDLE );
	pev->nextthink = gpGlobals->time + 0.1;
	pev->frame = RANDOM_FLOAT(0,255);
	pev->framerate = RANDOM_FLOAT( 0.7, 1.4 );

	Vector triggerPosition;
	UTIL_MakeVectorsPrivate( pev->angles, triggerPosition, NULL, NULL );
	triggerPosition = pev->origin + (triggerPosition * 64);
	// Create the trigger
	m_pTrigger = CXenTreeTrigger::TriggerCreate( edict(), triggerPosition );
	UTIL_SetSize( m_pTrigger->pev, Vector( -24, -24, 0 ), Vector( 24, 24, 128 ) );
}
开发者ID:Arkshine,项目名称:NS,代码行数:23,代码来源:xen.cpp


示例15: IsOkToCombatSpeak

//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
bool CAI_PlayerAlly::IsOkToCombatSpeak( void )
{
	// if not alive, certainly don't speak
	if ( !IsAlive() )
		return false;

	// if someone else is talking, don't speak
	if ( !GetExpresser()->SemaphoreIsAvailable() )
		return false;

	if ( m_spawnflags & SF_NPC_GAG )
		return false;

	// Don't speak if playing a script.
	if ( m_NPCState == NPC_STATE_SCRIPT )
		return false;

	// if player is not in pvs, don't speak
	if ( !UTIL_FindClientInPVS(edict()) )
		return false;

	return true;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:28,代码来源:npc_talker.cpp


示例16: ClientPrint

void CHostage::AnnounceDeath(CBasePlayer *pAttacker)
{
	ClientPrint(pAttacker->pev, HUD_PRINTCENTER, "#Killed_Hostage");

	if (!(pAttacker->m_flDisplayHistory & DHF_HOSTAGE_KILLED))
	{
		pAttacker->HintMessage("#Hint_lost_money");
		pAttacker->m_flDisplayHistory |= DHF_HOSTAGE_KILLED;
	}

	if (!g_pGameRules->IsMultiplayer())
		CHalfLifeTraining::HostageDied();

	UTIL_LogPrintf("\"%s<%i><%s><%s>\" triggered \"Killed_A_Hostage\"\n", STRING(pAttacker->pev->netname), GETPLAYERUSERID(pAttacker->edict()), GETPLAYERAUTHID(pAttacker->edict()), GetTeam(pAttacker->m_iTeam));

	MESSAGE_BEGIN(MSG_SPEC, SVC_DIRECTOR);
	WRITE_BYTE(9);
	WRITE_BYTE(DRC_CMD_EVENT);
	WRITE_SHORT(ENTINDEX(pAttacker->edict()));
	WRITE_SHORT(ENTINDEX(edict()));
	WRITE_LONG(15);
	MESSAGE_END();
}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:23,代码来源:hostage.cpp


示例17: UpdatePlayerView

void CTriggerCamera :: UpdatePlayerView( void )
{
	int flags = 0;

	if( m_hActivator == NULL || !m_hActivator->edict() || !( m_hActivator->pev->flags & FL_CLIENT ))
	{
		ALERT( at_error, "Camera: No Client!\n" );
		return;
	}

	if( pev->spawnflags & SF_CAMERA_PLAYER_TAKECONTROL )
	{
		int state;

		if( GetState() == STATE_ON )
			state = TRUE;
		else state = FALSE;
		
		// freeze player
		((CBasePlayer *)((CBaseEntity *)m_hActivator))->EnableControl( state );
	}
#if 1
	if( GetState() == STATE_OFF )
		flags |= CAMERA_ON;
	else flags = 0; 

	CBaseEntity *pCamera = UTIL_FindEntityByTargetname( NULL, STRING( pev->netname ));
	if( pCamera && !pCamera->IsBSPModel( ))
		UTIL_SetView( m_hActivator, pCamera, flags );
	else UTIL_SetView( m_hActivator, this, flags );
#else
	// enchanced engine SET_VIEW (see code in client\global\view.cpp)
	if( GetState() == STATE_OFF )
		SET_VIEW( m_hActivator->edict(), edict() );
	else SET_VIEW( m_hActivator->edict(), m_hActivator->edict() );
#endif
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:37,代码来源:basetrigger.cpp


示例18: Spawn

void CFuncConveyor :: Spawn( void )
{
	pev->flags |= FL_WORLDBRUSH;
	pev->solid = SOLID_BSP;
	pev->movetype = MOVETYPE_PUSH;

	SET_MODEL( edict(), GetModel() );

	if( !FBitSet( pev->spawnflags, SF_CONVEYOR_VISUAL ))
		SetBits( pev->flags, FL_CONVEYOR );

	// is mapper forgot set angles?
	if( pev->movedir == g_vecZero )
		pev->movedir = Vector( 1, 0, 0 );

	// HACKHACK - This is to allow for some special effects
	if( FBitSet( pev->spawnflags, SF_CONVEYOR_NOTSOLID ))
	{
		pev->solid = SOLID_NOT;
		pev->skin = 0; // don't want the engine thinking we've got special contents on this brush
	}
	else
	{
		if( m_hParent )
			m_pUserData = WorldPhysic->CreateKinematicBodyFromEntity( this );
		else m_pUserData = WorldPhysic->CreateStaticBodyFromEntity( this );
	}

	if( pev->speed == 0 )
		pev->speed = 100;

	m_flMaxSpeed = pev->speed;	// save initial speed

	if( FBitSet( pev->spawnflags, SF_CONVEYOR_STARTOFF ))
		UpdateSpeed( 0 );
	else UpdateSpeed( m_flMaxSpeed );
}
开发者ID:XashDev,项目名称:XashXT,代码行数:37,代码来源:bmodels.cpp


示例19: Killed

void CApache :: Killed( entvars_t *pevAttacker, int iGib )
{
	pev->movetype = MOVETYPE_TOSS;
	pev->gravity = 0.3;

	STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav" );

	UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) );
	SetThink( DyingThink );
	SetTouch( CrashTouch );
	pev->nextthink = gpGlobals->time + 0.1;
	pev->health = 0;
	pev->takedamage = DAMAGE_NO;

	if (pev->spawnflags & SF_NOWRECKAGE)
	{
		m_flNextRocket = gpGlobals->time + 4.0;
	}
	else
	{
		m_flNextRocket = gpGlobals->time + 15.0;
	}

	// modif de Julien
	if ( pev->spawnflags & SF_APACHE_LENSFLARE && m_bFlashLightOn == TRUE )
	{
		m_bFlashLightOn = FALSE;

		MESSAGE_BEGIN( MSG_ALL, gmsgLensFlare, NULL );

			WRITE_BYTE ( 0 );	// éteint
			WRITE_BYTE ( ENTINDEX ( edict() ) );

		MESSAGE_END();
	}

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


示例20: HandleAnimEvent

void CXenTree :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
	switch( pEvent->event )
	{
		case TREE_AE_ATTACK:
		{
			CBaseEntity *pList[8];
			BOOL sound = FALSE;
			int count = UTIL_EntitiesInBox( pList, 8, m_pTrigger->pev->absmin, m_pTrigger->pev->absmax, FL_MONSTER|FL_CLIENT );
			Vector forward;

			UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL );

			for ( int i = 0; i < count; i++ )
			{
				if ( pList[i] != this )
				{
					if ( pList[i]->pev->owner != edict() )
					{
						sound = TRUE;
						pList[i]->TakeDamage( pev, pev, 25, DMG_CRUSH | DMG_SLASH );
						pList[i]->pev->punchangle.x = 15;
						pList[i]->pev->velocity = pList[i]->pev->velocity + forward * 100;
					}
				}
			}
					
			if ( sound )
			{
				EMIT_SOUND_ARRAY_DYN( CHAN_WEAPON, pAttackHitSounds );
			}
		}
		return;
	}

	CActAnimating::HandleAnimEvent( pEvent );
}
开发者ID:Arkshine,项目名称:NS,代码行数:37,代码来源:xen.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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