public static float RecruitDifficulty(this Pawn pawn, Faction recruiterFaction, bool withPopIntent) { float num = pawn.kindDef.baseRecruitDifficulty; Rand.PushState(); Rand.Seed = pawn.HashOffset(); num += Rand.Range(-0.2f, 0.2f); Rand.PopState(); if (pawn.Faction != null) { int num2 = Mathf.Abs((int)(pawn.Faction.def.techLevel - recruiterFaction.def.techLevel)); num += (float)num2 * 0.15f; } if (withPopIntent) { float popIntent = (Current.ProgramState != ProgramState.Playing) ? 1f : Find.Storyteller.intenderPopulation.PopulationIntent; num = PawnUtility.PopIntentAdjustedRecruitDifficulty(num, popIntent); } return(Mathf.Clamp(num, 0.33f, 0.99f)); }
private static string <PopIntentRecruitDifficulty> m__5(float d, float pi) { return(PawnUtility.PopIntentAdjustedRecruitDifficulty(d, pi).ToStringPercent()); }
public static void PopIntentRecruitDifficulty() { List <float> list = new List <float>(); for (float num = -1f; num < 3f; num += 0.1f) { list.Add(num); } List <float> colValues = new List <float> { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 0.95f, 0.99f }; DebugTables.MakeTablesDialog <float, float>(colValues, (float d) => "d=" + d.ToString("F0"), list, (float rv) => rv.ToString("F1"), (float d, float pi) => PawnUtility.PopIntentAdjustedRecruitDifficulty(d, pi).ToStringPercent(), "intents"); }
public static void DoTable_PopIntentRecruitDifficulty() { List <float> list = new List <float>(); for (float num = -1f; num < 3.0; num = (float)(num + 0.10000000149011612)) { list.Add(num); } List <float> list2 = new List <float>(); list2.Add(0.1f); list2.Add(0.2f); list2.Add(0.3f); list2.Add(0.4f); list2.Add(0.5f); list2.Add(0.6f); list2.Add(0.7f); list2.Add(0.8f); list2.Add(0.9f); list2.Add(0.95f); list2.Add(0.99f); List <float> colValues = list2; DebugTables.MakeTablesDialog(colValues, (float d) => "d=" + d.ToString("F0"), list, (float rv) => rv.ToString("F1"), (float d, float pi) => PawnUtility.PopIntentAdjustedRecruitDifficulty(d, pi).ToStringPercent(), "intents"); }