コード例 #1
0
void instance_violet_hold::SetPortalId()
{
    if (IsCurrentPortalForTrash())
    {
        int iTemp = rand()%(m_uiMaxCountPortalLoc - 1);

        if (iTemp >= m_uiPortalId)
            ++iTemp;

        debug_log("SD2: instance_violet_hold: SetPortalId %i, old was id %u.", iTemp, m_uiPortalId);

        m_uiPortalId = iTemp;
    }
    else
    {
        debug_log("SD2: instance_violet_hold: SetPortalId %u (is boss), old was id %u.", m_uiMaxCountPortalLoc, m_uiPortalId);
        m_uiPortalId = m_uiMaxCountPortalLoc;
    }
}
コード例 #2
0
void instance_violet_hold::SetPortalId()
{
    if (IsCurrentPortalForTrash())
    {
        // Find another Trash portal position
        uint8 uiTemp = m_uiPortalId + urand(1, m_uiMaxCountPortalLoc - 1);
        // Decrease m_uiMaxCountPortalLoc so that the center position is skipped
        uiTemp %= m_uiMaxCountPortalLoc - 1;

        debug_log("SD2: instance_violet_hold: SetPortalId %u, old was id %u.", uiTemp, m_uiPortalId);

        m_uiPortalId = uiTemp;
    }
    else if (GetCurrentPortalNumber() == 18)
    {
        debug_log("SD2: instance_violet_hold: SetPortalId %u (Cyanigosa), old was id %u.", 0, m_uiPortalId);
        m_uiPortalId = 0;
    }
    else
    {
        debug_log("SD2: instance_violet_hold: SetPortalId %u (is boss), old was id %u.", m_uiMaxCountPortalLoc, m_uiPortalId);
        m_uiPortalId = m_uiMaxCountPortalLoc;
    }
}