using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Jotunn;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RtDOceanFoods")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RtDOceanFoods")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7d73ed15-3a73-40b5-813b-c23c5506fd0c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace rtDOceanFoods;
[BepInPlugin("Soloredis.RtDOceanFoods", "RtDOceanFoods", "0.0.6")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class RtDOceanFoods : BaseUnityPlugin
{
public const string PluginGUID = "Soloredis.RtDOceanFoods";
public const string PluginName = "RtDOceanFoods";
public const string PluginVersion = "0.0.6";
public static bool isModded = true;
public AssetBundle MyAssets;
internal static ManualLogSource Log;
public ConfigEntry<bool> LoggingEnable;
private CustomLocalization Localization;
public ConfigEntry<bool> JSONEnable;
public ConfigEntry<bool> JSONCustomEnable;
public string[] ItemList = new string[31]
{
"FishWraps1_RtD", "FishWraps2_RtD", "FishWraps3_RtD", "FishWraps4_RtD", "FishWraps5_RtD", "FishWraps6_RtD", "FishWraps7_RtD", "FishWraps8_RtD", "FishWraps9_RtD", "FishWraps10_RtD",
"FishWraps11_RtD", "FishWraps12_RtD", "SeaMonsterStew_RtD", "SharkMeatStew_RtD", "SeaMonsterTailCooked_RtD", "SeaMonsterTailRaw_RtD", "SeaWeed_RtD", "SharkMeatCooked_RtD", "SharkMeatRaw_RtD", "FishCooked1_RtD",
"FishCooked2_RtD", "FishCooked3_RtD", "FishCooked4_RtD", "FishCooked5_RtD", "FishCooked6_RtD", "FishCooked7_RtD", "FishCooked8_RtD", "FishCooked9_RtD", "FishCooked10_RtD", "FishCooked11_RtD",
"FishCooked12_RtD"
};
private void Awake()
{
CreateConfigs();
Log = ((BaseUnityPlugin)this).Logger;
LoadBundle();
AddItems();
TranslationJsons();
PrefabManager.OnPrefabsRegistered += EditDrops;
PrefabManager.OnPrefabsRegistered += AddDropsCheck;
PrefabManager.OnPrefabsRegistered += CharacterFoodDrops;
if (JSONEnable.Value)
{
PrefabManager.OnPrefabsRegistered += AddRecipesFromJson;
}
if (JSONCustomEnable.Value)
{
PrefabManager.OnPrefabsRegistered += AddCustomRecipesFromJson;
}
if (LoggingEnable.Value)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)"Logging is enabled in the config.");
}
}
private void LoadBundle()
{
try
{
MyAssets = AssetUtils.LoadAssetBundleFromResources("rtdoceanfoods", Assembly.GetExecutingAssembly());
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while loading bundle: {arg}");
}
}
public void CreateConfigs()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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_004a: Expected O, but got Unknown
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Expected O, but got Unknown
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Expected O, but got Unknown
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Expected O, but got Unknown
try
{
((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
JSONEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("Default Recipes", "Enable", true, new ConfigDescription("Enable or Disable. Enabled by default. Set to false to use custom recipes. ", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
{
IsAdminOnly = true,
Order = 55
} }));
JSONCustomEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("Custom Recipes", "Enable", false, new ConfigDescription("Enable or Disable. Disabled by default. Set to true to use custom recipe & make sure default is set to false. Place custom recipes within configs: Soloredis/RtDOceanFoods/Custom/Recipes. Example JSON can be found within Custom/Recipes or simply copy default and change values.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
{
IsAdminOnly = true,
Order = 60
} }));
LoggingEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("RtDOceanFoods Logging", "Enable", false, new ConfigDescription("Enables logging. Disabled by default", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
{
IsAdminOnly = true
} }));
SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr)
{
if (attr.InitialSynchronization)
{
Logger.LogMessage((object)"Initial Config sync event received for test");
}
else
{
Logger.LogMessage((object)"Config sync event received for test");
}
};
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding configuration values: {arg}");
}
}
private void TranslationJsons()
{
try
{
Localization = LocalizationManager.Instance.GetLocalization();
string[] files = Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Soloredis/RtDOceanFoods/Translations"), "*.json", SearchOption.AllDirectories);
foreach (string text in files)
{
Localization.AddJsonFile(Path.GetFileNameWithoutExtension(text), AssetUtils.LoadText(text));
}
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding translations from json files: {arg}");
}
}
private void AddRecipesFromJson()
{
try
{
string[] files = Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Soloredis/RtDOceanFoods/Recipes"), "*.json", SearchOption.AllDirectories);
foreach (string text in files)
{
ItemManager.Instance.AddRecipesFromJson(text);
if (LoggingEnable.Value)
{
((BaseUnityPlugin)this).Logger.LogMessage((object)("Added recipes from: " + text));
}
}
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding recipes from json files due to missing rtd mod: {arg}");
}
finally
{
PrefabManager.OnPrefabsRegistered -= AddRecipesFromJson;
}
}
private void AddCustomRecipesFromJson()
{
try
{
string[] files = Directory.GetFiles(Path.Combine(Paths.ConfigPath, "Soloredis/RtDOceanFoods/Custom/Recipes"), "*.json", SearchOption.AllDirectories);
foreach (string text in files)
{
ItemManager.Instance.AddRecipesFromJson(text);
if (LoggingEnable.Value)
{
((BaseUnityPlugin)this).Logger.LogMessage((object)("Added recipes from: " + text));
}
}
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding recipes from json files due to misconfigured custom JSON recipe: {arg}");
}
finally
{
PrefabManager.OnPrefabsRegistered -= AddCustomRecipesFromJson;
}
}
private void AddItems()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
try
{
string[] itemList = ItemList;
foreach (string text in itemList)
{
GameObject val = MyAssets.LoadAsset<GameObject>(text);
if ((Object)(object)val != (Object)null)
{
CustomItem val2 = new CustomItem(val, true);
ItemManager.Instance.AddItem(val2);
if (LoggingEnable.Value)
{
((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Object database"));
}
}
else
{
((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + text + " to the object database"));
}
}
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding prefabs: {arg}");
}
}
private void CharacterFoodDrops()
{
//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_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Expected O, but got Unknown
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: 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_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Expected O, but got Unknown
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Expected O, but got Unknown
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: 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_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Expected O, but got Unknown
//IL_0230: 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_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0248: 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_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Expected O, but got Unknown
//IL_0298: Unknown result type (might be due to invalid IL or missing references)
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Expected O, but got Unknown
//IL_0300: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0326: Unknown result type (might be due to invalid IL or missing references)
//IL_032d: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Expected O, but got Unknown
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_036d: Unknown result type (might be due to invalid IL or missing references)
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
//IL_03a1: Expected O, but got Unknown
//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0409: Expected O, but got Unknown
//IL_0438: Unknown result type (might be due to invalid IL or missing references)
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_0450: Unknown result type (might be due to invalid IL or missing references)
//IL_0457: Unknown result type (might be due to invalid IL or missing references)
//IL_045e: Unknown result type (might be due to invalid IL or missing references)
//IL_0465: Unknown result type (might be due to invalid IL or missing references)
//IL_0471: Expected O, but got Unknown
try
{
GameObject prefab = PrefabManager.Instance.GetPrefab("Shark_RtD");
GameObject prefab2 = PrefabManager.Instance.GetPrefab("SharkMeatRaw_RtD");
prefab.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab2,
m_chance = 1f,
m_amountMin = 5,
m_amountMax = 6,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab3 = PrefabManager.Instance.GetPrefab("BoneFish_RtD");
GameObject prefab4 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab3.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab4,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab5 = PrefabManager.Instance.GetPrefab("BoneSquid_RtD");
GameObject prefab6 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab5.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab6,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab7 = PrefabManager.Instance.GetPrefab("BoneSquid_RtD");
GameObject prefab8 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab7.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab8,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab9 = PrefabManager.Instance.GetPrefab("LuminousLooker_RtD");
GameObject prefab10 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab9.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab10,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab11 = PrefabManager.Instance.GetPrefab("Reptile_RtD");
GameObject prefab12 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab11.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab12,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab13 = PrefabManager.Instance.GetPrefab("CatFish_RtD");
GameObject prefab14 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab13.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab14,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab15 = PrefabManager.Instance.GetPrefab("CatFishWanderer_RtD");
GameObject prefab16 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab15.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab16,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab17 = PrefabManager.Instance.GetPrefab("ReptileWanderer_RtD");
GameObject prefab18 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab17.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab18,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab19 = PrefabManager.Instance.GetPrefab("MirLizard_RtD");
GameObject prefab20 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab19.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab20,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
GameObject prefab21 = PrefabManager.Instance.GetPrefab("MirRake_RtD");
GameObject prefab22 = PrefabManager.Instance.GetPrefab("SeaMonsterTailRaw_RtD");
prefab21.GetComponent<CharacterDrop>().m_drops.Add(new Drop
{
m_prefab = prefab22,
m_chance = 1f,
m_amountMin = 2,
m_amountMax = 3,
m_levelMultiplier = false,
m_onePerPlayer = false
});
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while loading bundle: {arg}");
}
finally
{
PrefabManager.OnPrefabsRegistered -= CharacterFoodDrops;
}
}
private void EditDrops()
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: 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_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: 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_0230: 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_02a3: 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_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_035e: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0444: Unknown result type (might be due to invalid IL or missing references)
//IL_046f: Unknown result type (might be due to invalid IL or missing references)
//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_052a: Unknown result type (might be due to invalid IL or missing references)
//IL_0555: Unknown result type (might be due to invalid IL or missing references)
//IL_059d: Unknown result type (might be due to invalid IL or missing references)
//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0610: Unknown result type (might be due to invalid IL or missing references)
//IL_063b: Unknown result type (might be due to invalid IL or missing references)
//IL_0683: Unknown result type (might be due to invalid IL or missing references)
//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0721: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject prefab = Cache.GetPrefab<GameObject>("SeaWeed1_RtD");
GameObject prefab2 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component = prefab.GetComponent<DropOnDestroyed>();
component.m_dropWhenDestroyed.m_dropChance = 1f;
component.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab2,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab3 = Cache.GetPrefab<GameObject>("SeaWeed2_RtD");
GameObject prefab4 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component2 = prefab3.GetComponent<DropOnDestroyed>();
component2.m_dropWhenDestroyed.m_dropChance = 1f;
component2.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab4,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab5 = Cache.GetPrefab<GameObject>("SeaWeed3_RtD");
GameObject prefab6 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component3 = prefab5.GetComponent<DropOnDestroyed>();
component3.m_dropWhenDestroyed.m_dropChance = 1f;
component3.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab6,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab7 = Cache.GetPrefab<GameObject>("SeaWeed4_RtD");
GameObject prefab8 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component4 = prefab7.GetComponent<DropOnDestroyed>();
component4.m_dropWhenDestroyed.m_dropChance = 1f;
component4.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab8,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab9 = Cache.GetPrefab<GameObject>("SeaWeed5_RtD");
GameObject prefab10 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component5 = prefab9.GetComponent<DropOnDestroyed>();
component5.m_dropWhenDestroyed.m_dropChance = 1f;
component5.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab10,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab11 = Cache.GetPrefab<GameObject>("SeaWeed6_RtD");
GameObject prefab12 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component6 = prefab11.GetComponent<DropOnDestroyed>();
component6.m_dropWhenDestroyed.m_dropChance = 1f;
component6.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab12,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab13 = Cache.GetPrefab<GameObject>("SeaWeed7_RtD");
GameObject prefab14 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component7 = prefab13.GetComponent<DropOnDestroyed>();
component7.m_dropWhenDestroyed.m_dropChance = 1f;
component7.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab14,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab15 = Cache.GetPrefab<GameObject>("SeaWeed8_RtD");
GameObject prefab16 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component8 = prefab15.GetComponent<DropOnDestroyed>();
component8.m_dropWhenDestroyed.m_dropChance = 1f;
component8.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab16,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab17 = Cache.GetPrefab<GameObject>("SeaWeed9_RtD");
GameObject prefab18 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component9 = prefab17.GetComponent<DropOnDestroyed>();
component9.m_dropWhenDestroyed.m_dropChance = 1f;
component9.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab18,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab19 = Cache.GetPrefab<GameObject>("SeaWeed10_RtD");
GameObject prefab20 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component10 = prefab19.GetComponent<DropOnDestroyed>();
component10.m_dropWhenDestroyed.m_dropChance = 1f;
component10.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab20,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab21 = Cache.GetPrefab<GameObject>("SeaWeed11_RtD");
GameObject prefab22 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component11 = prefab21.GetComponent<DropOnDestroyed>();
component11.m_dropWhenDestroyed.m_dropChance = 1f;
component11.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab22,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab23 = Cache.GetPrefab<GameObject>("SeaWeed12_RtD");
GameObject prefab24 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component12 = prefab23.GetComponent<DropOnDestroyed>();
component12.m_dropWhenDestroyed.m_dropChance = 1f;
component12.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab24,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab25 = Cache.GetPrefab<GameObject>("SeaWeed13_RtD");
GameObject prefab26 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component13 = prefab25.GetComponent<DropOnDestroyed>();
component13.m_dropWhenDestroyed.m_dropChance = 1f;
component13.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab26,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab27 = Cache.GetPrefab<GameObject>("SeaWeed14_RtD");
GameObject prefab28 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component14 = prefab27.GetComponent<DropOnDestroyed>();
component14.m_dropWhenDestroyed.m_dropChance = 1f;
component14.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab28,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab29 = Cache.GetPrefab<GameObject>("SeaWeed15_RtD");
GameObject prefab30 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component15 = prefab29.GetComponent<DropOnDestroyed>();
component15.m_dropWhenDestroyed.m_dropChance = 1f;
component15.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab30,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
GameObject prefab31 = Cache.GetPrefab<GameObject>("SeaWeed16_RtD");
GameObject prefab32 = Cache.GetPrefab<GameObject>("SeaWeed_RtD");
DropOnDestroyed component16 = prefab31.GetComponent<DropOnDestroyed>();
component16.m_dropWhenDestroyed.m_dropChance = 1f;
component16.m_dropWhenDestroyed.m_drops.Add(new DropData
{
m_item = prefab32,
m_stackMin = 2,
m_stackMax = 3,
m_weight = 1f
});
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while modifing Drops's: {arg}");
}
finally
{
PrefabManager.OnPrefabsRegistered -= EditDrops;
}
}
private void AddDropsCheck()
{
try
{
GameObject prefab = Cache.GetPrefab<GameObject>("Lobaco_RtD");
if (!Object.op_Implicit((Object)(object)prefab))
{
((BaseUnityPlugin)this).Logger.LogMessage((object)"RtDOcean was not installed, skipping drops related to this mod.");
}
}
catch (Exception arg)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding drops: {arg}");
}
finally
{
PrefabManager.OnPrefabsRegistered -= AddDropsCheck;
}
}
}