float GetChanceDetectFalseFlag()
{
// original code -->
// float rank = GetRankFromPoints(GetScore(GetMainCharacter()));
// return CHANCE_DETECT_FALSE_FLAG_BASE+(CHANCE_DETECT_FALSE_FLAG_MAX-CHANCE_DETECT_FALSE_FLAG_BASE)*rank/MAX_RANK;
// original code <--
// LDH -->
ref mchr = GetMainCharacter(); // KK
float score = GetScore(mchr); // KK
float rank = GetRankFromPoints(score);
int sneak = GetSummonSkillFromName(mchr, SKILL_SNEAK);
int difficulty = GetDifficulty();
float chance = rank/MAX_RANK * (11.0-sneak)/10.0;
chance = chance * difficulty/2.0; // 0.5, 1.0, 1.5, 2.0
// chance = chance * (difficulty+1)/3.0; // alternate difficulty calculation 0.67, 1,0, 1.33, 1.67
chance = retmin(chance,1.0); // so chance doesn't go over 100%
// LogIt("False Flag Detection - Score: " + score + ", rank: " + rank + ", Sneak: " + sneak + ", Chance: " + chance*100.0 + "%"); // for testing
// LogIt("The chance of your false flag being detected is " + chance*100.0 + "%"); // Tell the player, it might get him used to looking for it.
return chance;
// LDH <--
}