How junior partner inheritance really works(Hint: it is not a dice roll)

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Showing developer posts only. Show all posts in this thread.
ha! That is odd and interesting. Clearly the goal was to generate a random number, which really makes me wonder why they didn’t just generate a random number.
you also want to know the result consistently over time.
 
C++:
int CCountry::CalcMonarchDeathOutcome() const
{
    int nOutcome = GetCurrentMonarch()->GetID().GetID() + _Tag.GetIndex() + CCurrentGameState::AccessInstance()->GetCurrentDate().GetYear();

    if ( _pCurrentHeir->IsValid() )
    {
        nOutcome += _pCurrentHeir->GetID().GetID();
    }

    if ( CCurrentGameState::AccessInstance()->AccessEmpire().GetElectors().GetSize() > 0 )
    {
        nOutcome += CCurrentGameState::AccessInstance()->AccessEmpire().GetEmperor().GetCountry().GetCurrentMonarch()->GetID().GetID();
    }

    const CPapacy* pPapacy = _pReligion->GetPapacy();
    if ( pPapacy )
    {
        nOutcome += pPapacy->GetInstanceData().GetCuriaController().GetIndex();
    }

    nOutcome += _OwnedProvinces.GetSize();
    nOutcome += _nCapital;

    for ( auto pRuler : _PreviousMonarchs )
    {
        nOutcome += pRuler->GetID().GetID();
    }

    nOutcome = nOutcome % 100;

    return nOutcome;
}