Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void NounPlanet::updateAllegiance( dword nTick )
- {
- // other factors can affect allegiance levels, so we calculate the XP required here
- m_nAllegianceXPRequired = 1 << ( allegiance() + 2 );
- m_nAllegianceXPRequired *= ALLEGIANCE_XP_MOD;
- if ( nTick < m_nAllegianceTick )
- return;
- m_nAllegianceTick = nTick + ALLEGIANCE_UPDATE;
- // only increase allegiance if we're at 90% control or more
- // and if we're not already at max allegiance
- if ( ( ( control() * 1.1 ) > maxControl() ) && maxAllegiance() > allegiance() )
- {
- m_nAllegianceXP += ALLEGIANCE_UPDATE;
- if ( m_nAllegianceXP >= m_nAllegianceXPRequired )
- {
- // we may have more than the required XP to level the planet, put that back into the pool
- m_nAllegianceXP = m_nAllegianceXP - m_nAllegianceXPRequired;
- m_nAllegiance++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment