Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of JinxMod v1.5.0
LemonJinxMod.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Captain.Weapon; using EntityStates.Commando.CommandoWeapon; using HG.BlendableTypes; using IL.RoR2; using JinxMod.Controller; using JinxMod.Controllers; using JinxMod.Modules; using JinxMod.Modules.Characters; using JinxMod.Modules.LeagueSkins; using JinxMod.Modules.Survivors; using JinxMod.SkillStates; using JinxMod.SkillStates.BaseStates; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LemonJinxMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.0.0")] [assembly: AssemblyInformationalVersion("1.5.0+4b0555fcdea05b08a53a1dcfa32c5c89bda2ee95")] [assembly: AssemblyProduct("LemonJinxMod")] [assembly: AssemblyTitle("LemonJinxMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.0.0")] [module: UnverifiableCode] namespace JinxMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Lemonlust.JinxMod", "JinxMod", "1.5.0")] public class JinxPlugin : BaseUnityPlugin { public const string MODUID = "com.Lemonlust.JinxMod"; public const string MODNAME = "JinxMod"; public const string MODVERSION = "1.5.0"; public const string DEVELOPER_PREFIX = "Lemonlust"; public static JinxPlugin instance; public static ModdedDamageType jinxDamage; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) instance = this; try { jinxDamage = DamageAPI.ReserveDamageType(); Log.Init(((BaseUnityPlugin)this).Logger); Assets.Initialize(); Config.ReadConfig(); States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); NetworkingAPI.RegisterMessageType<RefreshStacksMessage>(); NetworkingAPI.RegisterMessageType<SyncBuffTimersMessage>(); new MyCharacter().Initialize(); new ContentPacks().Initialize(); Hook(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void Hook() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); RocketJumpFallProtection.Hook(); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Buffs.revdUp)) { args.attackSpeedMultAdd += (float)sender.GetBuffCount(Buffs.revdUp) * 0.18f; } if (sender.HasBuff(Buffs.getExcitedSpeedBuff)) { args.moveSpeedMultAdd += (float)sender.GetBuffCount(Buffs.getExcitedSpeedBuff) * 0.125f; args.attackSpeedMultAdd += 0.25f; } } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (damageReport != null && damageReport.victimBody != null && damageReport.attackerBody != null && (int)damageReport.victimTeamIndex != 1 && damageReport.attackerBody.bodyIndex == BodyCatalog.FindBodyIndex("JinxBody") && (damageReport.victimIsChampion || damageReport.victimIsBoss || damageReport.victimIsElite)) { damageReport.attackerBody.RefreshStacks(Buffs.getExcitedSpeedBuff.buffIndex, 1f, 6, setToMax: true); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public static class BuffTimerSync { public static void Send(CharacterBody body, BuffIndex index) { //IL_0035: 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_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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.networkIdentity)) { return; } List<float> list = new List<float>(); for (int i = 0; i < body.timedBuffs.Count; i++) { TimedBuff val = body.timedBuffs[i]; if (val.buffIndex == index) { list.Add(val.timer); } } NetMessageExtensions.Send((INetMessage)(object)new SyncBuffTimersMessage(body.networkIdentity.netId, index, list), (NetworkDestination)1); } public static IList<float> GetTimers(CharacterBody body, BuffIndex index) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) JinxBuffTimers jinxBuffTimers = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent<JinxBuffTimers>() : null); if (!Object.op_Implicit((Object)(object)jinxBuffTimers)) { return new List<float>(); } return jinxBuffTimers.GetTimers(index, body.GetBuffCount(index)); } public static float GetLongest(CharacterBody body, BuffIndex index) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) IList<float> timers = GetTimers(body, index); if (timers.Count <= 0) { return 0f; } return timers[0]; } } public class SyncBuffTimersMessage : INetMessage, ISerializableObject { private NetworkInstanceId netId; private BuffIndex index; private List<float> timers; public SyncBuffTimersMessage() { } public SyncBuffTimersMessage(NetworkInstanceId netId, BuffIndex index, List<float> timers) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) this.netId = netId; this.index = index; this.timers = timers; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown writer.Write(netId); writer.WritePackedUInt32((uint)(int)index); writer.WritePackedUInt32((uint)timers.Count); foreach (float timer in timers) { writer.Write(timer); } } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) netId = reader.ReadNetworkId(); index = (BuffIndex)reader.ReadPackedUInt32(); int num = (int)reader.ReadPackedUInt32(); timers = new List<float>(num); for (int i = 0; i < num; i++) { timers.Add(reader.ReadSingle()); } } public void OnReceived() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(netId); if (!Object.op_Implicit((Object)(object)val)) { return; } CharacterBody component = val.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { JinxBuffTimers jinxBuffTimers = ((Component)component).GetComponent<JinxBuffTimers>(); if (!Object.op_Implicit((Object)(object)jinxBuffTimers)) { jinxBuffTimers = ((Component)component).gameObject.AddComponent<JinxBuffTimers>(); } jinxBuffTimers.Set(index, timers); } } } public class JinxBuffTimers : MonoBehaviour { private readonly Dictionary<BuffIndex, List<float>> timers = new Dictionary<BuffIndex, List<float>>(); public void Set(BuffIndex index, List<float> values) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) List<float> list = new List<float>(values); list.Sort((float a, float b) => b.CompareTo(a)); timers[index] = list; } public IList<float> GetTimers(BuffIndex index, int actualStacks) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (!timers.TryGetValue(index, out var value)) { return new List<float>(); } if (value.Count > actualStacks) { value.RemoveRange(actualStacks, value.Count - actualStacks); } return value; } private void Update() { float deltaTime = Time.deltaTime; foreach (List<float> value in timers.Values) { for (int num = value.Count - 1; num >= 0; num--) { value[num] -= deltaTime; if (value[num] <= 0f) { value.RemoveAt(num); } } } } } public static class RefreshStacksHelper { public static void RefreshStacks(this CharacterBody body, BuffIndex index, float duration, int maxStacks, bool setToMax = false) { //IL_0014: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) int num = 0; for (int i = 0; i < body.timedBuffs.Count; i++) { TimedBuff val = body.timedBuffs[i]; if (val.buffIndex == index) { num++; if (val.timer < duration * (float)num) { val.timer = duration * (float)num; } } } if (setToMax) { for (int j = num; j < maxStacks; j++) { body.AddTimedBuff(BuffCatalog.GetBuffDef(index), duration * (float)(j + 1), maxStacks); } BuffTimerSync.Send(body, index); } else { if (num < maxStacks) { body.AddTimedBuff(BuffCatalog.GetBuffDef(index), duration * (float)(num + 1), maxStacks); } BuffTimerSync.Send(body, index); } } } public class RefreshStacksMessage : INetMessage, ISerializableObject { private CharacterBody body; private BuffIndex index; private float duration; private int maxStacks; private bool setToMax; public RefreshStacksMessage() { } public RefreshStacksMessage(CharacterBody body, BuffIndex index, float duration, int maxStacks, bool setToMax = false) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) this.body = body; this.index = index; this.duration = duration; this.maxStacks = maxStacks; this.setToMax = setToMax; } public void Serialize(NetworkWriter writer) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown writer.Write(body.networkIdentity.netId); writer.WritePackedUInt32((uint)(int)index); writer.Write(duration); writer.Write(maxStacks); writer.Write(setToMax); } public void Deserialize(NetworkReader reader) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(reader.ReadNetworkId()); body = val.GetComponent<CharacterBody>(); index = (BuffIndex)reader.ReadPackedUInt32(); duration = reader.ReadSingle(); maxStacks = reader.ReadInt32(); setToMax = reader.ReadBoolean(); } public void OnReceived() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) body.RefreshStacks(index, duration, maxStacks, setToMax); } } } namespace JinxMod.SkillStates { public class FishBones : BaseSkillState { public static float damageCoefficient = Config.fishBonesDamageCoefficient.Value; public static float procCoefficient = Config.fishBonesProcCoefficient.Value; public static float baseDuration = 1.5f; public static float throwForce = 80f; private float duration; private float fireTime; private bool hasFired; private Animator animator; private RocketController rocketController; public override void OnEnter() { //IL_0127: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.2f; if (duration < fireTime) { fireTime = duration * 0.2f; } ((BaseState)this).StartAimMode(duration, false); animator = ((EntityState)this).GetModelAnimator(); rocketController = ((EntityState)this).GetComponent<RocketController>(); if (Object.op_Implicit((Object)(object)rocketController)) { rocketController.attacks++; } if (animator.GetBool("isMoving") || !animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("Gesture, Override", "fishbonesattack"); } else if (!animator.GetBool("isMoving") && animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("FullBody, Override", "fishbonesattack"); } if (((EntityState)this).characterBody.GetBuffCount(Buffs.revdUp) > 0 && NetworkServer.active) { ((EntityState)this).characterBody.RemoveOldestTimedBuff(Buffs.revdUp); BuffTimerSync.Send(((EntityState)this).characterBody, Buffs.revdUp.buffIndex); } } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { if (!hasFired) { hasFired = true; Util.PlaySound("Play_JinxFishBonesShoot", ((EntityState)this).gameObject); FireMissile(); } } private void FireMissile() { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01e3: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0200: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).AddRecoil(-3f, -6f, -1.5f, 1.5f); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); GameObject missilePrefab = Projectiles.missilePrefab; bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); if (Object.op_Implicit((Object)(object)FireRocket.effectPrefab)) { EffectManager.SimpleMuzzleFlash(FireRocket.effectPrefab, ((EntityState)this).gameObject, "FishBonesMuzzle", false); } if (((EntityState)this).isAuthority) { int? num; if ((Object)(object)((EntityState)this).characterBody == (Object)null) { num = null; } else { Inventory inventory = ((EntityState)this).characterBody.inventory; num = (((Object)(object)inventory != (Object)null) ? new int?(inventory.GetItemCount(Items.MoreMissile)) : ((int?)null)); } InputBankTest component = ((Component)((EntityState)this).characterBody).GetComponent<InputBankTest>(); int valueOrDefault = num.GetValueOrDefault(); float num2 = Mathf.Max(1f, 1f + 0.5f * (float)(valueOrDefault - 1)); FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = missilePrefab, position = component.aimOrigin, rotation = Util.QuaternionSafeLookRotation(component.aimDirection), procChainMask = default(ProcChainMask), target = null, owner = ((Component)((EntityState)this).characterBody).gameObject, damage = ((EntityState)this).characterBody.damage * damageCoefficient * num2, crit = crit, force = 600f, damageColorIndex = (DamageColorIndex)0 }; ProjectileManager.instance.FireProjectile(val); Quaternion val2 = Quaternion.LookRotation(component.aimDirection); if (valueOrDefault > 0) { FireProjectileInfo val3 = val; val3.rotation = val2 * Quaternion.Euler(0f, -15f, 0f); val3.position = val.position + Random.insideUnitSphere * 1f; ProjectileManager.instance.FireProjectile(val3); FireProjectileInfo val4 = val; val4.rotation = val2 * Quaternion.Euler(0f, 15f, 0f); val4.position = val.position + Random.insideUnitSphere * 1f; ProjectileManager.instance.FireProjectile(val4); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class MegaRocket : BaseSkillState { public static float damageCoefficient = Config.megaRocketDamageCoefficient.Value; public static float procCoefficient = Config.megaRocketProcCoefficient.Value; public static float baseDuration = 1f; public static float throwForce = 80f; private float duration; private float fireTime; private bool hasFired; private RocketController rocketController; public override void OnEnter() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown ((BaseState)this).OnEnter(); duration = baseDuration; fireTime = 0.53f; ((BaseState)this).StartAimMode(duration, false); rocketController = ((EntityState)this).GetComponent<RocketController>(); if (Object.op_Implicit((Object)(object)rocketController)) { rocketController.attacks++; } ((EntityState)this).PlayAnimation("FullBody, Override", "megarocket"); Util.PlaySound("Play_JinxMegaRocketShootInitial", ((EntityState)this).gameObject); Vector3 origin = ((EntityState)this).characterBody.corePosition + Vector3.up * 1f; GameObject chargeEffect = Assets.chargeEffect; EffectData val = new EffectData { origin = origin }; Ray aimRay = ((BaseState)this).GetAimRay(); val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.scale = 1f; EffectManager.SpawnEffect(chargeEffect, val, false); if (Config.voiceLines.Value) { Util.PlaySound("Play_JinxMegaRocketVO", ((EntityState)this).gameObject); } } public override void OnExit() { ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); ((EntityState)this).OnExit(); } private void Fire() { if (!hasFired) { hasFired = true; Util.PlaySound("Play_JinxMegaRocketShoot", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { FireMissile(); } } } private void FireMissile() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-6f, -12f, -3f, 3f); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); GameObject megaRocketPrefab = Projectiles.megaRocketPrefab; bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); if (Object.op_Implicit((Object)(object)FireRocket.effectPrefab)) { EffectManager.SimpleMuzzleFlash(FireRocket.effectPrefab, ((EntityState)this).gameObject, "FishBonesMuzzle", false); } int? num; if ((Object)(object)((EntityState)this).characterBody == (Object)null) { num = null; } else { Inventory inventory = ((EntityState)this).characterBody.inventory; num = (((Object)(object)inventory != (Object)null) ? new int?(inventory.GetItemCount(Items.MoreMissile)) : ((int?)null)); } int valueOrDefault = num.GetValueOrDefault(); float num2 = Mathf.Max(1f, 1f + 0.5f * (float)(valueOrDefault - 1)); FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = megaRocketPrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), procChainMask = default(ProcChainMask), target = null, owner = ((Component)((EntityState)this).characterBody).gameObject, damage = ((EntityState)this).characterBody.damage * damageCoefficient * num2, crit = crit, force = 1200f, damageColorIndex = (DamageColorIndex)0 }; ProjectileManager.instance.FireProjectile(val); } public override void FixedUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_003a: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); Ray aimRay = ((BaseState)this).GetAimRay(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Ray)(ref aimRay)).direction != Vector3.zero) { ((EntityState)this).characterDirection.moveVector = ((Ray)(ref aimRay)).direction; } if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class PowPow : BaseSkillState { public static float damageCoefficient = Config.powPowDamageCoefficient.Value; public static float procCoefficient = Config.powPowProcCoefficient.Value; public static float baseDuration = 0.8f; public static float force = 400f; public static float recoil = 0.5f; public static float range = 256f; public static GameObject tracerEffectPrefab = Assets.powPowTracer; private float duration; private float fireTime; private bool hasFired; private string muzzleString; private float bulletStopWatch; private int bulletCount = 3; private RocketController rocketController; private bool hasHit; private bool hasBuff; public Animator animator { get; private set; } public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.1f * duration; ((BaseState)this).StartAimMode(duration, false); muzzleString = "PowPowMuzzle"; animator = ((EntityState)this).GetModelAnimator(); if (animator.GetBool("isMoving") || !animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("Gesture, Override", "powpowattack"); } else if (!animator.GetBool("isMoving") && animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("FullBody, Override", "powpowattack"); } Util.PlaySound("Play_JinxPowPowShoot", ((EntityState)this).gameObject); rocketController = ((EntityState)this).GetComponent<RocketController>(); if (Object.op_Implicit((Object)(object)rocketController)) { rocketController.attacks++; } } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) //IL_011f: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); if (((EntityState)this).isAuthority) { new BulletAttack { bulletCount = 1u, aimVector = ((EntityState)this).inputBank.aimDirection, origin = ((EntityState)this).inputBank.aimOrigin, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)1, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0.75f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 0f, spreadYawScale = 0f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab, hitCallback = new HitCallback(BulletHitCallback) }.Fire(); } } private bool BulletHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); HealthComponent val = (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) ? hitInfo.hitHurtBox.healthComponent : null); if (Object.op_Implicit((Object)(object)val) && val.alive && hitInfo.hitHurtBox.teamIndex != ((EntityState)this).teamComponent.teamIndex) { hasHit = true; PointSoundManager.EmitSoundLocal(AkEventIdArg.op_Implicit(NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(Assets.bulletHitSoundEvent.index)), ((Component)hitInfo.hitHurtBox).transform.position); } return result; } public override void FixedUpdate() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (bulletStopWatch < fireTime / 3f) { bulletStopWatch += Time.fixedDeltaTime; } if (((EntityState)this).fixedAge >= fireTime && bulletStopWatch > fireTime / 3f && bulletCount > 0) { bulletStopWatch = 0f; bulletCount--; if (!hasFired) { Fire(); } if (bulletCount <= 0) { hasFired = true; } } if (hasHit && !hasBuff) { hasBuff = true; NetMessageExtensions.Send((INetMessage)(object)new RefreshStacksMessage(((EntityState)this).characterBody, Buffs.revdUp.buffIndex, 2.5f, 3), (NetworkDestination)2); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class Switcharoo : GenericCharacterMain { public static float baseDuration = 0.266f; private Animator animator; private RocketController rocketController; private AnimatorOverrideController animatorOverrideController; private float stopwatch; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); rocketController = ((EntityState)this).GetComponent<RocketController>(); if (!rocketController.isRocket) { rocketController.isRocket = true; ((EntityState)this).PlayAnimation("Gesture, Override", "equip_rocket"); animatorOverrideController = Assets.mainAssetBundle.LoadAsset<AnimatorOverrideController>("RocketOverrideController"); animator.runtimeAnimatorController = (RuntimeAnimatorController)(object)animatorOverrideController; Util.PlaySound("Play_JinxSwitch2FishBones", ((EntityState)this).gameObject); ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, MyCharacter.fishBonesSkillDef, (SkillOverridePriority)3); } else { rocketController.isRocket = false; ((EntityState)this).PlayAnimation("Gesture, Override", "equip_gat"); animatorOverrideController = Assets.mainAssetBundle.LoadAsset<AnimatorOverrideController>("GatOverrideController"); animator.runtimeAnimatorController = (RuntimeAnimatorController)(object)animatorOverrideController; Util.PlaySound("Play_JinxSwitch2PowPow", ((EntityState)this).gameObject); ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, MyCharacter.fishBonesSkillDef, (SkillOverridePriority)3); } } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (((EntityState)this).isAuthority && stopwatch >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((GenericCharacterMain)this).OnExit(); } } public class Zap : BaseSkillState { public static float damageCoefficient = Config.zapDamageCoefficient.Value; public static float procCoefficient = Config.zapProcCoefficient.Value; public static float baseDuration = 1.18f; public static float throwForce = 80f; private float duration; private float fireTime; private bool hasFired; private Animator animator; private GameObject projectilePrefab = Projectiles.zapPrefab; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = FishBones.baseDuration; fireTime = 0.5f; ((BaseState)this).StartAimMode(duration, false); animator = ((EntityState)this).GetModelAnimator(); if (animator.GetBool("isMoving") || !animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("Gesture, Override", "zap"); } else if (!animator.GetBool("isMoving") && animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("FullBody, Override", "zap"); } Util.PlaySound("Play_JinxZapSFX", ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { if (!hasFired) { hasFired = true; Util.PlaySound("Play_JinxZapShoot", ((EntityState)this).gameObject); if (Config.voiceLines.Value) { Util.PlaySound("Play_JinxZapVO", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority) { FireMissile(); } } } private void FireMissile() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); ((BaseState)this).AddRecoil(-1f * FireTazer.recoilAmplitude, -1.5f * FireTazer.recoilAmplitude, -0.25f * FireTazer.recoilAmplitude, 0.25f * FireTazer.recoilAmplitude); if (Object.op_Implicit((Object)(object)FireTazer.muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FireTazer.muzzleflashEffectPrefab, ((EntityState)this).gameObject, "Muzzle", false); } FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), procChainMask = default(ProcChainMask), target = null, owner = ((Component)((EntityState)this).characterBody).gameObject, damage = ((EntityState)this).characterBody.damage * damageCoefficient, crit = crit, force = 200f, damageColorIndex = (DamageColorIndex)0 }; ProjectileManager.instance.FireProjectile(val); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace JinxMod.SkillStates.BaseStates { public class BaseMeleeAttack : BaseSkillState { public int swingIndex; protected string hitboxName = "Sword"; protected DamageType damageType; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartTime = 0.2f; protected float attackEndTime = 0.4f; protected float baseEarlyExitTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected bool cancelled; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound; private float earlyExitTime; public float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00f1: 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_013c: 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) //IL_017b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; animator.SetBool("attacking", true); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName); } PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f); } public override void OnExit() { if (!hasFired && !cancelled) { FireAttack(); } ((EntityState)this).OnExit(); animator.SetBool("attacking", false); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true); } protected virtual void OnHitEnemyAuthority() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate"); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (!hasFired) { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (((EntityState)this).isAuthority) { PlaySwingEffect(); ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { OnHitEnemyAuthority(); } } protected virtual void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack { swingIndex = num }); } public override void FixedUpdate() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.fixedDeltaTime; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } if (!inHitPause) { stopwatch += Time.fixedDeltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Swing.playbackRate", 0f); } } if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime) { FireAttack(); } if (stopwatch >= duration - earlyExitTime && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down) { if (!hasFired) { FireAttack(); } SetNextState(); } else if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } } public class BaseTimedSkillState : BaseSkillState { public static float TimedBaseDuration; public static float TimedBaseCastStartTime; public static float TimedBaseCastEndTime; protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; protected virtual void InitDurationValues(float baseDuration, float baseCastStartTime, float baseCastEndTime = 1f) { TimedBaseDuration = baseDuration; TimedBaseCastStartTime = baseCastStartTime; TimedBaseCastEndTime = baseCastEndTime; duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = baseCastStartTime * duration; castEndTime = baseCastEndTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && ((EntityState)this).fixedAge > castStartTime) { hasFired = true; OnCastEnter(); } bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public static float SkillEndTime = 0.9f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime); } protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime); } protected override void OnCastEnter() { } } internal class DeathState : GenericCharacterDeath { public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)9; } public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); Util.PlaySound("Play_JinxDeathVO", ((EntityState)this).gameObject); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.CrossFadeInFixedTime("Death", 0.1f); } } public override void OnExit() { ((GenericCharacterDeath)this).OnExit(); } } } namespace JinxMod.Controllers { [RequireComponent(typeof(ProjectileController))] public class JinxMegaImpact : ProjectileExplosion, IProjectileImpactBehavior { private float age; public static float bonusDamageCoefficient = 0.25f; public override void Awake() { ((ProjectileExplosion)this).Awake(); } public void FixedUpdate() { age += Time.fixedDeltaTime; } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00fe: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) List<HurtBox> list = new SphereSearch { radius = 16f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = impactInfo.estimatedPointOfImpact }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(base.projectileController.teamFilter.teamIndex)).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); List<HealthComponent> list2 = new List<HealthComponent>(); foreach (HurtBox item in list) { if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.healthComponent) && item.healthComponent.alive && !list2.Contains(item.healthComponent)) { float num = base.projectileDamage.damage * Mathf.Min(1f, age * 0.2f); DamageInfo val = new DamageInfo(); val.damage = num + item.healthComponent.missingCombinedHealth * bonusDamageCoefficient; val.crit = false; val.damageColorIndex = (DamageColorIndex)3; val.attacker = (Object.op_Implicit((Object)(object)base.projectileController.owner) ? base.projectileController.owner.gameObject : null); val.inflictor = ((Component)this).gameObject; val.position = ((Component)item.healthComponent).gameObject.transform.position; val.force = base.projectileDamage.force * ((Component)this).transform.forward; val.procChainMask = base.projectileController.procChainMask; val.procCoefficient = base.projectileController.procCoefficient; item.healthComponent.TakeDamage(val); list2.Add(item.healthComponent); } } } } [RequireComponent(typeof(ProjectileController))] public class RocketJumpController : MonoBehaviour { private struct OwnerInfo { public readonly GameObject gameObject; public readonly CharacterBody characterBody; public readonly CharacterMotor characterMotor; public readonly Rigidbody rigidbody; public readonly bool hasEffectiveAuthority; public OwnerInfo(GameObject ownerGameObject) { this = default(OwnerInfo); gameObject = ownerGameObject; if (Object.op_Implicit((Object)(object)gameObject)) { characterBody = gameObject.GetComponent<CharacterBody>(); characterMotor = gameObject.GetComponent<CharacterMotor>(); rigidbody = gameObject.GetComponent<Rigidbody>(); hasEffectiveAuthority = Util.HasEffectiveAuthority(gameObject); } } } private ProjectileController projectileController; private ProjectileImpactExplosion projectileImpactExplosion; public Rigidbody rigidbody; public ProjectileImpactEventCaller projectileImpactEventCaller; private OwnerInfo owner; public float explosionForce = 4000f; public float explosionRadius = Config.rocketJumpRadius.Value; private void Start() { owner = new OwnerInfo(projectileController.owner); } private void Awake() { projectileController = ((Component)this).GetComponent<ProjectileController>(); projectileImpactExplosion = ((Component)this).GetComponent<ProjectileImpactExplosion>(); rigidbody = ((Component)this).GetComponent<Rigidbody>(); explosionRadius = ((ProjectileExplosion)projectileImpactExplosion).blastRadius; if (NetworkServer.active) { projectileImpactEventCaller = ((Component)this).GetComponent<ProjectileImpactEventCaller>(); if (Object.op_Implicit((Object)(object)projectileImpactEventCaller)) { ((UnityEvent<ProjectileImpactInfo>)(object)projectileImpactEventCaller.impactEvent).AddListener((UnityAction<ProjectileImpactInfo>)OnImpact); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)projectileImpactEventCaller)) { ((UnityEvent<ProjectileImpactInfo>)(object)projectileImpactEventCaller.impactEvent).RemoveListener((UnityAction<ProjectileImpactInfo>)OnImpact); } } private void OnImpact(ProjectileImpactInfo projectileImpactInfo) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (((Component)((Component)projectileImpactInfo.collider).transform).gameObject.layer != LayerIndex.world.intVal) { return; } Collider[] array = Physics.OverlapSphere(projectileImpactInfo.estimatedPointOfImpact, explosionRadius); for (int i = 0; i < array.Length; i++) { CharacterBody component = ((Component)array[i]).GetComponent<CharacterBody>(); if ((Object)(object)owner.characterBody == (Object)(object)component && Object.op_Implicit((Object)(object)component) && component?.bodyIndex == (BodyIndex?)BodyCatalog.FindBodyIndex("JinxBody")) { if (Config.rocketJump.Value) { RocketJumpFallProtection.Grant(owner.characterBody); } AddExplosionForce(component, explosionForce, projectileImpactInfo.estimatedPointOfImpact, explosionRadius); } } } private void AddExplosionForce(CharacterBody characterBody, float explosionForce, Vector3 explosionPosition, float explosionRadius, float upliftModifier = 0f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002c: 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_0044: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) Vector3 val = characterBody.corePosition - explosionPosition; float num = 1f - ((Vector3)(ref val)).magnitude / explosionRadius; Vector3 val2 = ((Vector3)(ref val)).normalized * explosionForce * num; if (Config.rocketJump.Value) { characterBody.characterMotor.ApplyForce(val2, false, false); } if (upliftModifier != 0f) { float num2 = 1f - upliftModifier / explosionRadius; Vector3 val3 = Vector3.up * explosionForce * num2; if (Config.rocketJump.Value) { characterBody.characterMotor.ApplyForce(val3, false, false); } } } } public class RocketJumpFallProtection : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_TakeDamage <>9__4_0; public static hook_OnCharacterHitGroundServer <>9__4_1; internal void <Hook>b__4_0(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0018: 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) if (!NetworkServer.active || damageInfo == null || !Object.op_Implicit((Object)(object)self) || (damageInfo.damageType.damageType & 0x200000) == 0 || !IsProtected(self.body)) { orig.Invoke(self, damageInfo); } } internal void <Hook>b__4_1(orig_OnCharacterHitGroundServer orig, GlobalEventManager self, CharacterBody characterBody, HitGroundInfo hitGroundInfo) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, characterBody, hitGroundInfo); Clear(characterBody); } } private bool isProtected; public static void Grant(CharacterBody body) { if (NetworkServer.active && Object.op_Implicit((Object)(object)body)) { RocketJumpFallProtection rocketJumpFallProtection = ((Component)body).GetComponent<RocketJumpFallProtection>(); if (!Object.op_Implicit((Object)(object)rocketJumpFallProtection)) { rocketJumpFallProtection = ((Component)body).gameObject.AddComponent<RocketJumpFallProtection>(); } rocketJumpFallProtection.isProtected = true; } } private static bool IsProtected(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body)) { return false; } RocketJumpFallProtection component = ((Component)body).GetComponent<RocketJumpFallProtection>(); if (Object.op_Implicit((Object)(object)component)) { return component.isProtected; } return false; } private static void Clear(CharacterBody body) { if (Object.op_Implicit((Object)(object)body)) { RocketJumpFallProtection component = ((Component)body).GetComponent<RocketJumpFallProtection>(); if (Object.op_Implicit((Object)(object)component)) { component.isProtected = false; } } } internal static void Hook() { //IL_0014: 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_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown object obj = <>c.<>9__4_0; if (obj == null) { hook_TakeDamage val = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0018: 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) if (!NetworkServer.active || damageInfo == null || !Object.op_Implicit((Object)(object)self) || (damageInfo.damageType.damageType & 0x200000) == 0 || !IsProtected(self.body)) { orig.Invoke(self, damageInfo); } }; <>c.<>9__4_0 = val; obj = (object)val; } HealthComponent.TakeDamage += (hook_TakeDamage)obj; object obj2 = <>c.<>9__4_1; if (obj2 == null) { hook_OnCharacterHitGroundServer val2 = delegate(orig_OnCharacterHitGroundServer orig, GlobalEventManager self, CharacterBody characterBody, HitGroundInfo hitGroundInfo) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, characterBody, hitGroundInfo); Clear(characterBody); }; <>c.<>9__4_1 = val2; obj2 = (object)val2; } GlobalEventManager.OnCharacterHitGroundServer += (hook_OnCharacterHitGroundServer)obj2; } } } namespace JinxMod.Controller { [DefaultExecutionOrder(9000)] public class GestureAimCorrector : MonoBehaviour { private class Weapon { internal int stateHash; internal Transform back; internal Transform muzzle; internal Transform detached; } public string layerName = "Gesture, Override"; public float maxYaw = 150f; public float blendSpeed = 10f; private Animator animator; private CharacterBody body; private int layer = -1; private Transform[] spine; private readonly List<Weapon> weapons = new List<Weapon>(); private float weight; private float yaw; private Weapon lastWeapon; private void Start() { animator = ((Component)this).GetComponent<Animator>(); CharacterModel component = ((Component)this).GetComponent<CharacterModel>(); body = (Object.op_Implicit((Object)(object)component) ? component.body : null); if (Object.op_Implicit((Object)(object)animator)) { layer = animator.GetLayerIndex(layerName); } Dictionary<string, Transform> bones = new Dictionary<string, Transform>(); Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { if (!bones.ContainsKey(((Object)val).name)) { bones[((Object)val).name] = val; } } spine = (Transform[])(object)new Transform[3] { Bone("Spine1"), Bone("Spine2"), Bone("Spine3") }; AddWeapon("fishbonesattack", Bone("Rocket_Launcher_End"), Bone("Rocket_Launcher_Front"), null); AddWeapon("powpowattack", Bone("Minigun"), Bone("Minigun_Barrel1"), Bone("Minigun")); AddWeapon("zap", Bone("Pistol"), Bone("Cstm_Buffbone_Pistol"), Bone("Pistol")); Transform Bone(string n) { if (!bones.TryGetValue(n, out var value)) { return null; } return value; } } private void AddWeapon(string state, Transform back, Transform muzzle, Transform detached) { if (Object.op_Implicit((Object)(object)back) && Object.op_Implicit((Object)(object)muzzle)) { weapons.Add(new Weapon { stateHash = Animator.StringToHash(state), back = back, muzzle = muzzle, detached = detached }); } } private void LateUpdate() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)animator) || layer < 0 || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inputBank) || (Object)(object)spine[0] == (Object)null) { return; } Weapon weapon = null; if (animator.GetLayerWeight(layer) > 0f) { AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(layer); foreach (Weapon weapon2 in weapons) { if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).shortNameHash == weapon2.stateHash) { weapon = weapon2; break; } } } weight = Mathf.MoveTowards(weight, (weapon != null) ? 1f : 0f, blendSpeed * Time.deltaTime); if (weight <= 0f) { return; } if (weapon != null) { lastWeapon = weapon; Vector3 val = Vector3.ProjectOnPlane(weapon.muzzle.position - weapon.back.position, Vector3.up); Vector3 val2 = Vector3.ProjectOnPlane(body.inputBank.aimDirection, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 1E-06f && ((Vector3)(ref val2)).sqrMagnitude > 1E-06f) { yaw = Mathf.Clamp(Vector3.SignedAngle(val, val2, Vector3.up), 0f - maxYaw, maxYaw); } } float num = yaw * weight; if (Mathf.Abs(num) < 0.01f) { return; } Vector3 position = spine[0].position; int num2 = 0; Transform[] array = spine; for (int i = 0; i < array.Length; i++) { if (Object.op_Implicit((Object)(object)array[i])) { num2++; } } Quaternion val3 = Quaternion.AngleAxis(num / (float)num2, Vector3.up); array = spine; foreach (Transform val4 in array) { if (Object.op_Implicit((Object)(object)val4)) { val4.rotation = val3 * val4.rotation; } } if (lastWeapon != null && Object.op_Implicit((Object)(object)lastWeapon.detached)) { Quaternion val5 = Quaternion.AngleAxis(num, Vector3.up); Transform detached = lastWeapon.detached; detached.position = position + val5 * (detached.position - position); detached.rotation = val5 * detached.rotation; } } } [RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(ProjectileTargetComponent))] public class JinxMissileController : MonoBehaviour { private ProjectileTargetComponent targetComponent; public float maxVelocity = 25f; public float rollVelocity; public float acceleration = 3f; public float delayTimer = 0.5f; public float giveupTimer = 8f; public float deathTimer = 10f; private float timer; public float turbulence = 2f; private void Start() { targetComponent = ((Component)this).GetComponent<ProjectileTargetComponent>(); } private void Awake() { if (!NetworkServer.active) { ((Behaviour)this).enabled = false; } } private void FixedUpdate() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) timer += Time.fixedDeltaTime; if (timer < giveupTimer && Object.op_Implicit((Object)(object)targetComponent.target) && timer >= delayTimer) { Vector3 val = targetComponent.target.position + Random.insideUnitSphere * turbulence - ((Component)this).transform.position; if (val != Vector3.zero) { ((Component)this).transform.forward = Vector3.RotateTowards(((Component)this).transform.forward, val, MathF.PI * 4f * (Time.fixedDeltaTime * 2f), 0f); } } } } public class MenuController : MonoBehaviour { private uint playID; private uint playID2; private void OnDestroy() { if (playID != 0) { AkSoundEngine.StopPlayingID(playID); } if (playID2 != 0) { AkSoundEngine.StopPlayingID(playID2); } } private void OnEnable() { ((MonoBehaviour)this).Invoke("PlayEffect", 0.05f); } private void PlayEffect() { if (Config.voiceLines.Value) { playID = Util.PlaySound("Play_JinxTauntVO", ((Component)this).gameObject); } playID2 = Util.PlaySound("Play_JinxMenuSFX", ((Component)this).gameObject); } } public class RocketController : MonoBehaviour { public bool isRocket; private CharacterBody body; public float stopwatch; public float random; public float attackspeed; public int attacks; public void Start() { isRocket = false; body = ((Component)this).GetComponent<CharacterBody>(); random = Random.Range(15f * body.attackSpeed, 30f * body.attackSpeed); } public void Update() { if ((float)attacks > random) { attacks = 0; if (Config.voiceLines.Value) { Util.PlaySound("Play_JinxAttackVO", ((Component)this).gameObject); } random = Random.Range(15f * body.attackSpeed, 30f * body.attackSpeed); } } } } namespace JinxMod.Modules { internal static class Assets { internal static AssetBundle mainAssetBundle; internal static GameObject bombExplosionEffect; internal static GameObject megaExplosionEffect; internal static GameObject powPowTracer; internal static GameObject chargeEffect; internal static NetworkSoundEventDef explosionHitSoundEvent; internal static NetworkSoundEventDef bulletHitSoundEvent; internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard"); private static string[] assetNames = new string[0]; private const string assetbundleName = "jinx"; internal static void Initialize() { LoadAssetBundle(); LoadSoundbank(); PopulateAssets(); } internal static void LoadAssetBundle() { if ((Object)(object)mainAssetBundle == (Object)null) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JinxMod.jinx"); mainAssetBundle = AssetBundle.LoadFromStream(stream); } if ((Object)(object)mainAssetBundle == (Object)null) { Log.Error("Failed to load assetbundle. Make sure your assetbundle name is setup correctly"); } else { assetNames = mainAssetBundle.GetAllAssetNames(); } } internal static void LoadSoundbank() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JinxMod.JinxBank.bnk"); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } internal static void PopulateAssets() { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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) if (!Object.op_Implicit((Object)(object)mainAssetBundle)) { Log.Error("There is no AssetBundle to load assets from."); return; } bombExplosionEffect = LoadEffect("Jinx Normal rockets", "Play_JinxFishBonesImpact"); megaExplosionEffect = LoadEffect("Jinx Normal rockets Variant", "Play_JinxMegaRocketImpact"); explosionHitSoundEvent = CreateNetworkSoundEventDef("Play_JinxFishBonesImpact"); chargeEffect = LoadEffect("Charge Variant"); powPowTracer = CreateTracer("TracerGoldGat", "PowPowTracer"); if (Object.op_Implicit((Object)(object)powPowTracer)) { powPowTracer.GetComponent<Tracer>().speed = 600f; powPowTracer.GetComponent<Tracer>().length = 75f; } bulletHitSoundEvent = CreateNetworkSoundEventDef("Play_JinxPowPowImpact"); if (Object.op_Implicit((Object)(object)megaExplosionEffect)) { ShakeEmitter obj = megaExplosionEffect.AddComponent<ShakeEmitter>(); obj.amplitudeTimeDecay = true; obj.duration = 0.5f; obj.radius = 200f; obj.scaleShakeRadiusWithLocalScale = false; obj.wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f }; } } private static GameObject CreateTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>())) { val.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { val.AddComponent<VFXAttributes>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } val.GetComponent<Tracer>().speed = 250f; val.GetComponent<Tracer>().length = 50f; AddNewEffectDef(val); return val; } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; Content.AddNetworkSoundEventDef(obj); return obj; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } Renderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<Renderer>(); foreach (Renderer obj in componentsInChildren) { if (obj != null) { obj.material?.SetHopooMaterial(); } } } internal static RendererInfo[] SetupRendererInfos(GameObject obj) { //IL_0018: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length]; for (int i = 0; i < componentsInChildren.Length; i++) { array[i] = new RendererInfo { defaultMaterial = ((Renderer)componentsInChildren[i]).material, renderer = (Renderer)(object)componentsInChildren[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static GameObject LoadSurvivorModel(string modelName) { GameObject val = mainAssetBundle.LoadAsset<GameObject>(modelName); if ((Object)(object)val == (Object)null) { Log.Error("Trying to load a null model- check to see if the name in your code matches the name of the object in Unity"); return null; } return PrefabAPI.InstantiateClone(val, ((Object)val).name, false); } internal static Texture LoadCharacterIconGeneric(string characterName) { return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon"); } internal static GameObject LoadCrosshair(string crosshairName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null) { return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair"); } return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair"); } private static GameObject LoadEffect(string resourceName, string soundName) { return LoadEffect(resourceName, soundName, parentToTransform: false); } private static GameObject LoadEffect(string resourceName) { return LoadEffect(resourceName, "", parentToTransform: false); } private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) bool flag = false; for (int i = 0; i < assetNames.Length; i++) { if (assetNames[i].Contains(resourceName.ToLowerInvariant())) { flag = true; i = assetNames.Length; } } if (!flag) { Log.Error("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"); return null; } GameObject obj = mainAssetBundle.LoadAsset<GameObject>(resourceName); obj.AddComponent<DestroyOnTimer>().duration = 12f; obj.AddComponent<NetworkIdentity>(); obj.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; EffectComponent obj2 = obj.AddComponent<EffectComponent>(); obj2.applyScale = false; obj2.effectIndex = (EffectIndex)(-1); obj2.parentToReferencedTransform = parentToTransform; obj2.positionAtReferencedTransform = true; obj2.soundName = soundName; AddNewEffectDef(obj, soundName); return obj; } private static void AddNewEffectDef(GameObject effectPrefab) { AddNewEffectDef(effectPrefab, ""); } private static void AddNewEffectDef(GameObject effectPrefab, string soundName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown Content.AddEffectDef(new EffectDef { prefab = effectPrefab, prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(), prefabName = ((Object)effectPrefab).name, prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(), spawnSoundEventName = soundName }); } } public static class Buffs { internal static BuffDef revdUp; internal static BuffDef getExcitedSpeedBuff; internal static void RegisterBuffs() { //IL_0014: 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) revdUp = AddNewBuff("JinxRevdUp", Assets.mainAssetBundle.LoadAsset<Sprite>("Rev_d_up"), Color.white, canStack: true, isDebuff: false); getExcitedSpeedBuff = AddNewBuff("GetExcitedMovementSpeedBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("Jinx_Passive"), Color.white, canStack: true, isDebuff: false); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) BuffDef obj = ScriptableObject.CreateInstance<BuffDef>(); ((Object)obj).name = buffName; obj.buffColor = buffColor; obj.canStack = canStack; obj.isDebuff = isDebuff; obj.eliteDef = null; obj.iconSprite = buffIcon; Content.AddBuffDef(obj); return obj; } } public static class Config { public static ConfigEntry<bool> voiceLines; public static ConfigEntry<bool> rocketJump; public static ConfigEntry<bool> enableCharacter; public static ConfigEntry<float> armorGrowth; public static ConfigEntry<float> baseArmor; public static ConfigEntry<float> baseCrit; public static ConfigEntry<float> baseDamage; public static ConfigEntry<float> baseHealth; public static ConfigEntry<float> baseMovementSpeed; public static ConfigEntry<float> baseRegen; public static ConfigEntry<float> bonusHealthCoefficient; public static ConfigEntry<float> healthGrowth; public static ConfigEntry<int> jumpCount; public static ConfigEntry<float> damageGrowth; public static ConfigEntry<float> regenGrowth; public static ConfigEntry<float> fishBonesDamageCoefficient; public static ConfigEntry<float> fishBonesProcCoefficient; public static ConfigEntry<float> powPowDamageCoefficient; public static ConfigEntry<float> powPowProcCoefficient; public static ConfigEntry<float> zapDamageCoefficient; public static ConfigEntry<float> zapProcCoefficient; public static ConfigEntry<float> zapCD; public static ConfigEntry<float> megaRocketDamageCoefficient; public static ConfigEntry<float> megaRocketProcCoefficient; public static ConfigEntry<float> megaRocketCD; public static ConfigEntry<float> rocketJumpFishBonesForce; public static ConfigEntry<float> rocketJumpMegaRocketForce; public static ConfigEntry<float> rocketJumpRadius; public static void ReadConfig() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0063: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_0097: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00cf: Expected O, but got Unknown //IL_00e8: 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_0107: Expected O, but got Unknown //IL_0107: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_013f: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0177: Expected O, but got Unknown //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01af: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_01e7: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_021f: Expected O, but got Unknown //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown //IL_0257: Expected O, but got Unknown //IL_0270: 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_028f: Expected O, but got Unknown //IL_028f: Expected O, but got Unknown //IL_02a8: 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_02c7: Expected O, but got Unknown //IL_02c7: Expected O, but got Unknown //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Expected O, but got Unknown //IL_02ff: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0337: Expected O, but got Unknown //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Expected O, but got Unknown //IL_036f: Expected O, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Expected O, but got Unknown //IL_03a3: Expected O, but got Unknown //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Expected O, but got Unknown //IL_03db: Expected O, but got Unknown //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Expected O, but got Unknown //IL_0413: Expected O, but got Unknown //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Expected O, but got Unknown //IL_044b: Expected O, but got Unknown //IL_0464: 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_0483: Expected O, but got Unknown //IL_0483: Expected O, but got Unknown //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Expected O, but got Unknown //IL_04bb: Expected O, but got Unknown //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Expected O, but got Unknown //IL_04f3: Expected O, but got Unknown //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Expected O, but got Unknown //IL_052b: Expected O, but got Unknown //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Expected O, but got Unknown //IL_0563: Expected O, but got Unknown //IL_057c: 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_059b: Expected O, but got Unknown //IL_059b: Expected O, but got Unknown //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Expected O, but got Unknown //IL_05d3: Expected O, but got Unknown enableCharacter = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<bool>(new ConfigDefinition("00 - Other", "Enable Character"), true, new ConfigDescription("Enable Character", (AcceptableValueBase)null, Array.Empty<object>())); voiceLines = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<bool>(new ConfigDefinition("00 - Other", "Voice Lines"), true, new ConfigDescription("Enable Voice Lines", (AcceptableValueBase)null, Array.Empty<object>())); rocketJump = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<bool>(new ConfigDefinition("00 - Other", "Rocket Jumping"), true, new ConfigDescription("Enable Rocket Jumping", (AcceptableValueBase)null, Array.Empty<object>())); rocketJumpFishBonesForce = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("00 - Other", "Rocket Jump Force (Fishbones)"), 6000f, new ConfigDescription("Rocket Jump Force (Fishbones)", (AcceptableValueBase)null, Array.Empty<object>())); rocketJumpMegaRocketForce = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("00 - Other", "Rocket Jump Force (Mega Rocket)"), 12000f, new ConfigDescription("Rocket Jump Force (Mega Rocket)", (AcceptableValueBase)null, Array.Empty<object>())); rocketJumpRadius = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("00 - Other", "Rocket Jump Blast Radius"), 8f, new ConfigDescription("Rocket Jump Blast Radius", (AcceptableValueBase)null, Array.Empty<object>())); baseHealth = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("01 - Character Stats", "Base Health"), 110f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); healthGrowth = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("01 - Character Stats", "Health Growth"), 30f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseRegen = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("01 - Character Stats", "Base Health Regen"), 1f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); regenGrowth = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("01 - Character Stats", "Health Regen Growth"), 0.2f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); baseArmor = ((BaseUnityPlugin)JinxPlugin.instance).Config.Bind<float>(new ConfigDefinition("01 - Character Stats", "Base Armor"), 20f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>())); armorGrowth