本文整理汇总了C++中CCharacter::Buy方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::Buy方法的具体用法?C++ CCharacter::Buy怎么用?C++ CCharacter::Buy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::Buy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
void CNinja::Tick()
{
CCharacter *pOwner = GameServer()->GetPlayerChar(m_Owner);
if(!pOwner)
{
Reset();
return;
}
if(!m_Visible)
return;
char aBuf[128];
int Click = pOwner->MouseEvent(m_Pos);
if(!Click)
{
m_LastClick = 0;
return;
}
switch(m_Type)
{
case 1:
pOwner->Buy("Ninja permanent", &pOwner->GetPlayer()->m_AccData.m_NinjaPermanent, g_Config.m_EuNinjaPermanent, Click, 1);
break;
case 2:
pOwner->Buy("Ninja at start", &pOwner->GetPlayer()->m_AccData.m_NinjaStart, g_Config.m_EuNinjaStart, Click, 1);
break;
case 3:
pOwner->Buy("Ninja switch", &pOwner->GetPlayer()->m_AccData.m_NinjaSwitch, g_Config.m_EuNinjaSwitch, Click, 1);
break;
}
}
示例2: Tick
void CNoSelfDMG::Tick()
{
CCharacter *pOwner = GameServer()->GetPlayerChar(m_Owner);
if(!pOwner)
{
Reset();
return;
}
if(!m_Visible)
return;
char aBuf[128];
int Click = pOwner->MouseEvent(m_Pos);
if(!Click)
{
m_LastClick = 0;
return;
}
pOwner->Buy("No self damage", &pOwner->GetPlayer()->m_AccData.m_NoSelfDMG, g_Config.m_EuNoSelfDMG, Click, 1);
}
示例3: Tick
void CBuyHealth::Tick()
{
for(int i = 0; i < MAX_CLIENTS; i++)
{
CCharacter *pUser = GameServer()->GetPlayerChar(i);
if(!pUser)
continue;
int Click = pUser->MouseEvent(m_Pos-vec2(50,50));
int Click1 = pUser->MouseEvent(m_Pos-vec2(-50,50));
if(!Click && !Click1)
{
//m_LastClick = 0;
continue;
}
pUser->Buy("Health", &pUser->GetPlayer()->m_AccData.m_Health, g_Config.m_EuHealth, Click, 500);
pUser->Buy("Armor", &pUser->GetPlayer()->m_AccData.m_Armor, g_Config.m_EuArmor, Click1, 500);
}
}
示例4: Tick
void CFastReload::Tick()
{
CCharacter *pOwner = GameServer()->GetPlayerChar(m_Owner);
if(!pOwner)
{
Reset();
return;
}
if(!m_Visible)
return;
char aBuf[128];
int Click = pOwner->MouseEvent(m_Pos);
if(!Click)
{
m_LastClick = 0;
return;
}
pOwner->Buy("Fast reload", &pOwner->GetPlayer()->m_AccData.m_FastReload, g_Config.m_EuFastReload, Click, 10);
}
示例5: Tick
void CHealthRegen::Tick()
{
CCharacter *pOwner = GameServer()->GetPlayerChar(m_Owner);
if(!pOwner)
{
Reset();
return;
}
if(!m_Visible)
return;
char aBuf[128];
int Click = pOwner->MouseEvent(m_Pos);
if(!Click)
{
m_LastClick = 0;
return;
}
pOwner->Buy("Health regeneration", &pOwner->GetPlayer()->m_AccData.m_HealthRegen, g_Config.m_EuHealthRegen, Click, 25);
}