using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Cpp2IL.Core.Extensions;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using SOD.Common.Extensions;
using UnityEngine;
using UniverseLib;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CitizenImporter")]
[assembly: AssemblyConfiguration("IL2CPP")]
[assembly: AssemblyDescription("An example mod that works on both IL2CPP and Mono game branches")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ed4ce69a58d430953604554204c40d6463720ce1")]
[assembly: AssemblyProduct("CitizenImporter")]
[assembly: AssemblyTitle("CitizenImporter")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace CitizenImporter
{
[BepInPlugin("CitizenImporter", "CitizenImporter", "1.0.0")]
public class CitizenImporterPlugin : BasePlugin
{
private class HumanOverride
{
public int id;
public static int idCounter;
public static Dictionary<int, HumanOverride> createdHumans;
public int gameId = -1;
public string firstName;
public string lastName;
public string casualName;
public string dayOfBirth;
public string monthOfBirth;
public string age;
public string gender;
public string attractedTo;
public string ethnicity1;
public string ethnicity2;
public string height;
public string buildType;
public string hairColour;
public string hairColourExact = "";
public string hairType;
public string eyeColour;
public string[] traits;
public string[] notTraits;
public string partner;
public HumanOverride()
{
id = ++idCounter;
createdHumans[id] = this;
}
public static void ResetIdCounter()
{
idCounter = 1;
createdHumans = new Dictionary<int, HumanOverride>();
}
}
[HarmonyPatch(typeof(CitizenCreator), "Populate")]
public class CitizenCreator_Populate
{
public static void Prefix()
{
PluginLogger.LogInfo((object)"Reloading citizen overrides");
Creator_SetComplete.citizensLoadedFromFile = ReloadCitizensFromFile();
Creator_SetComplete.unusedPartnersCount = 0;
}
}
[HarmonyPatch(typeof(Creator), "SetComplete")]
public class Creator_SetComplete
{
public static bool citizensLoadedFromFile;
public static int unusedPartnersCount;
public static int directSpawnedCitCount;
public static int partnerSpawnedCitCount;
public static void Postfix(Creator __instance)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Expected O, but got Unknown
if (!citizensLoadedFromFile || !(ReflectionExtensions.GetActualType((object)__instance) == typeof(CitizenCreator)))
{
return;
}
ManualLogSource pluginLogger = PluginLogger;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(75, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen overrides applied. ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(loadedHumanOverrides.Aggregate(0, (int total, KeyValuePair<Gender, List<HumanOverride>> tuple) => total + tuple.Value.Count) + unusedPartnersCount);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" overrides were not used (");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(unusedPartnersCount);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" were unused partners)");
}
pluginLogger.LogWarning(val);
TestOverriddenHumans();
Enumerator<Citizen> enumerator = CityData.Instance.citizenDirectory.GetEnumerator();
while (enumerator.MoveNext())
{
Citizen current = enumerator.Current;
if ((Object)(object)((Human)current).partner != (Object)null)
{
partnerSpawnedCitCount++;
}
else if ((Object)(object)((Human)current).home != (Object)null)
{
directSpawnedCitCount++;
}
}
ManualLogSource pluginLogger2 = PluginLogger;
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(23, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(partnerSpawnedCitCount);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" have partners, ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(directSpawnedCitCount);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" do not");
}
pluginLogger2.LogInfo(val2);
}
}
[HarmonyPatch(typeof(Human), "SetSexualityAndGender")]
public class Human_SetSexualityAndGender
{
public static void Postfix(ref Human __instance)
{
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Expected O, but got Unknown
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
if (loadedHumanOverrides.Count <= 0)
{
return;
}
int i;
for (i = 0; i < loadedHumanOverrides[__instance.gender].Count; i++)
{
HumanOverride humanOverride = loadedHumanOverrides[__instance.gender][i];
if (int.TryParse(humanOverride.partner, out var result) && HumanOverride.createdHumans[result].gameId != -1)
{
loadedHumanOverrides[__instance.gender].RemoveAt(i);
Creator_SetComplete.unusedPartnersCount++;
continue;
}
if (HumanOverride.createdHumans.ContainsKey(result) && Enum.TryParse<Gender>(HumanOverride.createdHumans[result].gender, ignoreCase: true, out Gender result2))
{
if (__instance.attractedTo.Contains(result2))
{
__instance.attractedTo.Clear();
__instance.attractedTo.Add(result2);
break;
}
continue;
}
if (Enum.TryParse<Gender>(humanOverride.attractedTo, ignoreCase: true, out Gender result3))
{
if (__instance.attractedTo.Contains(result3))
{
__instance.attractedTo.Clear();
__instance.attractedTo.Add(result3);
break;
}
continue;
}
break;
}
if (i < loadedHumanOverrides[__instance.gender].Count)
{
overridenHumans[__instance.humanID] = (__instance, MiscExtensions.RemoveAndReturn<HumanOverride>(loadedHumanOverrides[__instance.gender], i));
overridenHumans[__instance.humanID].Item2.gameId = __instance.humanID;
if (__instance.attractedTo.Count > 1)
{
__instance.attractedTo.Remove((Gender)2);
}
if (overridenHumans[__instance.humanID].Item2.partner != "")
{
SocialStatistics.Instance.seriousRelationshipsRatio = 1f;
}
else if (overridenHumans[__instance.humanID].Item2.attractedTo == "none")
{
SocialStatistics.Instance.seriousRelationshipsRatio = 0f;
}
ManualLogSource pluginLogger = PluginLogger;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(36, 4, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Setting override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(overridenHumans[__instance.humanID].Item2.firstName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(overridenHumans[__instance.humanID].Item2.lastName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(overridenHumans[__instance.humanID].Item2.id);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") will replace ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(__instance.humanID);
}
pluginLogger.LogInfo(val);
}
}
}
[HarmonyPatch(typeof(Human), "GenerateSuitableGenderAndSexualityForParnter")]
public class Human_GenerateSuitableGenderAndSexualityForParnter
{
public static bool Prefix(Human __instance, Citizen newPartner)
{
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Invalid comparison between Unknown and I4
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Expected I4, but got Unknown
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Expected O, but got Unknown
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
SocialStatistics.Instance.seriousRelationshipsRatio = seriousRelationshipsRatioCache;
if (overridenHumans.ContainsKey(((Human)newPartner).humanID) && int.TryParse(overridenHumans[((Human)newPartner).humanID].Item2.partner, out var partnerHumanId))
{
if (SessionData.Instance.isFloorEdit || CityConstructor.Instance.generateNew)
{
__instance.humanID = Human.assignID;
Human.assignID += 1;
__instance.seed = Toolbox.Instance.SeedRand(0, 999999999).ToString();
}
if (overridenHumans[((Human)newPartner).humanID].Item2.gender != overridenHumans[((Human)newPartner).humanID].Item2.attractedTo)
{
__instance.sexuality = 1f;
__instance.homosexuality = 0f;
}
else
{
__instance.sexuality = 0f;
__instance.homosexuality = 1f;
}
if (__instance.homosexuality > 0.5f)
{
__instance.gender = ((Human)newPartner).gender;
__instance.genderScale = ((Human)newPartner).genderScale;
}
else if ((int)((Human)newPartner).gender == 0)
{
__instance.gender = (Gender)1;
__instance.genderScale = 0f;
}
else
{
__instance.gender = (Gender)0;
__instance.genderScale = 1f;
}
Gender gender = __instance.gender;
Gender val = gender;
switch ((int)val)
{
case 0:
__instance.AddCharacterTrait(SocialStatistics.Instance.maleTrait);
break;
case 1:
__instance.AddCharacterTrait(SocialStatistics.Instance.femaleTrait);
break;
case 2:
__instance.AddCharacterTrait(SocialStatistics.Instance.nbTrait);
break;
}
__instance.SetBirthGender();
int num = -1;
Gender key = __instance.gender;
Gender[] array = (Gender[])(object)new Gender[3]
{
default(Gender),
(Gender)1,
(Gender)2
};
foreach (Gender val2 in array)
{
num = loadedHumanOverrides[val2].FindIndex((HumanOverride ho) => ho.id == partnerHumanId);
key = val2;
if (num > -1)
{
break;
}
}
HumanOverride item = MiscExtensions.RemoveAndReturn<HumanOverride>(loadedHumanOverrides[key], num);
overridenHumans[__instance.humanID] = (__instance, item);
ManualLogSource pluginLogger = PluginLogger;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(53, 5, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Setting override: ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(overridenHumans[__instance.humanID].Item2.firstName);
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(overridenHumans[__instance.humanID].Item2.lastName);
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" (");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(overridenHumans[__instance.humanID].Item2.id);
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(") will replace ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(__instance.humanID);
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" as a partner of ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(((Human)newPartner).humanID);
}
pluginLogger.LogInfo(val3);
return false;
}
return true;
}
}
[HarmonyPatch(typeof(Human), "CalculateAge")]
public class Human_CalculateAge
{
public static void Postfix(Human __instance)
{
if (overridenHumans.ContainsKey(__instance.humanID))
{
HumanOverride item = overridenHumans[__instance.humanID].Item2;
int result = ((int.TryParse(item.dayOfBirth, out result) && result > 0 && result <= 31) ? result : int.Parse(__instance.birthday.Split("/")[0]));
int result2 = ((int.TryParse(item.monthOfBirth, out result2) && result2 > 0 && result2 <= 12) ? result2 : int.Parse(__instance.birthday.Split("/")[1]));
int num = int.Parse(__instance.birthday.Split("/")[2]);
__instance.birthday = result + "/" + result2 + "/" + num;
if (int.TryParse(item.age, out var result3) && __instance.GetAge() != result3)
{
num -= result3 - __instance.GetAge();
__instance.birthday = result + "/" + result2 + "/" + num;
}
}
}
}
public class Descriptors_ConstructorCalls
{
[HarmonyPatch(typeof(Descriptors), "GenerateEthnicity")]
public class Descriptors_ConstructorFirst_GenerateEthnicity
{
private static void Prefix(Descriptors __instance)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
cachedStats_height = SocialStatistics.Instance.heightMinMax;
cachedStates_heightAvg = SocialStatistics.Instance.averageHeight;
if (overridenHumans.ContainsKey(__instance.citizen.humanID))
{
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.height != "" && float.TryParse(item.height, out var result))
{
SocialStatistics.Instance.heightMinMax = new Vector2(result, result);
SocialStatistics.Instance.averageHeight = result;
}
}
}
}
[HarmonyPatch(typeof(Descriptors), "GenerateFacialFeatures")]
public class Descriptors_ConstructorLast_GenerateFacialFeatures
{
private static void Postfix()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
SocialStatistics.Instance.heightMinMax = cachedStats_height;
SocialStatistics.Instance.averageHeight = cachedStates_heightAvg;
}
}
private static Vector2 cachedStats_height;
private static float cachedStates_heightAvg;
private static int cachedStates_menWithBeards;
private static int cachedStates_menWithMoustaches;
private static int cachedStates_glassesRatio;
}
[HarmonyPatch(typeof(Descriptors), "GenerateEthnicity")]
public class Descriptors_GenerateEthnicity
{
private static Dictionary<EthnicGroup, EthnicityStats> ethStats;
public static void Prefix(Descriptors __instance)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Expected O, but got Unknown
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Expected O, but got Unknown
if (ethStats == null)
{
ethStats = new Dictionary<EthnicGroup, EthnicityStats>();
Enumerator<EthnicityStats> enumerator = SocialStatistics.Instance.ethnicityStats.GetEnumerator();
while (enumerator.MoveNext())
{
EthnicityStats current = enumerator.Current;
ethStats.Add(current.group, current);
}
}
if (!overridenHumans.ContainsKey(__instance.citizen.humanID))
{
return;
}
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.ethnicity1 != null && item.ethnicity1 != "")
{
if (item.ethnicity2 == null || item.ethnicity2 == "")
{
item.ethnicity2 = item.ethnicity1;
}
if (!Enum.TryParse<EthnicGroup>(item.ethnicity1, ignoreCase: true, out EthnicGroup result))
{
LogParseFailure(__instance.citizen, item, "ethnicity1");
return;
}
if (!Enum.TryParse<EthnicGroup>(item.ethnicity2, ignoreCase: true, out EthnicGroup result2))
{
LogParseFailure(__instance.citizen, item, "ethnicity2");
return;
}
__instance.ethnicities.Add(new EthnicitySetting
{
group = result,
ratio = 1f,
stats = ethStats[result]
});
__instance.ethnicities.Add(new EthnicitySetting
{
group = result2,
ratio = 1f,
stats = ethStats[result2]
});
}
}
}
[HarmonyPatch(typeof(Descriptors), "GenerateEyes")]
public class Descriptors_GenerateEyes
{
public static void Postfix(Descriptors __instance)
{
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
if (!overridenHumans.ContainsKey(__instance.citizen.humanID))
{
return;
}
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.eyeColour != null && item.eyeColour != "")
{
if (Enum.TryParse<EyeColour>(item.eyeColour, ignoreCase: true, out EyeColour result))
{
__instance.eyeColour = result;
}
else
{
LogParseFailure(__instance.citizen, item, "eyeColour");
}
}
}
}
[HarmonyPatch(typeof(Descriptors), "GenerateNameAndSkinColour")]
public class Descriptors_GenerateNameAndSkinColour
{
public static void Prefix(Descriptors __instance)
{
if (overridenHumans.ContainsKey(__instance.citizen.humanID))
{
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.ethnicity1 != null && item.ethnicity1 != "")
{
__instance.ethnicities.RemoveAt(__instance.ethnicities.Count - 1);
}
}
}
public static void Postfix(Descriptors __instance)
{
if (overridenHumans.ContainsKey(__instance.citizen.humanID))
{
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
__instance.citizen.firstName = ((item.firstName.Length > 0) ? item.firstName : __instance.citizen.firstName);
__instance.citizen.surName = ((item.lastName.Length > 0) ? item.lastName : __instance.citizen.surName);
__instance.citizen.casualName = ((item.casualName.Length > 0) ? item.casualName : __instance.citizen.firstName);
__instance.citizen.citizenName = __instance.citizen.firstName + " " + __instance.citizen.surName;
((Object)((Component)__instance.citizen).gameObject).name = __instance.citizen.citizenName;
((Object)__instance.citizen).name = __instance.citizen.citizenName;
}
}
}
[HarmonyPatch(typeof(Descriptors), "GenerateHair")]
public class Descriptors_GenerateHair
{
public static void Postfix(Descriptors __instance)
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
if (!overridenHumans.ContainsKey(__instance.citizen.humanID))
{
return;
}
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.hairColour != "")
{
if (Enum.TryParse<HairColour>(item.hairColour, ignoreCase: true, out HairColour result))
{
__instance.hairColourCategory = result;
if (item.hairColourExact != "")
{
Color hairColour = default(Color);
if (ColorUtility.TryParseHtmlString(item.hairColourExact, ref hairColour))
{
__instance.hairColour = hairColour;
}
else
{
LogParseFailure(__instance.citizen, item, "exactHairColour");
}
}
else
{
Enumerator<HairSetting> enumerator = SocialStatistics.Instance.hairColourSettings.GetEnumerator();
while (enumerator.MoveNext())
{
HairSetting current = enumerator.Current;
if (current.colour == __instance.hairColourCategory)
{
string seed = __instance.citizen.seed;
__instance.hairColour = Color.Lerp(current.hairColourRange1, current.hairColourRange2, Toolbox.Instance.GetPsuedoRandomNumberContained(0f, 1f, ref seed));
__instance.citizen.seed = seed;
break;
}
}
}
}
else
{
LogParseFailure(__instance.citizen, item, "hairColour");
}
}
if (item.hairType != "")
{
if (Enum.TryParse<HairStyle>(item.hairType, ignoreCase: true, out HairStyle result2))
{
__instance.hairType = result2;
}
else
{
LogParseFailure(__instance.citizen, item, "hairType");
}
}
}
}
[HarmonyPatch(typeof(Descriptors), "GenerateBuild")]
public class Descriptors_GenerateBuild
{
public static void Postfix(Descriptors __instance)
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
if (!overridenHumans.ContainsKey(__instance.citizen.humanID))
{
return;
}
HumanOverride item = overridenHumans[__instance.citizen.humanID].Item2;
if (item.buildType != "")
{
if (Enum.TryParse<BuildType>(item.buildType, ignoreCase: true, out BuildType result))
{
__instance.build = result;
}
else
{
LogParseFailure(__instance.citizen, item, "buildType");
}
}
}
}
[HarmonyPatch(typeof(Human), "GetTraitChance")]
public class Human_GetTraitChance
{
public static bool Prefix(Human __instance, CharacterTrait trait, ref float __result)
{
if (overridenHumans.TryGetValue(__instance.humanID, out var value))
{
if (value.Item2.traits.Contains(((SoCustomComparison)trait).presetName.ToLowerInvariant()))
{
__result = 1f;
return false;
}
if (value.Item2.notTraits.Contains(((SoCustomComparison)trait).presetName.ToLowerInvariant()))
{
__result = 0f;
return false;
}
}
return true;
}
}
public static List<MatchCollection> testMatches = new List<MatchCollection>();
public static ManualLogSource PluginLogger;
private static Dictionary<Gender, List<HumanOverride>> loadedHumanOverrides = new Dictionary<Gender, List<HumanOverride>>
{
{
(Gender)0,
new List<HumanOverride>()
},
{
(Gender)1,
new List<HumanOverride>()
},
{
(Gender)2,
new List<HumanOverride>()
}
};
private static Dictionary<int, (Human, HumanOverride)> overridenHumans = new Dictionary<int, (Human, HumanOverride)>();
public static float seriousRelationshipsRatioCache;
public override void Load()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
PluginLogger = ((BasePlugin)this).Log;
ManualLogSource pluginLogger = PluginLogger;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CitizenImporter");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
}
pluginLogger.LogInfo(val);
Harmony val2 = new Harmony("CitizenImporter");
val2.PatchAll();
ManualLogSource pluginLogger2 = PluginLogger;
val = new BepInExInfoLogInterpolatedStringHandler(19, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CitizenImporter");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is patched!");
}
pluginLogger2.LogInfo(val);
}
private static bool ReloadCitizensFromFile()
{
//IL_041c: Unknown result type (might be due to invalid IL or missing references)
//IL_0462: Unknown result type (might be due to invalid IL or missing references)
seriousRelationshipsRatioCache = SocialStatistics.Instance.seriousRelationshipsRatio;
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "citizens.csv");
if (!File.Exists(path))
{
PluginLogger.LogError((object)"Citizen file not found, no citizen overrides will be loaded. See https://docs.google.com/spreadsheets/d/11OvB572ezm2j-iO2rd89XHInrTNXey83eLdw2VJcujE/edit#gid=1379962932");
return false;
}
string[] array = File.ReadAllLines(path);
loadedHumanOverrides[(Gender)0].Clear();
loadedHumanOverrides[(Gender)1].Clear();
loadedHumanOverrides[(Gender)2].Clear();
HumanOverride.ResetIdCounter();
for (int i = 1; i < array.Length; i++)
{
MatchCollection matchCollection = Regex.Matches(array[i], "(?:^|,)(?=[^\"]|(\")?)\"?((?(1)(?:[^\"]|\"\")*|[^,\"]*))\"?(?=,|$)");
testMatches.Add(matchCollection);
HumanOverride humanOverride = new HumanOverride
{
firstName = matchCollection[0].Groups[2].Value,
lastName = matchCollection[1].Groups[2].Value,
casualName = matchCollection[2].Groups[2].Value,
dayOfBirth = matchCollection[3].Groups[2].Value,
monthOfBirth = matchCollection[4].Groups[2].Value,
age = matchCollection[5].Groups[2].Value,
gender = matchCollection[6].Groups[2].Value,
attractedTo = matchCollection[7].Groups[2].Value,
ethnicity1 = matchCollection[8].Groups[2].Value,
ethnicity2 = matchCollection[9].Groups[2].Value,
height = matchCollection[10].Groups[2].Value,
buildType = matchCollection[11].Groups[2].Value,
hairColour = matchCollection[12].Groups[2].Value,
hairType = matchCollection[13].Groups[2].Value,
eyeColour = matchCollection[14].Groups[2].Value,
traits = (from trait in matchCollection[15].Groups[2].Value.Split(",")
select trait.Trim().ToLowerInvariant() into trait
where trait != ""
select trait).ToArray(),
notTraits = (from trait in matchCollection[16].Groups[2].Value.Split(",")
select trait.Trim().ToLowerInvariant() into trait
where trait != ""
select trait).ToArray(),
partner = matchCollection[17].Groups[2].Value
};
if (humanOverride.traits.Contains("affliction-farsighted") && !humanOverride.notTraits.Contains("affliction-shortsighted"))
{
CollectionExtensions.AddItem<string>((IEnumerable<string>)humanOverride.notTraits, "affliction-shortsighted");
}
if (humanOverride.traits.Contains("affliction-shortsighted") && !humanOverride.notTraits.Contains("affliction-farsighted"))
{
CollectionExtensions.AddItem<string>((IEnumerable<string>)humanOverride.notTraits, "affliction-farsighted");
}
Gender result = (Gender)Random.Range(0, 2);
if (humanOverride.gender.Length != 0 && !Enum.TryParse<Gender>(humanOverride.gender, ignoreCase: true, out result))
{
LogParseFailure(null, humanOverride, "gender");
}
loadedHumanOverrides[result].Add(humanOverride);
}
if (loadedHumanOverrides.Aggregate(0, (int total, KeyValuePair<Gender, List<HumanOverride>> tuple) => total + tuple.Value.Count) == 0)
{
PluginLogger.LogError((object)"Citizen file found, but no citizen overrides loaded. No overrides will be applied.");
return false;
}
return true;
}
public static void DebugPrintHuman(Human human)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Expected O, but got Unknown
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Expected O, but got Unknown
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Expected O, but got Unknown
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
bool flag = default(bool);
PluginLogger.LogInfo(new BepInExInfoLogInterpolatedStringHandler(0, 0, ref flag));
ManualLogSource pluginLogger = PluginLogger;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(6, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Name: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)human).name);
}
pluginLogger.LogInfo(val);
Enumerator<Trait> enumerator = human.characterTraits.GetEnumerator();
while (enumerator.MoveNext())
{
Trait current = enumerator.Current;
ManualLogSource pluginLogger2 = PluginLogger;
val = new BepInExInfoLogInterpolatedStringHandler(8, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\tTrait: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(current.name);
}
pluginLogger2.LogInfo(val);
}
PluginLogger.LogInfo(new BepInExInfoLogInterpolatedStringHandler(0, 0, ref flag));
Enumerator<EthnicitySetting> enumerator2 = human.descriptors.ethnicities.GetEnumerator();
while (enumerator2.MoveNext())
{
EthnicitySetting current2 = enumerator2.Current;
ManualLogSource pluginLogger3 = PluginLogger;
val = new BepInExInfoLogInterpolatedStringHandler(6, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\tEth: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<EthnicGroup>(current2.group);
}
pluginLogger3.LogInfo(val);
}
}
private static void LogParseFailure(Human? human, HumanOverride humanOverride, string field)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
ManualLogSource pluginLogger = PluginLogger;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(42, 4, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Human ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int?>((human != null) ? new int?(human.humanID) : null);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (Override name: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(humanOverride.firstName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(humanOverride.lastName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") failed to parse ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(field);
}
pluginLogger.LogWarning(val);
}
private static void TestOverriddenHumans()
{
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Expected O, but got Unknown
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Expected O, but got Unknown
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Expected O, but got Unknown
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Expected O, but got Unknown
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Expected O, but got Unknown
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02f0: Expected O, but got Unknown
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: Expected O, but got Unknown
//IL_03db: Unknown result type (might be due to invalid IL or missing references)
//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0411: Unknown result type (might be due to invalid IL or missing references)
//IL_0418: Expected O, but got Unknown
//IL_0494: Unknown result type (might be due to invalid IL or missing references)
//IL_049b: Expected O, but got Unknown
//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
//IL_051d: Unknown result type (might be due to invalid IL or missing references)
//IL_0524: Expected O, but got Unknown
//IL_0572: Unknown result type (might be due to invalid IL or missing references)
//IL_0577: Unknown result type (might be due to invalid IL or missing references)
//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: Expected O, but got Unknown
//IL_062a: Unknown result type (might be due to invalid IL or missing references)
//IL_062f: Unknown result type (might be due to invalid IL or missing references)
//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
//IL_065e: Unknown result type (might be due to invalid IL or missing references)
//IL_0665: Expected O, but got Unknown
//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
//IL_06ee: Expected O, but got Unknown
//IL_077e: Unknown result type (might be due to invalid IL or missing references)
//IL_0785: Expected O, but got Unknown
//IL_0833: Unknown result type (might be due to invalid IL or missing references)
//IL_083a: Expected O, but got Unknown
PluginLogger.LogInfo((object)"Checking overrides for inconsistencies...");
bool flag = default(bool);
foreach (KeyValuePair<int, (Human, HumanOverride)> overridenHuman in overridenHumans)
{
Human item = overridenHuman.Value.Item1;
HumanOverride item2 = overridenHuman.Value.Item2;
if (item2.firstName != "" && item.firstName != item2.firstName)
{
ManualLogSource pluginLogger = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(44, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'firstName'");
}
pluginLogger.LogWarning(val);
}
if (item2.lastName != "" && item.surName != item2.lastName)
{
ManualLogSource pluginLogger2 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(42, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'surName'");
}
pluginLogger2.LogWarning(val);
}
if (item2.casualName != "" && item.casualName != item2.casualName)
{
ManualLogSource pluginLogger3 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'casualName'");
}
pluginLogger3.LogWarning(val);
}
if (item2.dayOfBirth != "" && item.birthday.Split("/")[0] != item2.dayOfBirth)
{
ManualLogSource pluginLogger4 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'dayOfBirth'");
}
pluginLogger4.LogWarning(val);
}
if (item2.monthOfBirth != "" && item.birthday.Split("/")[1] != item2.monthOfBirth)
{
ManualLogSource pluginLogger5 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'monthOfBirth'");
}
pluginLogger5.LogWarning(val);
}
if (item2.age != "" && item.GetAge().ToString() != item2.age)
{
ManualLogSource pluginLogger6 = PluginLogger;
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(38, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" doesn't match 'age'");
}
pluginLogger6.LogInfo(val2);
}
Gender gender;
if (item2.gender != "")
{
gender = item.gender;
if (((object)(Gender)(ref gender)).ToString().ToLower() != item2.gender)
{
ManualLogSource pluginLogger7 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'gender'");
}
pluginLogger7.LogWarning(val);
}
}
if ((Object)(object)item.partner != (Object)null && item2.attractedTo != "")
{
string attractedTo = item2.attractedTo;
gender = ((Human)item.partner).gender;
if (!attractedTo.Contains(((object)(Gender)(ref gender)).ToString().ToLower()))
{
ManualLogSource pluginLogger8 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(46, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'attractedTo'");
}
pluginLogger8.LogWarning(val);
}
}
if (item2.height != "" && item.descriptors.heightCM.ToString() != item2.height)
{
ManualLogSource pluginLogger9 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'height'");
}
pluginLogger9.LogWarning(val);
}
if (item2.buildType != "")
{
BuildType build = item.descriptors.build;
if (((object)(BuildType)(ref build)).ToString() != item2.buildType)
{
ManualLogSource pluginLogger10 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(44, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'buildType'");
}
pluginLogger10.LogWarning(val);
}
}
if (item2.hairColour != "")
{
HairColour hairColourCategory = item.descriptors.hairColourCategory;
if (((object)(HairColour)(ref hairColourCategory)).ToString() != item2.hairColour)
{
ManualLogSource pluginLogger11 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(48, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'hairColour' (");
BepInExWarningLogInterpolatedStringHandler obj = val;
hairColourCategory = item.descriptors.hairColourCategory;
((BepInExLogInterpolatedStringHandler)obj).AppendFormatted<string>(((object)(HairColour)(ref hairColourCategory)).ToString());
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
}
pluginLogger11.LogWarning(val);
}
}
if (item2.hairType != "")
{
HairStyle hairType = item.descriptors.hairType;
if (((object)(HairStyle)(ref hairType)).ToString() != item2.hairType)
{
ManualLogSource pluginLogger12 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(43, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'hairType'");
}
pluginLogger12.LogWarning(val);
}
}
if (item2.eyeColour != "")
{
EyeColour eyeColour = item.descriptors.eyeColour;
if (((object)(EyeColour)(ref eyeColour)).ToString() != item2.eyeColour)
{
ManualLogSource pluginLogger13 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(44, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" doesn't match 'eyeColour'");
}
pluginLogger13.LogWarning(val);
}
}
string[] traits = item2.traits;
foreach (string overrideTrait in traits)
{
if (EnumerableExtensions.Where<Trait>(item.characterTraits, (Func<Trait, bool>)((Trait trait) => ((SoCustomComparison)trait.trait).presetName.ToLowerInvariant() == overrideTrait)).Count() != 1)
{
ManualLogSource pluginLogger14 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(42, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" missing required trait ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(overrideTrait);
}
pluginLogger14.LogWarning(val);
}
}
string[] notTraits = item2.notTraits;
foreach (string overrideNotTrait in notTraits)
{
if (EnumerableExtensions.Where<Trait>(item.characterTraits, (Func<Trait, bool>)((Trait trait) => ((SoCustomComparison)trait.trait).presetName.ToLowerInvariant() == overrideNotTrait)).Count() != 0)
{
ManualLogSource pluginLogger15 = PluginLogger;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Citizen override: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.citizenName);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" has banned trait ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(overrideNotTrait);
}
pluginLogger15.LogWarning(val);
}
}
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "CitizenImporter";
public const string PLUGIN_NAME = "CitizenImporter";
public const string PLUGIN_VERSION = "1.0.0";
}
}