本文整理汇总了C++中CASW_Marine_Resource::GetProfile方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::GetProfile方法的具体用法?C++ CASW_Marine_Resource::GetProfile怎么用?C++ CASW_Marine_Resource::GetProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::GetProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Spawn
void CJaS_Marine_Jack::Spawn()
{
CASW_Marine_Resource *pResource = dynamic_cast<CASW_Marine_Resource *>( CreateEntityByName( "asw_marine_resource" ) );
pResource->SetProfileIndex( 6 );
pResource->SetMarineEntity( this );
SetMarineResource( pResource );
pResource->Spawn();
m_pProfileOverride = pResource->GetProfile();
SelectModelFromProfile();
SetModelFromProfile();
CBaseCombatWeapon *pWeapon = dynamic_cast<CBaseCombatWeapon *>( CreateEntityByName( "asw_weapon_sniper_rifle" ) );
if ( pWeapon )
{
pWeapon->Spawn();
pWeapon->GiveDefaultAmmo();
pWeapon->m_iClip1 = 9999;
GiveAmmo(9999, pWeapon->GetPrimaryAmmoType());
Weapon_Equip_In_Index( pWeapon, 0 );
Weapon_Switch( pWeapon );
}
m_bConstantSlowHeal = true;
m_hSquadFormation = static_cast<CASW_SquadFormation *>( CreateEntityByName( "asw_squadformation" ) );
m_hSquadFormation->Leader( this );
SetRenderColor( 0x99, 0x40, 0x40 );
BaseClass::Spawn();
}
示例2: asw_marine_skill_f
void asw_marine_skill_f(const CCommand &args)
{
CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient());
if (!ASWGameRules())
return;
if (!pPlayer)
return;
CASW_Game_Resource* pGameResource = ASWGameResource();
if (!pGameResource)
return;
CASW_Marine_Profile *pProfile = NULL;
CASW_Marine *pMarine = pPlayer->GetMarine();
if (pMarine)
{
pProfile = pMarine->GetMarineProfile();
}
else
{
// find the first marine info that belongs to us
for (int i=0;i<pGameResource->GetMaxMarineResources();i++)
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource(i);
if (pMR && pMR->GetCommander() == pPlayer)
{
pProfile = pMR->GetProfile();
break;
}
}
}
if ( !pProfile )
return;
if ( args.ArgC() < 2 )
{
Msg("Usage: asw_marine_skill [SkillSlot] - reports the number of skill points of the current marine in that skill\n asw_marine_skill [SkillSlot] [x] - sets that skill to the specified number of skill points (0-5)\n");
Msg("SkillSlot goes from 0 to 4 for your skills, slot 5 is spare skill points.\n");
return;
}
int nSkillSlot = atoi(args[1]);
if ( nSkillSlot < 0 || nSkillSlot >= ASW_NUM_SKILL_SLOTS )
{
Msg("nSkillSlot out of bounds\n");
return;
}
if ( args.ArgC() < 3 )
{
int iSkillPoints = ASWGameResource()->GetMarineSkill( pProfile->m_ProfileIndex, nSkillSlot );
Msg( "Marine skill[%d] is %s = %d\n", nSkillSlot, SkillToString( pProfile->GetSkillMapping( nSkillSlot ) ), iSkillPoints );
}
else
{
int iNewPoints = atoi(args[2]);
ASWGameResource()->SetMarineSkill( pProfile->m_ProfileIndex, nSkillSlot, iNewPoints );
int iSkillPoints = ASWGameResource()->GetMarineSkill( pProfile->m_ProfileIndex, nSkillSlot );
Msg( "Marine skill[%d] is now %s = %d\n", nSkillSlot, SkillToString( pProfile->GetSkillMapping( nSkillSlot ) ), iSkillPoints );
}
}