Пример #1
0
    int ComputeScoreForOrgan(SingleTaskManager organ)
    {
        switch (organ.currTask)
        {
        case SingleTaskManager.TaskType.LESS_THAN:
        {
            return(10 - (int)(organ.GetAimPercent() / 10));
        }

        case SingleTaskManager.TaskType.MORE_THAN:
        {
            return((int)(organ.GetAimPercent() / 10));
        }

        case SingleTaskManager.TaskType.SCORE:
        {
            return((int)(organ.GetAimScore() / 20));
        }

        default:
        {
            return(0);
        }
        }
    }
Пример #2
0
    int ComputeClicksNeededFor(SingleTaskManager organ)
    {
        double result = 0.0f;

        if (organ.currTask == SingleTaskManager.TaskType.SCORE)
        {
            result = organ.GetAimScore() / SingleTaskManager.DEFAULT_DELTA;
        }
        else
        {
            float aimPercent  = organ.GetAimPercent();
            float currPercent = organ.health.GetCurrPercent();
            if (organ.currTask == SingleTaskManager.TaskType.MORE_THAN)
            {
                if (currPercent >= aimPercent)
                {
                    return(1);
                }
                result = (aimPercent - currPercent) / MAX_INCREASE_PERCENT_IMPACT;
            }
            else if (organ.currTask == SingleTaskManager.TaskType.LESS_THAN)
            {
                if (aimPercent >= currPercent)
                {
                    return(1);
                }
                result = (currPercent - aimPercent) / MAX_DECREASE_PERCENT_IMPACT;
            }
        }

        result = System.Math.Round(result);

        return((int)result);
    }