Created
December 24, 2015 01:04
-
-
Save hawksprite/1ac89d35c717bfd7c915 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float PI = (m_oNext.m_oPersonalInfluence.GetCurrentValue() * 25.0f) / 100.0f; | |
float opinionOfPlayer = ((GetOpinionOfCharacter(ECHAR_ID_COREY) + 5.0f) * 100.0f) / 10.0f; | |
// Gather some formal authority values | |
float formalAuthority = 0.0f; | |
float yourFormalAuthority = 0.0f; | |
float formalRespect = 0.0f; | |
for (int k = 0; k < (int)m_pkoMeeting->GetCharacters().size(); k++) | |
{ | |
CCharacter &roLookedCharacter = *m_pkoMeeting->GetCharacters()[k]; | |
if (ECHAR_ID_COREY == roLookedCharacter.GetId()) | |
{ | |
formalAuthority = roLookedCharacter.GetCurrentFormalAuthority().GetCurrentValue(); | |
} | |
if (GetId() == roLookedCharacter.GetId()) { | |
yourFormalAuthority = roLookedCharacter.GetCurrentFormalAuthority().GetCurrentValue(); | |
formalRespect = roLookedCharacter.GetRespectForAuthority().GetCurrentValue(); | |
} | |
} | |
formalAuthority = (((yourFormalAuthority - formalAuthority) * formalRespect) / 25.0f) * 100.0f; | |
float averageRoomTensionPercentage = 0.0f; | |
float averageRoomCount = 0.0f; | |
for (int k = 0; k < (int)m_pkoMeeting->GetCharacters().size(); k++) | |
{ | |
CCharacter &roLookedCharacter = *m_pkoMeeting->GetCharacters()[k]; | |
if (ECHAR_ID_COREY != roLookedCharacter.GetId()) // && GetId() != roLookedCharacter.GetId() | |
{ | |
averageRoomCount += 1.0f; | |
float x = roLookedCharacter.GetCurrentTension().GetCurrentValue(); | |
averageRoomTensionPercentage += (50.0f + (((7.0f - abs(2.0f - x)) - (x + 5.0f) / 4.0f) * 10.0f)); | |
} | |
} | |
float leadershipPotential = PI + opinionOfPlayer + formalAuthority + averageRoomTensionPercentage; | |
// 304 seems to be the apparant max, so this converts the range from 0 to 100 | |
leadershipPotential = (leadershipPotential) / 400.0f; | |
if (leadershipPotential > 100) { | |
leadershipPotential = 100.0f; | |
} | |
if (leadershipPotential < 0) { | |
leadershipPotential = 0.0f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment