本文整理汇总了C++中LPCHARACTER::FindAffect方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::FindAffect方法的具体用法?C++ LPCHARACTER::FindAffect怎么用?C++ LPCHARACTER::FindAffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::FindAffect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecMember
void CWarMap::DecMember(LPCHARACTER ch)
{
if (!ch->IsPC())
return;
sys_log(0, "WarMap::DecMember");
DWORD gid = 0;
if (ch->GetGuild())
gid = ch->GetGuild()->GetID();
if (!ch->IsObserverMode())
{
if (gid == m_TeamData[0].dwID)
m_TeamData[0].RemoveMember(ch);
else if (gid == m_TeamData[1].dwID)
m_TeamData[1].RemoveMember(ch);
if (m_kMapInfo.bType == WAR_MAP_TYPE_FLAG)
{
CAffect * pkAff = ch->FindAffect(AFFECT_WAR_FLAG);
if (pkAff)
{
BYTE idx;
if (GetTeamIndex(pkAff->lApplyValue, idx))
AddFlag(idx, ch->GetX(), ch->GetY());
ch->RemoveAffect(AFFECT_WAR_FLAG);
}
}
sys_log(0, "WarMap -m %u(cur:%d, acc:%d) vs %u(cur:%d, acc:%d)",
m_TeamData[0].dwID, m_TeamData[0].GetCurJointerCount(), m_TeamData[0].GetAccumulatedJoinerCount(),
m_TeamData[1].dwID, m_TeamData[1].GetCurJointerCount(), m_TeamData[1].GetAccumulatedJoinerCount());
CheckWarEnd();
ch->SetQuestFlag("war.is_war_member", 0);
}
else
{
--m_iObserverCount;
sys_log(0, "WarMap -o %d", m_iObserverCount);
ch->SetObserverMode(false);
}
UpdateUserCount();
m_set_pkChr.erase(ch);
}
示例2: OnKill
void CWarMap::OnKill(LPCHARACTER killer, LPCHARACTER ch)
{
if (m_bEnded)
return;
DWORD dwKillerGuild = 0;
DWORD dwDeadGuild = 0;
if (killer->GetGuild())
dwKillerGuild = killer->GetGuild()->GetID();
if (ch->GetGuild())
dwDeadGuild = ch->GetGuild()->GetID();
BYTE idx;
sys_log(0, "WarMap::OnKill %u %u", dwKillerGuild, dwDeadGuild);
if (!GetTeamIndex(dwKillerGuild, idx))
return;
if (!GetTeamIndex(dwDeadGuild, idx))
return;
switch (m_kMapInfo.bType)
{
case WAR_MAP_TYPE_NORMAL:
SendGuildWarScore(dwKillerGuild, dwDeadGuild, 1, ch->GetLevel());
break;
case WAR_MAP_TYPE_FLAG:
{
CAffect * pkAff = ch->FindAffect(AFFECT_WAR_FLAG);
if (pkAff)
{
if (GetTeamIndex(pkAff->lApplyValue, idx))
AddFlag(idx, ch->GetX(), ch->GetY());
ch->RemoveAffect(AFFECT_WAR_FLAG);
}
}
break;
default:
sys_err("unknown war map type %u index %d", m_kMapInfo.bType, m_kMapInfo.lMapIndex);
break;
}
}
示例3: Validate
void CHorseNameManager::Validate(LPCHARACTER pChar)
{
CAffect *pkAff = pChar->FindAffect(AFFECT_HORSE_NAME);
if ( pkAff != NULL )
{
if ( pChar->GetQuestFlag("horse_name.valid_till") < get_global_time() )
{
pChar->HorseSummon(false, true);
pChar->RemoveAffect(pkAff);
UpdateHorseName(pChar->GetPlayerID(), "", true);
pChar->HorseSummon(true, true);
}
else
{
++(pkAff->lDuration);
}
}
}
示例4: operator
void operator() (LPCHARACTER ch)
{
if (ch->FindAffect(AFFECT_WAR_FLAG))
ch->RemoveAffect(AFFECT_WAR_FLAG);
}