Пример #1
0
/*----------------------------------------------------------------------------------------
函数名: CommonCheck
参数:
		None
返回值:
		None
描述:
		进行一些常规的检测:提示音、关机、电量检测、低电处理等
----------------------------------------------------------------------------------------*/
void CommonCheck(void)
{
//	if(g_cntSysTicks == REMINDER_TIME){
//		g_cntSysTicks = REMINDER_TIME + 1;
//		g_bReminderAudio = 0;
//		g_bContinueTick = 1;
//		PlayBegin(PEN_TIMEOUT_AUDIO);
//	}
	if(g_cntSysTicks >= SHUTDOWN_TIME){
		g_bShutDown = 0;
		g_bContinueTick = 0;
		g_nState = SLEEP_STATE;
		g_cntSysTicks = 0;
	}

	if(g_bCheckPower){
		g_bCheckPower = 0;
		PowerCheck();
	}
	if(g_bLowPwrAudio)
	{
		g_bLowPwrAudio = 0;
		PlayBegin(PEN_LOWPWR_AUDIO);
		g_nState = PWRDOWN_STATE;		
	}
//	if(g_cntLowPwrTicks >= LOW_POWER_TIME)		//这个暂时不需要(电压更低)
//	{
//		g_nState = SLEEP_STATE;
//	}
}
Пример #2
0
            void FilterTargets(std::list<WorldObject*>& targets)
            {
                targets.remove_if(PowerCheck(POWER_MANA));
                targets.remove_if(RaidCheck(GetCaster()));

                uint32 const maxTargets = 3;

                if (targets.size() > maxTargets)
                {
                    targets.sort(Trinity::PowerPctOrderPred(POWER_MANA));
                    targets.resize(maxTargets);
                }
            }