using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EpicJewels.Common;
using EpicJewels.GemEffects;
using HarmonyLib;
using JetBrains.Annotations;
using Jewelcrafting;
using Microsoft.CodeAnalysis;
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("EpicJewels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EpicJewels")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
[module: UnverifiableCode]
namespace EpicJewels
{
public static class CustomGems
{
public static void AddGems()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
API.AddGems("Jade", "jade", new Color(0.031f, 0.69f, 0.043f));
API.AddGems("Amber", "amber", new Color(1f, 0.776f, 0.071f));
API.AddGems("Aquamarine", "aquamarine", new Color(0.259f, 0.663f, 1f, 0.71f));
API.AddGems("Garnet", "garnet", new Color(1f, 0.141f, 0.039f));
API.AddGems("Opal", "opel", new Color(0.945f, 0.988f, 0.988f));
API.AddGems("Amethyst", "amethyst", new Color(0.784f, 0.302f, 0.98f));
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("AddSlashDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [3, 6, 9]");
stringBuilder.AppendLine("AddChopDamage:");
stringBuilder.AppendLine(" slot: tool");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [6, 9, 12]");
stringBuilder.AppendLine("CoinHoarder:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [1, 2.5, 5]");
stringBuilder.AppendLine("CoinGreed:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [5, 10, 20]");
stringBuilder.AppendLine("SlashResistance:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("ExpertAcrobat:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("ExpertDaggers:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("AddSlashDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: jade");
stringBuilder.AppendLine(" power: [3, 6, 9]");
stringBuilder.AppendLine("BluntResistance:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("ExpertSmasher:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("AddBluntDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [3, 6, 9]");
stringBuilder.AppendLine("ExpertSpearmaiden:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("BlockReduceStamina:");
stringBuilder.AppendLine(" slot: shield");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [10, 15, 20]");
stringBuilder.AppendLine("WeaponReducedStamina:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [5, 10, 15]");
stringBuilder.AppendLine("IncreaseStaminaRegen:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: amber");
stringBuilder.AppendLine(" power: [5, 10, 15]");
stringBuilder.AppendLine("PierceResistance:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("ExpertSprinter:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("AddPierceDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [3, 6, 9]");
stringBuilder.AppendLine("WaterSwiftness:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("WaterFrenzy:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [6, 9, 18]");
stringBuilder.AppendLine("WaterResistant:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: aquamarine");
stringBuilder.AppendLine(" power: [15, 30, 60]");
stringBuilder.AppendLine("FireResistance:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("ExpertAxemaster:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("ExpertMage:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("Inferno:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [20, 40, 60]");
stringBuilder.AppendLine("AddPickaxeDamage:");
stringBuilder.AppendLine(" slot: tool");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [6, 9, 12]");
stringBuilder.AppendLine("BurningFrenzy:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [6, 9, 18]");
stringBuilder.AppendLine("BurningViking:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: garnet");
stringBuilder.AppendLine(" power: [5, 15, 30]");
stringBuilder.AppendLine("AddLightningDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [6, 9, 12]");
stringBuilder.AppendLine("ExpertFisher:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("ExpertHarvester:");
stringBuilder.AppendLine(" slot: tool");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("ExpertPolearms:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("ReduceWeight:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [2, 4, 6]");
stringBuilder.AppendLine("LightningResistance:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("CoverOfDarkness:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: opel");
stringBuilder.AppendLine(" power: [10, 15, 30]");
stringBuilder.AppendLine("AddSpiritDamage:");
stringBuilder.AppendLine(" slot: ['weapon', 'elementalmagic', 'bow', 'crossbow']");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [9, 12, 18]");
stringBuilder.AppendLine("ExpertSwordsman:");
stringBuilder.AppendLine(" slot: chest");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("IncreaseStamina:");
stringBuilder.AppendLine(" slot: utility");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [6, 9, 15]");
stringBuilder.AppendLine("IncreaseEitr:");
stringBuilder.AppendLine(" slot: head");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [6, 9, 15]");
stringBuilder.AppendLine("ExpertBrawler:");
stringBuilder.AppendLine(" slot: legs");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [5, 7, 12]");
stringBuilder.AppendLine("PoisonResistance:");
stringBuilder.AppendLine(" slot: cloak");
stringBuilder.AppendLine(" gem: amethyst");
stringBuilder.AppendLine(" power: [1, 3, 5]");
stringBuilder.AppendLine("gems:");
stringBuilder.AppendLine(" meadows:");
stringBuilder.AppendLine(" aquamarine: 0.1");
stringBuilder.AppendLine(" amber: 0.1");
stringBuilder.AppendLine(" jade: 0.3");
stringBuilder.AppendLine(" black forest:");
stringBuilder.AppendLine(" jade: 0.1");
stringBuilder.AppendLine(" garnet: 0.1");
stringBuilder.AppendLine(" opel: 0.1");
stringBuilder.AppendLine(" swamp:");
stringBuilder.AppendLine(" amber: 0.2");
stringBuilder.AppendLine(" garnet: 0.2");
stringBuilder.AppendLine(" opel: 0.1");
stringBuilder.AppendLine(" mountain:");
stringBuilder.AppendLine(" aquamarine: 0.4");
stringBuilder.AppendLine(" jade: 0.2");
stringBuilder.AppendLine(" amethyst: 0.1");
stringBuilder.AppendLine(" plains:");
stringBuilder.AppendLine(" amber: 0.4");
stringBuilder.AppendLine(" garnet: 0.4");
stringBuilder.AppendLine(" opel: 0.1");
stringBuilder.AppendLine(" mistlands:");
stringBuilder.AppendLine(" aquamarine: 0.2");
stringBuilder.AppendLine(" amethyst: 0.4");
stringBuilder.AppendLine(" opel: 0.1");
stringBuilder.AppendLine(" ash lands:");
stringBuilder.AppendLine(" amethyst: 0.2");
stringBuilder.AppendLine(" garnet: 0.4");
stringBuilder.AppendLine(" opel: 0.1");
API.AddGemConfig(stringBuilder.ToString());
}
}
[BepInPlugin("MidnightsFX.EpicJewels", "EpicJewels", "0.2.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class EpicJewels : BaseUnityPlugin
{
public const string PluginGUID = "MidnightsFX.EpicJewels";
public const string PluginName = "EpicJewels";
public const string PluginVersion = "0.2.1";
public static readonly ManualLogSource EJLog = Logger.CreateLogSource("EpicJewels");
public Config cfg;
private void Awake()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Expected O, but got Unknown
cfg = new Config(((BaseUnityPlugin)this).Config);
EJLog.LogInfo((object)"Let the gems flow.");
EffectList.AddGemEffects();
CustomGems.AddGems();
Assembly executingAssembly = Assembly.GetExecutingAssembly();
Harmony val = new Harmony("MidnightsFX.EpicJewels");
val.PatchAll(executingAssembly);
}
}
}
namespace EpicJewels.GemEffects
{
public static class AddBluntDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
static AddBluntDamage()
{
}
}
public static class AddChopDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
public static class CoverOfDarkness
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "Damage")]
public static class SummonBatHelpers
{
private static void Prefix(HitData hit)
{
if (!(hit.GetAttacker() is Player) || !(Player.m_localPlayer.GetEffectPower<Config>("CoverOfDarkness").Power > 0f) || !(Random.value < 0.15f))
{
return;
}
EpicJewels.EJLog.LogDebug((object)string.Format("Cover of darkness triggered darkness power: {0}", Player.m_localPlayer.GetEffectPower<Config>("CoverOfDarkness").Power));
int stars = 1;
float power = Player.m_localPlayer.GetEffectPower<Config>("CoverOfDarkness").Power;
float num = power;
if (num > 70f)
{
stars = 4;
}
else
{
float num2 = num;
if (num2 > 50f)
{
stars = 3;
}
else
{
float num3 = num;
if (num3 > 30f)
{
stars = 2;
}
}
}
if (Player.m_localPlayer.GetEffectPower<Config>("CoverOfDarkness").Power > 90f)
{
SpawnBat(stars);
SpawnBat(stars);
}
else
{
SpawnBat(stars);
}
}
}
private static GameObject bat;
private static void SpawnBat(int stars = 1)
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: 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_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)bat == (Object)null)
{
ZNetScene.instance.m_namedPrefabs.TryGetValue(StringExtensionMethods.GetStableHashCode("Bat"), out bat);
}
Quaternion val = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
Vector3 position = ((Component)Player.m_localPlayer).gameObject.transform.position;
position.z += 0.5f;
GameObject val2 = Object.Instantiate<GameObject>(bat, position, val);
Character component = val2.GetComponent<Character>();
component.m_level = stars;
Object.Destroy((Object)(object)val2.GetComponent<CharacterDrop>());
Humanoid component2 = val2.GetComponent<Humanoid>();
if ((Object)(object)component2 != (Object)null)
{
((Character)component2).m_faction = (Faction)0;
}
else
{
Object.Destroy((Object)(object)val2);
}
val2.AddComponent<CharacterTimedDestruction>();
val2.GetComponent<CharacterTimedDestruction>().m_character = component;
val2.GetComponent<CharacterTimedDestruction>().Trigger(Player.m_localPlayer.GetEffectPower<Config>("CoverOfDarkness").Power);
}
}
public static class Inferno
{
[PublicAPI]
public struct Config
{
[MultiplicativePercentagePower]
public float Power;
}
}
public static class AddLightningDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
internal class AddPickaxeDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
public static class AddPierceDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
public static class AddSlashDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
public static class AddSpiritDamage
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
}
public static class BlockReduceStamina
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Humanoid), "BlockAttack")]
public static class ModifyBlockStaminaUse_Humanoid_BlockAttack_Patch
{
public static void Prefix(Humanoid __instance, HitData hit, Character attacker)
{
if (((Character)__instance).IsPlayer() && Player.m_localPlayer.GetEffectPower<Config>("BlockReduceStamina").Power > 0f)
{
float num = 100f / (100f + Player.m_localPlayer.GetEffectPower<Config>("BlockReduceStamina").Power);
EpicJewels.EJLog.LogDebug((object)$"Multiplying block stamina cost by {num}");
__instance.m_blockStaminaDrain *= num;
}
}
}
}
public static class BluntResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReduceBluntDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_blunt > 0f && val.GetEffectPower<Config>("BluntResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("BluntResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Blunt Resistance is reducing Blunt damage {1f - num}");
hit.m_damage.m_slash *= num;
}
}
}
}
}
public static class BurningFrenzy
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "Damage")]
private class AddBonusBonusDamageWhileOnFire
{
private static void Prefix(HitData hit)
{
if (hit.GetAttacker() is Player)
{
bool flag = ((Character)Player.m_localPlayer).GetSEMan().HaveStatusEffect(burningstatus);
EpicJewels.EJLog.LogDebug((object)$"Frenzy checking for burning viking {flag}");
if (flag)
{
float num = (100f + Player.m_localPlayer.GetEffectPower<Config>("BurningFrenzy").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"VikingOnFire Damage multiplier {num}");
hit.m_damage.m_blunt *= num;
hit.m_damage.m_pierce *= num;
hit.m_damage.m_pierce *= num;
hit.m_damage.m_fire *= num;
hit.m_damage.m_lightning *= num;
hit.m_damage.m_frost *= num;
hit.m_damage.m_spirit *= num;
hit.m_damage.m_poison *= num;
hit.m_damage.m_pickaxe *= num;
}
}
}
}
private static int burningstatus = StringExtensionMethods.GetStableHashCode("Burning");
}
public static class BurningViking
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Player), "GetJogSpeedFactor")]
private class IncreaseJogSpeed
{
private static void Postfix(Player __instance, ref float __result)
{
if (((Character)Player.m_localPlayer).GetSEMan().HaveStatusEffect(burningstatus) && __instance.GetEffectPower<Config>("BurningViking").Power > 0f)
{
__result *= (__instance.GetEffectPower<Config>("BurningViking").Power + 100f) / 100f;
}
}
}
[HarmonyPatch(typeof(Player), "GetRunSpeedFactor")]
private class IncreaseRunSpeed
{
private static void Postfix(Player __instance, ref float __result)
{
if (((Character)Player.m_localPlayer).GetSEMan().HaveStatusEffect(burningstatus) && __instance.GetEffectPower<Config>("BurningViking").Power > 0f)
{
__result *= (__instance.GetEffectPower<Config>("BurningViking").Power + 100f) / 100f;
}
}
}
private static int burningstatus = StringExtensionMethods.GetStableHashCode("Burning");
}
public static class CoinGreed
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "OnDeath")]
public static class AddGreedOnDeathFromPlayer
{
[UsedImplicitly]
private static void Postfix(Character __instance)
{
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)__instance.m_lastHit.GetAttacker() != (Object)(object)Player.m_localPlayer)
{
return;
}
float power = Player.m_localPlayer.GetEffectPower<Config>("CoinGreed").Power;
EpicJewels.EJLog.LogDebug((object)$"Coingreed enabled? {power > 0f}");
if (!(power > 0f))
{
return;
}
float num = 0.15f;
float value = Random.value;
EpicJewels.EJLog.LogDebug((object)$"Coingreed: {value} < {num} = {value < num}");
if (value < num)
{
float num2 = Random.Range(1f, Math.Max(1f, power));
EpicJewels.EJLog.LogDebug((object)$"coingreed drop {(int)num2}");
for (int i = 0; i <= (int)num2; i++)
{
Object.Instantiate<GameObject>(ObjectDB.instance.GetItemPrefab("Coins"), ((Component)__instance).gameObject.transform.position, ((Component)__instance).gameObject.transform.rotation);
}
}
}
}
}
internal class CoinHoarder
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "Damage")]
private class IncreaseAllDamageByCoins
{
private static void Prefix(HitData hit)
{
Character attacker = hit.GetAttacker();
Player val2 = (Player)(object)((attacker is Player) ? attacker : null);
if (val2 != null)
{
ItemData[] array = (from val in ((Humanoid)Player.m_localPlayer).m_inventory.GetAllItems()
where ((Object)val.m_dropPrefab).name == "Coins"
select val).ToArray();
if (array.Length != 0)
{
float num = array[0].m_stack;
float power = Player.m_localPlayer.GetEffectPower<Config>("CoinHoarder").Power;
float num2 = num * (power / 100f);
float num3 = (num2 + 100f) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Coinhorder bonus multipler {num3} coinhorder bonus: {num2} inv coins: {num} coinhorder power: {power}");
hit.m_damage.m_blunt *= num3;
hit.m_damage.m_pierce *= num3;
hit.m_damage.m_slash *= num3;
hit.m_damage.m_fire *= num3;
hit.m_damage.m_lightning *= num3;
hit.m_damage.m_frost *= num3;
hit.m_damage.m_spirit *= num3;
hit.m_damage.m_poison *= num3;
hit.m_damage.m_pickaxe *= num3;
}
}
}
}
}
public static class EffectList
{
public static void AddGemEffects()
{
API.AddGemEffect<BluntResistance.Config>("BluntResistance", "Reduces taken blunt damage.", "Reduces blunt damage taken by $1%.");
API.AddGemEffect<PierceResistance.Config>("PierceResistance", "Reduces taken pierce damage.", "Reduces pierce damage taken by $1%.");
API.AddGemEffect<SlashResistance.Config>("SlashResistance", "Reduces taken slash damage.", "Reduces slash damage taken by $1%.");
API.AddGemEffect<FireResistance.Config>("FireResistance", "Reduces taken fire damage.", "Reduces fire damage taken by $1%.");
API.AddGemEffect<PoisonResistance.Config>("PoisonResistance", "Reduces taken poison damage.", "Reduces poison damage taken by $1%.");
API.AddGemEffect<LightningResistance.Config>("LightningResistance", "Reduces taken lightning damage.", "Reduces lightning damage taken by $1%.");
API.AddGemEffect<AddBluntDamage.Config>("AddBluntDamage", "Adds blunt damage.", "Increases blunt damage done by $1%.");
API.AddGemEffect<AddPierceDamage.Config>("AddPierceDamage", "Adds pierce damage.", "Increases pierce damage done by $1%.");
API.AddGemEffect<AddSlashDamage.Config>("AddSlashDamage", "Adds slash damage.", "Increases slash damage done by $1%.");
API.AddGemEffect<AddSpiritDamage.Config>("AddSpiritDamage", "Adds spirit damage.", "Increases spirit damage done by $1%.");
API.AddGemEffect<AddLightningDamage.Config>("AddLightningDamage", "Adds lightning damage.", "Increases lightning damage done by $1%.");
API.AddGemEffect<AddPickaxeDamage.Config>("AddPickaxeDamage", "Adds pickaxe damage.", "Increases pickaxe damage done by $1%.");
API.AddGemEffect<AddChopDamage.Config>("AddChopDamage", "Adds woodcutting damage.", "Increases woodcutting damage done by $1%.");
API.AddGemEffect<Inferno.Config>("Inferno", "Chance to do massive fire damage.", "20% chance to do $1% of total damage as fire damage.");
API.AddGemEffect<IncreaseEitr.Config>("IncreaseEitr", "Increase max Eitr.", "Increases your total eitr by $1%.");
API.AddGemEffect<IncreaseStamina.Config>("IncreaseStamina", "Increase max stamina.", "Increases your total stamina by $1%.");
API.AddGemEffect<IncreaseStaminaRegen.Config>("IncreaseStaminaRegen", "Increase stamina rate.", "Increases your stamina regeneration rate by $1%.");
API.AddGemEffect<BlockReduceStamina.Config>("BlockReduceStamina", "Reduces stamina cost for blocking.", "Reduces stamina block drain by $1%.");
API.AddGemEffect<WeaponReducedStamina.Config>("WeaponReducedStamina", "Reduces stamina cost for attacking.", "Reduces stamina attack cost by $1%.");
API.AddGemEffect<CoinGreed.Config>("CoinGreed", "Enemies may drop coins", "Enemies have a 15% chance to drop 1-$1 coins.");
API.AddGemEffect<CoinHoarder.Config>("CoinHoarder", "Increase your damage by carrying coins", "Increase all of your damage based on $1% of the total coins you carry.");
API.AddGemEffect<WaterResistant.Config>("WaterResistant", "Prevents wetness for a period of time", "Prevents becoming wet if you are not exposed to water for more than $1% seconds.");
API.AddGemEffect<WaterFrenzy.Config>("WaterFrenzy", "Increases damage when wet", "You deal $1% percent more damage when wet.");
API.AddGemEffect<WaterSwiftness.Config>("WaterSwiftness", "Increases speed when wet", "You move $1% percent faster when wet.");
API.AddGemEffect<BurningViking.Config>("BurningViking", "Increases speed when burning", "You move $1% percent faster when burning.");
API.AddGemEffect<BurningFrenzy.Config>("BurningFrenzy", "Increase damage when burning", "You deal $1% percent more damage when burning.");
API.AddGemEffect<ExpertFisher.Config>("ExpertFisher", "Increase Fishing skill", "Your fishing skill is $1% higher.");
API.AddGemEffect<ExpertMage.Config>("ExpertMage", "Increase Magic skills", "Your Elemental & Blood magic skills are $1% higher.");
API.AddGemEffect<ExpertHarvester.Config>("ExpertHarvester", "Increase Woodcutting & Pickaxe skill", "Your woodcutting and pickaxe skills are $1% higher.");
API.AddGemEffect<ExpertBrawler.Config>("ExpertBrawler", "Increase Brawling skill", "Your fists skill is $1% higher.");
API.AddGemEffect<ExpertAcrobat.Config>("ExpertAcrobat", "Increase Jump skill", "Your jump skill is $1% higher.");
API.AddGemEffect<ExpertDaggers.Config>("ExpertDaggers", "Increase Knives skill", "Your knives skill is $1% higher.");
API.AddGemEffect<ExpertSwordsman.Config>("ExpertSwordsman", "Increase Swords skill", "Your sword skill is $1% higher.");
API.AddGemEffect<ExpertSmasher.Config>("ExpertSmasher", "Increase Maces skill", "Your clubs skill is $1% higher.");
API.AddGemEffect<ExpertPolearms.Config>("ExpertPolearms", "Increase Polearms skill", "Your polearms skill is $1% higher.");
API.AddGemEffect<ExpertSpearmaiden.Config>("ExpertSpearmaiden", "Increase Spears skill", "Your spears skill is $1% higher.");
API.AddGemEffect<ExpertAxemaster.Config>("ExpertAxemaster", "Increase Axe skill", "Your axes skill is $1% higher.");
API.AddGemEffect<ExpertShieldbearer.Config>("ExpertShieldbearer", "Increase Block skill", "Your block skill is $1% higher.");
API.AddGemEffect<ExpertSprinter.Config>("ExpertSprinter", "Increase Run skill", "Your run skill is $1% higher.");
API.AddGemEffect<ReduceWeight.Config>("ReduceWeight", "Reduces Weight of items you carry", "Carried items are $1% lighter.");
API.AddGemEffect<CoverOfDarkness.Config>("CoverOfDarkness", "Summon bats when fighting", "15% Chance to summon a bat that fights for you for $1% seconds, stronger bats with higher levels.");
}
}
public static class ExpertAcrobat
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertAxemaster
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertBrawler
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertDaggers
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertHarvester
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertMage
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertFisher
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertPolearms
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertShieldbearer
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertSmasher
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertSpearmaiden
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertSprinter
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class ExpertSwordsman
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
}
public static class FireResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReducePierceDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_fire > 0f && val.GetEffectPower<Config>("FireResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("FireResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Fire Resistance is reducing fire damage {1f - num}");
hit.m_damage.m_fire *= num;
}
}
}
}
}
public static class IncreaseEitr
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
public static class IncreaseTotalStamina
{
public static void Postfix(Player __instance, ref float eitr)
{
eitr += __instance.GetEffectPower<Config>("IncreaseEitr").Power;
}
}
}
public static class IncreaseStamina
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
public static class IncreaseTotalStamina
{
public static void Postfix(Player __instance, ref float stamina)
{
stamina += __instance.GetEffectPower<Config>("IncreaseStamina").Power;
}
}
}
public static class IncreaseStaminaRegen
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(SEMan), "ModifyStaminaRegen")]
public static class IncreasePlayerStaminaRegen
{
public static void Postfix(SEMan __instance, ref float staminaMultiplier)
{
if (__instance.m_character.IsPlayer() && Player.m_localPlayer.GetEffectPower<Config>("IncreaseStaminaRegen").Power > 0f)
{
float power = Player.m_localPlayer.GetEffectPower<Config>("IncreaseStaminaRegen").Power;
EpicJewels.EJLog.LogDebug((object)$"stamina regen multiplied by {power}");
staminaMultiplier *= power;
}
}
}
}
public static class LightningResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReducePierceDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_lightning > 0f && val.GetEffectPower<Config>("LightningResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("LightningResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Lightning Resistance is reducing lightning damage {1f - num}");
hit.m_damage.m_fire *= num;
}
}
}
}
}
public static class PierceResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReducePierceDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_pierce > 0f && val.GetEffectPower<Config>("PierceResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("PierceResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Pierce Resistance is reducing Pierce damage {1f - num}");
hit.m_damage.m_pierce *= num;
}
}
}
}
}
public static class PoisonResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReducePoisonDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_poison > 0f && val.GetEffectPower<Config>("PoisonResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("PoisonResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Poison Resistance is reducing poison damage {1f - num}");
hit.m_damage.m_poison *= num;
}
}
}
}
}
public static class ReduceWeight
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(ItemData), "GetWeight")]
public static class ReduceWeight_ItemData_GetWeight_Patch
{
public static void Postfix(ref float __result)
{
if (!((Object)(object)Player.m_localPlayer == (Object)null) && Player.m_localPlayer.GetEffectPower<Config>("ReduceWeight").Power > 0f)
{
float num = 100f / (Player.m_localPlayer.GetEffectPower<Config>("ReduceWeight").Power + 100f);
__result *= num;
}
}
}
}
public static class SlashResistance
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "RPC_Damage")]
public static class ReduceSlashDamageTaken
{
[UsedImplicitly]
private static void Prefix(Character __instance, HitData hit)
{
Player val = (Player)(object)((__instance is Player) ? __instance : null);
if (val != null)
{
Character attacker = hit.GetAttacker();
if (attacker != null && (Object)(object)attacker != (Object)(object)__instance && hit.m_damage.m_slash > 0f && val.GetEffectPower<Config>("SlashResistance").Power > 0f)
{
float num = (100f - val.GetEffectPower<Config>("SlashResistance").Power) / 100f;
EpicJewels.EJLog.LogDebug((object)$"Slash Resistance is reducing Slash damage {1f - num}");
hit.m_damage.m_slash *= num;
}
}
}
}
}
public static class WaterFrenzy
{
[PublicAPI]
public struct Config
{
[AdditivePower]
public float Power;
}
[HarmonyPatch(typeof(Character), "Damage")]
private class AddBonusSlashDamage
{
private static void Prefix(HitData hit)
{
if (hit.GetAttacker() is Player)
{
bool flag = ((Character)Player.m_localPlayer).GetSEMan().HaveStatusEffect(wetstatus);
EpicJewels.EJLog.LogDebug((object)$"Frenzy checking for wet viking {flag}");
if (flag)
{
float num = (Player.m_localPlayer.GetEffectPower<Config>("WaterFrenzy").Power + 100f) / 100f;
EpicJewels.EJLog.LogDebug((object)$"WetDogViking Damage multiplier {num}");
hit.m_damage.m_blunt *= num;
hit.m_damage.m_pierce *= num;
hit.m_damage.m_pierce *= num;
hit.m_damage.m_fire *= num;
hit.m_damage.m_lightning *= num;
hit.m_damage.m_frost *= num;
hit.m_damage.m_spirit *= num;
hit.m_damage.m_poison *= num;
hit.m_damage.m_pickaxe *= num;
}
}
}
}
private static int wetstatus = StringExtensionMethods.GetStableHashCode("Wet");
}
internal class WaterResistant
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[]
{
typeof(int),
typeof(bool),
typeof(int),
typeof(float)
})]
public static class Waterproof_SEMan_AddStatusEffect_Patch
{
public static bool Prefix(SEMan __instance, int nameHash)
{
if (__instance.m_character.IsPlayer() && nameHash == wet_hash && Player.m_localPlayer.GetEffectPower<Config>("WaterResistant").Power > 0f)
{
if (delayWetTill == 0f)
{
delayWetTill = Time.time + Player.m_localPlayer.GetEffectPower<Config>("WaterResistant").Power;
EpicJewels.EJLog.LogDebug((object)$"Set water resistance timeout: {delayWetTill}");
return false;
}
if (delayWetTill < Time.time)
{
EpicJewels.EJLog.LogDebug((object)"Water resistance is expired.");
if (delayWetTill + 2f < Time.time)
{
EpicJewels.EJLog.LogDebug((object)"Reset water resistance.");
delayWetTill = 0f;
return false;
}
delayWetTill = 0f;
return true;
}
return false;
}
return true;
}
}
public static float delayWetTill = 0f;
private static int wet_hash = "Wet".GetHashCode();
}
public static class WaterSwiftness
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Player), "GetJogSpeedFactor")]
private class IncreaseJogSpeed
{
private static void Postfix(Player __instance, ref float __result)
{
if (((Character)__instance).GetSEMan().HaveStatusEffect(wetstatus) && __instance.GetEffectPower<Config>("WaterSwiftness").Power > 0f)
{
__result *= (__instance.GetEffectPower<Config>("WaterSwiftness").Power + 100f) / 100f;
}
}
}
[HarmonyPatch(typeof(Player), "GetRunSpeedFactor")]
private class IncreaseRunSpeed
{
private static void Postfix(Player __instance, ref float __result)
{
if (((Character)__instance).GetSEMan().HaveStatusEffect(wetstatus) && __instance.GetEffectPower<Config>("WaterSwiftness").Power > 0f)
{
__result *= (__instance.GetEffectPower<Config>("WaterSwiftness").Power + 100f) / 100f;
}
}
}
private static int wetstatus = StringExtensionMethods.GetStableHashCode("Wet");
}
public static class WeaponReducedStamina
{
[PublicAPI]
public struct Config
{
[InverseMultiplicativePercentagePower]
public float Power;
}
[HarmonyPatch(typeof(Attack), "GetAttackStamina")]
public class ReduceStaminaCostForAttack
{
public static void Postfix(Attack __instance, ref float __result)
{
Humanoid character = __instance.m_character;
Player val = (Player)(object)((character is Player) ? character : null);
if (val != null && Player.m_localPlayer.GetEffectPower<Config>("WeaponReducedStamina").Power > 0f)
{
float num = 100f / (val.GetEffectPower<Config>("WeaponReducedStamina").Power + 100f);
EpicJewels.EJLog.LogDebug((object)$"Stamina Reduction multipler: {num}");
__result *= num;
}
}
}
}
}
namespace EpicJewels.EffectHelpers
{
[HarmonyPatch(typeof(Character), "Damage")]
public static class IncreaseDamageByPowers
{
private static void Prefix(HitData hit)
{
Character attacker = hit.GetAttacker();
Player val = (Player)(object)((attacker is Player) ? attacker : null);
if (val != null)
{
float num = hit.m_damage.m_blunt + hit.m_damage.m_pierce + hit.m_damage.m_slash + hit.m_damage.m_fire + hit.m_damage.m_lightning + hit.m_damage.m_frost + hit.m_damage.m_spirit + hit.m_damage.m_poison;
float num2 = num * (Player.m_localPlayer.GetEffectPower<AddBluntDamage.Config>("AddBluntDamage").Power / 100f);
float num3 = num * (Player.m_localPlayer.GetEffectPower<AddSlashDamage.Config>("AddSlashDamage").Power / 100f);
float num4 = num * (Player.m_localPlayer.GetEffectPower<AddPierceDamage.Config>("AddPierceDamage").Power / 100f);
float num5 = num * (Player.m_localPlayer.GetEffectPower<AddLightningDamage.Config>("AddLightningDamage").Power / 100f);
float num6 = num * (Player.m_localPlayer.GetEffectPower<AddSpiritDamage.Config>("AddSpiritDamage").Power / 100f);
float num7 = num * (Player.m_localPlayer.GetEffectPower<AddPickaxeDamage.Config>("AddPickaxeDamage").Power / 100f);
float num8 = num * (Player.m_localPlayer.GetEffectPower<AddPickaxeDamage.Config>("AddPickaxeDamage").Power / 100f);
float num9 = num2 + num3 + num4 + num5 + num6 + num7;
if (Random.value < 0.2f && Player.m_localPlayer.GetEffectPower<Inferno.Config>("Inferno").Power > 0f)
{
float num10 = num * (Player.m_localPlayer.GetEffectPower<Inferno.Config>("Inferno").Power / 100f);
hit.m_damage.m_fire += num10;
EpicJewels.EJLog.LogDebug((object)$"Inferno activated, added fire damage: {num10}");
}
EpicJewels.EJLog.LogDebug((object)$"Added Damage {num9} = blunt:{num2} slash:{num3} pierce:{num4} lightning: {num5} spirit: {num6} pickaxe: {num7} original_total_dmg {num}");
hit.m_damage.m_blunt += num2;
hit.m_damage.m_pierce += num4;
hit.m_damage.m_slash += num3;
hit.m_damage.m_lightning += num5;
hit.m_damage.m_spirit += num6;
hit.m_damage.m_chop += num8;
hit.m_damage.m_pickaxe += num7;
}
}
}
[HarmonyPatch(typeof(Skills), "GetSkillFactor")]
public static class IncreaseHarvestingSkills
{
[UsedImplicitly]
private static void Postfix(Skills __instance, SkillType skillType, ref float __result)
{
//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_0009: Unknown result type (might be due to invalid IL or missing references)
//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_004d: Expected I4, but got Unknown
//IL_004f: 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_0084: Expected I4, but got Unknown
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Invalid comparison between Unknown and I4
float num = 0f;
switch ((int)skillType)
{
default:
switch (skillType - 100)
{
default:
if ((int)skillType == 999)
{
num += __instance.m_player.GetEffectPower<ExpertHarvester.Config>("ExpertHarvester").Power;
num += __instance.m_player.GetEffectPower<ExpertHarvester.Config>("ExpertHarvester").Power;
num += __instance.m_player.GetEffectPower<ExpertSwordsman.Config>("ExpertSwordsman").Power;
num += __instance.m_player.GetEffectPower<ExpertSpearmaiden.Config>("ExpertSpearmaiden").Power;
num += __instance.m_player.GetEffectPower<ExpertSmasher.Config>("ExpertSmasher").Power;
num += __instance.m_player.GetEffectPower<ExpertPolearms.Config>("ExpertPolearms").Power;
num += __instance.m_player.GetEffectPower<ExpertMage.Config>("ExpertMage").Power;
num += __instance.m_player.GetEffectPower<ExpertMage.Config>("ExpertMage").Power;
num += __instance.m_player.GetEffectPower<ExpertFisher.Config>("ExpertFisher").Power;
num += __instance.m_player.GetEffectPower<ExpertDaggers.Config>("ExpertDaggers").Power;
num += __instance.m_player.GetEffectPower<ExpertBrawler.Config>("ExpertBrawler").Power;
num += __instance.m_player.GetEffectPower<ExpertAxemaster.Config>("ExpertAxemaster").Power;
num += __instance.m_player.GetEffectPower<ExpertShieldbearer.Config>("ExpertShieldbearer").Power;
num += __instance.m_player.GetEffectPower<ExpertAcrobat.Config>("ExpertAcrobat").Power;
}
break;
case 4:
if (__instance.m_player.GetEffectPower<ExpertFisher.Config>("ExpertFisher").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertFisher.Config>("ExpertFisher").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertFisher skill increase {num}");
}
break;
case 0:
if (__instance.m_player.GetEffectPower<ExpertAcrobat.Config>("ExpertAcrobat").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertAcrobat.Config>("ExpertAcrobat").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertAcrobat skill increase {num}");
}
break;
case 2:
if (__instance.m_player.GetEffectPower<ExpertSprinter.Config>("ExpertSprinter").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertSprinter.Config>("ExpertSprinter").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertSprinter skill increase {num}");
}
break;
case 1:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
break;
}
break;
case 1:
if (__instance.m_player.GetEffectPower<ExpertSwordsman.Config>("ExpertSwordsman").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertSwordsman.Config>("ExpertSwordsman").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertSwordsman skill increase {num}");
}
break;
case 5:
if (__instance.m_player.GetEffectPower<ExpertSpearmaiden.Config>("ExpertSpearmaiden").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertSpearmaiden.Config>("ExpertSpearmaiden").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertSpearmaiden skill increase {num}");
}
break;
case 3:
if (__instance.m_player.GetEffectPower<ExpertSmasher.Config>("ExpertSmasher").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertSmasher.Config>("ExpertSmasher").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertSmasher skill increase {num}");
}
break;
case 4:
if (__instance.m_player.GetEffectPower<ExpertPolearms.Config>("ExpertPolearms").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertPolearms.Config>("ExpertPolearms").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertPolearms skill increase {num}");
}
break;
case 9:
case 10:
if (__instance.m_player.GetEffectPower<ExpertMage.Config>("ExpertMage").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertMage.Config>("ExpertMage").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertMage skill increase {num}");
}
break;
case 2:
if (__instance.m_player.GetEffectPower<ExpertDaggers.Config>("ExpertDaggers").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertDaggers.Config>("ExpertDaggers").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertDaggers skill increase {num}");
}
break;
case 11:
if (__instance.m_player.GetEffectPower<ExpertBrawler.Config>("ExpertBrawler").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertBrawler.Config>("ExpertBrawler").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertBrawler skill increase {num}");
}
break;
case 7:
if (__instance.m_player.GetEffectPower<ExpertAxemaster.Config>("ExpertAxemaster").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertAxemaster.Config>("ExpertAxemaster").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertAxemaster skill increase {num}");
}
break;
case 6:
if (__instance.m_player.GetEffectPower<ExpertShieldbearer.Config>("ExpertShieldbearer").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertShieldbearer.Config>("ExpertShieldbearer").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertShieldbearer skill increase {num}");
}
break;
case 12:
case 13:
if (__instance.m_player.GetEffectPower<ExpertHarvester.Config>("ExpertHarvester").Power > 0f)
{
num += __instance.m_player.GetEffectPower<ExpertHarvester.Config>("ExpertHarvester").Power;
EpicJewels.EJLog.LogDebug((object)$"ExpertHarvester skill increase {num}");
}
break;
case 0:
case 8:
case 14:
break;
}
float num2 = (num + 100f) / 100f;
__result *= num2;
}
}
}
namespace EpicJewels.Common
{
internal class Config
{
public static ConfigFile cfg;
public static ConfigEntry<bool> EnableDebugMode;
public Config(ConfigFile cfgref)
{
cfg = cfgref;
cfg.SaveOnConfigSet = true;
CreateConfigValues(cfgref);
}
private void CreateConfigValues(ConfigFile Config)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Jewelcrafting
{
[PublicAPI]
internal static class API
{
[PublicAPI]
public class GemInfo
{
public readonly string gemPrefab;
public readonly Sprite gemSprite;
public readonly Dictionary<string, float> gemEffects;
public GemInfo(string gemPrefab, Sprite gemSprite, Dictionary<string, float> gemEffects)
{
this.gemPrefab = gemPrefab;
this.gemSprite = gemSprite;
this.gemEffects = gemEffects;
}
}
public delegate bool GemBreakHandler(ItemData? container, ItemData gem, int count = 1);
public delegate bool ItemBreakHandler(ItemData? container);
public delegate bool ItemMirroredHandler(ItemData? item);
public static event Action? OnEffectRecalc;
public static bool IsLoaded()
{
return false;
}
internal static void InvokeEffectRecalc()
{
API.OnEffectRecalc?.Invoke();
}
public static GameObject CreateNecklaceFromTemplate(string colorName, Color color)
{
return null;
}
public static GameObject CreateNecklaceFromTemplate(string colorName, Material material)
{
return null;
}
public static GameObject CreateRingFromTemplate(string colorName, Color color)
{
return null;
}
public static GameObject CreateRingFromTemplate(string colorName, Material material)
{
return null;
}
public static void MarkJewelry(GameObject jewelry)
{
}
public static void AddGems(string type, string colorName, Color color)
{
}
public static List<GameObject> AddGems(string type, string colorName, Material material, Color color)
{
return null;
}
public static GameObject AddDestructibleFromTemplate(string type, string colorName, Color color)
{
return null;
}
public static GameObject AddDestructibleFromTemplate(string type, string colorName, Material material)
{
return null;
}
public static GameObject AddUncutFromTemplate(string type, string colorName, Color color)
{
return null;
}
public static GameObject AddUncutFromTemplate(string type, string colorName, Material material)
{
return null;
}
public static GameObject AddAndRegisterUncutFromTemplate(string type, string colorName, Color color)
{
return null;
}
public static GameObject AddAndRegisterUncutFromTemplate(string type, string colorName, Material material)
{
return null;
}
public static GameObject AddShardFromTemplate(string type, string colorName, Color color)
{
return null;
}
public static GameObject AddShardFromTemplate(string type, string colorName, Material material)
{
return null;
}
public static GameObject[] AddTieredGemFromTemplate(string type, string colorName, Color color)
{
return null;
}
public static GameObject[] AddTieredGemFromTemplate(string type, string colorName, Material material, Color color)
{
return null;
}
public static void AddGem(GameObject prefab, string colorName)
{
}
public static void AddShard(GameObject prefab, string colorName)
{
}
public static void AddDestructible(GameObject prefab, string colorName)
{
}
public static void AddUncutGem(GameObject prefab, string colorName, ConfigEntry<float>? dropChance = null)
{
}
public static void AddGemEffect<T>(string name, string? englishDescription = null, string? englishDescriptionDetailed = null) where T : struct
{
}
public static void AddGemConfig(string yaml)
{
}
public static T GetEffectPower<T>(this Player player, string name) where T : struct
{
return default(T);
}
public static List<GemInfo?> GetGems(ItemData item)
{
return new List<GemInfo>();
}
public static bool SetGems(ItemData item, List<GemInfo?> gems)
{
return false;
}
public static Sprite GetSocketBorder()
{
return null;
}
public static GameObject GetGemcuttersTable()
{
return null;
}
public static void AddParticleEffect(string prefabName, GameObject effect, VisualEffectCondition displayCondition)
{
}
public static void SetSocketsLock(ItemData item, bool enabled)
{
}
public static void OnGemBreak(GemBreakHandler callback)
{
}
public static void OnItemBreak(ItemBreakHandler callback)
{
}
public static void OnItemMirrored(ItemMirroredHandler callback)
{
}
public static bool IsJewelryEquipped(Player player, string prefabName)
{
return false;
}
public static bool BlacklistItem(GameObject item)
{
return false;
}
}
[AttributeUsage(AttributeTargets.Field)]
internal abstract class PowerAttribute : Attribute
{
public abstract float Add(float a, float b);
}
internal class AdditivePowerAttribute : PowerAttribute
{
public override float Add(float a, float b)
{
return a + b;
}
}
internal class MultiplicativePercentagePowerAttribute : PowerAttribute
{
public override float Add(float a, float b)
{
return ((1f + a / 100f) * (1f + b / 100f) - 1f) * 100f;
}
}
internal class InverseMultiplicativePercentagePowerAttribute : PowerAttribute
{
public override float Add(float a, float b)
{
return (1f - (1f - a / 100f) * (1f - b / 100f)) * 100f;
}
}
internal class MinPowerAttribute : PowerAttribute
{
public override float Add(float a, float b)
{
return Mathf.Min(a, b);
}
}
internal class MaxPowerAttribute : PowerAttribute
{
public override float Add(float a, float b)
{
return Mathf.Max(a, b);
}
}
[AttributeUsage(AttributeTargets.Field)]
internal class OptionalPowerAttribute : Attribute
{
public readonly float DefaultValue;
public OptionalPowerAttribute(float defaultValue)
{
DefaultValue = defaultValue;
}
}
[Flags]
internal enum VisualEffectCondition : uint
{
IsSkill = 0xFFFu,
Swords = 1u,
Knives = 2u,
Clubs = 3u,
Polearms = 4u,
Spears = 5u,
Blocking = 6u,
Axes = 7u,
Bows = 8u,
Unarmed = 0xBu,
Pickaxes = 0xCu,
WoodCutting = 0xDu,
Crossbows = 0xEu,
IsItem = 0xFF000u,
Helmet = 0x6000u,
Chest = 0x7000u,
Legs = 0xB000u,
Hands = 0xC000u,
Shoulder = 0x11000u,
Tool = 0x13000u,
GenericExtraAttributes = 0xFF000000u,
Blackmetal = 0x40000000u,
TwoHanded = 0x80000000u,
SpecificExtraAttributes = 0xF00000u,
Hammer = 0x113000u,
Hoe = 0x213000u,
Buckler = 0x100006u,
Towershield = 0x200006u,
FineWoodBow = 0x100008u,
BowHuntsman = 0x200008u,
BowDraugrFang = 0x300008u,
PickaxeIron = 0x10000Cu,
Club = 0x100003u
}
}