using System;
using System.Collections;
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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.BeetleQueenMonster;
using EntityStates.ClayBruiser.Weapon;
using EntityStates.GoldGat;
using EntityStates.Gup;
using EntityStates.ImpBossMonster;
using EntityStates.LunarWisp;
using EntityStates.Missions.Arena.NullWard;
using EntityStates.NullifierMonster;
using EntityStates.QuestVolatileBattery;
using EntityStates.ShrineHalcyonite;
using EntityStates.VagrantMonster;
using EntityStates.VagrantNovaItem;
using HG;
using IL.RoR2;
using IL.RoR2.Artifacts;
using IL.RoR2.Items;
using IL.RoR2.Orbs;
using IL.RoR2.Projectile;
using IL.RoR2.Skills;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MoreStats;
using On.EntityStates.CaptainSupplyDrop;
using On.EntityStates.ClayBruiser.Weapon;
using On.EntityStates.Gup;
using On.EntityStates.LunarWisp;
using On.EntityStates.Missions.Arena.NullWard;
using On.EntityStates.NullifierMonster;
using On.EntityStates.QuestVolatileBattery;
using On.EntityStates.ShrineHalcyonite;
using On.EntityStates.VagrantMonster;
using On.EntityStates.VagrantNovaItem;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Orbs;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RainrotSharedUtils.Difficulties;
using RainrotSharedUtils.Shelters;
using RiskierRain.Changes;
using RiskierRain.Changes.Components;
using RiskierRain.Components;
using RiskierRain.CoreModules;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Items;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using SwanSongExtended.Modules;
using SwanSongExtended.Storms;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("RiskierRain")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RiskierRain")]
[assembly: AssemblyTitle("RiskierRain")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace RiskierRain
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.RiskOfBrainrot.RiskierRain", "RiskierRain", "1.3.38")]
[R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "DirectorAPI", "ItemAPI", "RecalculateStatsAPI", "EliteAPI" })]
internal class RiskierRainPlugin : BaseUnityPlugin
{
public static int sacrificeDropCount = 12;
public static int sacrificeDropCountRestricted = 5;
public static float sacrificeDropRate = 8f;
public static float sacrificeDropRateLimited = 20f;
public static int sonorousDropCountBase = 4;
public static int sonorousDropCountStack = 2;
public static int sonorousDropCountRestrictedBase = 5;
public static int sonorousDropCountRestrictedStack = 1;
public static float sonorousDropRateBase = 5f;
public static float sonorousDropRateStack = 5f;
public static float sonorousDropRateLimited = 20f;
private static int serverSacrificeDropTally = 0;
private static int serverSonorousDropTally = 0;
public static int minSpikes = 3;
public static int maxSpikes = 4;
public static int baseSpikesPerBuff = 2;
public static int stackSpikesPerBuff = 1;
public static float minDamageCoefficient = 5f;
public static float releaseSpeed = 2f;
public static float spikeDamageCoefficient = 0.3f;
public static float spikeProcCoefficient = 1f;
public static int shatterspleenBleedChance = 20;
public static GameObject impBleedSpikePrefab;
public const string guid = "com.RiskOfBrainrot.RiskierRain";
public const string teamName = "RiskOfBrainrot";
public const string modName = "RiskierRain";
public const string version = "1.3.38";
public static bool isAELoaded = Tools.isLoaded("com.Borbo.ArtificerExtended");
public static bool isHBULoaded = Tools.isLoaded("com.Borbo.HuntressBuffULTIMATE");
public static bool isScepterLoaded = Tools.isLoaded("com.DestroyedClone.AncientScepter");
public static bool autosprintLoaded = Tools.isLoaded("com.johnedwa.RTAutoSprintEx");
public static bool acridLungeLoaded = Tools.isLoaded("Withor.AcridBiteLunge");
public static bool ucrLoaded = Tools.isLoaded("HIFU.UltimateCustomRun");
public static string drizzleDesc = "Simplifies difficulty for players new to the game. Weeping and gnashing is replaced by laughter and tickles. \n>Difficulty Scaling: \n>Player Damage Reduction: ";
public static string rainstormDesc = "This is the way the game is meant to be played! Test your abilities and skills against formidable foes. \n>Difficulty Scaling: ";
public static GameObject meatballNapalmPool;
public static PluginInfo PInfo { get; private set; }
public static string dropPrefabsPath => Assets.dropPrefabsPath;
public static string iconsPath => Assets.iconsPath;
public static string eliteMaterialsPath => Assets.eliteMaterialsPath;
internal static ConfigFile CustomConfigFile { get; set; }
public static ConfigEntry EnableConfig { get; set; }
public static void DoSacrificeDropLimit()
{
//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
SacrificeArtifactManager.OnServerCharacterDeath += new Manipulator(DropLimitForSacrifice);
GlobalEventManager.OnCharacterDeath += new Manipulator(DropLimitForSonorous);
Stage.onServerStageBegin += ResetServerDropCount;
LanguageAPI.Add("ITEM_ITEMDROPCHANCEONKILL_DESC", "On killing a large monster, it will drop an item. " + $"Elite monsters have a chance of " + $"dropping an item .");
}
public static int GetDropCountForSacrifice()
{
if (!Object.op_Implicit((Object)(object)Run.instance))
{
return 0;
}
if (UsingRestrictedSacrifice())
{
return sacrificeDropCountRestricted * Run.instance.participatingPlayerCount;
}
return sacrificeDropCount * Run.instance.participatingPlayerCount;
}
public static int GetDropCountForSonorous()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Run.instance))
{
return 0;
}
int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.ItemDropChanceOnKill.itemIndex, false, true);
if (UsingRestrictedSacrifice())
{
return sonorousDropCountRestrictedBase + sonorousDropCountRestrictedStack * (itemCountForTeam - 1);
}
return sonorousDropCountBase + sonorousDropCountStack * (itemCountForTeam - 1);
}
internal static bool UsingRestrictedSacrifice()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Invalid comparison between Unknown and I4
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Invalid comparison between Unknown and I4
return (int)Stage.instance.sceneDef.sceneType == 2 || (int)Stage.instance.sceneDef.sceneType == 5;
}
private static void ResetServerDropCount(Stage obj)
{
serverSacrificeDropTally = 0;
serverSonorousDropTally = 0;
}
private static void DropLimitForSacrifice(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
FixSacrificeDropChance(val);
val.Index = 0;
AddSacrificeDropTally(val);
}
private static void FixSacrificeDropChance(ILCursor c)
{
float num = default(float);
if (!c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "GetExpAdjustedDropChancePercent")
}) || !c.TryGotoPrev((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
}))
{
DebugBreakpoint("FixSacrificeDropChance");
return;
}
c.EmitDelegate>((Func)((float _) => (serverSacrificeDropTally >= GetDropCountForSacrifice() && !Util.CheckRoll(sacrificeDropRateLimited, 0f, (CharacterMaster)null)) ? 0f : sacrificeDropRate));
}
private static void AddSacrificeDropTally(ILCursor c)
{
if (!c.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet")
}))
{
DebugBreakpoint("AddSacrificeDropTally");
return;
}
c.EmitDelegate((Action)delegate
{
serverSacrificeDropTally++;
});
}
private static void DropLimitForSonorous(ILContext il)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
ILLabel val2 = val.DefineLabel();
int masterLoc = 17;
int itemCountLoc = 102;
if (!val.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Items", "ItemDropChanceOnKill")
}) || !val.TryGotoPrev((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref masterLoc)
}) || !val.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective")
}))
{
DebugBreakpoint("DropLimitForSonorous", 1);
return;
}
SonorousUseTeamItemCount(val, masterLoc);
if (!val.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref itemCountLoc)
}))
{
DebugBreakpoint("DropLimitForSonorous", 2);
return;
}
val2 = val.MarkLabel();
FixSonorousDropChance(val, itemCountLoc, masterLoc);
val.GotoLabel(val2, (MoveType)1, false);
AddSonorousDropTally(val, itemCountLoc);
}
private static void SonorousUseTeamItemCount(ILCursor c, int masterLoc)
{
DoTheRoar();
if (!c.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective")
}))
{
DebugBreakpoint("SonorousUseTeamItemCount");
}
else
{
DoTheRoar();
}
void DoTheRoar()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Ldloc, masterLoc);
c.EmitDelegate>((Func)((int oldItemCount, CharacterMaster master) => Util.GetItemCountForTeam(master.teamIndex, Items.ItemDropChanceOnKill.itemIndex, true, true)));
}
}
private static void FixSonorousDropChance(ILCursor c, int itemCountLoc, int masterLoc)
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
if (!c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_isElite")
}) || !c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, itemCountLoc)
}) || !c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, masterLoc)
}))
{
DebugBreakpoint("FixSonorousDropChance");
return;
}
c.Emit(OpCodes.Ldloc, itemCountLoc);
c.EmitDelegate>((Func)((float chanceIn, int stack) => (serverSonorousDropTally >= GetDropCountForSacrifice() && !Util.CheckRoll(sonorousDropRateLimited, 0f, (CharacterMaster)null)) ? 0f : (sonorousDropRateBase + sonorousDropRateStack * (float)(stack - 1))));
}
private static void AddSonorousDropTally(ILCursor c, int itemCountLoc)
{
if (!c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_isElite")
}) || !c.TryGotoNext((MoveType)0, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, itemCountLoc)
}) || !c.TryGotoNext((MoveType)2, new Func[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet")
}))
{
DebugBreakpoint("AddSonorousDropTally");
return;
}
c.EmitDelegate((Action)delegate
{
serverSonorousDropTally++;
});
}
private void ReworkShatterspleen()
{
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Expected O, but got Unknown
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Expected O, but got Unknown
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Expected O, but got Unknown
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Expected O, but got Unknown
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Expected O, but got Unknown
impBleedSpikePrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/projectiles/ImpVoidspikeProjectile"), "ShatterspleenBleedSpike", true);
ProjectileController component = impBleedSpikePrefab.GetComponent();
component.procCoefficient = 1f;
ProjectileImpactExplosion component2 = impBleedSpikePrefab.GetComponent();
((ProjectileExplosion)component2).blastRadius = 4f;
Rigidbody component3 = impBleedSpikePrefab.GetComponent();
component3.useGravity = true;
AntiGravityForce val = impBleedSpikePrefab.AddComponent();
val.antiGravityCoefficient = -1f;
val.rb = component3;
ProjectileDirectionalTargetFinder val2 = impBleedSpikePrefab.AddComponent();
((Behaviour)val2).enabled = true;
val2.lookRange = 50f;
val2.lookCone = 10f;
ProjectileSteerTowardTarget val3 = impBleedSpikePrefab.AddComponent();
val3.yAxisOnly = false;
val3.rotationSpeed = 50f;
Assets.projectilePrefabs.Add(impBleedSpikePrefab);
GlobalEventManager.ProcessHitEnemy += new Manipulator(RevokeShatterspleenBleedRights);
GlobalEventManager.OnCharacterDeath += new Manipulator(RevokeShatterspleenDeathRights);
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RemoveShatterspleenCrit);
CharacterBody.RecalculateStats += new hook_RecalculateStats(ShatterspleenBleedChance);
GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(NewShatterspleenFunctionality);
CharacterBody.RemoveBuff_BuffIndex += new hook_RemoveBuff_BuffIndex(FireShatterspleenBleedSpike);
LanguageAPI.Add("ITEM_BLEEDONHITANDEXPLODE_PICKUP", "Massive hits charge a volley of bleed spikes.");
LanguageAPI.Add("ITEM_BLEEDONHITANDEXPLODE_DESC", $"Gain {shatterspleenBleedChance}% bleed chance. " + "Hits that deal also " + $"charge {minSpikes}-{maxSpikes} volleys of " + $"{baseSpikesPerBuff} void spikes (+{stackSpikesPerBuff} per stack). " + $"These spikes release {releaseSpeed} seconds at a time, " + "dealing " + Tools.ConvertDecimal(spikeDamageCoefficient) + " BASE damage and bleeding enemies hit for " + Tools.ConvertDecimal(2.4f * spikeProcCoefficient) + " base damage.");
}
private void ShatterspleenBleedChance(orig_RecalculateStats orig, CharacterBody self)
{
orig.Invoke(self);
Inventory inventory = self.inventory;
if (inventory != null && inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
{
self.bleedChance += (float)shatterspleenBleedChance;
}
}
private void RemoveShatterspleenCrit(CharacterBody sender, StatHookEventArgs args)
{
if (Object.op_Implicit((Object)(object)sender.inventory))
{
Inventory inventory = sender.inventory;
if (inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
{
args.critAdd -= 5f;
}
}
}
private void FireShatterspleenBleedSpike(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
if (buffType == Assets.shatterspleenSpikeBuff.buffIndex)
{
int itemCountEffective = self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode);
if (itemCountEffective > 0)
{
Util.PlaySound(FireVoidspikes.attackSoundString, ((Component)self).gameObject);
EffectManager.SimpleMuzzleFlash(FireVoidspikes.swipeEffectPrefab, ((Component)self).gameObject, "Head", false);
Ray val = default(Ray);
((Ray)(ref val))..ctor(self.inputBank.aimOrigin, self.inputBank.aimDirection);
int num = baseSpikesPerBuff + stackSpikesPerBuff * (itemCountEffective - 1);
Debug.Log((object)num);
for (int i = 0; i < num; i++)
{
float num2 = 0f;
float num3 = FireVoidspikes.projectileSpeed * 0.3f * (float)(i + 1);
Vector3 val2 = Util.ApplySpread(((Ray)(ref val)).direction, 0f, 0f, 1f, 1f, num2, 0f);
ProjectileManager.instance.FireProjectile(impBleedSpikePrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(val2), ((Component)self).gameObject, self.damage * spikeDamageCoefficient, 0f, Util.CheckRoll(self.crit, self.master), (DamageColorIndex)0, (GameObject)null, num3, (DamageTypeCombo?)null);
}
}
}
orig.Invoke(self, buffType);
}
private void NewShatterspleenFunctionality(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
{
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.procCoefficient > 0f && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)5))
{
CharacterBody component = damageInfo.attacker.GetComponent();
CharacterBody component2 = victim.GetComponent();
if (Object.op_Implicit((Object)(object)component))
{
int num = 0;
Inventory inventory = component.inventory;
if (Object.op_Implicit((Object)(object)inventory))
{
num = inventory.GetItemCountEffective(Items.BleedOnHitAndExplode);
if ((Object)(object)component2 != (Object)null && num > 0)
{
int num2 = Random.Range(minSpikes, maxSpikes + 1);
int buffCount = component.GetBuffCount(Assets.shatterspleenSpikeBuff);
if (damageInfo.damage / component.damage >= minDamageCoefficient && num2 > buffCount)
{
((ProcChainMask)(ref damageInfo.procChainMask)).AddProc((ProcType)5);
for (int i = buffCount; i < num2; i++)
{
component.AddTimedBuffAuthority(Assets.shatterspleenSpikeBuff.buffIndex, releaseSpeed * (float)(i + 1));
}
}
}
}
}
}
orig.Invoke(self, damageInfo, victim);
}
private void RevokeShatterspleenBleedRights(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective")
});
val.Emit(OpCodes.Ldc_I4, 0);
val.Emit(OpCodes.Mul);
}
private void RevokeShatterspleenDeathRights(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective")
});
val.Emit(OpCodes.Ldc_I4, 0);
val.Emit(OpCodes.Mul);
}
private bool IsCategoryEnabled(bool category)
{
return category;
}
private void Awake()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
PInfo = ((BaseUnityPlugin)this).Info;
InitializeCoreModules();
InitializeConfig();
InitializeEverything();
CharacterBody.RemoveBuff_BuffDef += new hook_RemoveBuff_BuffDef(Gah);
SaveConfig();
new ContentPacks().Initialize();
}
public static void DebugBreakpoint(string methodName, int breakpointNumber = -1)
{
string text = "RiskierRain: " + methodName + " IL hook failed!";
if (breakpointNumber >= 0)
{
text += $" (breakpoint {breakpointNumber})";
}
Debug.LogError((object)text);
}
private void Gah(orig_RemoveBuff_BuffDef orig, CharacterBody self, BuffDef buffType)
{
if (!NetworkServer.active)
{
Debug.Log((object)((Object)buffType).name);
}
orig.Invoke(self, buffType);
}
private void InitializeEverything()
{
ItemChanges.Initialize();
EquipmentChanges.Initialize();
DifficultyChanges.Initialize();
EnemyChanges.Initialize();
InteractableChanges.Initialize();
DoSacrificeDropLimit();
LanguageAPI.Add("DIFFICULTY_EASY_DESCRIPTION", drizzleDesc + "");
LanguageAPI.Add("DIFFICULTY_NORMAL_DESCRIPTION", rainstormDesc + "");
LanguageAPI.Add("DIFFICULTY_HARD_DESCRIPTION", monsoonDesc + "");
}
public static AssetReferenceT LoadAsync(string guid, Action callback) where T : Object
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
AssetReferenceT val = new AssetReferenceT(guid);
AsyncOperationHandle handle2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
if (callback == null)
{
return val;
}
if (handle2.IsDone)
{
onCompleted(handle2);
return val;
}
handle2.Completed += onCompleted;
return val;
void onCompleted(AsyncOperationHandle handle)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Invalid comparison between Unknown and I4
if (handle.Result == null || (int)handle.Status != 1)
{
Debug.LogError((object)$"Failed to load asset [{handle.DebugName}] : {handle.OperationException}");
}
else
{
callback(handle.Result);
}
}
}
public static void RetierItemAsync(string itemGuid, ItemTier tier = 5, Action callback = null)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
AssetReferenceT val = new AssetReferenceT(itemGuid);
AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle ctx)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
ItemDef result = ctx.Result;
result.tier = tier;
result.deprecatedTier = tier;
if (callback != null)
{
callback(result);
}
};
}
public static void RemoveEquipmentAsync(string equipmentGuid, Action callback = null)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
AssetReferenceT val = new AssetReferenceT(equipmentGuid);
AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle ctx)
{
EquipmentDef result = ctx.Result;
result.canDrop = false;
result.canBeRandomlyTriggered = false;
result.enigmaCompatible = false;
result.dropOnDeathChance = 0f;
if (callback != null)
{
callback(result);
}
};
}
public static void ChangeEquipmentEnigma(string equipName, bool canEnigma)
{
EquipmentDef val = LoadEquipDef(equipName);
if ((Object)(object)val != (Object)null)
{
val.enigmaCompatible = canEnigma;
}
}
public static void ChangeBuffStacking(string buffName, bool canStack)
{
BuffDef val = LoadBuffDef(buffName);
if ((Object)(object)val != (Object)null)
{
val.canStack = canStack;
}
}
public static ItemDef LoadItemDef(string name)
{
return LegacyResourcesAPI.Load("ItemDefs/" + name);
}
public static EquipmentDef LoadEquipDef(string name)
{
return LegacyResourcesAPI.Load("EquipmentDefs/" + name);
}
public static BuffDef LoadBuffDef(string name)
{
return LegacyResourcesAPI.Load("BuffDefs/" + name);
}
public static void CreateMeatballNapalm()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Expected O, but got Unknown
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//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_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
meatballNapalmPool = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/projectiles/beetlequeenacid"), "NapalmFire", true);
Color val = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)120, (byte)0, byte.MaxValue));
Transform val2 = meatballNapalmPool.transform.Find("FX/Decal");
Material val3 = new Material(((Component)val2).GetComponent().Material);
val3.SetColor("_Color", val);
((Component)val2).GetComponent().Material = val3;
ProjectileDotZone component = meatballNapalmPool.GetComponent();
component.lifetime = 5f;
component.fireFrequency = 2f;
component.damageCoefficient = 0.5f;
component.overlapProcCoefficient = 0.5f;
component.attackerFiltering = (AttackerFiltering)0;
meatballNapalmPool.GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)128);
meatballNapalmPool.GetComponent().procCoefficient = 1f;
float num = 2.5f;
meatballNapalmPool.GetComponent().localScale = new Vector3(num, num, num);
Transform val4 = meatballNapalmPool.transform.Find("FX");
((Component)val4.Find("Spittle")).gameObject.SetActive(false);
GameObject val5 = Object.Instantiate(LegacyResourcesAPI.Load("prefabs/FireTrail").GetComponent().segmentPrefab, ((Component)val4).transform);
MainModule main = val5.GetComponent().main;
((MainModule)(ref main)).duration = 8f;
((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.075f);
MinMaxCurve startSizeX = ((MainModule)(ref main)).startSizeX;
((MinMaxCurve)(ref startSizeX)).constantMin = ((MinMaxCurve)(ref startSizeX)).constantMin * 0.6f;
((MinMaxCurve)(ref startSizeX)).constantMax = ((MinMaxCurve)(ref startSizeX)).constantMax * 0.8f;
MinMaxCurve startSizeY = ((MainModule)(ref main)).startSizeY;
((MinMaxCurve)(ref startSizeY)).constantMin = ((MinMaxCurve)(ref startSizeY)).constantMin * 0.8f;
((MinMaxCurve)(ref startSizeY)).constantMax = ((MinMaxCurve)(ref startSizeY)).constantMax * 1f;
MinMaxCurve startSizeZ = ((MainModule)(ref main)).startSizeZ;
((MinMaxCurve)(ref startSizeZ)).constantMin = ((MinMaxCurve)(ref startSizeZ)).constantMin * 0.6f;
((MinMaxCurve)(ref startSizeZ)).constantMax = ((MinMaxCurve)(ref startSizeZ)).constantMax * 0.8f;
MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
((MinMaxCurve)(ref startLifetime)).constantMin = 0.9f;
((MinMaxCurve)(ref startLifetime)).constantMax = 1.1f;
((Behaviour)val5.GetComponent()).enabled = false;
val5.transform.localPosition = Vector3.zero;
val5.transform.localPosition = Vector3.zero;
val5.transform.localScale = Vector3.one;
ShapeModule shape = val5.GetComponent().shape;
((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0;
((ShapeModule)(ref shape)).scale = Vector3.one * 0.5f;
GameObject gameObject = ((Component)val4.Find("Point Light")).gameObject;
Light component2 = gameObject.GetComponent();
component2.color = new Color(1f, 0.5f, 0f);
component2.intensity = 6f;
component2.range = 12f;
Assets.projectilePrefabs.Add(meatballNapalmPool);
}
private bool GetConfigBool(bool defaultValue, string packetTitle, string desc = "")
{
if (desc != "")
{
return CustomConfigFile.Bind("Packets - See README For Details.", packetTitle + " Packet", defaultValue, "The changes in this Packet will be enabled if set to true.").Value;
}
return CustomConfigFile.Bind("Packets", packetTitle + " Packet", defaultValue, "(The following changes will be enabled if set to true) " + desc).Value;
}
private void InitializeConfig()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
CustomConfigFile = new ConfigFile(Paths.ConfigPath + "\\RiskierRain.cfg", true);
CustomConfigFile.SaveOnConfigSet = false;
EnableConfig = CustomConfigFile.Bind("Allow Config Options", "Enable Config", false, "Set this to true to enable config options. Please keep in mind that it was not within my design intentions to play this way. This is primarily meant for modpack users with tons of mods installed. If you have any issues or feedback on my mod balance, please feel free to send in feedback with the contact info in the README or Thunderstore description.");
Debug.Log((object)"Config initialized!");
}
private void SaveConfig()
{
CustomConfigFile.SaveOnConfigSet = true;
CustomConfigFile.Save();
}
private void InitializeCoreModules()
{
IEnumerable enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(CoreModule))
select type;
foreach (Type item in enumerable)
{
CoreModule coreModule = (CoreModule)Activator.CreateInstance(item);
coreModule.Init();
Debug.Log((object)("Core Module: " + coreModule?.ToString() + " Initialized!"));
}
}
}
public static class Extensions
{
public static string AsPercent(this float d)
{
return d * 100f + "%";
}
}
public static class Tools
{
public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons");
public static AssetBundle LoadAssetBundle(byte[] resourceBytes)
{
if (resourceBytes == null)
{
throw new ArgumentNullException("resourceBytes");
}
return AssetBundle.LoadFromMemory(resourceBytes);
}
public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName)
{
return $"@{plugin.Info.Metadata.Name}+{bundleName}";
}
internal static bool isLoaded(string modguid)
{
foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos)
{
string key = pluginInfo.Key;
PluginInfo value = pluginInfo.Value;
if (key == modguid)
{
return true;
}
}
return false;
}
internal static string ConvertDecimal(float d)
{
return d.AsPercent();
}
internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Expected O, but got Unknown
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
Renderer[] componentsInChildren = model.GetComponentsInChildren();
Renderer[] array = componentsInChildren;
foreach (Renderer val in array)
{
Renderer val2 = val;
if (string.Equals(((Object)val).name, childObject))
{
if (color == Color.clear)
{
Object.Destroy((Object)(object)val);
break;
}
if ((Object)(object)material == (Object)null)
{
material = new Material(val.material);
material.mainTexture = val.material.mainTexture;
material.shader = val.material.shader;
material.color = color;
}
val.material = material;
Transform transform = ((Component)val).transform;
transform.localScale *= scaleMultiplier;
if (!replaceAll)
{
break;
}
}
}
}
internal static void DebugMaterial(GameObject model)
{
Renderer[] componentsInChildren = model.GetComponentsInChildren();
Renderer[] array = componentsInChildren;
foreach (Renderer val in array)
{
Renderer val2 = val;
Debug.Log((object)("Material: " + ((Object)val2).name.ToString()));
}
}
internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
ParticleSystem[] componentsInChildren = model.GetComponentsInChildren();
ParticleSystem[] array = componentsInChildren;
foreach (ParticleSystem val in array)
{
ParticleSystem val2 = val;
MainModule main = val2.main;
ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
ColorBySpeedModule colorBySpeed = val2.colorBySpeed;
if (string.Equals(((Object)val2).name, childObject))
{
((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color);
((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier;
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color);
((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color);
if (!replaceAll)
{
break;
}
}
}
}
internal static void DebugParticleSystem(GameObject model)
{
ParticleSystem[] components = model.GetComponents();
ParticleSystem[] array = components;
foreach (ParticleSystem val in array)
{
ParticleSystem val2 = val;
Debug.Log((object)("Particle: " + ((Object)val2).name.ToString()));
}
}
internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
Light[] componentsInChildren = model.GetComponentsInChildren();
Light[] array = componentsInChildren;
foreach (Light val in array)
{
Light val2 = val;
if (string.Equals(((Object)val2).name, childObject))
{
val2.color = color;
if (!replaceAll)
{
break;
}
}
}
}
internal static void DebugLight(GameObject model)
{
Light[] componentsInChildren = model.GetComponentsInChildren();
Light[] array = componentsInChildren;
foreach (Light val in array)
{
Light val2 = val;
Debug.Log((object)("Light: " + ((Object)val2).name.ToString()));
}
}
public static void ClearDotStacksForType(this DotController dotController, DotIndex dotIndex)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
for (int num = dotController.dotStackList.Count - 1; num >= 0; num--)
{
if (dotController.dotStackList[num].dotIndex == dotIndex)
{
dotController.RemoveDotStackAtServer(num);
}
}
}
public static void LoadCharacterBodyAsync(string guid, Action callback)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
AssetReferenceT val = new AssetReferenceT(guid);
AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle ctx)
{
GameObject result = ctx.Result;
CharacterBody obj = default(CharacterBody);
if (!((Object)(object)result == (Object)null) && result.TryGetComponent(ref obj))
{
callback(obj);
}
};
}
}
}
namespace RiskierRain.CoreModules
{
public class Assets : CoreModule
{
public static AssetBundle _retierAssetBundle;
public static string dropPrefabsPath = "Assets/Models/DropPrefabs";
public static string iconsPath = "Assets/Textures/Icons/";
public static string eliteMaterialsPath = "Assets/Textures/Materials/Elite/";
public static List artifactDefs = new List();
public static List buffDefs = new List();
public static List effectDefs = new List();
public static List skillFamilies = new List();
public static List skillDefs = new List();
public static List projectilePrefabs = new List();
public static List networkedObjectPrefabs = new List();
public static List entityStates = new List();
public static List itemDefs = new List();
public static List equipDefs = new List();
public static List eliteDefs = new List();
public static List masterPrefabs = new List();
public static List bodyPrefabs = new List();
public static string shredKeywordToken = "DUCK_SHRED_KEYWORD";
public static BuffDef soulShrineLuckBuff;
public static BuffDef voidCradleCurse;
public static BuffDef shockMarker;
public static int shockMarkerDuration = 4;
public static BuffDef shockHealCooldown;
public static float survivorExecuteThreshold = 0.15f;
public static float banditExecutionThreshold = 0.1f;
public static float harvestExecutionThreshold = 0.2f;
public static BuffDef shatterspleenSpikeBuff;
public static BuffDef noRazorwire;
public static AssetBundle retierAssetBundle
{
get
{
if ((Object)(object)_retierAssetBundle == (Object)null)
{
_retierAssetBundle = AssetBundle.LoadFromFile(GetAssetBundlePath("retier2"));
}
return _retierAssetBundle;
}
set
{
_retierAssetBundle = value;
}
}
public static List MaterialsWithSwappedShaders { get; } = new List();
public static string GetAssetBundlePath(string bundleName)
{
return Path.Combine(Path.GetDirectoryName(RiskierRainPlugin.PInfo.Location), bundleName);
}
public static bool RegisterEntityState(Type entityState)
{
if (entityStates.Contains(entityState) || !entityState.IsSubclassOf(typeof(EntityState)) || entityState.IsAbstract)
{
return false;
}
entityStates.Add(entityState);
return true;
}
public static EffectDef CreateEffect(GameObject effect)
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
if ((Object)(object)effect == (Object)null)
{
Debug.LogError((object)"Effect prefab was null");
return null;
}
EffectComponent component = effect.GetComponent();
if ((Object)(object)component == (Object)null)
{
Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have an EffectComponent.", new object[1] { ((Object)effect).name });
return null;
}
VFXAttributes component2 = effect.GetComponent();
if ((Object)(object)component2 == (Object)null)
{
Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have a VFXAttributes component.", new object[1] { ((Object)effect).name });
return null;
}
EffectDef val = new EffectDef
{
prefab = effect,
prefabEffectComponent = component,
prefabVfxAttributes = component2,
prefabName = ((Object)effect).name,
spawnSoundEventName = component.soundName
};
effectDefs.Add(val);
return val;
}
public override void Init()
{
AddShatterspleenSpikeBuff();
AddRazorwireCooldown();
AddVoidCradleCurse();
AddShockDebuff();
AddShockCooldown();
AddSoulShrineLuckBuff();
}
private void AddSoulShrineLuckBuff()
{
//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_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Expected O, but got Unknown
BuffDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/bdExtraLifeBuff.asset").WaitForCompletion();
soulShrineLuckBuff = ScriptableObject.CreateInstance();
soulShrineLuckBuff.buffColor = val.buffColor;
soulShrineLuckBuff.canStack = true;
soulShrineLuckBuff.isDebuff = val.isDebuff;
soulShrineLuckBuff.flags = val.flags;
((Object)soulShrineLuckBuff).name = "bdExtraLuckBuff";
soulShrineLuckBuff.iconSprite = val.iconSprite;
buffDefs.Add(soulShrineLuckBuff);
StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(SoulShrineLuck);
}
private void SoulShrineLuck(CharacterBody sender, MoreStatHookEventArgs args)
{
int buffCount = sender.GetBuffCount(soulShrineLuckBuff);
if (buffCount > 0)
{
args.luckAdd += (float)(buffCount * InteractableChanges.soulShrineLuckIncrease);
}
}
private void AddVoidCradleCurse()
{
//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)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
voidCradleCurse = ScriptableObject.CreateInstance();
voidCradleCurse.buffColor = Color.black;
voidCradleCurse.canStack = false;
voidCradleCurse.isDebuff = false;
((Object)voidCradleCurse).name = "VoidCradleCurse";
voidCradleCurse.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffVoidFog.tif").WaitForCompletion();
buffDefs.Add(voidCradleCurse);
}
private void AddShockDebuff()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
shockMarker = ScriptableObject.CreateInstance();
((Object)shockMarker).name = "Shock";
shockMarker.buffColor = new Color(0f, 0f, 0.6f);
shockMarker.canStack = false;
shockMarker.isDebuff = true;
BuffDef obj = shockMarker;
obj.flags = (Flags)(obj.flags | 1);
shockMarker.isHidden = true;
shockMarker.iconSprite = null;
buffDefs.Add(shockMarker);
}
private void AddShockCooldown()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
shockHealCooldown = ScriptableObject.CreateInstance();
((Object)shockHealCooldown).name = "Shock";
shockHealCooldown.buffColor = new Color(0f, 0f, 0.6f);
shockHealCooldown.canStack = true;
shockHealCooldown.isDebuff = false;
shockHealCooldown.isCooldown = true;
shockHealCooldown.iconSprite = null;
buffDefs.Add(shockHealCooldown);
}
private void AddShatterspleenSpikeBuff()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
shatterspleenSpikeBuff = ScriptableObject.CreateInstance();
shatterspleenSpikeBuff.buffColor = new Color(0.7f, 0f, 0.2f, 1f);
shatterspleenSpikeBuff.canStack = true;
shatterspleenSpikeBuff.isDebuff = false;
((Object)shatterspleenSpikeBuff).name = "ShatterspleenSpikeCharge";
shatterspleenSpikeBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion();
buffDefs.Add(shatterspleenSpikeBuff);
}
private void AddRazorwireCooldown()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
noRazorwire = ScriptableObject.CreateInstance();
noRazorwire.buffColor = Color.black;
noRazorwire.canStack = false;
noRazorwire.isDebuff = true;
BuffDef obj = noRazorwire;
obj.flags = (Flags)(obj.flags | 1);
((Object)noRazorwire).name = "NoRazorwire";
noRazorwire.iconSprite = null;
buffDefs.Add(noRazorwire);
}
public static void SwapShadersFromMaterialsInBundle(AssetBundle bundle)
{
if (bundle.isStreamedSceneAssetBundle)
{
Debug.LogWarning((object)"Cannot swap material shaders from a streamed scene assetbundle.");
return;
}
Material[] array = (from mat in bundle.LoadAllAssets()
where ((Object)mat.shader).name.StartsWith("Stubbed")
select mat).ToArray();
foreach (Material val in array)
{
if (!((Object)val.shader).name.StartsWith("Stubbed"))
{
Debug.LogWarning((object)$"The material {val} has a shader which's name doesnt start with \"Stubbed\" ({((Object)val.shader).name}), this is not allowed for stubbed shaders for MSU. not swapping shader.");
continue;
}
try
{
SwapShader(val);
}
catch (Exception arg)
{
Debug.LogError((object)$"Failed to swap shader of material {val}: {arg}");
}
}
}
private static void SwapShader(Material material)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
string text = ((Object)material.shader).name.Substring("Stubbed".Length);
string text2 = text + ".shader";
Shader shader = Addressables.LoadAssetAsync((object)text2).WaitForCompletion();
material.shader = shader;
MaterialsWithSwappedShaders.Add(material);
}
}
internal class ContentPacks : IContentPackProvider
{
internal ContentPack contentPack = new ContentPack();
public string identifier => "RiskierRain";
public void Initialize()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
}
private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
{
addContentPackProvider.Invoke((IContentPackProvider)(object)this);
}
public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
{
contentPack.identifier = identifier;
contentPack.artifactDefs.Add(Assets.artifactDefs.ToArray());
contentPack.buffDefs.Add(Assets.buffDefs.ToArray());
contentPack.effectDefs.Add(Assets.effectDefs.ToArray());
contentPack.equipmentDefs.Add(Assets.equipDefs.ToArray());
contentPack.itemDefs.Add(Assets.itemDefs.ToArray());
contentPack.eliteDefs.Add(Assets.eliteDefs.ToArray());
contentPack.projectilePrefabs.Add(Assets.projectilePrefabs.ToArray());
contentPack.bodyPrefabs.Add(Assets.bodyPrefabs.ToArray());
contentPack.masterPrefabs.Add(Assets.masterPrefabs.ToArray());
contentPack.entityStateTypes.Add(Assets.entityStates.ToArray());
args.ReportProgress(1f);
yield break;
}
public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
{
ContentPack.Copy(contentPack, args.output);
args.ReportProgress(1f);
yield break;
}
public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
{
args.ReportProgress(1f);
yield break;
}
}
public abstract class CoreModule
{
public abstract void Init();
}
public class EliteModule : CoreModule
{
public class CustomEliteDef : ScriptableObject
{
public EliteDef eliteDef;
public EliteTiers eliteTier;
public Color lightColor = Color.clear;
public Texture eliteRamp;
public Material overlayMaterial;
public GameObject spawnEffect;
}
public enum EliteTiers
{
Tier1,
Tier2,
Other
}
public static List Elites = new List();
public static Texture defaultShaderRamp = null;
public override void Init()
{
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddElites));
}
private static void AddElites()
{
foreach (CustomEliteDef elite in Elites)
{
switch (elite.eliteTier)
{
case EliteTiers.Tier1:
ArrayUtils.ArrayAppend(ref CombatDirector.eliteTiers[1].eliteTypes, ref elite.eliteDef);
ArrayUtils.ArrayAppend(ref CombatDirector.eliteTiers[2].eliteTypes, ref elite.eliteDef);
break;
case EliteTiers.Tier2:
ArrayUtils.ArrayAppend(ref CombatDirector.eliteTiers[3].eliteTypes, ref elite.eliteDef);
break;
}
}
}
}
public class Spawnlists : CoreModule
{
public override void Init()
{
SpawnCards.Init();
}
public static void AddMonsterCardToSpawnlist(DirectorCardCategorySelection categorySelection, DirectorCard directorCard, MonsterCategory monsterCategory)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Expected I4, but got Unknown
categorySelection.AddCard((int)monsterCategory, directorCard);
}
}
public static class SpawnCards
{
public static bool initialized;
public static CharacterSpawnCard AlphaConstruct;
public static CharacterSpawnCard Beetle;
public static CharacterSpawnCard Lemurian;
public static CharacterSpawnCard Larva;
public static CharacterSpawnCard Wisp;
public static CharacterSpawnCard Jellyfish;
public static CharacterSpawnCard BlindPestSnowy;
public static CharacterSpawnCard BlindVerminSnowy;
public static CharacterSpawnCard Imp;
public static CharacterSpawnCard Vulture;
public static CharacterSpawnCard Golem;
public static CharacterSpawnCard BeetleGuard;
public static CharacterSpawnCard Mushrum;
public static CharacterSpawnCard Bison;
public static CharacterSpawnCard ClayApothecary;
public static CharacterSpawnCard ElderLemurian;
public static CharacterSpawnCard Parent;
public static CharacterSpawnCard Gup;
public static CharacterSpawnCard Bronzong;
public static CharacterSpawnCard GreaterWisp;
public static CharacterSpawnCard TitanBlackBeach;
public static CharacterSpawnCard TitanDampCave;
public static CharacterSpawnCard TitanGolemPlains;
public static CharacterSpawnCard TitanGooLake;
public static CharacterSpawnCard Vagrant;
public static CharacterSpawnCard BeetleQueen;
public static CharacterSpawnCard Dunestrider;
public static CharacterSpawnCard MagmaWorm;
public static CharacterSpawnCard ImpOverlord;
public static CharacterSpawnCard Grovetender;
public static CharacterSpawnCard RoboBall;
public static CharacterSpawnCard XiConstruct;
public static CharacterSpawnCard Grandparent;
public static CharacterSpawnCard OverloadingWorm;
public static CharacterSpawnCard solusInvalidator;
public static CharacterSpawnCard solusScorcher;
public static CharacterSpawnCard solusTransporter;
public static CharacterSpawnCard solusExtractor;
public static CharacterSpawnCard solusProspector;
public static CharacterSpawnCard solusDistributor;
public static CharacterSpawnCard solusAmalgamator;
public static void Init()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0233: Unknown result type (might be due to invalid IL or missing references)
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
if (!initialized)
{
initialized = true;
AlphaConstruct = Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/cscMinorConstruct.asset").WaitForCompletion();
Beetle = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetle");
Lemurian = LegacyResourcesAPI.Load("spawncards/characterspawncards/csclemurian");
Wisp = LegacyResourcesAPI.Load("spawncards/characterspawncards/csclesserwisp");
Jellyfish = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscjellyfish");
Imp = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscimp");
Vulture = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscvulture");
Golem = Addressables.LoadAssetAsync((object)"RoR2/Base/Golem/cscGolem.asset").WaitForCompletion();
BeetleGuard = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetleguard");
Mushrum = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscminimushroom");
Bison = Addressables.LoadAssetAsync((object)"RoR2/Base/Bison/cscBison.asset").WaitForCompletion();
ElderLemurian = Addressables.LoadAssetAsync((object)"RoR2/Base/LemurianBruiser/cscLemurianBruiser.asset").WaitForCompletion();
Parent = Addressables.LoadAssetAsync((object)"RoR2/Base/Parent/cscParent.asset").WaitForCompletion();
Gup = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Gup/cscGupBody.asset").WaitForCompletion();
Bronzong = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbell");
GreaterWisp = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscgreaterwisp");
TitanBlackBeach = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitanblackbeach");
TitanDampCave = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitandampcave");
TitanGolemPlains = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitangolemplains");
TitanGooLake = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitangoolake");
Vagrant = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscvagrant");
BeetleQueen = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetlequeen");
Dunestrider = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscclayboss");
MagmaWorm = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscmagmaworm");
ImpOverlord = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscimpboss");
Grovetender = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscgravekeeper");
RoboBall = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscroboballboss");
Grandparent = Addressables.LoadAssetAsync((object)"RoR2/Base/Grandparent/cscGrandparent.asset").WaitForCompletion();
OverloadingWorm = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscelectricworm");
BlindVerminSnowy = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Vermin/cscVerminSnowy.asset").WaitForCompletion();
BlindPestSnowy = Addressables.LoadAssetAsync((object)"RoR2/DLC1/FlyingVermin/cscFlyingVerminSnowy.asset").WaitForCompletion();
ClayApothecary = Addressables.LoadAssetAsync((object)"RoR2/DLC1/ClayGrenadier/cscClayGrenadier.asset").WaitForCompletion();
Larva = Addressables.LoadAssetAsync((object)"RoR2/DLC1/AcidLarva/cscAcidLarva.asset").WaitForCompletion();
XiConstruct = Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/cscMegaConstruct.asset").WaitForCompletion();
solusDistributor = Addressables.LoadAssetAsync((object)"RoR2/DLC3/MinePod/cscMinePod.asset").WaitForCompletion();
solusExtractor = Addressables.LoadAssetAsync((object)"RoR2/DLC3/ExtractorUnit/cscExtractorUnit.asset ").WaitForCompletion();
solusInvalidator = Addressables.LoadAssetAsync((object)"RoR2/DLC3/DefectiveUnit/cscDefectiveUnit.asset").WaitForCompletion();
solusProspector = Addressables.LoadAssetAsync((object)"RoR2/DLC3/WorkerUnit/cscWorkerUnit.asset").WaitForCompletion();
solusScorcher = Addressables.LoadAssetAsync((object)"RoR2/DLC3/Tanker/cscTanker.asset").WaitForCompletion();
solusTransporter = Addressables.LoadAssetAsync((object)"RoR2/DLC3/IronHauler/cscIronHauler.asset").WaitForCompletion();
solusAmalgamator = Addressables.LoadAssetAsync((object)"RoR2/DLC3/SolusAmalgamator/cscSolusAmalgamator.asset").WaitForCompletion();
DirectorCards.Init();
}
}
}
public static class DirectorCards
{
public static bool initialized;
public static DirectorCard AlphaConstruct;
public static DirectorCard AlphaConstructNear;
public static DirectorCard Beetle;
public static DirectorCard Lemurian;
public static DirectorCard Larva;
public static DirectorCard Wisp;
public static DirectorCard Jellyfish;
public static DirectorCard BlindPestSnowy;
public static DirectorCard BlindVerminSnowy;
public static DirectorCard Imp;
public static DirectorCard Vulture;
public static DirectorCard Golem;
public static DirectorCard BeetleGuard;
public static DirectorCard Mushrum;
public static DirectorCard ClayApothecary;
public static DirectorCard Bison;
public static DirectorCard BisonLoop;
public static DirectorCard ElderLemurian;
public static DirectorCard Parent;
public static DirectorCard Gup;
public static DirectorCard Bronzong;
public static DirectorCard GreaterWisp;
public static DirectorCard TitanBlackBeach;
public static DirectorCard TitanDampCave;
public static DirectorCard TitanGolemPlains;
public static DirectorCard TitanGooLake;
public static DirectorCard Vagrant;
public static DirectorCard BeetleQueen;
public static DirectorCard Dunestrider;
public static DirectorCard MagmaWorm;
public static DirectorCard ImpOverlord;
public static DirectorCard Grovetender;
public static DirectorCard RoboBall;
public static DirectorCard Grandparent;
public static DirectorCard OverloadingWorm;
public static DirectorCard XiConstruct;
public static DirectorCard LunarGolemSkyMeadow;
public static DirectorCard LunarGolemSkyMeadowBasic;
public static DirectorCard SolusInvalidator;
public static DirectorCard SolusScorcher;
public static DirectorCard SolusTransporter;
public static DirectorCard SolusExtractor;
public static DirectorCard SolusProspector;
public static DirectorCard SolusDistributor;
public static DirectorCard SolusAmalgamator;
public static bool logCardInfo;
public static void Init()
{
if (!initialized)
{
initialized = true;
AlphaConstruct = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)0);
AlphaConstructNear = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)1);
Beetle = BuildDirectorCard(SpawnCards.Beetle);
Lemurian = BuildDirectorCard(SpawnCards.Lemurian);
Larva = BuildDirectorCard(SpawnCards.Larva);
Wisp = BuildDirectorCard(SpawnCards.Wisp);
Jellyfish = BuildDirectorCard(SpawnCards.Jellyfish, 1, 0, (MonsterSpawnDistance)2);
BlindPestSnowy = BuildDirectorCard(SpawnCards.BlindPestSnowy);
BlindVerminSnowy = BuildDirectorCard(SpawnCards.BlindVerminSnowy);
Imp = BuildDirectorCard(SpawnCards.Imp);
Vulture = BuildDirectorCard(SpawnCards.Vulture, 1, 3, (MonsterSpawnDistance)0);
Golem = BuildDirectorCard(SpawnCards.Golem);
BeetleGuard = BuildDirectorCard(SpawnCards.BeetleGuard);
Mushrum = BuildDirectorCard(SpawnCards.Mushrum);
ClayApothecary = BuildDirectorCard(SpawnCards.ClayApothecary);
Bison = BuildDirectorCard(SpawnCards.Bison, 1, 2, (MonsterSpawnDistance)0);
Bronzong = BuildDirectorCard(SpawnCards.Bronzong);
GreaterWisp = BuildDirectorCard(SpawnCards.GreaterWisp);
ElderLemurian = BuildDirectorCard(SpawnCards.ElderLemurian, 1, 3, (MonsterSpawnDistance)0);
Parent = BuildDirectorCard(SpawnCards.Parent, 1, 3, (MonsterSpawnDistance)0);
Gup = BuildDirectorCard(SpawnCards.Gup, 1, 3, (MonsterSpawnDistance)0);
TitanBlackBeach = BuildDirectorCard(SpawnCards.TitanBlackBeach);
TitanDampCave = BuildDirectorCard(SpawnCards.TitanDampCave);
TitanGolemPlains = BuildDirectorCard(SpawnCards.TitanGolemPlains);
TitanGooLake = BuildDirectorCard(SpawnCards.TitanGooLake);
Vagrant = BuildDirectorCard(SpawnCards.Vagrant);
BeetleQueen = BuildDirectorCard(SpawnCards.BeetleQueen);
Dunestrider = BuildDirectorCard(SpawnCards.Dunestrider);
ImpOverlord = BuildDirectorCard(SpawnCards.ImpOverlord, 1, 1, (MonsterSpawnDistance)0);
Grovetender = BuildDirectorCard(SpawnCards.Grovetender);
RoboBall = BuildDirectorCard(SpawnCards.RoboBall, 1, 3, (MonsterSpawnDistance)0);
MagmaWorm = BuildDirectorCard(SpawnCards.MagmaWorm, 1, 2, (MonsterSpawnDistance)0);
Grandparent = BuildDirectorCard(SpawnCards.Grandparent, 1, 2, (MonsterSpawnDistance)0);
OverloadingWorm = BuildDirectorCard(SpawnCards.OverloadingWorm);
XiConstruct = BuildDirectorCard(SpawnCards.XiConstruct, 1, 2, (MonsterSpawnDistance)0);
SolusInvalidator = BuildDirectorCard(SpawnCards.solusInvalidator);
SolusScorcher = BuildDirectorCard(SpawnCards.solusScorcher);
SolusTransporter = BuildDirectorCard(SpawnCards.solusTransporter);
SolusExtractor = BuildDirectorCard(SpawnCards.solusExtractor);
SolusProspector = BuildDirectorCard(SpawnCards.solusProspector);
SolusDistributor = BuildDirectorCard(SpawnCards.solusDistributor);
SolusAmalgamator = BuildDirectorCard(SpawnCards.solusAmalgamator);
}
}
public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard)
{
return BuildDirectorCard(spawnCard, 1, 0, (MonsterSpawnDistance)0);
}
public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard, int weight, int minStages, MonsterSpawnDistance spawnDistance)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Expected O, but got Unknown
return new DirectorCard
{
spawnCard = (SpawnCard)(object)spawnCard,
selectionWeight = weight,
preventOverhead = false,
minimumStageCompletions = minStages,
spawnDistance = spawnDistance
};
}
public static DirectorCard BuildDirectorCard(InteractableSpawnCard spawnCard, int weight, int minStages)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
return new DirectorCard
{
spawnCard = (SpawnCard)(object)spawnCard,
selectionWeight = weight,
preventOverhead = false,
minimumStageCompletions = minStages
};
}
}
public class StatHooks : CoreModule
{
public class BorboStatHookEventArgs : EventArgs
{
public float attackSpeedMultAdd = 1f;
public float attackSpeedDivAdd = 1f;
}
public delegate void StatHookEventHandler(CharacterBody sender, BorboStatHookEventArgs args);
public static event StatHookEventHandler BorboStatCoefficients;
public static void ApplyCooldownScale(GenericSkill skillSlot, float cooldownScale)
{
if ((Object)(object)skillSlot != (Object)null)
{
skillSlot.cooldownScale *= cooldownScale;
}
}
public override void Init()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
CharacterBody.RecalculateStats += new hook_RecalculateStats(AttackSpeedBs);
}
private void AttackSpeedBs(orig_RecalculateStats orig, CharacterBody self)
{
orig.Invoke(self);
BorboStatHookEventArgs borboStatHookEventArgs = new BorboStatHookEventArgs();
StatHooks.BorboStatCoefficients?.Invoke(self, borboStatHookEventArgs);
float num = borboStatHookEventArgs.attackSpeedMultAdd / borboStatHookEventArgs.attackSpeedDivAdd;
self.attackSpeed *= num;
}
}
}
namespace RiskierRain.Components
{
internal class CopyInventoryFromOwner : MonoBehaviour
{
public Func inventoryItemCopyFilter = Inventory.defaultItemCopyFilterDelegate.Invoke;
public bool copyInventory = true;
public bool copyEquipment = true;
public void Start()
{
CharacterMaster component = ((Component)this).gameObject.GetComponent();
MinionOwnership component2 = ((Component)this).gameObject.GetComponent();
if (!((Object)(object)component2 != (Object)null) || !((Object)(object)component != (Object)null))
{
return;
}
CharacterMaster ownerMaster = component2.ownerMaster;
Inventory val = ((ownerMaster != null) ? ownerMaster.inventory : null);
if (Object.op_Implicit((Object)(object)val))
{
if (copyEquipment)
{
component.inventory.CopyEquipmentFrom(val);
}
if (copyInventory)
{
component.inventory.CopyItemsFrom(val, inventoryItemCopyFilter);
}
}
}
}
internal class InteractableBuffController : MonoBehaviour
{
private PurchaseInteraction _purchaseInteraction;
public BuffDef buffDef;
public float duration = -1f;
public PurchaseInteraction purchaseInteraction
{
get
{
if (Object.op_Implicit((Object)(object)_purchaseInteraction))
{
return _purchaseInteraction;
}
_purchaseInteraction = ((Component)this).GetComponent();
return _purchaseInteraction;
}
}
internal virtual void Start()
{
((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)OnPurchase);
}
private void OnPurchase(Interactor interactor)
{
if (!((Object)(object)buffDef == (Object)null))
{
CharacterBody component = ((Component)interactor).GetComponent();
if (Object.op_Implicit((Object)(object)component) && NetworkServer.active)
{
AddDebuff(component);
}
}
}
internal virtual void AddDebuff(CharacterBody interactorBody)
{
if (duration <= 0f)
{
interactorBody.AddBuff(buffDef);
}
else
{
interactorBody.AddTimedBuff(buffDef, duration);
}
}
}
internal class StatBuffer : MonoBehaviour
{
public int levelOffset = 0;
public float levelDamage = 0f;
public float levelAttackSpeed = 0f;
public float levelMoveSpeed = 0f;
public float levelShield = 0f;
public float levelArmor = 0f;
}
}
namespace RiskierRain.Changes
{
public static class DifficultyChanges
{
public delegate bool orig_getHasOneShotProtection(CharacterBody self);
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Manipulator <>9__79_0;
public static Manipulator <>9__79_1;
public static Manipulator <>9__79_2;
public static Manipulator <>9__79_3;
public static Func <>9__85_0;
public static Func <>9__85_2;
public static Func <>9__87_0;
public static Func <>9__89_0;
public static Func <>9__89_1;
public static Func <>9__89_2;
public static Func <>9__103_0;
public static Func <>9__103_1;
public static Func <>9__103_2;
public static Func <>9__103_3;
public static Func <>9__103_4;
public static Func <>9__104_1;
public static Func <>9__104_2;
public static Func <>9__104_3;
public static Func <>9__104_4;
public static Func <>9__104_5;
public static Func <>9__104_6;
public static Func <>9__104_8;
public static Func <>9__104_9;
public static Func <>9__104_10;
public static Func <>9__104_11;
public static Func <>9__104_12;
public static Func <>9__104_13;
public static Func <>9__104_14;
internal void b__79_0(ILContext ctx)
{
RemoveEclipseEffect(ctx, "E1");
}
internal void b__79_1(ILContext ctx)
{
RemoveEclipseEffect(ctx, "E3");
}
internal void b__79_2(ILContext ctx)
{
RemoveEclipseEffect(ctx, "E5");
}
internal void b__79_3(ILContext ctx)
{
RemoveEclipseEffect(ctx, "E6");
}
internal bool b__85_0(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_selectedDifficulty");
}
internal bool b__85_2(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__87_0(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_selectedDifficulty");
}
internal bool b__89_0(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_selectedDifficulty");
}
internal bool b__89_1(Instruction x)
{
int num = default(int);
return ILPatternMatchingExt.MatchLdcI4(x, ref num);
}
internal bool b__89_2(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_fullHealth");
}
internal bool b__103_0(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__103_1(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__103_2(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__103_3(Instruction x)
{
int num = default(int);
return ILPatternMatchingExt.MatchStloc(x, ref num);
}
internal bool b__103_4(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__104_1(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__104_2(Instruction x)
{
return ILPatternMatchingExt.MatchMul(x);
}
internal bool b__104_3(Instruction x)
{
return ILPatternMatchingExt.MatchCallOrCallvirt(x, "Floor");
}
internal bool b__104_4(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__104_5(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool b__104_6(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld(x, "stageClearCount");
}
internal bool b__104_8(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__104_9(Instruction x)
{
return ILPatternMatchingExt.MatchMul(x);
}
internal bool b__104_10(Instruction x)
{
float num = default(float);
return ILPatternMatchingExt.MatchLdcR4(x, ref num);
}
internal bool b__104_11(Instruction x)
{
return ILPatternMatchingExt.MatchLdarg(x, 0);
}
internal bool b__104_12(Instruction x)
{
return ILPatternMatchingExt.MatchLdfld(x, "stageClearCount");
}
internal bool b__104_13(Instruction x)
{
return ILPatternMatchingExt.MatchLdsfld(x, "ambientLevelCap");
}
internal float b__104_14(float levelIn)
{
float ambientLevelBoost = GetAmbientLevelBoost();
return levelIn + ambientLevelBoost;
}
}
public static string Tier2EliteName = "Rare";
public static bool potentialProtectionVisibility = true;
public static float potentialProtectionDuration = 4f;
public static bool pityChargeOn = false;
public static float pityChargeShrinkDelta = 0f;
public static float pityChargeRecolorDelta = 0f;
public static float fastDirectorEliteBias = 1.2f;
public static float fastDirectorCreditMultiplier = 0.75f;
public static float slowDirectorEliteBias = 1.2f;
public static float slowDirectorCreditMultiplier = 1f;
public static float teleLesserEliteBias = 1f;
public static float teleLesserCreditMultiplier = 0.8f;
public static float teleBossEliteBias = 1f;
public static float teleBossCreditMultiplier = 1f;
public static float teleBossCreditMultiplierStage1 = 0.5f;
public static float interactableCreditsAdd = 125f;
public static float monsterCreditsMultiplier = 1f;
public static float drizzleDifficultyBoost = 0f;
public static float rainstormDifficultyBoost = 0f;
public static float monsoonDifficultyBoost = 3f;
public static float eclipseDifficultyBoost = 6f;
public static int ambientLevelCapDrizzle = 99;
public static int ambientLevelCap = 999;
public static float easyTeleParticleRadius = 1f;
public static float normalTeleParticleRadius = 0.8f;
public static float hardTeleParticleRadius = 0.4f;
public static float eclipseTeleParticleRadius = 0.4f;
public static float defaultTeleParticleRadius = 0.9f;
public static int Tier2EliteMinimumStageDefault = 6;
public static int Tier2EliteMinimumStageDrizzle = 11;
public static int Tier2EliteMinimumStageRainstorm = 6;
public static int Tier2EliteMinimumStageMonsoon = 4;
public static int Tier2EliteMinimumStageEclipse = 4;
public static DifficultyIndex eclipseLevelBossElite = (DifficultyIndex)3;
public static string eclipseOneDesc = "\n(1) Boss Enemies: ";
public static DifficultyIndex eclipseLevelEnemyMspd = (DifficultyIndex)4;
public static float eclipseEnemyMspd = 0.3f;
public static string eclipseTwoDesc = "\n(2) Enemy Speed: ";
public static DifficultyIndex eclipseLevelSmallHoldout = (DifficultyIndex)5;
public static DifficultyIndex eclipseLevelHoldoutLoss = (DifficultyIndex)5;
public static float eclipseHoldoutLossRate = 0.02f;
public static float eclipseHoldoutScale = 0.6f;
public static string eclipseThreeDesc = "\n(3) All Holdout Zones are ";
public static DifficultyIndex eclipseHealingLoss = (DifficultyIndex)6;
public static float eclipseHealingMultiplier = 0.75f;
public static string eclipseFourDesc = "\n(4) Ally Healing: ";
public static DifficultyIndex eclipseLevelEnemyCdr = (DifficultyIndex)7;
public static float eclipseEnemyCooldownScale = 0.6f;
public static string eclipseFiveDesc = "\n(5) Enemy Cooldowns: ";
public static DifficultyIndex eclipseLevelSpiteArtifact = (DifficultyIndex)8;
public static string eclipseSixDesc = "\n(6) On Kill: ";
public static DifficultyIndex eclipseLevelItemTax = (DifficultyIndex)9;
public static int eclipseItemTaxCount = 2;
public static float eclipseItemTaxPercent = 0.2f;
public static string eclipseSevenDesc = "\n(7) Item Tax: ";
public static string eclipseEightDesc = "\n(8) Allies recieve ";
public static float baseScalingMultiplier = 0.8f;
public static float difficultyIncreasePerMinutePerDifficulty = 0.01f;
public static float difficultyIncreasePerMinuteBase = 1f;
public static float difficultyIncreasePerStage = 0.9f;
public static float difficultyIncreasePerLoop = 1.3f;
public static float playerBaseDifficultyFactor = 0.2f;
public static float playerScalingDifficultyFactor = 0.2f;
public static float playerSpawnRateFactor = 0.5f;
public static float difficultySpawnRateFactor = 0.4f;
public static float voidFieldsTimeCost = 120f;
private static GameObject awu = LegacyResourcesAPI.Load("prefabs/characterbodies/SuperRoboBallBossBody");
private static CharacterBody awuBody;
private static float awuArmor = 40f;
private static float awuAdditionalArmor = 0f;
private static int awuAdaptiveArmorCount = 1;
private static float costExponent = 1f;
private static float goldRewardMultiplierGlobal = 0.35f;
private static float expRewardMultiplierGlobal = 0.4f;
private static float compensationForStartingLevel = 1f;
internal static float GetAmbientLevelBoost()
{
return DifficultyUtilsModule.GetAmbientLevelBoost();
}
public static void Initialize()
{
RemoveOspForever();
AddPotentialProtection();
AddPityCharge();
FreezeDifficultyScalingOnFinalLevels();
ChangeDifficultyCoefficientCalculation();
ChangeEnemyRewards();
DifficultyUtilsModule.EnableAll();
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddDifficultyStats));
AddMonsoonScalingStats();
ChangeEclipse();
ChangeDirectorStats();
DirectorAPI.StageSettingsActions += IncreaseStageInteractableCredits;
DirectorAPI.StageSettingsActions += IncreaseStageMonsterCredits;
}
public static void RemoveOspForever()
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
Hook val = new Hook((MethodBase)typeof(CharacterBody).GetMethod("get_hasOneShotProtection", (BindingFlags)(-1)), typeof(DifficultyChanges).GetMethod("ReflectOnThatThang", (BindingFlags)(-1)));
}
public static bool ReflectOnThatThang(orig_getHasOneShotProtection orig, CharacterBody self)
{
return false;
}
public static void AddPotentialProtection()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
PickupPickerPanel.Awake += new hook_Awake(CommandOrPotentialArmor);
static void CommandOrPotentialArmor(orig_Awake orig, PickupPickerPanel self)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
CharacterBody cachedBody = firstLocalUser.cachedBody;
cachedBody.AddTimedBuffAuthority(GetBuffIndex(), potentialProtectionDuration);
orig.Invoke(self);
}
static BuffIndex GetBuffIndex()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
if (potentialProtectionVisibility)
{
return Buffs.Immune.buffIndex;
}
return Buffs.HiddenInvincibility.buffIndex;
}
}
public static void AddPityCharge()
{
//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
ChargingState.FixedUpdate += new hook_FixedUpdate(WeakenBossPostTpCharge);
ChargingState.OnExit += new hook_OnExit(PityChargeOnExit);
}
public static void PityChargeOnExit(orig_OnExit orig, ChargingState self)
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
orig.Invoke(self);
if (pityChargeOn)
{
pityChargeOn = false;
pityChargeShrinkDelta = 0f;
pityChargeRecolorDelta = 0f;
((BaseTeleporterState)self).teleporterInteraction.holdoutZoneController.calcColor -= new CalcColorDelegate(PityChargeCalcColor);
((BaseTeleporterState)self).teleporterInteraction.holdoutZoneController.calcRadius -= new CalcRadiusDelegate(PityChargeCalcRadius);
}
}
public static void PityChargeCalcRadius(ref float radius)
{
radius = Mathf.Max(radius * (1f - pityChargeShrinkDelta), 10f);
}
public static void PityChargeCalcColor(ref Color color)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
color = FocusConvergenceController.convergenceMaterialColor;
}
public static void WeakenBossPostTpCharge(orig_FixedUpdate orig, ChargingState baseState)
{
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Expected O, but got Unknown
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: 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_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_022d: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(baseState);
if (!StormRunBehavior.IsStormStage(Stage.instance.sceneDef))
{
return;
}
if (((BaseTeleporterState)baseState).teleporterInteraction.holdoutZoneController.charge >= 1f)
{
if (((BaseTeleporterState)baseState).teleporterInteraction.monstersCleared || !((BaseTeleporterState)baseState).teleporterInteraction.holdoutZoneController.isAnyoneCharging)
{
return;
}
if (!pityChargeOn)
{
pityChargeOn = true;
((BaseTeleporterState)baseState).teleporterInteraction.holdoutZoneController.calcColor += new CalcColorDelegate(PityChargeCalcColor);
((BaseTeleporterState)baseState).teleporterInteraction.holdoutZoneController.calcRadius += new CalcRadiusDelegate(PityChargeCalcRadius);
Chat.AddMessage("");
}
if (pityChargeRecolorDelta < 1f)
{
pityChargeRecolorDelta += Time.fixedDeltaTime;
}
pityChargeShrinkDelta += Time.fixedDeltaTime * 0.01f;
if (!NetworkServer.active)
{
return;
}
BossGroup bossGroup = ((BaseTeleporterState)baseState).teleporterInteraction.bossGroup;
BossMemory[] bossMemories = bossGroup.bossMemories;
foreach (BossMemory val in bossMemories)
{
CharacterBody val2 = val.cachedBody;
if ((Object)(object)val2 == (Object)null && (Object)(object)val.cachedMaster != (Object)null)
{
val2 = val.cachedMaster.GetBody();
}
if ((Object)(object)val2 != (Object)null)
{
val2.AddTimedBuff(Buffs.Cripple, 9999f);
val2.AddTimedBuff(Buffs.HealingDisabled, 9999f);
HealthComponent healthComponent = val2.healthComponent;
if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.health > 1f)
{
DamageInfo val3 = new DamageInfo();
val3.damage = (val2.maxHealth + val2.maxShield) * 0.01f * Time.fixedDeltaTime;
val3.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)2048), (DamageTypeExtended)0, (DamageSource)0);
val3.damageType |= DamageTypeCombo.op_Implicit((DamageType)2);
val3.damageType |= DamageTypeCombo.op_Implicit((DamageType)64);
val3.procCoefficient = 1f;
val3.position = val2.corePosition;
healthComponent.TakeDamage(val3);
}
}
}
}
else
{
pityChargeOn = false;
}
}
public static void ChangeDirectorStats()
{
//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_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Expected O, but got Unknown
GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion();
CombatDirector[] components = val.GetComponents();
if (components.Length != 0)
{
CombatDirector val2 = components[0];
if ((Object)(object)val2 != (Object)null)
{
val2.eliteBias = fastDirectorEliteBias;
val2.eliteBias = fastDirectorCreditMultiplier;
}
CombatDirector val3 = components[1];
if ((Object)(object)val3 != (Object)null)
{
val3.eliteBias = slowDirectorEliteBias;
val3.eliteBias = slowDirectorCreditMultiplier;
}
}
CombatDirector.Awake += new hook_Awake(AdjustTpDirectors);
CombatDirector.SetNextSpawnAsBoss += new hook_SetNextSpawnAsBoss(FixBossDirectorCredits);
}
private static void FixBossDirectorCredits(orig_SetNextSpawnAsBoss orig, CombatDirector self)
{
self.monsterCredit *= teleBossCreditMultiplier;
orig.Invoke(self);
}
private static void AdjustTpDirectors(orig_Awake orig, CombatDirector director)
{
if (director.customName == "Boss")
{
AdjustTpBossDirector(director);
}
if (director.customName == "Monsters")
{
AdjustTpMonsterDirector(director);
}
orig.Invoke(director);
}
private static void AdjustDirectorsForTeleporter(orig_Awake orig, TeleporterInteraction self)
{
AdjustTpBossDirector(self.bossDirector);
AdjustTpBossDirector(self.companionBoss);
AdjustTpMonsterDirector(self.bonusDirector);
orig.Invoke(self);
}
private static void AdjustTeleporterDirectors(CombatDirector[] directors)
{
if (directors != null && directors.Length != 0)
{
foreach (CombatDirector val in directors)
{
}
}
}
private static void AdjustTpBossDirector(CombatDirector director)
{
director.eliteBias = teleBossEliteBias;
director.creditMultiplier = teleBossCreditMultiplier;
if (Run.instance.stageClearCount == 0)
{
director.creditMultiplier *= teleBossCreditMultiplierStage1;
}
}
private static void AdjustTpMonsterDirector(CombatDirector director)
{
director.eliteBias = teleLesserEliteBias;
director.creditMultiplier = teleLesserCreditMultiplier;
}
public static void IncreaseStageInteractableCredits(StageSettings settings, StageInfo currentStage)
{
settings.SceneDirectorInteractableCredits = (int)((float)settings.SceneDirectorInteractableCredits + interactableCreditsAdd);
}
public static void IncreaseStageMonsterCredits(StageSettings settings, StageInfo currentStage)
{
settings.SceneDirectorMonsterCredits = (int)((float)settings.SceneDirectorMonsterCredits * monsterCreditsMultiplier);
}
public static void AddDifficultyStats()
{
//IL_000a: 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_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected I4, but got Unknown
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < 11; i++)
{
DifficultyIndex val = (DifficultyIndex)i;
DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val);
StartingDifficulty val2 = (StartingDifficulty)0;
float num = 0f;
float startingDifficultyCoefficientBoost = difficultyDef.scalingValue - 1f;
int num2 = ambientLevelCap;
int num3 = 5;
float num4 = 1f;
DifficultyIndex val3 = val;
DifficultyIndex val4 = val3;
switch ((int)val4)
{
case 0:
val2 = (StartingDifficulty)0;
num = drizzleDifficultyBoost;
num3 = Tier2EliteMinimumStageDrizzle;
num4 = easyTeleParticleRadius;
num2 = ambientLevelCapDrizzle;
break;
case 1:
val2 = (StartingDifficulty)3;
num = rainstormDifficultyBoost;
num3 = Tier2EliteMinimumStageRainstorm;
num4 = normalTeleParticleRadius;
break;
case 2:
val2 = (StartingDifficulty)6;
num = monsoonDifficultyBoost;
num3 = Tier2EliteMinimumStageMonsoon;
num4 = hardTeleParticleRadius;
break;
default:
val2 = (StartingDifficulty)6;
num = monsoonDifficultyBoost;
num3 = Tier2EliteMinimumStageMonsoon;
num4 = hardTeleParticleRadius;
break;
}
MoreDifficultyStats moreDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(val);
moreDifficultyStats.startingDifficultyDisplay = (float)val2;
moreDifficultyStats.startingLevelBoost = num;
moreDifficultyStats.startingDifficultyCoefficientBoost = startingDifficultyCoefficientBoost;
moreDifficultyStats.ambientLevelCap = num2;
moreDifficultyStats.tier2EliteStage = num3;
moreDifficultyStats.teleporterParticleRangeMultiplier = num4;
DifficultyUtilsModule.difficultyCustomStats[val] = moreDifficultyStats;
}
}
public static void AddMonsoonScalingStats()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
RiskierRainPlugin.monsoonDesc += "\n>Enemies gain