本文整理汇总了C++中LPCHARACTER::GetY方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetY方法的具体用法?C++ LPCHARACTER::GetY怎么用?C++ LPCHARACTER::GetY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HealParty
void CParty::HealParty()
{
// XXX DELETEME 클라이언트 완료될때까지
{
return;
}
if (!m_bPartyHealReady)
return;
TMemberMap::iterator it;
LPCHARACTER l = GetLeaderCharacter();
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
if (!it->second.pCharacter)
continue;
LPCHARACTER ch = it->second.pCharacter;
if (DISTANCE_APPROX(l->GetX()-ch->GetX(), l->GetY()-ch->GetY()) < PARTY_DEFAULT_RANGE)
{
ch->PointChange(POINT_HP, ch->GetMaxHP()-ch->GetHP());
ch->PointChange(POINT_SP, ch->GetMaxSP()-ch->GetSP());
}
}
m_bPartyHealReady = false;
m_dwPartyHealTime = get_dword_time();
}
示例2: CharLog
void LogManager::CharLog(LPCHARACTER ch, DWORD dw, const char * c_pszText, const char * c_pszHint)
{
if (ch)
CharLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), dw, c_pszText, c_pszHint, ch->GetDesc() ? ch->GetDesc()->GetHostName() : "");
else
CharLog(0, 0, 0, dw, c_pszText, c_pszHint, "");
}
示例3: operator
void operator () (LPENTITY ent)
{
if (ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = (LPCHARACTER) ent;
if (ch->IsMonster())
{
return;
}
if (sx <= ch->GetX() && ch->GetX() <= ex
&& sy <= ch->GetY() && ch->GetY() <= ey)
{
bIn = true;
}
}
}
示例4: 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);
}
示例5: IsPositionNearLeader
bool CParty::IsPositionNearLeader(LPCHARACTER ch)
{
if (!m_pkChrLeader)
return false;
if (DISTANCE_APPROX(ch->GetX() - m_pkChrLeader->GetX(), ch->GetY() - m_pkChrLeader->GetY()) >= PARTY_DEFAULT_RANGE)
return false;
return true;
}
示例6:
FuncFindMobVictim(LPCHARACTER pkChr, int iMaxDistance) :
m_pkChr(pkChr),
m_iMinDistance(~(1L << 31)),
m_iMaxDistance(iMaxDistance),
m_lx(pkChr->GetX()),
m_ly(pkChr->GetY()),
m_pkChrVictim(NULL),
m_pkChrBuilding(NULL)
{
};
示例7: DistanceValid
bool CItem::DistanceValid(LPCHARACTER ch)
{
if (!GetSectree())
return false;
int iDist = DISTANCE_APPROX(GetX() - ch->GetX(), GetY() - ch->GetY());
if (iDist > 300)
return false;
return true;
}
示例8: 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);
}
示例9: ItemLog
void LogManager::ItemLog(LPCHARACTER ch, LPITEM item, const char * c_pszText, const char * c_pszHint)
{
if (NULL == ch || NULL == item)
{
sys_err("character or item nil (ch %p item %p text %s)", get_pointer(ch), get_pointer(item), c_pszText);
return;
}
ItemLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), item->GetID(),
NULL == c_pszText ? "" : c_pszText,
c_pszHint, ch->GetDesc() ? ch->GetDesc()->GetHostName() : "",
item->GetOriginalVnum());
}
示例10: Buy
// 아이템 구입
void CShopManager::Buy(LPCHARACTER ch, BYTE pos)
{
if (!ch->GetShop())
return;
if (!ch->GetShopOwner())
return;
if (DISTANCE_APPROX(ch->GetX() - ch->GetShopOwner()->GetX(), ch->GetY() - ch->GetShopOwner()->GetY()) > 2000)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상점과의 거리가 너무 멀어 물건을 살 수 없습니다."));
return;
}
CShop* pkShop = ch->GetShop();
if (!pkShop->IsPCShop())
{
//if (pkShop->GetVnum() == 0)
// return;
//const CMob* pkMob = CMobManager::instance().Get(pkShop->GetNPCVnum());
//if (!pkMob)
// return;
//if (pkMob->m_table.bType != CHAR_TYPE_NPC)
//{
// return;
//}
}
else
{
}
//PREVENT_ITEM_COPY
ch->SetMyShopTime();
//END_PREVENT_ITEM_COPY
int ret = pkShop->Buy(ch, pos);
if (SHOP_SUBHEADER_GC_OK != ret) // 문제가 있었으면 보낸다.
{
TPacketGCShop pack;
pack.header = HEADER_GC_SHOP;
pack.subheader = ret;
pack.size = sizeof(TPacketGCShop);
ch->GetDesc()->Packet(&pack, sizeof(pack));
}
}
示例11: 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;
}
}
示例12: StartShopping
// 상점 거래를 시작
bool CShopManager::StartShopping(LPCHARACTER pkChr, LPCHARACTER pkChrShopKeeper, int iShopVnum)
{
if (pkChr->GetShopOwner() == pkChrShopKeeper)
return false;
// this method is only for NPC
if (pkChrShopKeeper->IsPC())
return false;
//PREVENT_TRADE_WINDOW
if (pkChr->IsOpenSafebox() || pkChr->GetExchange() || pkChr->GetMyShop() || pkChr->IsCubeOpen())
{
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열린상태에서는 상점거래를 할수 가 없습니다."));
return false;
}
//END_PREVENT_TRADE_WINDOW
long distance = DISTANCE_APPROX(pkChr->GetX() - pkChrShopKeeper->GetX(), pkChr->GetY() - pkChrShopKeeper->GetY());
if (distance >= SHOP_MAX_DISTANCE)
{
sys_log(1, "SHOP: TOO_FAR: %s distance %d", pkChr->GetName(), distance);
return false;
}
LPSHOP pkShop;
if (iShopVnum)
pkShop = Get(iShopVnum);
else
pkShop = GetByNPCVnum(pkChrShopKeeper->GetRaceNum());
if (!pkShop)
{
sys_log(1, "SHOP: NO SHOP");
return false;
}
bool bOtherEmpire = false;
if (pkChr->GetEmpire() != pkChrShopKeeper->GetEmpire())
bOtherEmpire = true;
pkShop->AddGuest(pkChr, pkChrShopKeeper->GetVID(), bOtherEmpire);
pkChr->SetShopOwner(pkChrShopKeeper);
sys_log(0, "SHOP: START: %s", pkChr->GetName());
return true;
}
示例13: GetNextOwnership
LPCHARACTER CParty::GetNextOwnership(LPCHARACTER ch, long x, long y)
{
if (m_itNextOwner == m_memberMap.end())
return ch;
int size = m_memberMap.size();
while (size-- > 0)
{
LPCHARACTER pkMember = m_itNextOwner->second.pCharacter;
if (pkMember && DISTANCE_APPROX(pkMember->GetX() - x, pkMember->GetY() - y) < 3000)
{
IncreaseOwnership();
return pkMember;
}
IncreaseOwnership();
}
return ch;
}
示例14: PutData
void CLand::PutData(const TLand * data)
{
memcpy(&m_data, data, sizeof(TLand));
if (m_data.dwGuildID)
{
const TMapRegion * r = SECTREE_MANAGER::instance().GetMapRegion(m_data.lMapIndex);
if (r)
{
CharacterVectorInteractor i;
if (CHARACTER_MANAGER::instance().GetCharactersByRaceNum(20040, i))
{
CharacterVectorInteractor::iterator it = i.begin();
while (it != i.end())
{
LPCHARACTER ch = *(it++);
if (ch->GetMapIndex() != m_data.lMapIndex)
continue;
int x = ch->GetX() - r->sx;
int y = ch->GetY() - r->sy;
if (x > m_data.x + m_data.width || x < m_data.x)
continue;
if (y > m_data.y + m_data.height || y < m_data.y)
continue;
M2_DESTROY_CHARACTER(ch);
}
}
}
}
}
示例15: battle_melee_attack
int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim)
{
if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
if (!victim || ch == victim)
return BATTLE_NONE;
if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
if (!battle_is_attackable(ch, victim))
return BATTLE_NONE;
if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName());
// °Её® ГјЕ©
int distance = DISTANCE_APPROX(ch->GetX() - victim->GetX(), ch->GetY() - victim->GetY());
if (!victim->IsBuilding())
{
int max = 300;
if (false == ch->IsPC())
{
// ёуЅєЕНАЗ °жїм ёуЅєЕН °ш°Э °Её®ё¦ »зїл
max = (int) (ch->GetMobAttackRange() * 1.15f);
}
else
{
// PCАП °жїм »уґл°Ў melee ёчАП °жїм ёчАЗ °ш°Э °Её®°Ў ГЦґл °ш°Э °Её®
if (false == victim->IsPC() && BATTLE_TYPE_MELEE == victim->GetMobBattleType())
max = MAX(300, (int) (victim->GetMobAttackRange() * 1.15f));
}
if (distance > max)
{
if (test_server)
sys_log(0, "VICTIM_FAR: %s distance: %d max: %d", ch->GetName(), distance, max);
return BATTLE_NONE;
}
}
if (timed_event_cancel(ch))
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("АьЕх°Ў ЅГАЫ µЗѕо ГлјТ µЗѕъЅАґПґЩ."));
if (timed_event_cancel(victim))
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("АьЕх°Ў ЅГАЫ µЗѕо ГлјТ µЗѕъЅАґПґЩ."));
ch->SetPosition(POS_FIGHTING);
ch->SetVictim(victim);
const PIXEL_POSITION & vpos = victim->GetXYZ();
ch->SetRotationToXY(vpos.x, vpos.y);
int dam;
int ret = battle_hit(ch, victim, dam);
return (ret);
}