本文整理汇总了C++中CUser::GetSex方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::GetSex方法的具体用法?C++ CUser::GetSex怎么用?C++ CUser::GetSex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::GetSex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPropose
void CCoupleHelper::OnPropose( CUser* pUser, const char* szPlayer )
{
election::OutputDebugString( "S: CCoupleHelper.OnPropose: %s", szPlayer );
u_long idPlayer = CPlayerDataCenter::GetInstance()->GetPlayerId( const_cast<char*>( szPlayer ) );
if( idPlayer == 0 )
{
pUser->AddDefinedText( TID_GAME_COUPLE_E00, "%s", szPlayer ); //%s님을 찾을 수 없습니다.
return;
}
CUser* pTarget = static_cast<CUser*>( prj.GetUserByID( idPlayer ) );
if( !IsValidObj( pTarget ) )
{
pUser->AddDefinedText( TID_GAME_COUPLE_E00 ); //%s님을 찾을 수 없습니다.
return;
}
if( pUser == pTarget )
{
pUser->AddDefinedText( TID_GAME_COUPLE_E01 ); // 대상이 부적합 합니다. 커플이 아닌 이성 캐릭터에게만 가능합니다.
return;
}
if( pUser->GetSex() == pTarget->GetSex() )
{
pUser->AddDefinedText( TID_GAME_COUPLE_E01 ); // 대상이 부적합 합니다. 커플이 아닌 이성 캐릭터에게만 가능합니다.
return;
}
m_pdpClient->SendPropose( pUser->m_idPlayer, pTarget->m_idPlayer );
}
示例2: __EndQuest
//int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition = TRUE )
int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition )
{
int nNum;
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( pQuestProp )
{
CUser* pUser = prj.GetUser( nPcId );
if( IsEndQuestCondition )
{
if( __IsEndQuestCondition( pUser, nQuestId ) == 0 )
return FALSE;
}
// 보상 아이템 갯수 만큼, 인벤토리 여유가 있는가?
int nItemNum = 0;
for( int i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
}
}
if( nItemNum > pUser->m_Inventory.GetEmptyCount() )
{
pUser->AddDefinedText( TID_QUEST_NOINVENTORYSPACE ); // 인벤토리 공간이 없어서 퀘스트를 완료할 수 없습니다.
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_EXIT;
pUser->AddRunScriptFunc( rsf );
return FALSE;
}
////////////////////////////
// 보상 지급
////////////////////////////
for( i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
if( pEndRewardItem->m_nItemIdx )
{
int nItemNum = pEndRewardItem->m_nItemNum;
#ifdef __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption, pEndRewardItem->m_byFlag );
#else // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption );
#endif // __CHIPI_QUESTITEM_FLAG
#else // __JEFF_11
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum );
#endif // __JEFF_11
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
int nItemNum = pEndRewardItem->m_nItemNum;
#ifdef __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption, pEndRewardItem->m_byFlag );
#else // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption );
//.........这里部分代码省略.........