Пример #1
0
void GuideManager::nextStep(int step)
{
    CCLOG("step = %d",step);

    const StepInfo& stepInfo = m_vecStep.at(step);
    
    if (getWait())
    {
        return;
    }
    
    if (isLimit(stepInfo))
    {
        return;
    }
    
    m_guideLayer->removeFromParent();
    getParent()->addChild(m_guideLayer, GUIDE_LAYER_ZORDER);
    
    if (stepInfo.getNextStepId() == END)
    {
        endGuide();
        return;
    }
    else if (stepInfo.getNextStepId() == WAIT)
    {
        setWait(true);
    }
    else if (stepInfo.getNextStepId() == SLEEP)
    {
        getGuideLayer()->sleep();
    }
    else if (stepInfo.getNextStepId() == WAKE)
    {
        getGuideLayer()->wake();
    }
    
    
    // by order
    checkDialog(stepInfo);
    checkRect(stepInfo);
    checkTalk(stepInfo);
    checkHand(stepInfo);
    checkEvent(stepInfo);
    
    setNextStepId(step + 1);
}
Пример #2
0
float Personality::determineEmotion()
{
	int count = 0;
	if(checkHunger())
	{
		count++;
	}
	if(checkThirst())
	{
		count++;
	}
	if(checkBladder())
	{
		count++;
	}
	if(checkTired())
	{
		count++;
	}
	if(checkFear())
	{
		count++;
	}
	if(checkBoredom())
	{
		count++;
	}
	if(checkTalk())
	{
		count++;
	}
	if(checkToxication())
	{
		count++;
	}

	HVDynamics.Ment.Emotion = count * 10;
	return HVDynamics.Ment.Emotion;
}