本文整理汇总了C++中LPCHARACTER::GetDungeon方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetDungeon方法的具体用法?C++ LPCHARACTER::GetDungeon怎么用?C++ LPCHARACTER::GetDungeon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetDungeon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CParty::Update()
{
sys_log(1, "PARTY::Update");
LPCHARACTER l = GetLeaderCharacter();
if (!l)
return;
TMemberMap::iterator it;
int iNearMember = 0;
bool bResendAll = false;
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
LPCHARACTER ch = it->second.pCharacter;
it->second.bNear = false;
if (!ch)
continue;
if (l->GetDungeon())
it->second.bNear = l->GetDungeon() == ch->GetDungeon();
else
it->second.bNear = (DISTANCE_APPROX(l->GetX()-ch->GetX(), l->GetY()-ch->GetY()) < PARTY_DEFAULT_RANGE);
if (it->second.bNear)
{
++iNearMember;
//sys_log(0,"NEAR %s", ch->GetName());
}
}
if (iNearMember <= 1 && !l->GetDungeon())
{
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
it->second.bNear = false;
iNearMember = 0;
}
if (iNearMember != m_iCountNearPartyMember)
{
m_iCountNearPartyMember = iNearMember;
bResendAll = true;
}
m_iLeadership = l->GetLeadershipSkillLevel();
int iNewExpBonus = ComputePartyBonusExpPercent();
m_iAttBonus = ComputePartyBonusAttackGrade();
m_iDefBonus = ComputePartyBonusDefenseGrade();
if (m_iExpBonus != iNewExpBonus)
{
bResendAll = true;
m_iExpBonus = iNewExpBonus;
}
bool bLongTimeExpBonusChanged = false;
// 파티 결성 후 충분한 시간이 지나면 경험치 보너스를 받는다.
if (!m_iLongTimeExpBonus && (get_dword_time() - m_dwPartyStartTime > PARTY_ENOUGH_MINUTE_FOR_EXP_BONUS * 60 * 1000 / (g_iUseLocale?1:2)))
{
bLongTimeExpBonusChanged = true;
m_iLongTimeExpBonus = 5;
bResendAll = true;
}
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
LPCHARACTER ch = it->second.pCharacter;
if (!ch)
continue;
if (bLongTimeExpBonusChanged && ch->GetDesc())
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("파티의 협동력이 높아져 지금부터 추가 경험치 보너스를 받습니다."));
bool bNear = it->second.bNear;
ComputeRolePoint(ch, it->second.bRole, bNear);
if (bNear)
{
if (!bResendAll)
SendPartyInfoOneToAll(ch);
}
}
// PARTY_ROLE_LIMIT_LEVEL_BUG_FIX
m_anMaxRole[PARTY_ROLE_ATTACKER] = m_iLeadership >= 10 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_HASTE] = m_iLeadership >= 20 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_TANKER] = m_iLeadership >= 20 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_BUFFER] = m_iLeadership >= 25 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_SKILL_MASTER] = m_iLeadership >= 35 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_DEFENDER] = m_iLeadership >= 40 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_ATTACKER] += m_iLeadership >= 40 ? 1 : 0;
// END_OF_PARTY_ROLE_LIMIT_LEVEL_BUG_FIX
//.........这里部分代码省略.........
示例2: Update
void CParty::Update()
{
sys_log(1, "PARTY::Update");
LPCHARACTER l = GetLeaderCharacter();
if (!l)
return;
TMemberMap::iterator it;
int iNearMember = 0;
bool bResendAll = false;
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
LPCHARACTER ch = it->second.pCharacter;
it->second.bNear = false;
if (!ch)
continue;
if (l->GetDungeon())
it->second.bNear = l->GetDungeon() == ch->GetDungeon();
else
it->second.bNear = (DISTANCE_APPROX(l->GetX()-ch->GetX(), l->GetY()-ch->GetY()) < PARTY_DEFAULT_RANGE);
if (it->second.bNear)
{
++iNearMember;
//sys_log(0,"NEAR %s", ch->GetName());
}
}
if (iNearMember <= 1 && !l->GetDungeon())
{
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
it->second.bNear = false;
iNearMember = 0;
}
if (iNearMember != m_iCountNearPartyMember)
{
m_iCountNearPartyMember = iNearMember;
bResendAll = true;
}
m_iLeadership = l->GetLeadershipSkillLevel();
int iNewExpBonus = ComputePartyBonusExpPercent();
m_iAttBonus = ComputePartyBonusAttackGrade();
m_iDefBonus = ComputePartyBonusDefenseGrade();
if (m_iExpBonus != iNewExpBonus)
{
bResendAll = true;
m_iExpBonus = iNewExpBonus;
}
bool bLongTimeExpBonusChanged = false;
// ЖДЖј °бјє ИД ГжєРЗС ЅГ°ЈАМ БціЄёй °жЗиДЎ єёіКЅєё¦ №ЮґВґЩ.
if (!m_iLongTimeExpBonus && (get_dword_time() - m_dwPartyStartTime > PARTY_ENOUGH_MINUTE_FOR_EXP_BONUS * 60 * 1000 / (g_iUseLocale?1:2)))
{
bLongTimeExpBonusChanged = true;
m_iLongTimeExpBonus = 5;
bResendAll = true;
}
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
LPCHARACTER ch = it->second.pCharacter;
if (!ch)
continue;
if (bLongTimeExpBonusChanged && ch->GetDesc())
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ЖДЖјАЗ Зщµї·ВАМ іфѕЖБ® Бц±ЭєОЕН ГЯ°Ў °жЗиДЎ єёіКЅєё¦ №ЮЅАґПґЩ."));
bool bNear = it->second.bNear;
ComputeRolePoint(ch, it->second.bRole, bNear);
if (bNear)
{
if (!bResendAll)
SendPartyInfoOneToAll(ch);
}
}
// PARTY_ROLE_LIMIT_LEVEL_BUG_FIX
m_anMaxRole[PARTY_ROLE_ATTACKER] = m_iLeadership >= 10 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_HASTE] = m_iLeadership >= 20 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_TANKER] = m_iLeadership >= 20 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_BUFFER] = m_iLeadership >= 25 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_SKILL_MASTER] = m_iLeadership >= 35 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_DEFENDER] = m_iLeadership >= 40 ? 1 : 0;
m_anMaxRole[PARTY_ROLE_ATTACKER] += m_iLeadership >= 40 ? 1 : 0;
// END_OF_PARTY_ROLE_LIMIT_LEVEL_BUG_FIX
//.........这里部分代码省略.........