本文整理汇总了C++中LPCHARACTER::IsDead方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::IsDead方法的具体用法?C++ LPCHARACTER::IsDead怎么用?C++ LPCHARACTER::IsDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::IsDead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Insert
void CPVPManager::Insert(LPCHARACTER pkChr, LPCHARACTER pkVictim)
{
if (pkChr->IsDead() || pkVictim->IsDead())
return;
CPVP kPVP(pkChr->GetPlayerID(), pkVictim->GetPlayerID());
CPVP * pkPVP;
if ((pkPVP = Find(kPVP.m_dwCRC)))
{
// 복수할 수 있으면 바로 싸움!
if (pkPVP->Agree(pkChr->GetPlayerID()))
{
pkVictim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s님과의 대결 시작!"), pkChr->GetName());
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s님과의 대결 시작!"), pkVictim->GetName());
}
return;
}
pkPVP = M2_NEW CPVP(kPVP);
pkPVP->SetVID(pkChr->GetPlayerID(), pkChr->GetVID());
pkPVP->SetVID(pkVictim->GetPlayerID(), pkVictim->GetVID());
m_map_pkPVP.insert(map<DWORD, CPVP *>::value_type(pkPVP->m_dwCRC, pkPVP));
m_map_pkPVPSetByID[pkChr->GetPlayerID()].insert(pkPVP);
m_map_pkPVPSetByID[pkVictim->GetPlayerID()].insert(pkPVP);
pkPVP->Packet();
char msg[CHAT_MAX_LEN + 1];
snprintf(msg, sizeof(msg), LC_TEXT("%s님이 대결신청을 했습니다. 승낙하려면 대결동의를 하세요."), pkChr->GetName());
pkVictim->ChatPacket(CHAT_TYPE_INFO, msg);
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s에게 대결신청을 했습니다."), pkVictim->GetName());
// NOTIFY_PVP_MESSAGE
LPDESC pkVictimDesc = pkVictim->GetDesc();
if (pkVictimDesc)
{
TPacketGCWhisper pack;
int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1);
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + len;
pack.bType = WHISPER_TYPE_SYSTEM;
strlcpy(pack.szNameFrom, pkChr->GetName(), sizeof(pack.szNameFrom));
TEMP_BUFFER buf;
buf.write(&pack, sizeof(TPacketGCWhisper));
buf.write(msg, len);
pkVictimDesc->Packet(buf.read_peek(), buf.size());
}
// END_OF_NOTIFY_PVP_MESSAGE
}
示例2: battle_is_attackable
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
// 상대방이 죽었으면 중단한다.
if (victim->IsDead())
return false;
// 안전지대면 중단
{
SECTREE *sectree = NULL;
sectree = ch->GetSectree();
if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK))
return false;
sectree = victim->GetSectree();
if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
return false;
}
// 내가 죽었으면 중단한다.
if (ch->IsStun() || ch->IsDead())
return false;
if (ch->IsPC() && victim->IsPC())
{
CGuild* g1 = ch->GetGuild();
CGuild* g2 = victim->GetGuild();
if (g1 && g2)
{
if (g1->UnderWar(g2->GetID()))
return true;
}
}
if (IS_CASTLE_MAP(ch->GetMapIndex()) && false==castle_can_attack(ch, victim))
return false;
if (CArenaManager::instance().CanAttack(ch, victim) == true)
return true;
return CPVPManager::instance().CanAttack(ch, victim);
}
示例3: operator
bool operator () (LPENTITY ent)
{
if (!ent->IsType(ENTITY_CHARACTER))
return false;
LPCHARACTER pkChr = (LPCHARACTER) ent;
if (pkChr->IsBuilding() &&
(pkChr->IsAffectFlag(AFF_BUILDING_CONSTRUCTION_SMALL) ||
pkChr->IsAffectFlag(AFF_BUILDING_CONSTRUCTION_LARGE) ||
pkChr->IsAffectFlag(AFF_BUILDING_UPGRADE)))
{
m_pkChrBuilding = pkChr;
}
if (pkChr->IsNPC())
{
if ( !pkChr->IsMonster() || !m_pkChr->IsAttackMob() || m_pkChr->IsAggressive() )
return false;
}
if (pkChr->IsDead())
return false;
if (pkChr->IsAffectFlag(AFF_EUNHYUNG) ||
pkChr->IsAffectFlag(AFF_INVISIBILITY) ||
pkChr->IsAffectFlag(AFF_REVIVE_INVISIBLE))
return false;
if (pkChr->IsAffectFlag(AFF_TERROR) && m_pkChr->IsImmune(IMMUNE_TERROR) == false ) // 공포 처리
{
if ( pkChr->GetLevel() >= m_pkChr->GetLevel() )
return false;
}
if ( m_pkChr->IsNoAttackShinsu() )
{
if ( pkChr->GetEmpire() == 1 )
return false;
}
if ( m_pkChr->IsNoAttackChunjo() )
{
if ( pkChr->GetEmpire() == 2 )
return false;
}
if ( m_pkChr->IsNoAttackJinno() )
{
if ( pkChr->GetEmpire() == 3 )
return false;
}
int iDistance = DISTANCE_APPROX(m_lx - pkChr->GetX(), m_ly - pkChr->GetY());
if (iDistance < m_iMinDistance && iDistance <= m_iMaxDistance)
{
m_pkChrVictim = pkChr;
m_iMinDistance = iDistance;
}
return true;
}