using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DOTC.Assets;
using DOTC.Hooks;
using DOTC.Items;
using DOTC.Util;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Orbs;
using UnityEngine;
using UnityEngine.Networking;
[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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DOTC")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DOTC")]
[assembly: AssemblyTitle("DOTC")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace DOTC
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.descendants.clouditems", "Descendants of The Clouds", "1.0.0")]
[R2APISubmoduleDependency(new string[] { "ItemAPI", "LanguageAPI", "RecalculateStatsAPI" })]
public class Plugin : BaseUnityPlugin
{
[CompilerGenerated]
private static class <>O
{
public static hook_RecalculateStats <0>__OnRecalc;
public static hook_OnHitEnemy <1>__OnHit;
public static hook_TakeDamage <2>__OnDmg;
public static hook_FixedUpdate <3>__OnUpdate;
public static hook_OnCharacterDeath <4>__OnKill;
public static hook_OnSkillActivated <5>__OnSkill;
public static hook_OnLanded <6>__OnLand;
}
private const string GUID = "com.descendants.clouditems";
private const string Name = "Descendants of The Clouds";
private const string Version = "1.0.0";
private void Awake()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//IL_0065: 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_0070: Expected O, but got Unknown
//IL_0086: 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_0091: Expected O, but got Unknown
//IL_00a7: 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_00b2: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Expected O, but got Unknown
//IL_00e9: 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_00f4: Expected O, but got Unknown
AssetLoader.Init(((BaseUnityPlugin)this).Logger);
ItemDefs.RegisterAll();
object obj = <>O.<0>__OnRecalc;
if (obj == null)
{
hook_RecalculateStats val = StatsHook.OnRecalc;
<>O.<0>__OnRecalc = val;
obj = (object)val;
}
CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
object obj2 = <>O.<1>__OnHit;
if (obj2 == null)
{
hook_OnHitEnemy val2 = HitHook.OnHit;
<>O.<1>__OnHit = val2;
obj2 = (object)val2;
}
GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj2;
object obj3 = <>O.<2>__OnDmg;
if (obj3 == null)
{
hook_TakeDamage val3 = DamageHook.OnDmg;
<>O.<2>__OnDmg = val3;
obj3 = (object)val3;
}
HealthComponent.TakeDamage += (hook_TakeDamage)obj3;
object obj4 = <>O.<3>__OnUpdate;
if (obj4 == null)
{
hook_FixedUpdate val4 = UpdateHook.OnUpdate;
<>O.<3>__OnUpdate = val4;
obj4 = (object)val4;
}
CharacterBody.FixedUpdate += (hook_FixedUpdate)obj4;
object obj5 = <>O.<4>__OnKill;
if (obj5 == null)
{
hook_OnCharacterDeath val5 = CombatHook.OnKill;
<>O.<4>__OnKill = val5;
obj5 = (object)val5;
}
GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj5;
object obj6 = <>O.<5>__OnSkill;
if (obj6 == null)
{
hook_OnSkillActivated val6 = CombatHook.OnSkill;
<>O.<5>__OnSkill = val6;
obj6 = (object)val6;
}
CharacterBody.OnSkillActivated += (hook_OnSkillActivated)obj6;
object obj7 = <>O.<6>__OnLand;
if (obj7 == null)
{
hook_OnLanded val7 = CombatHook.OnLand;
<>O.<6>__OnLand = val7;
obj7 = (object)val7;
}
CharacterMotor.OnLanded += (hook_OnLanded)obj7;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Descendants of The Clouds loaded.");
}
}
}
namespace DOTC.Util
{
internal static class Combat
{
internal static bool IsWeather()
{
SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef;
if ((Object)(object)mostRecentSceneDef == (Object)null)
{
return false;
}
float num = (Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.GetRunStopwatch() : 0f);
return num % 120f < 30f;
}
internal static void DmgAOE(CharacterBody src, float radius, float dmgMult, bool pull)
{
//IL_002a: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)src) || !Object.op_Implicit((Object)(object)src.teamComponent))
{
return;
}
Collider[] array = Physics.OverlapSphere(src.transform.position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
foreach (Collider val in array)
{
HurtBox component = ((Component)val).GetComponent<HurtBox>();
if (Object.op_Implicit((Object)(object)component?.healthComponent?.body) && !((Object)(object)component.healthComponent.body == (Object)(object)src) && FriendlyFireManager.ShouldDirectHitProceed(component.healthComponent, src.teamComponent.teamIndex))
{
component.healthComponent.TakeDamage(new DamageInfo
{
damage = src.damage * dmgMult,
attacker = ((Component)src).gameObject,
position = ((Component)component).transform.position,
procCoefficient = 0.5f,
crit = src.RollCrit()
});
if (pull && Object.op_Implicit((Object)(object)component.healthComponent.body.rigidbody))
{
Vector3 val2 = src.transform.position - ((Component)component).transform.position;
Vector3 normalized = ((Vector3)(ref val2)).normalized;
component.healthComponent.body.rigidbody.AddForce(normalized * 2000f, (ForceMode)1);
}
}
}
}
}
internal static class Helpers
{
internal static int Cnt(CharacterBody b, ItemDef d)
{
return Object.op_Implicit((Object)(object)b.inventory) ? b.inventory.GetItemCount(d) : 0;
}
internal static NetworkInstanceId Id(CharacterBody b)
{
//IL_001a: 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)
return Object.op_Implicit((Object)(object)b.networkIdentity) ? b.networkIdentity.netId : NetworkInstanceId.Invalid;
}
}
}
namespace DOTC.Items
{
internal static class ItemDefs
{
internal static ItemDef Featherweight;
internal static ItemDef StormBatt;
internal static ItemDef Updraft;
internal static ItemDef Cotton;
internal static ItemDef Rod;
internal static ItemDef Windwalker;
internal static ItemDef Nimbus;
internal static ItemDef Stabilizer;
internal static ItemDef Thermal;
internal static ItemDef Altitude;
internal static ItemDef Echo;
internal static ItemDef Compass;
internal static ItemDef Cyclone;
internal static ItemDef GravAnch;
internal static ItemDef StormFocus;
internal static ItemDef Vane;
internal static ItemDef CelSigil;
internal static ItemDef PrSuit;
internal static ItemDef Aether;
internal static ItemDef WingMem;
internal static ItemDef Static;
internal static ItemDef Baro;
internal static ItemDef Herald;
internal static ItemDef GravManip;
internal static ItemDef WingsFallen;
internal static ItemDef Tempest;
internal static ItemDef CelCata;
internal static ItemDef VoidCon;
internal static ItemDef Maelstrom;
internal static ItemDef Crown;
internal static ItemDef FoA;
internal static ItemDef Chains;
internal static ItemDef EyeStorm;
internal static ItemDef Weightless;
internal static void RegisterAll()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: 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_0008: 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_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected I4, but got Unknown
//IL_006e: 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_007a: Expected I4, but got Unknown
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Expected I4, but got Unknown
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Expected I4, but got Unknown
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Expected I4, but got Unknown
//IL_0152: 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_015e: Expected I4, but got Unknown
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Expected I4, but got Unknown
//IL_01c4: 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_01d0: Expected I4, but got Unknown
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Expected I4, but got Unknown
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: Expected I4, but got Unknown
//IL_026f: 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_027b: Expected I4, but got Unknown
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Expected I4, but got Unknown
//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Expected I4, but got Unknown
//IL_031a: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_0326: Expected I4, but got Unknown
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Expected I4, but got Unknown
//IL_038c: 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_0398: Expected I4, but got Unknown
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Expected I4, but got Unknown
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0407: Unknown result type (might be due to invalid IL or missing references)
//IL_040a: Expected I4, but got Unknown
//IL_0437: Unknown result type (might be due to invalid IL or missing references)
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Expected I4, but got Unknown
//IL_0470: Unknown result type (might be due to invalid IL or missing references)
//IL_0479: Unknown result type (might be due to invalid IL or missing references)
//IL_047c: Expected I4, but got Unknown
//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
//IL_04b5: Expected I4, but got Unknown
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
//IL_04ee: Expected I4, but got Unknown
//IL_051b: Unknown result type (might be due to invalid IL or missing references)
//IL_0524: Unknown result type (might be due to invalid IL or missing references)
//IL_0527: Expected I4, but got Unknown
//IL_0554: Unknown result type (might be due to invalid IL or missing references)
//IL_055d: Unknown result type (might be due to invalid IL or missing references)
//IL_0560: Expected I4, but got Unknown
//IL_058d: Unknown result type (might be due to invalid IL or missing references)
//IL_0596: Unknown result type (might be due to invalid IL or missing references)
//IL_0599: Expected I4, but got Unknown
//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
//IL_05d2: Expected I4, but got Unknown
//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0608: Unknown result type (might be due to invalid IL or missing references)
//IL_060b: Expected I4, but got Unknown
//IL_0638: Unknown result type (might be due to invalid IL or missing references)
//IL_0641: Unknown result type (might be due to invalid IL or missing references)
//IL_0644: Expected I4, but got Unknown
//IL_0671: Unknown result type (might be due to invalid IL or missing references)
//IL_067a: Unknown result type (might be due to invalid IL or missing references)
//IL_067d: Expected I4, but got Unknown
//IL_06aa: Unknown result type (might be due to invalid IL or missing references)
//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
//IL_06b6: Expected I4, but got Unknown
//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
//IL_06bb: Expected I4, but got Unknown
//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
//IL_06f4: Expected I4, but got Unknown
//IL_0721: Unknown result type (might be due to invalid IL or missing references)
//IL_072a: Unknown result type (might be due to invalid IL or missing references)
//IL_072d: Expected I4, but got Unknown
//IL_075a: Unknown result type (might be due to invalid IL or missing references)
//IL_0763: Unknown result type (might be due to invalid IL or missing references)
//IL_0766: Expected I4, but got Unknown
//IL_0793: Unknown result type (might be due to invalid IL or missing references)
//IL_079c: Unknown result type (might be due to invalid IL or missing references)
//IL_079f: Expected I4, but got Unknown
ItemTier tier = (ItemTier)0;
ItemTier tier2 = (ItemTier)1;
ItemTier tier3 = (ItemTier)2;
ItemTier tier4 = (ItemTier)3;
ItemTag val = (ItemTag)3;
ItemTag val2 = (ItemTag)1;
ItemTag val3 = (ItemTag)2;
Featherweight = Mk("FEATHERWEIGHT", "Featherweight Charm", "Reduce fall damage and increase jump height.", "Reduce fall damage by <style=cIsUtility>50%</style> <style=cStack>(+25% per stack)</style>. Increase jump height by <style=cIsUtility>15%</style>.", "A charm worn by cloud temple monks who learned to walk on air itself.", "texFeatherweightCharmIcon", "mdlFeatherweightCharmIcon", tier, (ItemTag)(int)val);
StormBatt = Mk("STORMBATTERY", "Storm Battery", "Gain attack speed during thunderstorms.", "Gain <style=cIsDamage>5%</style> <style=cStack>(+5% per stack)</style> attack speed during thunderstorms.", "Crystallized lightning. Still crackling with residual energy.", "texStormBatteryIcon", "mdlStormBatteryIcon", tier, (ItemTag)(int)val2);
Updraft = Mk("UPDRAFT", "Updraft Boots", "Gain movement speed while airborne.", "Gain <style=cIsUtility>10%</style> <style=cStack>(+10% per stack)</style> movement speed while airborne.", "Boots enchanted to catch the wind. The wearer never truly falls.", "texUpdraftBootsIcon", "mdlUpdraftBootsIcon", tier, (ItemTag)(int)val);
Cotton = Mk("CLOUDCOTTON", "Cloud Cotton", "Reduce gravity and decrease fall speed.", "Reduce gravity by <style=cIsUtility>8%</style> <style=cStack>(+4% per stack)</style>. Decrease fall speed.", "Fiber harvested from the clouds themselves. Impossibly light.", "texCloudCottonIcon", "mdlCloudCottonIcon", tier, (ItemTag)(int)val);
Rod = Mk("LIGHTNINGROD", "Lightning Rod", "Chance to strike enemies with lightning.", "<style=cIsDamage>10%</style> chance to strike hit enemies with lightning for <style=cIsDamage>50%</style> <style=cStack>(+50% per stack)</style> damage.", "A conductor that channels the storm's fury through your attacks.", "texLightningRodIcon", "mdlLightningRodIcon", tier, (ItemTag)(int)val2);
Windwalker = Mk("WINDWALKER", "Windwalker's Token", "Heal for distance traveled.", "Heal <style=cIsHealing>3 HP</style> <style=cStack>(+3 per stack)</style> for every 100m traveled.", "The nomads of the clouds never stopped moving. Neither should you.", "texWindwalkersTokenIcon", "mdlWindwalkersTokenIcon", tier, (ItemTag)(int)val3);
Nimbus = Mk("NIMBUS", "Nimbus Fragments", "Projectiles pierce enemies.", "Projectiles pierce <style=cIsDamage>1</style> <style=cStack>(+1 per stack)</style> enemy.", "Shards of condensed cloud matter. They pass through solid objects.", "texNimbusFragmentsIcon", "mdlNimbusFragmentsIcon", tier, (ItemTag)(int)val2);
Stabilizer = Mk("STABILIZER", "Pressure Stabilizer", "Reduce skill cooldowns when low health.", "Reduce skill cooldowns by <style=cIsUtility>4%</style> <style=cStack>(+4% per stack)</style> below 50% health.", "When the pressure is on, time moves differently.", "texPressureStabilizerIcon", "mdlPressureStabilizerIcon", tier, (ItemTag)(int)val);
Thermal = Mk("THERMAL", "Thermal Currents", "Increase vertical mobility.", "Increase vertical mobility by <style=cIsUtility>12%</style> <style=cStack>(+12% per stack)</style>.", "Invisible hands lift you upward. The sky welcomes you.", "texThermalCurrentsIcon", "mdlThermalCurrentsIcon", tier, (ItemTag)(int)val);
Altitude = Mk("ALTITUDE", "Altitude Gauge", "Gain armor based on height above ground.", "Gain <style=cIsHealing>2 armor</style> per 10m above ground <style=cStack>(+1 armor per stack)</style>.", "The higher you climb, the safer you become.", "texAltitudeGaugeIcon", "mdlAltitudeGaugeIcon", tier, (ItemTag)(int)val);
Echo = Mk("ECHOSHARD", "Echo Shard", "Skills used in air deal bonus damage.", "Skills used in air deal <style=cIsDamage>10%</style> <style=cStack>(+10% per stack)</style> bonus damage.", "Crystallized sound. The echoes of ancient battles still reverberate within.", "texEchoShardIcon", "mdlEchoShardIcon", tier, (ItemTag)(int)val2);
Compass = Mk("COMPASS", "Sky Compass", "Reveal all interactables.", "Reveal all interactables within <style=cIsUtility>15m</style> <style=cStack>(+15m per stack)</style>.", "It always points toward what you seek.", "texSkyCompassIcon", "mdlSkyCompassIcon", tier, (ItemTag)(int)val);
Cyclone = Mk("CYCLONE", "Cyclone Generator", "Critical strikes create wind bursts.", "Critical strikes create wind bursts that knock back enemies <style=cIsUtility>10m</style> <style=cStack>(+5m per stack)</style>.", "A device that weaponizes the very air around you.", "texCycloneGeneratorIcon", "mdlCycloneGeneratorIcon", tier2, (ItemTag)(int)val2);
GravAnch = Mk("GRAVANCHOR", "Gravity Anchor", "Pull items to you from increased range.", "Pull items within <style=cIsUtility>20m</style> <style=cStack>(+10m per stack)</style> to you. Increased pickup range.", "The clouds' treasures come to those who bend gravity.", "texGravityAnchorIcon", "mdlGravityAnchorIcon", tier2, (ItemTag)(int)val);
StormFocus = Mk("STORMFOCUS", "Stormcaller's Focus", "Gain attack speed during storms.", "Gain <style=cIsDamage>30%</style> attack speed during storms. <style=cStack>+1s duration per stack</style>.", "Channel the tempest. Let it flow through you.", "texStormcallersFocusIcon", "mdlStormcallersFocusIcon", tier2, (ItemTag)(int)val2);
Vane = Mk("WEATHERVANE", "Weathervane", "Hitting enemies increases movement speed.", "Hitting enemies increases movement speed by <style=cIsUtility>25%</style> for <style=cIsUtility>3s</style> <style=cStack>(+1.5s per stack)</style>.", "Follow the wind. Strike like lightning. Never stop moving.", "texWeathervaneIcon", "mdlWeathervaneIcon", tier2, (ItemTag)(int)val);
CelSigil = Mk("CELSIGIL", "Celestial Sigil", "Jumping recharges special cooldown.", "Jumping recharges <style=cIsUtility>8%</style> <style=cStack>(+4% per stack)</style> of special cooldown.", "Each leap brings you closer to divinity.", "texCelestialSigilIcon", "mdlCelestialSigilIcon", tier2, (ItemTag)(int)val);
PrSuit = Mk("PRSUIT", "Pressure Suit", "Immune to knockback and gain armor.", "Immune to knockback and push effects. Gain <style=cIsHealing>50 armor</style> <style=cStack>(+25 per stack)</style>.", "Engineered to withstand the strongest winds. Nothing moves you.", "texPressureSuitIcon", "mdlPressureSuitIcon", tier2, (ItemTag)(int)val);
Aether = Mk("AETHER", "Aetherium Core", "Gain movement speed on kill.", "On kill, gain <style=cIsUtility>20%</style> movement speed for <style=cIsUtility>5s</style> <style=cStack>(+3s per stack)</style>.", "The heart of a cloud temple. It pulses with stolen momentum.", "texAetheriumCoreIcon", "mdlAetheriumCoreIcon", tier2, (ItemTag)(int)val);
WingMem = Mk("WINGMEM", "Wing Membrane", "Gain an additional jump and better air control.", "Gain <style=cIsUtility>1</style> additional jump. Increase air control by <style=cIsUtility>20%</style> <style=cStack>(+20% per stack)</style>.", "Grafted from creatures that knew only sky.", "texWingMembraneIcon", "mdlWingMembraneIcon", tier2, (ItemTag)(int)val);
Static = Mk("STATIC", "Static Discharge", "Release chain lightning periodically.", "Every <style=cIsDamage>4 hits</style> release chain lightning for <style=cIsDamage>200%</style> <style=cStack>(+100% per stack)</style> damage.", "Build up static. Release it all at once.", "texStaticDischargeIcon", "mdlStaticDischargeIcon", tier2, (ItemTag)(int)val2);
Baro = Mk("BARO", "Barometric Sensor", "Gain damage during weather events.", "Gain <style=cIsDamage>15%</style> <style=cStack>(+10% per stack)</style> damage during weather events.", "When the storm comes, strike with it.", "texBarometricSensorIcon", "mdlBarometricSensorIcon", tier2, (ItemTag)(int)val2);
Herald = Mk("HERALD", "Herald of Storms", "Summon a storm that follows you.", "Summon a storm every <style=cIsUtility>30s</style> that follows you, dealing <style=cIsDamage>800% damage/sec</style> to enemies.", "You are the storm. Where you walk, lightning follows.", "texHeraldOfStormsIcon", "mdlHeraldOfStormsIcon", tier3, (ItemTag)(int)val2);
GravManip = Mk("GRAVMANIP", "Gravity Manipulator", "Reverse gravity when hitting elites.", "Reverse gravity for <style=cIsUtility>3s</style> when hitting elite enemies. Cooldown: <style=cIsUtility>20s</style>.", "Masters of the clouds bent physics to their will.", "texGravityManipulatorIcon", "mdlGravityManipulatorIcon", tier3, (ItemTag)(int)val);
WingsFallen = Mk("WINGSFALLEN", "Wings of the Fallen", "Gain permanent flight with stamina.", "Gain <style=cIsUtility>permanent flight</style> with stamina bar. Attacking drains stamina faster.", "The last pair of wings. They carried their owner to the summit.", "texWingsOfTheFallenIcon", "mdlWingsOfTheFallenIcon", tier3, (ItemTag)(int)val);
Tempest = Mk("TEMPEST", "Tempest Core", "Attacks create damaging wind trails.", "Attacks create wind trails that deal <style=cIsDamage>400%</style> damage and push enemies.", "The beating heart of a storm made solid.", "texTempestCoreIcon", "mdlTempestCoreIcon", tier3, (ItemTag)(int)val2);
CelCata = Mk("CELCATA", "Celestial Catalyst", "Skills in air cost no cooldown but drain health.", "Skills used in air cost <style=cIsUtility>no cooldown</style> but drain <style=cIsHealth>10% max health</style>.", "The price of power is written in blood.", "texCelestialCatalystIcon", "mdlCelestialCatalystIcon", tier3, (ItemTag)(int)val);
VoidCon = Mk("VOIDCON", "Void Conduit", "Teleport to your past position.", "Teleport to where you were <style=cIsUtility>3s ago</style>. <style=cIsUtility>12s cooldown</style>.", "Time is not linear in the clouds.", "texVoidConduitIcon", "mdlVoidConduitIcon", tier3, (ItemTag)(int)val);
Maelstrom = Mk("MAELSTROM", "Maelstrom Heart", "Create vortex when taking damage.", "On taking damage, create a vortex pulling enemies and dealing <style=cIsDamage>600%</style> damage.", "When you bleed, the storm bleeds with you.", "texMaelstromHeartIcon", "mdlMaelstromHeartIcon", tier3, (ItemTag)(int)val2);
Crown = Mk("CROWN", "Sovereign's Crown", "Enemies deal less damage, you deal more at high health.", "Enemies within <style=cIsUtility>30m</style> deal <style=cIsUtility>20%</style> less damage. You deal <style=cIsDamage>30%</style> more damage above 80% health.", "Worn by the last king of the clouds.", "texSovereignsCrownIcon", "mdlSovereignsCrownIcon", tier3, (ItemTag)(int)val2, (ItemTag)(int)val);
FoA = Mk("FOA", "Feather of Ascension", "Gain jump height and air control... BUT take more fall damage.", "Gain <style=cIsUtility>100%</style> jump height and air control. <style=cIsHealth>BUT take 50% more fall damage.</style>", "Fly higher than any mortal should.", "texFeatherOfAscensionIcon", "mdlFeatherOfAscensionIcon", tier4, (ItemTag)(int)val);
Chains = Mk("CHAINS", "Chains of Heaven", "Double all damage... BUT lose armor and healing cap.", "<style=cIsDamage>Double all damage.</style> <style=cIsHealth>BUT lose all armor and cannot heal above 50% health.</style>", "They bound the gods with these. Now they bind you.", "texChainsOfHeavenIcon", "mdlChainsOfHeavenIcon", tier4, (ItemTag)(int)val2);
EyeStorm = Mk("EYESTORM", "Eye of the Storm", "Gain attack speed... BUT skills cost health.", "Gain <style=cIsDamage>100%</style> attack speed. <style=cIsHealth>BUT skills cost 20% max health instead of cooldowns.</style>", "In the center of chaos, there is perfect clarity.", "texEyeOfTheStormIcon", "mdlEyeOfTheStormIcon", tier4, (ItemTag)(int)val2);
Weightless = Mk("WEIGHTLESS", "Weightless Soul", "Immune to gravity... BUT cannot touch ground or die.", "<style=cIsUtility>Immune to gravity.</style> <style=cIsHealth>BUT cannot touch the ground or die instantly.</style>", "You have ascended beyond mortal limits.", "texWeightlessSoulIcon", "mdlWeightlessSoulIcon", tier4, (ItemTag)(int)val);
}
private static ItemDef Mk(string name, string disp, string pickup, string desc, string lore, string tex, string mdl, ItemTier tier, params ItemTag[] tags)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
return AssetLoader.CreateItem(name, disp, pickup, desc, lore, tex, mdl, tier, tags);
}
}
}
namespace DOTC.Hooks
{
internal static class CombatHook
{
internal static void OnKill(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport rep)
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: 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)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, rep);
if (NetworkServer.active && !((Object)(object)rep.attackerBody == (Object)null) && Object.op_Implicit((Object)(object)rep.attackerBody.inventory))
{
NetworkInstanceId val = Helpers.Id(rep.attackerBody);
int num;
if ((num = Helpers.Cnt(rep.attackerBody, ItemDefs.Aether)) > 0 && val != NetworkInstanceId.Invalid)
{
StateTracker.SetF(StateTracker.AetherTimer, val, 5f + 3f * (float)(num - 1));
}
}
}
internal static void OnSkill(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
{
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: 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_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: 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_01bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: 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_01e9: Expected O, but got Unknown
orig.Invoke(self, skill);
if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && NetworkServer.active)
{
int num;
if ((num = Helpers.Cnt(self, ItemDefs.CelSigil)) > 0 && (Object)(object)self.skillLocator?.special != (Object)null && Object.op_Implicit((Object)(object)self.characterMotor) && !self.characterMotor.isGrounded)
{
float num2 = 0.08f + 0.04f * (float)(num - 1);
GenericSkill special = self.skillLocator.special;
special.rechargeStopwatch += self.skillLocator.special.finalRechargeInterval * num2;
}
if (Helpers.Cnt(self, ItemDefs.EyeStorm) > 0 && Object.op_Implicit((Object)(object)self.healthComponent))
{
self.healthComponent.TakeDamage(new DamageInfo
{
damage = self.healthComponent.fullHealth * 0.2f,
attacker = ((Component)self).gameObject,
position = self.transform.position,
damageType = DamageTypeCombo.op_Implicit((DamageType)66),
procCoefficient = 0f
});
skill.stock = Mathf.Max(skill.stock, 1);
}
if (Helpers.Cnt(self, ItemDefs.CelCata) > 0 && Object.op_Implicit((Object)(object)self.characterMotor) && !self.characterMotor.isGrounded && Object.op_Implicit((Object)(object)self.healthComponent))
{
self.healthComponent.TakeDamage(new DamageInfo
{
damage = self.healthComponent.fullHealth * 0.1f,
attacker = ((Component)self).gameObject,
position = self.transform.position,
damageType = DamageTypeCombo.op_Implicit((DamageType)66),
procCoefficient = 0f
});
skill.stock = Mathf.Max(skill.stock, 1);
skill.rechargeStopwatch = skill.finalRechargeInterval;
}
}
}
internal static void OnLand(orig_OnLanded orig, CharacterMotor self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && NetworkServer.active)
{
int num = Helpers.Cnt(self.body, ItemDefs.CelSigil);
if (num > 0 && (Object)(object)self.body.skillLocator?.special != (Object)null)
{
float num2 = 0.08f + 0.04f * (float)(num - 1);
GenericSkill special = self.body.skillLocator.special;
special.rechargeStopwatch += self.body.skillLocator.special.finalRechargeInterval * num2;
}
}
}
}
internal static class DamageHook
{
internal static void OnDmg(orig_TakeDamage orig, HealthComponent self, DamageInfo di)
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: 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_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: 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_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: 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)
if (Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory))
{
int num;
if ((num = Helpers.Cnt(self.body, ItemDefs.Featherweight)) > 0 && DamageTypeCombo.op_Implicit(di.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) != 0)
{
di.damage *= 1f / (1f + 0.1f * (float)num);
}
if (Helpers.Cnt(self.body, ItemDefs.PrSuit) > 0)
{
di.force = Vector3.zero;
}
if (Helpers.Cnt(self.body, ItemDefs.FoA) > 0 && DamageTypeCombo.op_Implicit(di.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) != 0)
{
di.damage *= 1.5f;
}
if (Object.op_Implicit((Object)(object)di.attacker) && Helpers.Cnt(self.body, ItemDefs.Crown) > 0)
{
float num2 = Vector3.Distance(self.body.transform.position, di.attacker.transform.position);
if (num2 <= 30f)
{
di.damage *= 0.8f;
}
}
if ((num = Helpers.Cnt(self.body, ItemDefs.Maelstrom)) > 0 && NetworkServer.active)
{
NetworkInstanceId val = Helpers.Id(self.body);
if (val != NetworkInstanceId.Invalid)
{
StateTracker.GetF(StateTracker.MaelstromCD, val);
if (StateTracker.MaelstromCD[val] <= 0f)
{
StateTracker.SetF(StateTracker.MaelstromCD, val, 5f);
Combat.DmgAOE(self.body, 20f, 6f, pull: true);
}
}
}
}
orig.Invoke(self, di);
if (Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && Helpers.Cnt(self.body, ItemDefs.Weightless) > 0 && Object.op_Implicit((Object)(object)self.body.characterMotor) && self.body.characterMotor.isGrounded && self.alive)
{
self.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
}
}
}
internal static class HitHook
{
internal static void OnHit(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo di, GameObject victim)
{
//IL_00b3: 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)
//IL_00ba: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: 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_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_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Expected O, but got Unknown
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: 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_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: 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_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_0285: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: 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_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b2: 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_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Expected O, but got Unknown
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_0308: Unknown result type (might be due to invalid IL or missing references)
//IL_030a: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0453: Unknown result type (might be due to invalid IL or missing references)
//IL_0458: Unknown result type (might be due to invalid IL or missing references)
//IL_0460: Unknown result type (might be due to invalid IL or missing references)
//IL_046c: Unknown result type (might be due to invalid IL or missing references)
//IL_046e: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Unknown result type (might be due to invalid IL or missing references)
//IL_0483: Unknown result type (might be due to invalid IL or missing references)
//IL_048f: Unknown result type (might be due to invalid IL or missing references)
//IL_0491: Unknown result type (might be due to invalid IL or missing references)
//IL_049b: Expected O, but got Unknown
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_04df: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Unknown result type (might be due to invalid IL or missing references)
//IL_0385: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_0391: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
//IL_03f7: 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_040d: Expected O, but got Unknown
//IL_061b: Unknown result type (might be due to invalid IL or missing references)
//IL_0620: Unknown result type (might be due to invalid IL or missing references)
//IL_0622: Unknown result type (might be due to invalid IL or missing references)
//IL_0624: Unknown result type (might be due to invalid IL or missing references)
//IL_063d: Unknown result type (might be due to invalid IL or missing references)
//IL_064f: Unknown result type (might be due to invalid IL or missing references)
//IL_066f: Unknown result type (might be due to invalid IL or missing references)
//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0745: Unknown result type (might be due to invalid IL or missing references)
//IL_0755: Unknown result type (might be due to invalid IL or missing references)
//IL_075a: Unknown result type (might be due to invalid IL or missing references)
//IL_075f: Unknown result type (might be due to invalid IL or missing references)
//IL_0763: Unknown result type (might be due to invalid IL or missing references)
//IL_0768: Unknown result type (might be due to invalid IL or missing references)
//IL_0770: Unknown result type (might be due to invalid IL or missing references)
//IL_0777: Unknown result type (might be due to invalid IL or missing references)
//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0570: Unknown result type (might be due to invalid IL or missing references)
//IL_058c: Unknown result type (might be due to invalid IL or missing references)
//IL_0591: Unknown result type (might be due to invalid IL or missing references)
//IL_0599: Unknown result type (might be due to invalid IL or missing references)
//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
//IL_05da: Expected O, but got Unknown
orig.Invoke(self, di, victim);
if (!Object.op_Implicit((Object)(object)di.attacker) || !NetworkServer.active)
{
return;
}
CharacterBody component = di.attacker.GetComponent<CharacterBody>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory))
{
return;
}
CharacterBody val = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent<CharacterBody>() : null);
int num;
if ((num = Helpers.Cnt(component, ItemDefs.Rod)) > 0 && Util.CheckRoll(10f, component.master) && Object.op_Implicit((Object)(object)((val != null) ? val.mainHurtBox : null)))
{
OrbManager.instance.AddOrb((Orb)new LightningOrb
{
origin = di.position,
damageValue = di.damage * 0.5f * (float)num,
isCrit = di.crit,
bouncesRemaining = 0,
teamIndex = component.teamComponent.teamIndex,
attacker = di.attacker,
procCoefficient = 0.5f,
lightningType = (LightningType)0,
damageColorIndex = (DamageColorIndex)3,
target = val.mainHurtBox
});
}
Vector3 val2;
if ((num = Helpers.Cnt(component, ItemDefs.Cyclone)) > 0 && di.crit && Object.op_Implicit((Object)(object)val))
{
float num2 = 10f + 5f * (float)(num - 1);
val2 = victim.transform.position - di.attacker.transform.position;
Vector3 normalized = ((Vector3)(ref val2)).normalized;
if (Object.op_Implicit((Object)(object)val.characterMotor))
{
val.characterMotor.ApplyForce(normalized * num2 * 300f, true, false);
}
else if (Object.op_Implicit((Object)(object)val.rigidbody))
{
val.rigidbody.AddForce(normalized * num2 * 100f, (ForceMode)1);
}
}
if ((num = Helpers.Cnt(component, ItemDefs.Vane)) > 0)
{
component.AddTimedBuff(Buffs.WhipBoost, 3f + 1.5f * (float)(num - 1));
}
if ((num = Helpers.Cnt(component, ItemDefs.Echo)) > 0 && Object.op_Implicit((Object)(object)component.characterMotor) && !component.characterMotor.isGrounded && Object.op_Implicit((Object)(object)((val != null) ? val.healthComponent : null)))
{
val.healthComponent.TakeDamage(new DamageInfo
{
damage = di.damage * 0.1f * (float)num,
attacker = di.attacker,
position = di.position,
procCoefficient = 0f,
crit = false,
damageColorIndex = (DamageColorIndex)3
});
}
if ((num = Helpers.Cnt(component, ItemDefs.Static)) > 0 && Object.op_Implicit((Object)(object)((val != null) ? val.mainHurtBox : null)))
{
NetworkInstanceId val3 = Helpers.Id(component);
if (val3 != NetworkInstanceId.Invalid)
{
if (!StateTracker.HitCounts.ContainsKey(val3))
{
StateTracker.HitCounts[val3] = 0;
}
if (++StateTracker.HitCounts[val3] >= 4)
{
StateTracker.HitCounts[val3] = 0;
OrbManager.instance.AddOrb((Orb)new LightningOrb
{
origin = di.position,
damageValue = component.damage * (2f + 1f * (float)(num - 1)),
isCrit = component.RollCrit(),
bouncesRemaining = 3,
teamIndex = component.teamComponent.teamIndex,
attacker = di.attacker,
procCoefficient = 0.3f,
lightningType = (LightningType)1,
damageColorIndex = (DamageColorIndex)3,
target = val.mainHurtBox
});
}
}
}
if ((num = Helpers.Cnt(component, ItemDefs.Nimbus)) > 0 && Object.op_Implicit((Object)(object)((val != null) ? val.healthComponent : null)))
{
float num3 = di.damage * 0.8f;
val.healthComponent.TakeDamage(new DamageInfo
{
damage = num3,
attacker = di.attacker,
position = di.position,
procCoefficient = 0.2f,
crit = di.crit,
damageColorIndex = (DamageColorIndex)3
});
float num4 = 8f + 4f * (float)(num - 1);
float damage = num3 * 1.3f;
HashSet<HealthComponent> hashSet = new HashSet<HealthComponent> { val.healthComponent };
Collider[] array = Physics.OverlapSphere(val.transform.position, num4, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
foreach (Collider val4 in array)
{
HurtBox component2 = ((Component)val4).GetComponent<HurtBox>();
if (Object.op_Implicit((Object)(object)component2?.healthComponent?.body) && hashSet.Add(component2.healthComponent) && !((Object)(object)component2.healthComponent.body == (Object)(object)component) && FriendlyFireManager.ShouldDirectHitProceed(component2.healthComponent, component.teamComponent.teamIndex))
{
component2.healthComponent.TakeDamage(new DamageInfo
{
damage = damage,
attacker = di.attacker,
position = ((Component)component2).transform.position,
procCoefficient = 0f,
crit = di.crit,
damageColorIndex = (DamageColorIndex)3
});
}
}
}
if ((num = Helpers.Cnt(component, ItemDefs.GravManip)) > 0 && (Object)(object)val != (Object)null && val.isElite)
{
NetworkInstanceId val5 = Helpers.Id(component);
if (val5 != NetworkInstanceId.Invalid)
{
StateTracker.GetF(StateTracker.GravManipCD, val5);
if (StateTracker.GravManipCD[val5] <= 0f)
{
StateTracker.SetF(StateTracker.GravManipCD, val5, 20f);
if (Object.op_Implicit((Object)(object)val.characterMotor))
{
val.characterMotor.useGravity = false;
val.characterMotor.ApplyForce(Vector3.up * 5000f, true, false);
}
else if (Object.op_Implicit((Object)(object)val.rigidbody))
{
val.rigidbody.useGravity = false;
val.rigidbody.AddForce(Vector3.up * 5000f, (ForceMode)1);
}
}
}
}
if ((num = Helpers.Cnt(component, ItemDefs.Tempest)) > 0 && (Object)(object)val != (Object)null)
{
Combat.DmgAOE(component, 12f, 4f, pull: false);
if (Object.op_Implicit((Object)(object)val.characterMotor))
{
val2 = victim.transform.position - di.attacker.transform.position;
Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
val.characterMotor.ApplyForce(normalized2 * 2000f, true, false);
}
}
}
}
internal static class StateTracker
{
private static readonly Dictionary<NetworkInstanceId, int> _hitCounts = new Dictionary<NetworkInstanceId, int>();
private static readonly Dictionary<NetworkInstanceId, float> _windwalkerDist = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, Vector3> _windwalkerPos = new Dictionary<NetworkInstanceId, Vector3>();
private static readonly Dictionary<NetworkInstanceId, float> _heraldTimer = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _gravManipCD = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _voidCD = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, Queue<Vector3>> _voidPositions = new Dictionary<NetworkInstanceId, Queue<Vector3>>();
private static readonly Dictionary<NetworkInstanceId, float> _voidRecordTimer = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _aetherTimer = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _stormFocusTimer = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _maelstromCD = new Dictionary<NetworkInstanceId, float>();
private static readonly Dictionary<NetworkInstanceId, float> _wingsStamina = new Dictionary<NetworkInstanceId, float>();
internal static Dictionary<NetworkInstanceId, int> HitCounts => _hitCounts;
internal static Dictionary<NetworkInstanceId, float> WindwalkerDist => _windwalkerDist;
internal static Dictionary<NetworkInstanceId, Vector3> WindwalkerPos => _windwalkerPos;
internal static Dictionary<NetworkInstanceId, float> HeraldTimer => _heraldTimer;
internal static Dictionary<NetworkInstanceId, float> GravManipCD => _gravManipCD;
internal static Dictionary<NetworkInstanceId, float> VoidCD => _voidCD;
internal static Dictionary<NetworkInstanceId, Queue<Vector3>> VoidPositions => _voidPositions;
internal static Dictionary<NetworkInstanceId, float> VoidRecordTimer => _voidRecordTimer;
internal static Dictionary<NetworkInstanceId, float> AetherTimer => _aetherTimer;
internal static Dictionary<NetworkInstanceId, float> StormFocusTimer => _stormFocusTimer;
internal static Dictionary<NetworkInstanceId, float> MaelstromCD => _maelstromCD;
internal static Dictionary<NetworkInstanceId, float> WingsStamina => _wingsStamina;
internal static float GetF(Dictionary<NetworkInstanceId, float> d, NetworkInstanceId id, float def = 0f)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
if (!d.ContainsKey(id))
{
d[id] = def;
}
return d[id];
}
internal static void SetF(Dictionary<NetworkInstanceId, float> d, NetworkInstanceId id, float val)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
d[id] = val;
}
internal static float Tick(Dictionary<NetworkInstanceId, float> d, NetworkInstanceId id, float dt)
{
//IL_0002: 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_0035: 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_0022: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
if (d.ContainsKey(id) && d[id] > 0f)
{
d[id] -= dt;
}
return d.ContainsKey(id) ? d[id] : 0f;
}
}
internal static class StatsHook
{
internal static void OnRecalc(orig_RecalculateStats orig, CharacterBody s)
{
//IL_015b: 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_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: 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)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_047a: Unknown result type (might be due to invalid IL or missing references)
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_0481: Unknown result type (might be due to invalid IL or missing references)
//IL_0483: Unknown result type (might be due to invalid IL or missing references)
//IL_0494: Unknown result type (might be due to invalid IL or missing references)
//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0512: Unknown result type (might be due to invalid IL or missing references)
//IL_0524: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(s);
if (!Object.op_Implicit((Object)(object)s) || !Object.op_Implicit((Object)(object)s.inventory))
{
return;
}
int num;
if ((num = Helpers.Cnt(s, ItemDefs.Featherweight)) > 0)
{
s.jumpPower *= 1f + (1f - 1f / (1f + 0.05f * (float)num));
}
if ((num = Helpers.Cnt(s, ItemDefs.Cotton)) > 0 && Object.op_Implicit((Object)(object)s.characterMotor))
{
CharacterMotor characterMotor = s.characterMotor;
characterMotor.mass *= 1f - (0.08f + 0.04f * (float)(num - 1));
}
if ((num = Helpers.Cnt(s, ItemDefs.Updraft)) > 0 && Object.op_Implicit((Object)(object)s.characterMotor) && !s.characterMotor.isGrounded)
{
s.moveSpeed *= 1f + 0.1f * (float)num;
}
if ((num = Helpers.Cnt(s, ItemDefs.Thermal)) > 0)
{
s.jumpPower *= 1f + 0.12f * (float)num;
}
if ((num = Helpers.Cnt(s, ItemDefs.Altitude)) > 0)
{
float num2 = Mathf.Max(0f, s.transform.position.y);
s.armor += num2 / 10f * (2f + (float)(num - 1));
}
if ((num = Helpers.Cnt(s, ItemDefs.StormBatt)) > 0 && Combat.IsWeather())
{
s.attackSpeed *= 1f + 0.05f * (float)num;
}
if ((num = Helpers.Cnt(s, ItemDefs.PrSuit)) > 0)
{
s.armor += 50f + 25f * (float)(num - 1);
}
if ((num = Helpers.Cnt(s, ItemDefs.WingMem)) > 0)
{
s.maxJumpCount += 1;
if (Object.op_Implicit((Object)(object)s.characterMotor))
{
s.characterMotor.airControl = Mathf.Min(1f, s.characterMotor.airControl + 0.2f * (float)num);
}
}
if ((num = Helpers.Cnt(s, ItemDefs.StormFocus)) > 0)
{
NetworkInstanceId val = Helpers.Id(s);
if (val != NetworkInstanceId.Invalid)
{
StateTracker.GetF(StateTracker.StormFocusTimer, val);
if (Combat.IsWeather())
{
StateTracker.SetF(StateTracker.StormFocusTimer, val, 5f + 1f * (float)(num - 1));
}
if (StateTracker.StormFocusTimer[val] > 0f)
{
s.attackSpeed *= 1.3f;
}
}
}
if ((num = Helpers.Cnt(s, ItemDefs.Baro)) > 0 && Combat.IsWeather())
{
s.damage *= 1f + (0.15f + 0.1f * (float)(num - 1));
}
if ((num = Helpers.Cnt(s, ItemDefs.Crown)) > 0 && Object.op_Implicit((Object)(object)s.healthComponent) && s.healthComponent.combinedHealthFraction > 0.8f)
{
s.damage *= 1.3f;
}
if ((num = Helpers.Cnt(s, ItemDefs.Chains)) > 0)
{
s.damage *= 2f;
s.armor = 0f;
}
if ((num = Helpers.Cnt(s, ItemDefs.EyeStorm)) > 0)
{
s.attackSpeed *= 2f;
}
if ((num = Helpers.Cnt(s, ItemDefs.FoA)) > 0)
{
s.jumpPower *= 2f;
if (Object.op_Implicit((Object)(object)s.characterMotor))
{
s.characterMotor.airControl = 1f;
}
}
if ((num = Helpers.Cnt(s, ItemDefs.Weightless)) > 0 && Object.op_Implicit((Object)(object)s.characterMotor))
{
s.characterMotor.useGravity = false;
}
if (Helpers.Cnt(s, ItemDefs.Aether) > 0)
{
NetworkInstanceId val2 = Helpers.Id(s);
if (val2 != NetworkInstanceId.Invalid && StateTracker.AetherTimer.ContainsKey(val2) && StateTracker.AetherTimer[val2] > 0f)
{
s.moveSpeed *= 1.2f;
}
}
if ((num = Helpers.Cnt(s, ItemDefs.WingsFallen)) <= 0 || !Object.op_Implicit((Object)(object)s.characterMotor))
{
return;
}
NetworkInstanceId val3 = Helpers.Id(s);
if (val3 != NetworkInstanceId.Invalid)
{
StateTracker.GetF(StateTracker.WingsStamina, val3, 100f);
if (StateTracker.WingsStamina[val3] > 0f)
{
s.characterMotor.useGravity = false;
s.baseJumpCount += 10;
}
}
}
}
internal static class UpdateHook
{
internal static void OnUpdate(orig_FixedUpdate orig, CharacterBody s)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: 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_03c0: Unknown result type (might be due to invalid IL or missing references)
//IL_03cc: 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)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: 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_031b: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0332: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_0492: Unknown result type (might be due to invalid IL or missing references)
//IL_0493: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Unknown result type (might be due to invalid IL or missing references)
//IL_049b: Unknown result type (might be due to invalid IL or missing references)
//IL_04af: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
//IL_037c: Unknown result type (might be due to invalid IL or missing references)
//IL_0382: Unknown result type (might be due to invalid IL or missing references)
//IL_069d: Unknown result type (might be due to invalid IL or missing references)
//IL_06aa: Unknown result type (might be due to invalid IL or missing references)
//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
//IL_050a: Unknown result type (might be due to invalid IL or missing references)
//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_052f: Unknown result type (might be due to invalid IL or missing references)
//IL_0540: Unknown result type (might be due to invalid IL or missing references)
//IL_0553: Unknown result type (might be due to invalid IL or missing references)
//IL_0554: Unknown result type (might be due to invalid IL or missing references)
//IL_0558: Unknown result type (might be due to invalid IL or missing references)
//IL_055c: Unknown result type (might be due to invalid IL or missing references)
//IL_0570: Unknown result type (might be due to invalid IL or missing references)
//IL_051e: Unknown result type (might be due to invalid IL or missing references)
//IL_0407: Unknown result type (might be due to invalid IL or missing references)
//IL_0413: Unknown result type (might be due to invalid IL or missing references)
//IL_0418: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0421: Unknown result type (might be due to invalid IL or missing references)
//IL_0426: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
//IL_0435: Unknown result type (might be due to invalid IL or missing references)
//IL_043c: Unknown result type (might be due to invalid IL or missing references)
//IL_0442: Unknown result type (might be due to invalid IL or missing references)
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0605: Unknown result type (might be due to invalid IL or missing references)
//IL_058c: 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_05a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0755: Unknown result type (might be due to invalid IL or missing references)
//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
//IL_0823: Unknown result type (might be due to invalid IL or missing references)
//IL_0829: Unknown result type (might be due to invalid IL or missing references)
//IL_0783: Unknown result type (might be due to invalid IL or missing references)
//IL_0764: Unknown result type (might be due to invalid IL or missing references)
//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
//IL_0653: Unknown result type (might be due to invalid IL or missing references)
//IL_0664: Unknown result type (might be due to invalid IL or missing references)
//IL_066a: Unknown result type (might be due to invalid IL or missing references)
//IL_066f: Unknown result type (might be due to invalid IL or missing references)
//IL_0636: Unknown result type (might be due to invalid IL or missing references)
//IL_068d: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(s);
if (!Object.op_Implicit((Object)(object)s) || !Object.op_Implicit((Object)(object)s.inventory) || !NetworkServer.active)
{
return;
}
NetworkInstanceId val = Helpers.Id(s);
if (val == NetworkInstanceId.Invalid)
{
return;
}
float fixedDeltaTime = Time.fixedDeltaTime;
int num;
if ((num = Helpers.Cnt(s, ItemDefs.Stabilizer)) > 0 && Object.op_Implicit((Object)(object)s.healthComponent) && s.healthComponent.combinedHealthFraction < 0.5f && Object.op_Implicit((Object)(object)s.skillLocator))
{
float num2 = 0.04f * (float)num * fixedDeltaTime;
SkillLocator skillLocator = s.skillLocator;
if (Object.op_Implicit((Object)(object)skillLocator.primary) && skillLocator.primary.stock < skillLocator.primary.maxStock)
{
GenericSkill primary = skillLocator.primary;
primary.rechargeStopwatch += num2;
}
if (Object.op_Implicit((Object)(object)skillLocator.secondary) && skillLocator.secondary.stock < skillLocator.secondary.maxStock)
{
GenericSkill secondary = skillLocator.secondary;
secondary.rechargeStopwatch += num2;
}
if (Object.op_Implicit((Object)(object)skillLocator.utility) && skillLocator.utility.stock < skillLocator.utility.maxStock)
{
GenericSkill utility = skillLocator.utility;
utility.rechargeStopwatch += num2;
}
if (Object.op_Implicit((Object)(object)skillLocator.special) && skillLocator.special.stock < skillLocator.special.maxStock)
{
GenericSkill special = skillLocator.special;
special.rechargeStopwatch += num2;
}
}
if ((num = Helpers.Cnt(s, ItemDefs.Compass)) > 0)
{
float num3 = 15f * (float)num;
Collider[] array = Physics.OverlapSphere(s.transform.position, num3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask));
foreach (Collider val2 in array)
{
PurchaseInteraction component = ((Component)val2).GetComponent<PurchaseInteraction>();
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)((Component)component).GetComponent<PingInfoProvider>()))
{
Highlight component2 = ((Component)component).GetComponent<Highlight>();
if (Object.op_Implicit((Object)(object)component2))
{
component2.isOn = true;
}
}
}
}
if ((num = Helpers.Cnt(s, ItemDefs.Windwalker)) > 0 && Object.op_Implicit((Object)(object)s.healthComponent))
{
if (!StateTracker.WindwalkerPos.ContainsKey(val))
{
StateTracker.WindwalkerPos[val] = s.transform.position;
}
StateTracker.GetF(StateTracker.WindwalkerDist, val);
StateTracker.WindwalkerDist[val] += Vector3.Distance(s.transform.position, StateTracker.WindwalkerPos[val]);
StateTracker.WindwalkerPos[val] = s.transform.position;
if (StateTracker.WindwalkerDist[val] >= 100f)
{
StateTracker.WindwalkerDist[val] -= 100f;
s.healthComponent.Heal(3f * (float)num, default(ProcChainMask), true);
}
}
if ((num = Helpers.Cnt(s, ItemDefs.GravAnch)) > 0)
{
float num4 = 20f + 10f * (float)(num - 1);
Collider[] array2 = Physics.OverlapSphere(s.transform.position, num4, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask));
foreach (Collider val3 in array2)
{
GenericPickupController component3 = ((Component)val3).GetComponent<GenericPickupController>();
if (Object.op_Implicit((Object)(object)component3))
{
Vector3 val4 = s.transform.position - ((Component)component3).transform.position;
Vector3 normalized = ((Vector3)(ref val4)).normalized;
Transform transform = ((Component)component3).transform;
transform.position += normalized * 30f * fixedDeltaTime;
}
}
}
if ((num = Helpers.Cnt(s, ItemDefs.Herald)) > 0)
{
StateTracker.GetF(StateTracker.HeraldTimer, val);
StateTracker.HeraldTimer[val] -= fixedDeltaTime;
if (StateTracker.HeraldTimer[val] <= 0f)
{
StateTracker.SetF(StateTracker.HeraldTimer, val, 30f);
Combat.DmgAOE(s, 15f, 8f, pull: false);
}
}
if ((num = Helpers.Cnt(s, ItemDefs.VoidCon)) > 0)
{
if (!StateTracker.VoidPositions.ContainsKey(val))
{
StateTracker.VoidPositions[val] = new Queue<Vector3>();
}
StateTracker.GetF(StateTracker.VoidRecordTimer, val);
StateTracker.GetF(StateTracker.VoidCD, val);
StateTracker.VoidRecordTimer[val] -= fixedDeltaTime;
if (StateTracker.VoidRecordTimer[val] <= 0f)
{
StateTracker.SetF(StateTracker.VoidRecordTimer, val, 0.5f);
StateTracker.VoidPositions[val].Enqueue(s.transform.position);
while (StateTracker.VoidPositions[val].Count > 6)
{
StateTracker.VoidPositions[val].Dequeue();
}
}
StateTracker.VoidCD[val] -= fixedDeltaTime;
if (StateTracker.VoidCD[val] <= 0f && Object.op_Implicit((Object)(object)s.inputBank) && ((ButtonState)(ref s.inputBank.interact)).justPressed && StateTracker.VoidPositions[val].Count > 0)
{
StateTracker.SetF(StateTracker.VoidCD, val, 12f);
Vector3 val5 = StateTracker.VoidPositions[val].Dequeue();
if (Object.op_Implicit((Object)(object)s.characterMotor))
{
((BaseCharacterController)s.characterMotor).Motor.SetPosition(val5, true);
}
}
}
StateTracker.Tick(StateTracker.AetherTimer, val, fixedDeltaTime);
StateTracker.Tick(StateTracker.StormFocusTimer, val, fixedDeltaTime);
StateTracker.Tick(StateTracker.GravManipCD, val, fixedDeltaTime);
StateTracker.Tick(StateTracker.MaelstromCD, val, fixedDeltaTime);
if (Helpers.Cnt(s, ItemDefs.WingsFallen) > 0)
{
StateTracker.GetF(StateTracker.WingsStamina, val, 100f);
bool flag = Object.op_Implicit((Object)(object)s.inputBank) && (s.inputBank.skill1.down || s.inputBank.skill2.down || s.inputBank.skill3.down || s.inputBank.skill4.down);
StateTracker.SetF(StateTracker.WingsStamina, val, flag ? Mathf.Max(0f, StateTracker.WingsStamina[val] - 15f * fixedDeltaTime) : Mathf.Min(100f, StateTracker.WingsStamina[val] + 8f * fixedDeltaTime));
if (StateTracker.WingsStamina[val] <= 0f && Object.op_Implicit((Object)(object)s.characterMotor))
{
s.characterMotor.useGravity = true;
}
}
if (Helpers.Cnt(s, ItemDefs.Weightless) > 0 && Object.op_Implicit((Object)(object)s.characterMotor) && s.characterMotor.isGrounded && Object.op_Implicit((Object)(object)s.healthComponent) && s.healthComponent.alive)
{
s.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
}
if (Helpers.Cnt(s, ItemDefs.Chains) > 0 && Object.op_Implicit((Object)(object)s.healthComponent))
{
float num5 = s.healthComponent.fullHealth * 0.5f;
if (s.healthComponent.health > num5)
{
s.healthComponent.health = num5;
}
}
}
}
}
namespace DOTC.Assets
{
internal static class AssetLoader
{
private static AssetBundle _bundle;
private static ManualLogSource _log;
private static readonly string[] _pathFormats = new string[10] { "assets/clouditems/{0}.{1}", "Assets/CloudItems/{2}.{1}", "assets/clouditems/{2}.{1}", "{2}", "assets/clouditems/{2}", "Assets/CloudItems/{2}", "assets/{2}", "Assets/{2}", "{0}", "assets/clouditems/{0}" };
internal static void Init(ManualLogSource log)
{
_log = log;
LoadBundle();
}
private static void LoadBundle()
{
try
{
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
_log.LogInfo((object)("[AssetBundle] Plugin directory: " + directoryName));
string text = null;
string[] files = Directory.GetFiles(directoryName);
foreach (string text2 in files)
{
if (Path.GetFileName(text2).ToLower() == "clouditemsassets")
{
text = text2;
_log.LogInfo((object)("[AssetBundle] Matched bundle: " + text2));
break;
}
}
if (text == null)
{
_log.LogError((object)("[AssetBundle] Could not find clouditemsassets in " + directoryName));
return;
}
_bundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)_bundle == (Object)null)
{
_log.LogWarning((object)"[AssetBundle] LoadFromFile returned null, trying LoadFromMemory...");
try
{
byte[] array = File.ReadAllBytes(text);
_log.LogInfo((object)$"[AssetBundle] Read {array.Length} bytes");
_bundle = AssetBundle.LoadFromMemory(array);
if ((Object)(object)_bundle == (Object)null)
{
_log.LogError((object)"[AssetBundle] LoadFromMemory returned null. Bundle may be corrupt.");
}
}
catch (Exception ex)
{
_log.LogError((object)("[AssetBundle] LoadFromMemory failed: " + ex.Message));
}
}
if ((Object)(object)_bundle != (Object)null)
{
_log.LogInfo((object)$"[AssetBundle] Loaded {_bundle.GetAllAssetNames().Length} assets");
string[] allAssetNames = _bundle.GetAllAssetNames();
foreach (string text3 in allAssetNames)
{
_log.LogInfo((object)("[AssetBundle] - " + text3));
}
}
}
catch (Exception ex2)
{
_log.LogError((object)("[AssetBundle] Exception: " + ex2.Message + "\n" + ex2.StackTrace));
}
}
private static string[] BuildPaths(string name, string ext)
{
string[] array = new string[_pathFormats.Length];
for (int i = 0; i < _pathFormats.Length; i++)
{
array[i] = string.Format(_pathFormats[i], name.ToLower(), ext, name);
}
return array;
}
private static T LoadAsset<T>(string name, string ext) where T : Object
{
if ((Object)(object)_bundle == (Object)null)
{
return default(T);
}
string[] array = BuildPaths(name, ext);
foreach (string text in array)
{
T val = _bundle.LoadAsset<T>(text);
if ((Object)(object)val != (Object)null)
{
return val;
}
}
return default(T);
}
internal static Sprite LoadIcon(string tex, ItemTier t)
{
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected I4, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_bundle != (Object)null)
{
Sprite val = LoadAsset<Sprite>(tex, "png");
if ((Object)(object)val != (Object)null)
{
return val;
}
Texture2D val2 = LoadAsset<Texture2D>(tex, "png");
if ((Object)(object)val2 != (Object)null)
{
return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f), 100f);
}
_log.LogWarning((object)("[LoadIcon] Could not find " + tex + ", using placeholder"));
}
if (1 == 0)
{
}
string text = (int)t switch
{
0 => "Textures/ItemIcons/texMonsterToothIcon",
1 => "Textures/ItemIcons/texInfusionIcon",
2 => "Textures/ItemIcons/texDaggerIcon",
3 => "Textures/ItemIcons/texLunarPrimaryReplacementIcon",
_ => "Textures/MiscIcons/texMysteryIcon",
};
if (1 == 0)
{
}
return LegacyResourcesAPI.Load<Sprite>(text);
}
internal static GameObject LoadModel(string mdl, ItemTier t)
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Expected I4, but got Unknown
if ((Object)(object)_bundle != (Object)null)
{
GameObject val = LoadAsset<GameObject>(mdl, "prefab");
if ((Object)(object)val != (Object)null)
{
return val;
}
_log.LogWarning((object)("[LoadModel] Could not find " + mdl + ", using placeholder"));
}
if (1 == 0)
{
}
string text = (int)t switch
{
0 => "Prefabs/PickupModels/PickupMonsterTooth",
1 => "Prefabs/PickupModels/PickupInfusion",
2 => "Prefabs/PickupModels/PickupDagger",
3 => "Prefabs/PickupModels/PickupLunarPrimaryReplacement",
_ => "Prefabs/PickupModels/PickupMystery",
};
if (1 == 0)
{
}
return LegacyResourcesAPI.Load<GameObject>(text);
}
internal static ItemDef CreateItem(string name, string dispName, string pickup, string desc, string lore, string tex, string mdl, ItemTier tier, params ItemTag[] tags)
{
//IL_0010: 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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected I4, but got Unknown
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
ItemDef val = ScriptableObject.CreateInstance<ItemDef>();
((Object)val).name = name;
val.tier = tier;
val.tags = tags;
val.canRemove = true;
val.hidden = false;
val.pickupIconSprite = LoadIcon(tex, tier);
val.pickupModelPrefab = LoadModel(mdl, tier);
string text = "ITEM_" + name + "_";
val.nameToken = text + "NAME";
val.pickupToken = text + "PICKUP";
val.descriptionToken = text + "DESC";
val.loreToken = text + "LORE";
ItemDef val2 = val;
if (1 == 0)
{
}
string text2 = (int)tier switch
{
0 => "ItemTierDefs/Tier1Def",
1 => "ItemTierDefs/Tier2Def",
2 => "ItemTierDefs/Tier3Def",
3 => "ItemTierDefs/LunarTierDef",
_ => null,
};
if (1 == 0)
{
}
val2._itemTierDef = LegacyResourcesAPI.Load<ItemTierDef>(text2);
LanguageAPI.Add(text + "NAME", dispName);
LanguageAPI.Add(text + "PICKUP", pickup);
LanguageAPI.Add(text + "DESC", desc);
LanguageAPI.Add(text + "LORE", lore);
ItemAPI.Add(new CustomItem(val, (ItemDisplayRule[])(object)new ItemDisplayRule[0]));
return val;
}
}
}