当前位置: 首页>>代码示例>>C++>>正文


C++ CCharacter::Buy方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Bloodwork28,项目名称:teeworlds-uTown,代码行数:35,代码来源:ninja.cpp

示例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);
		
}
开发者ID:Bloodwork28,项目名称:teeworlds-uTown,代码行数:25,代码来源:noselfdmg.cpp

示例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);
	}
}
开发者ID:Bloodwork28,项目名称:teeworlds-uTown,代码行数:22,代码来源:health.cpp

示例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);
}
开发者ID:Bloodwork28,项目名称:teeworlds-uTown,代码行数:24,代码来源:fastreload.cpp

示例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);
}
开发者ID:Bloodwork28,项目名称:teeworlds-uTown,代码行数:24,代码来源:healthregen.cpp


注:本文中的CCharacter::Buy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。