Decompiled source of FFU Super v0.5.400

monomod/Assembly-CSharp.FFU_BR_Super.mm.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using FFU_Beyond_Reach;
using Microsoft.CodeAnalysis;
using MonoMod;
using Ostranauts.ShipGUIs.Chargen;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class patch_Interaction : Interaction
{
	private void CalcRate()
	{
		if (base.strActionGroup != "Work" || base.bCTThemModifierCalculated)
		{
			return;
		}
		base.fCTThemModifierUs = 1f;
		if (base.strCTThemMultCondUs != null)
		{
			base.fCTThemModifierUs = (float)((Interaction)this).objUs.GetCondAmount(base.strCTThemMultCondUs);
			if (FFU_BR_Defs.AllowSuperChars && FFU_BR_Defs.SuperCharacters.Length != 0 && FFU_BR_Defs.SuperCharacters.Contains(((Interaction)this).objUs.strName.ToLower()))
			{
				base.fCTThemModifierUs *= FFU_BR_Defs.SuperCharMultiplier;
			}
		}
		base.fCTThemModifierUs = Mathf.Clamp(base.fCTThemModifierUs, 1f, FFU_BR_Defs.ModifyUpperLimit ? FFU_BR_Defs.BonusUpperLimit : 10f);
		base.fCTThemModifierTools = 1f;
		if (base.strCTThemMultCondTools != null)
		{
			base.fCTThemModifierTools = 0f;
			if (base.aLootItemUseContract != null)
			{
				foreach (CondOwner item in base.aLootItemUseContract)
				{
					if ((Object)(object)item != (Object)null && base.strCTThemMultCondTools != null)
					{
						base.fCTThemModifierTools += (float)item.GetCondAmount(base.strCTThemMultCondTools);
					}
				}
			}
		}
		base.fCTThemModifierPenalty = (float)((Interaction)this).objUs.GetCondAmount("StatWorkSpeedPenalty");
		if ((double)base.fCTThemModifierPenalty > 0.99)
		{
			base.fCTThemModifierPenalty = 0.99f;
		}
		base.bCTThemModifierCalculated = true;
	}
}
public class patch_GUIChargenCareer : GUIChargenCareer
{
	private void AddSkillTrait(JsonCareer jc, string strChosen)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)base.bmpDot2).color = Color.white;
		List<string> list = new List<string>(base.coUser.mapConds.Keys);
		base.cgs.AddCareer(jc);
		CareerChosen latestCareer = base.cgs.GetLatestCareer();
		base.cgs.ApplyCareer(base.coUser, latestCareer, true);
		latestCareer.bTermEnded = true;
		latestCareer.aEvents.Add(strChosen);
		double num = 1.0;
		if (strChosen != null && strChosen.IndexOf("-") == 0)
		{
			strChosen = strChosen.Substring(1);
			num = -1.0;
		}
		int num2 = ((!FFU_BR_Defs.NoSkillTraitCost) ? (((GUIChargenCareer)this).GetTraitYears(strChosen) * (int)num) : 0);
		CondRuleThresh changedCRThresh = ((GUIChargenCareer)this).GetChangedCRThresh(0, num2);
		if (changedCRThresh != null && base._promisedAgeLoot.TryGetValue(changedCRThresh.strLootNew, out var value) && value != null)
		{
			foreach (KeyValuePair<string, double> item in value)
			{
				base.coUser.AddCondAmount(item.Key, item.Value, 0.0, 0f);
			}
		}
		base.coUser.bFreezeCondRules = true;
		base.coUser.AddCondAmount("StatAge", (double)num2, 0.0, 0f);
		base.coUser.bFreezeCondRules = false;
		base.coUser.AddCondAmount(strChosen, num, 0.0, 0f);
		foreach (Condition value2 in base.coUser.mapConds.Values)
		{
			if (list.IndexOf(value2.strName) < 0 && latestCareer.aSkillsChosen.IndexOf(value2.strName) < 0 && value2.nDisplaySelf == 2 && value2.strName.IndexOf("Dc") != 0)
			{
				latestCareer.aSkillsChosen.Add(value2.strName);
			}
		}
	}

	private void RebuildMultiSelectSidebar()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Expected O, but got Unknown
		if (base._selectedSkills.Count == 0)
		{
			((GUIChargenCareer)this).UpdateSidebar();
			return;
		}
		foreach (Transform item in base.tfSidebar)
		{
			Transform val = item;
			Object.Destroy((Object)(object)((Component)val).gameObject);
		}
		VerticalLayoutGroup component = ((Component)base.tfSidebar).GetComponent<VerticalLayoutGroup>();
		((HorizontalOrVerticalLayoutGroup)component).spacing = 2f;
		LayoutRebuilder.ForceRebuildLayoutImmediate(((Component)base.tfSidebar).GetComponent<RectTransform>());
		string @string = DataHandler.GetString("GUI_CAREER_SIDEBAR_COST_2", false);
		int num = 0;
		((GUIChargenCareer)this).SpawnSideBarHeader();
		foreach (SkillSelectionDTO selectedSkill in base._selectedSkills)
		{
			int num2 = ((!FFU_BR_Defs.NoSkillTraitCost) ? (((GUIChargenCareer)this).GetTraitYears(selectedSkill.CondName) * selectedSkill.Change) : 0);
			selectedSkill.AgeConds = ((GUIChargenCareer)this).GetAgeRelatedConds(num, num2);
			((GUIChargenCareer)this).SpawnAgeRelatedConds(selectedSkill.AgeConds);
			if (base._dictCheckmarks.TryGetValue(selectedSkill.CondName, out var _))
			{
				((GUIChargenCareer)this).UpdateToggle(selectedSkill.Condition, (double)selectedSkill.Change);
			}
			num += num2;
			GameObject val2 = Object.Instantiate<GameObject>(base.pnlColumnLists, base.tfSidebar);
			GameObject val3 = Object.Instantiate<GameObject>(base.lblLeftTMP, val2.transform);
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("<b>");
			if (selectedSkill.Change < 0)
			{
				stringBuilder.Append("- ");
			}
			else
			{
				stringBuilder.Append("+ ");
			}
			stringBuilder.Append(selectedSkill.Condition.strNameFriendly);
			stringBuilder.AppendLine("</b> ");
			val3.GetComponent<TMP_Text>().text = stringBuilder.ToString();
			GameObject val4 = Object.Instantiate<GameObject>(base.lblLeftTMP, val2.transform);
			stringBuilder = new StringBuilder();
			stringBuilder.Append(num2);
			stringBuilder.AppendLine(@string);
			TMP_Text component2 = val4.GetComponent<TMP_Text>();
			component2.alignment = (TextAlignmentOptions)516;
			component2.text = stringBuilder.ToString();
		}
		Object.Instantiate<GameObject>(base.bmpLine01, base.tfSidebar);
		GameObject val5 = Object.Instantiate<GameObject>(base.lblLeftTMP, base.tfSidebar);
		TMP_Text component3 = val5.GetComponent<TMP_Text>();
		component3.alignment = (TextAlignmentOptions)516;
		component3.text = "<b>Total Cost: </b>" + num + @string;
		((GUIChargenCareer)this).AddApplyClearButtonSection(num);
		((MonoBehaviour)this).StartCoroutine(CrewSim.objInstance.ScrollBottom(base.srSide));
	}
}
namespace FFU_Beyond_Reach
{
	[MonoModIgnore]
	public class FFU_BR_Defs
	{
		public enum SyncLogs
		{
			None,
			ModChanges,
			DeepCopy,
			ModdedDump,
			ExtendedDump,
			ContentDump,
			SourceDump
		}

		public enum ActLogs
		{
			None,
			Interactions,
			Runtime
		}

		public static SyncLogs SyncLogging;

		public static ActLogs ActLogging;

		public static bool DynamicRandomRange;

		public static int MaxLogTextSize;

		public static bool ModSyncLoading;

		public static bool EnableCodeFixes;

		public static bool ModifyUpperLimit;

		public static float BonusUpperLimit;

		public static float SuitOxygenNotify;

		public static float SuitPowerNotify;

		public static bool ShowEachO2Battery;

		public static bool StrictInvSorting;

		public static bool AltTempEnabled;

		public static string AltTempSymbol;

		public static float AltTempMult;

		public static float AltTempShift;

		public static bool TowBraceAllowsKeep;

		public static bool OrgInventoryMode;

		public static float[] OrgInventoryTweaks;

		public static bool BetterInvTransfer;

		public static bool QuickBarPinning;

		public static float[] QuickBarTweaks;

		public static bool NoSkillTraitCost;

		public static bool AllowSuperChars;

		public static float SuperCharMultiplier;

		public static string[] SuperCharacters;
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}