本文整理汇总了C++中CASW_Player::GetMarine方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Player::GetMarine方法的具体用法?C++ CASW_Player::GetMarine怎么用?C++ CASW_Player::GetMarine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Player
的用法示例。
在下文中一共展示了CASW_Player::GetMarine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asw_room_info_f
void asw_room_info_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if ( pPlayer && pPlayer->GetMarine() && missionchooser && missionchooser->RandomMissions() )
{
IASW_Room_Details *pRoom = missionchooser->RandomMissions()->GetRoomDetails( pPlayer->GetMarine()->GetAbsOrigin() );
if ( !pRoom )
{
Msg(" Couldn't find room\n" );
}
else
{
char buf[MAX_PATH];
pRoom->GetFullRoomName( buf, MAX_PATH );
Msg( " Room name: %s\n", buf );
Msg( " Room tags: " );
int nNumTags = pRoom->GetNumTags();
for ( int i = 0; i < nNumTags; ++ i )
{
Msg( "%s ", pRoom->GetTag( i ) );
}
Msg( "\n" );
}
}
}
示例2: asw_test_turret_f
void asw_test_turret_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (pPlayer && pPlayer->GetMarine())
{
CASW_Marine *pMarine = pPlayer->GetMarine();
if (pMarine->m_hRemoteTurret.Get())
{
pMarine->m_hRemoteTurret->StopUsingTurret();//m_hUser = NULL;
pMarine->m_hRemoteTurret = NULL;
return;
}
CBaseEntity* pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "asw_remote_turret" )) != NULL)
{
CASW_Remote_Turret* pTurret = dynamic_cast<CASW_Remote_Turret*>(pEntity);
if (pTurret)
{
pTurret->StartedUsingTurret(pMarine);
pMarine->m_hRemoteTurret = pTurret;
Msg("Set turret\n");
return;
}
}
}
Msg("Failed to find a turret\n");
}
示例3: asw_path_end_f
void asw_path_end_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if ( !pPlayer || !ASWPathUtils() )
return;
if ( !pPlayer->GetMarine() )
return;
Vector vecPathEnd = pPlayer->GetMarine()->GetAbsOrigin();
debugoverlay->AddBoxOverlay( g_vecPathStart, Vector(-10, -10, -10 ), Vector(10, 10, 10) , vec3_angle, 255, 0, 0, 255, 30.0f );
debugoverlay->AddBoxOverlay( vecPathEnd, Vector(-10, -10, -10 ), Vector(10, 10, 10) , vec3_angle, 255, 255, 0, 255, 30.0f );
AI_Waypoint_t *pWaypoint = ASWPathUtils()->BuildRoute( g_vecPathStart, vecPathEnd, NULL, 100, NAV_NONE, bits_BUILD_GET_CLOSE );
if ( !pWaypoint )
{
Msg( "Failed to find route\n" );
return;
}
if ( UTIL_ASW_DoorBlockingRoute( pWaypoint, true ) )
{
Msg(" Route blocked by sealed/locked door\n" );
}
ASWPathUtils()->DebugDrawRoute( g_vecPathStart, pWaypoint );
}
示例4: asw_suicide_f
void asw_suicide_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (pPlayer && pPlayer->GetMarine() && pPlayer->GetMarine()->GetHealth() > 0)
{
pPlayer->GetMarine()->Suicide();
}
}
示例5: asw_stop_burning_f
void asw_stop_burning_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (pPlayer && pPlayer->GetMarine())
{
CASW_Marine *pMarine = pPlayer->GetMarine();
pMarine->Extinguish();
}
}
示例6: asw_build_speech_durations_f
void asw_build_speech_durations_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (!pPlayer || !MarineProfileList() || !pPlayer->GetMarine())
return;
Msg("Saving speech durations...");
MarineProfileList()->SaveSpeechDurations(pPlayer->GetMarine());
Msg("Done!\n");
}
示例7: ShootMe
void ShootMe()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if ( pPlayer->GetMarine() )
{
CTakeDamageInfo dmgInfo( pPlayer, pPlayer, 3, DMG_BULLET );
Vector vecDir = RandomVector(-1, 1);
trace_t tr;
pPlayer->GetMarine()->DispatchTraceAttack( dmgInfo, vecDir, &tr );
}
}
示例8: asw_path_start_f
void asw_path_start_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if ( !pPlayer || !ASWPathUtils() )
return;
if ( !pPlayer->GetMarine() )
return;
g_vecPathStart = pPlayer->GetMarine()->GetAbsOrigin();
}
示例9: ASW_PhysicsShove_f
void ASW_PhysicsShove_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (pPlayer && pPlayer->GetMarine())
{
if (pPlayer->GetMarine()->GetFlags() & FL_FROZEN) // don't allow this if the marine is frozen
return;
pPlayer->GetMarine()->PhysicsShove();
}
}
示例10: cc_asw_inventory
void cc_asw_inventory()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if ( pPlayer->GetMarine() )
{
for (int i=0;i<pPlayer->GetMarine()->WeaponCount();i++)
{
CBaseEntity *pWeapon = pPlayer->GetMarine()->GetWeapon(i);
if ( pWeapon )
{
Msg(" Inventory[%d] = %s (%d)\n", i, pWeapon->GetClassname(), pWeapon->entindex() );
}
}
}
}
示例11: asw_ragdoll_marine_f
void asw_ragdoll_marine_f()
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
static CRagdollProp * s_pRagdoll = NULL;
if (pPlayer && pPlayer->GetMarine())
{
CASW_Marine* pMarine = pPlayer->GetMarine();
pMarine->SetKnockedOut(!pMarine->m_bKnockedOut);
return;
if (pMarine->IsEffectActive(EF_NODRAW) && s_pRagdoll)
{
//Calcs the diff between ragdoll worldspace center and victim worldspace center, moves the victim by this diff.
//Sets the victim's angles to 0, ragdoll yaw, 0
QAngle newAngles( 0, s_pRagdoll->GetAbsAngles()[YAW], 0 );
Vector centerDelta = s_pRagdoll->WorldSpaceCenter() - pMarine->WorldSpaceCenter();
centerDelta.z = 0; // don't put us in the floor
Vector newOrigin = pMarine->GetAbsOrigin() + centerDelta;
pMarine->SetAbsOrigin( newOrigin );
pMarine->SetAbsAngles( newAngles );
//DetachAttachedRagdoll( s_pRagdoll ); // unnecessary since we remove it next?
UTIL_Remove( s_pRagdoll );
pMarine->RemoveEffects( EF_NODRAW );
pMarine->RemoveSolidFlags( FSOLID_NOT_SOLID );
}
else
{
pMarine->InvalidateBoneCache();
pMarine->AddSolidFlags( FSOLID_NOT_SOLID );
CTakeDamageInfo info;
info.SetDamageType( DMG_GENERIC );
info.SetDamageForce( vec3_origin );
info.SetDamagePosition( pMarine->WorldSpaceCenter() );
s_pRagdoll = (CRagdollProp*) CreateServerRagdoll( pMarine, 0, info, COLLISION_GROUP_NONE );
if ( s_pRagdoll )
{
s_pRagdoll->DisableAutoFade();
s_pRagdoll->SetThink( NULL );
s_pRagdoll->SetUnragdoll( pMarine );
}
pMarine->AddEffects( EF_NODRAW );
//pMarine->SetupBones( m_pRagdollBones, BONE_USED_BY_ANYTHING );
}
}
}
示例12: asw_drop_ammo_f
void asw_drop_ammo_f(const CCommand &args)
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (!pPlayer)
return;
CASW_Marine *pMarine = pPlayer->GetMarine();
if (!pMarine)
return;
int iBagSlot = atoi(args[1]);
CASW_Weapon_Ammo_Bag *pBag = dynamic_cast<CASW_Weapon_Ammo_Bag*>(pMarine->GetWeapon(0));
if (pBag)
{
if (pBag->DropAmmoPickup(iBagSlot))
{
return;
}
}
pBag = dynamic_cast<CASW_Weapon_Ammo_Bag*>(pMarine->GetWeapon(1));
if (pBag)
{
if (pBag->DropAmmoPickup(iBagSlot))
{
return;
}
}
}
示例13: SetupMove
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CASW_Prediction::SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper,
CMoveData *move )
{
// Call the default SetupMove code.
BaseClass::SetupMove( player, ucmd, pHelper, move );
CASW_Player *pASWPlayer = static_cast<CASW_Player*>( player );
if ( !asw_allow_detach.GetBool() )
{
if ( pASWPlayer && pASWPlayer->GetMarine() )
{
// this forces horizontal movement
move->m_vecAngles.x = 0;
move->m_vecViewAngles.x = 0;
}
}
CBaseEntity *pMoveParent = player->GetMoveParent();
if (!pMoveParent)
{
move->m_vecAbsViewAngles = move->m_vecViewAngles;
}
else
{
matrix3x4_t viewToParent, viewToWorld;
AngleMatrix( move->m_vecViewAngles, viewToParent );
ConcatTransforms( pMoveParent->EntityToWorldTransform(), viewToParent, viewToWorld );
MatrixAngles( viewToWorld, move->m_vecAbsViewAngles );
}
CASW_MoveData *pASWMove = static_cast<CASW_MoveData*>( move );
pASWMove->m_iForcedAction = ucmd->forced_action;
// setup trace optimization
g_pGameMovement->SetupMovementBounds( move );
}
示例14: asw_alien_batch_f
// creates a batch of aliens at the mouse cursor
void asw_alien_batch_f( const CCommand& args )
{
MDLCACHE_CRITICAL_SECTION();
bool allowPrecache = CBaseEntity::IsPrecacheAllowed();
CBaseEntity::SetAllowPrecache( true );
// find spawn point
CASW_Player* pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (!pPlayer)
return;
CASW_Marine *pMarine = pPlayer->GetMarine();
if (!pMarine)
return;
trace_t tr;
Vector forward;
AngleVectors( pMarine->EyeAngles(), &forward );
UTIL_TraceLine(pMarine->EyePosition(),
pMarine->EyePosition() + forward * 300.0f,MASK_SOLID,
pMarine, COLLISION_GROUP_NONE, &tr );
if ( tr.fraction != 0.0 )
{
// trace to the floor from this spot
Vector vecSrc = tr.endpos;
tr.endpos.z += 12;
UTIL_TraceLine( vecSrc + Vector(0, 0, 12),
vecSrc - Vector( 0, 0, 512 ) ,MASK_SOLID,
pMarine, COLLISION_GROUP_NONE, &tr );
ASWSpawnManager()->SpawnAlienBatch( "asw_parasite", 25, tr.endpos, vec3_angle );
}
CBaseEntity::SetAllowPrecache( allowPrecache );
}
示例15: asw_test_marinenearby_f
void asw_test_marinenearby_f(const CCommand &args)
{
Msg("0.5 as float = %f\n", 0.5f);
Msg("0.5f as int = %d\n", (int) 0.5f);
Msg("0.51f as int = %d\n", (int) 0.51f);
Msg("0.52f as int = %d\n", (int) 0.52f);
Msg("0.6f as int = %d\n", (int) 0.6f);
Msg("0.56f as int = %d\n", (int) 0.56f);
Msg("0.49f as int = %d\n", (int) 0.49f);
Msg("1.99f as int = %d\n", (int) 1.99f);
Msg("2.01f as int = %d\n", (int) 2.01f);
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (!ASWGameRules())
return;
if (!pPlayer || !pPlayer->GetMarine())
return;
if ( args.ArgC() < 4 )
{
Msg("Usage: asw_test_marinenearby [0|1] [grid step] [grid count]\n");
}
int iWide = atoi(args[1]);
float fGridStep = atof(args[2]);
int iGridCount = atoi(args[3]);
//Msg("Wide = %d, step = %f, count = %d\n", iWide, fGridStep, iGridCount);
Vector asw_default_camera_dir_2;
QAngle test_angle(asw_marine_nearby_angle.GetFloat(), 90, 0);
AngleVectors(test_angle, &asw_default_camera_dir_2);
Vector asw_default_camera_offset_2 = asw_default_camera_dir_2 * -405.0f;
for (int x=-iGridCount;x<iGridCount;x++)
{
for (int y=-iGridCount;y<iGridCount*3;y++)
{
Vector pos = pPlayer->GetMarine()->GetAbsOrigin() + Vector(x * fGridStep, y*fGridStep, 10);
//Msg("Testing pos %f, %f, %f\n", pos.x, pos.y, pos.z);
bool bCorpseCanSee = false;
UTIL_ASW_AnyMarineCanSee(pos,
iWide, bCorpseCanSee);
}
}
Vector pos = (pPlayer->GetMarine()->GetAbsOrigin() + asw_default_camera_offset_2);
//NDebugOverlay::Line(pos, pos + asw_default_camera_dir_2 * 410, 0,0,255,true, 30);
}