Decompiled source of RuModROR2 v0.1.0

RuModROR2/RuModROR2.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HG;
using On.RoR2;
using On.RoR2.Skills;
using R2API;
using RoR2;
using RoR2.Skills;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("RuModROR2")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RuModROR2")]
[assembly: AssemblyTitle("RuModROR2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.example.rumodror2", "RuModROR2", "1.0.0")]
public class RuModROR2 : BaseUnityPlugin
{
	public void Awake()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		SkillCatalog.Init += new hook_Init(ChangeSkillDef);
		SurvivorCatalog.Init += new hook_Init(ChangeSurvivorDef);
		ItemCatalog.Init += new hook_Init(ChangeItemDef);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Translation tokens registered.");
	}

	private void ChangeItemDef(orig_Init orig)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke();
		Enumerator<ItemDef> enumerator = ItemCatalog.allItemDefs.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				ItemDef current = enumerator.Current;
				if (current.nameToken.Contains("JAVANGLE_MYST_MAGICITE_"))
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)("\n\nitem.nameToken -- " + current.nameToken + "\nitem.loreToken -- " + current.loreToken + "\nitem.pickupToken -- " + current.pickupToken + "\nitem.descriptionToken -- " + current.descriptionToken));
				}
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
	}

	private void ChangeSurvivorDef(orig_Init orig)
	{
		orig.Invoke();
		foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
		{
			if (allSurvivorDef.descriptionToken != null)
			{
				string descriptionToken = allSurvivorDef.descriptionToken;
				string text = descriptionToken;
				if (text != null && text.Contains("Void Reaver is a funny purple crab. <style=cSub>\r\n\r\n < ! > The number of bullets fired with Void Darts increases or decreases based on your attack speed, while the duration of the attack remains the same.\r\n\r\n < ! > Void Reaver excels at mid-ranged combat. Keep enemies at bay with Capture's bombs and their natural debuff.\r\n\r\n < ! > Veil will break enemy line-of-sight, so use it to your advantage when trying to get out of a bad situation.\r\n\r\n < ! > When you're surrounded by enemies, use Reave and then quickly use Veil to regenerate some of your lost health and escape the chaos."))
				{
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_DESCRIPTION", allSurvivorDef.descriptionToken);
					allSurvivorDef.descriptionToken = "LUAFUBUKI_VOIDREAVER_DESCRIPTION";
				}
			}
			if (allSurvivorDef.displayNameToken != null)
			{
				string displayNameToken = allSurvivorDef.displayNameToken;
				string text2 = displayNameToken;
				if (text2 != null && text2.Contains("Void Reaver"))
				{
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_NAME", allSurvivorDef.displayNameToken);
					allSurvivorDef.displayNameToken = "LUAFUBUKI_VOIDREAVER_NAME";
				}
			}
		}
	}

	private void ChangeSkillDef(orig_Init orig)
	{
		orig.Invoke();
		foreach (SkillDef allSkillDef in SkillCatalog.allSkillDefs)
		{
			if (allSkillDef.keywordTokens != null)
			{
				for (int i = 0; i < allSkillDef.keywordTokens.Length; i++)
				{
					switch (allSkillDef.keywordTokens[i])
					{
					case "<style=cKeywordName>Symbiotic</style><style=cSub>Gain <style=cIsDamage>attack speed</style> and <style=cIsUtility>move speed</style> for each stock missing. Additional stocks are converted into missing stock.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_SYMBIOTIC_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_SYMBIOTIC_SKILLDEF";
						break;
					case "<style=cKeywordName>Agile</style><style=cSub>The skill can be used while sprinting.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_AGILE_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_AGILE_SKILLDEF";
						break;
					case "<style=cKeywordName>Symbiotic Slash</style><style=cSub><style=cIsUtility>Stunning</style>. When your <color=#9B3737>Symbiotic</color> weapon is available hit for an additional strike dealing <style=cIsDamage>200% damage</style>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_SYMBIOTIC_SLASH_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_SYMBIOTIC_SLASH_SKILLDEF";
						break;
					case "<style=cKeywordName>Insatiable</style><style=cSub>Attacks <style=cIsHealth>bleed</style> and grant <color=#9B3737>Needles</color>. <style=cIsHealing>Healing</style> is converted into <style=cIsHealing>Barrier</style>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_INSATIABLE_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_INSATIABLE_SKILLDEF";
						break;
					case "<style=cKeywordName>Needles</style><style=cSub>Gain <color=#9B3737>Needles</color> by picking up your <color=#9B3737>Symbiotic</color> weapons or hitting enemies during <color=#9B3737>Insatiable</color>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_NEEDLES_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_NEEDLES_SKILLDEF";
						break;
					case "<style=cKeywordName>Details</style><style=cSub>Gain <style=cIsDamage>0,04 base damage</style> per <style=cIsHealth>1 missing health</style>. Heal up to <style=cIsHealing>2,5%</style> of your <style=cIsHealth>missing health</style> on hit.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_DETAILS_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_DETAILS_SKILLDEF";
						break;
					case "<style=cKeywordName>Insatiable</style><style=cSub>Attacks <style=cIsHealth>bleed </style>and grant <color=#9B3737>Needles</color>. <style=cIsHealing>Healing</style> is converted into <style=cIsHealing>Barrier</style>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_INSATIABLE__SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_INSATIABLE__SKILLDEF";
						break;
					case "<style=cKeywordName>Crush</style><style=cSub>Deal bonus damage to an enemy based on their velocity and <style=cIsHealth>max health</style>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_CRUSH_SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_CRUSH_SKILLDEF";
						break;
					case "<style=cKeywordName>Symbiotic Slash</style><style=cSub><style=cIsUtility>Stunning</style>. When your<color=#9B3737> Symbiotic</color> weapon is available hit for an additional strike dealing <style=cIsDamage>200% damage</style>.</style>":
						LanguageAPI.Add("KENKO_SEAMSTRESS_SYMBIOTIC_SLASH__SKILLDEF", allSkillDef.keywordTokens[i]);
						allSkillDef.keywordTokens[i] = "KENKO_SEAMSTRESS_SYMBIOTIC_SLASH__SKILLDEF";
						break;
					}
				}
			}
			if (allSkillDef.skillDescriptionToken != null)
			{
				string skillDescriptionToken = allSkillDef.skillDescriptionToken;
				string text = skillDescriptionToken;
				if (text != null)
				{
					if (text.Contains("Fire 3 void pearls in quick succession that hit twice for <style=cIsDamage>2x") && text.Contains("% damage</style>. <style=cIsUtility>Number of pearls increases</style> with <style=cIsUtility>attack speed</style>."))
					{
						LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_PRIMARY_DESCRIPTION", allSkillDef.skillDescriptionToken);
						allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_PRIMARY_DESCRIPTION";
					}
					else
					{
						string text2 = text;
						if (text2.Contains("Fire 5 void pearls in a line that hit twice for <style=cIsDamage>2x") && text2.Contains("% damage</style>."))
						{
							LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_ALT_PRIMARY_DESCRIPTION", allSkillDef.skillDescriptionToken);
							allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_ALT_PRIMARY_DESCRIPTION";
						}
						else
						{
							string text3 = text;
							if (text3.Contains("Temporarily slip into the void, becoming <style=cIsUtility>intangible</style> and recovering <style=cIsHealing>10% health</style>."))
							{
								LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_UTILITY_DESCRIPTION", allSkillDef.skillDescriptionToken);
								allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_UTILITY_DESCRIPTION";
							}
							else
							{
								string text4 = text;
								if (text4.Contains("Fade away, becoming <style=cIsUtility>intangible</style> for 1.5 seconds and gaining <style=cIsUtility>130% movement speed</style>. <style=cIsHealing>Heal for "))
								{
									LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SECOND_UTILITY_DESCRIPTION", allSkillDef.skillDescriptionToken);
									allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_SECOND_UTILITY_DESCRIPTION";
								}
								else
								{
									string text5 = text;
									if (text5.Contains("Summon a cluster of bombs that deal <style=cIsDamage>") && text5.Contains("% damage</style>. 3 consecutive hits will <style=cIsUtility>nullify</style> subjects. <style=cIsUtility>Attack Speed</style> will <style=cIsUtility>increase number of bombs</style> and <style=cIsUtility>slightly increase placement radius</style>."))
									{
										LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SECONDARY_DESCRIPTION", allSkillDef.skillDescriptionToken);
										allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_SECONDARY_DESCRIPTION";
									}
									else
									{
										string text6 = text;
										if (text6.Contains("Sacrifice <style=cIsHealth>") && text6.Contains("% of your health</style>, and deal <style=cIsDamage>") && text6.Contains("% damage in a blast</style> to any nearby test subjects."))
										{
											LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SPECIAL_DESCRIPTION", allSkillDef.skillDescriptionToken);
											allSkillDef.skillDescriptionToken = "LUAFUBUKI_VOIDREAVER_VOID_SPECIAL_DESCRIPTION";
										}
									}
								}
							}
						}
					}
				}
			}
			if (allSkillDef.skillNameToken != null)
			{
				switch (allSkillDef.skillNameToken)
				{
				case "Void Impulse":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_PRIMARY_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_PRIMARY_NAME";
					break;
				case "Void Sweep":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_ALT_PRIMARY_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_ALT_PRIMARY_NAME";
					break;
				case "Undertow":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SECONDARY_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_SECONDARY_NAME";
					break;
				case "Dive":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_UTILITY_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_UTILITY_NAME";
					break;
				case "Shadowfade":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SECOND_UTILITY_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_SECOND_UTILITY_NAME";
					break;
				case "Reave":
					LanguageAPI.Add("LUAFUBUKI_VOIDREAVER_VOID_SPECIAL_NAME", allSkillDef.skillNameToken);
					allSkillDef.skillNameToken = "LUAFUBUKI_VOIDREAVER_VOID_SPECIAL_NAME";
					break;
				}
			}
		}
	}
}