Decompiled source of SanyaCards v0.9.0
SanyaCards.dll
Decompiled a day 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Jotunn.Utils; using MapsExt; using MapsExt.Utils; using Microsoft.CodeAnalysis; using ModdingUtils.Utils; using Photon.Pun; using SanyaCards.Cards; using SanyaCards.Extensions; using SanyaCards.Monos; using UnboundLib.Cards; using UnboundLib.GameModes; using UnityEngine; [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("SanyaCards")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+b8b9734b0c03d26e2b3811359932aab1a842137b")] [assembly: AssemblyProduct("SanyaCards")] [assembly: AssemblyTitle("SanyaCards")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } [HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")] internal class CharacterStatModifiersPatchResetStats { private static void Prefix(CharacterStatModifiers __instance) { __instance.GetAdditionalData().explosionResistance = 0f; } } namespace SanyaCards { internal class Assets { private static readonly AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("sanyacards", typeof(SanyaCards).Assembly); public static AudioClip eatingSandwich = Bundle.LoadAsset<AudioClip>("NomNomNom.mp3"); } [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.*/)] [BepInPlugin("com.Shadow.SanyaCards", "SanyaCards", "0.9.0")] [BepInProcess("Rounds.exe")] public class SanyaCards : BaseUnityPlugin { private const string ModId = "com.Shadow.SanyaCards"; private const string ModName = "SanyaCards"; public const string Version = "0.9.0"; public const string ModInitials = "SANYA"; public static SanyaCards instance { get; private set; } private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new Harmony("com.Shadow.SanyaCards").PatchAll(); } private void Start() { instance = this; CustomCard.BuildCard<NukeCard>(); CustomCard.BuildCard<ScoutTF2Card>(); CustomCard.BuildCard<PrecisionStrikeCard>(); CustomCard.BuildCard<SprayAndPrayCard>(); CustomCard.BuildCard<AmmoBoostCard>(); CustomCard.BuildCard<BouncesToDamageCard>(); CustomCard.BuildCard<SandwichCard>(); CustomCard.BuildCard<BloodySpeedCard>(); CustomCard.BuildCard<StompCard>(); CustomCard.BuildCard<FleeCard>(); CustomCard.BuildCard<AccuracyCard>(); CustomCard.BuildCard<MagneticBulletsCard>(); CustomCard.BuildCard<ExplosionResistanceCard>(); CustomCard.BuildCard<GlueCard>(); CustomCard.BuildCard<KickBackCard>(); CustomCard.BuildCard<KineticBatteryCard>(); CustomCard.BuildCard<TeamSpiritCard>(); CustomCard.BuildCard<RewindCard>(); CustomCard.BuildCard<SoftBodyCard>(); CustomCard.BuildCard<HealthTaxesCard>(); CustomCard.BuildCard<AcidShieldCard>(); Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)ExplosionResistanceCard.Validation); Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)BouncesToDamageCard.Validation); Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)TeamSpiritCard.Validation); GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => KineticBatteryMono.OnPointEnd())); GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => GlueBulletMono.OnPointEnd())); } } } namespace SanyaCards.Patches { [HarmonyPatch(typeof(Explosion), "DoExplosionEffects")] public class ExplosionPatch { private static bool Prefix(Explosion __instance, Collider2D hitCol, float rangeMultiplier, float distance) { Damagable componentInParent = ((Component)hitCol).gameObject.GetComponentInParent<Damagable>(); if (!Object.op_Implicit((Object)(object)componentInParent)) { return true; } CharacterStatModifiers component = ((Component)componentInParent).GetComponent<CharacterStatModifiers>(); if (!Object.op_Implicit((Object)(object)component)) { return true; } __instance.damage *= 1f - component.GetAdditionalData().explosionResistance; return true; } private static void Postfix(Explosion __instance, Collider2D hitCol, float rangeMultiplier, float distance) { Damagable componentInParent = ((Component)hitCol).gameObject.GetComponentInParent<Damagable>(); if (Object.op_Implicit((Object)(object)componentInParent)) { CharacterStatModifiers component = ((Component)componentInParent).GetComponent<CharacterStatModifiers>(); if (Object.op_Implicit((Object)(object)component)) { __instance.damage /= 1f - component.GetAdditionalData().explosionResistance; } } } } [HarmonyPatch(typeof(ProjectileCollision))] public class ProjectileCollisionPatch { [HarmonyPatch("HitSurface")] [HarmonyPrefix] public static bool hitSurface(ProjectileCollision __instance, ref HasToStop __result, GameObject projectile, HitInfo hit) { ProjectileHit component = ((Component)__instance).GetComponent<ProjectileHit>(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)projectile.GetComponent<ProjectileHit>().ownPlayer == (Object)(object)component.ownPlayer && ((Object)(object)projectile.GetComponentInChildren<NoSelfCollide>() != (Object)null || (Object)(object)((Component)__instance).GetComponentInChildren<NoSelfCollide>() != (Object)null)) { return false; } return true; } } } namespace SanyaCards.Monos { internal class AcidShieldMono : MonoBehaviour { public static readonly float abilityCooldown = 4f; public static readonly float abilityDuration = 3f; public static readonly float abilityRadius = 5f; private Player player; private bool abilityActive; private float abilityUseTime; private GameObject lineEffectGO; private LineRenderer lineRenderer; private LineEffect lineEffect; private void Start() { //IL_0006: 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_005d: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00df: 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) ((Component)this).transform.localPosition = Vector3.zero; player = ((Component)this).GetComponentInParent<Player>(); Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); lineEffectGO = new GameObject("LineEffect"); lineEffectGO.transform.SetParent(((Component)this).transform); lineEffectGO.transform.localPosition = Vector3.zero; lineRenderer = lineEffectGO.AddComponent<LineRenderer>(); lineEffect = lineEffectGO.AddComponent<LineEffect>(); lineRenderer.startWidth = 0.1f; ((Renderer)lineRenderer).material = new Material(Shader.Find("Unlit/Color")); ((Renderer)lineRenderer).material.color = Color.green; lineRenderer.positionCount = 50; lineRenderer.useWorldSpace = true; lineRenderer.endWidth = lineRenderer.startWidth; lineEffect.lineType = (LineType)1; lineEffect.radius = abilityRadius; lineEffect.segments = lineRenderer.positionCount; lineEffect.globalTimeSpeed = 1f; lineEffect.loop = true; lineEffect.effects = (LineEffectInstance[])(object)new LineEffectInstance[0]; lineEffect.raycastCollision = true; } private void FixedUpdate() { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_0158: 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_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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (!abilityActive) { return; } Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)player).transform.position), abilityRadius * ((Component)this).transform.root.localScale.x, 32768); foreach (Collider2D val in array) { if (!((Component)((Component)val).transform.root).CompareTag("Bullet")) { continue; } SpawnedAttack componentInParent = ((Component)val).GetComponentInParent<SpawnedAttack>(); if (!((Object)(object)componentInParent == (Object)null) && componentInParent.spawner.teamID != player.teamID && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)val).transform.position), player).canSee) { ProjectileHit componentInParent2 = ((Component)val).gameObject.GetComponentInParent<ProjectileHit>(); float num = Mathf.Pow(0.25f, Time.fixedDeltaTime); float num2 = Mathf.Pow(0.75f, Time.fixedDeltaTime); componentInParent2.damage *= num; float num3 = componentInParent2.damage / 55f; MoveTransform component = ((Component)componentInParent2).gameObject.GetComponent<MoveTransform>(); float num4 = ((Vector3)(ref component.velocity)).sqrMagnitude * (1f - num2) / num3; if (num4 > ((Vector3)(ref component.velocity)).magnitude) { component.velocity = Vector3.zero; } else { component.velocity -= ((Vector3)(ref component.velocity)).normalized * num4; } if (componentInParent2.damage < 5f) { Object.Destroy((Object)(object)((Component)componentInParent2).gameObject); } } } } private void OnDestroy() { Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnDisable() { if (abilityActive) { ((MonoBehaviour)this).StopAllCoroutines(); abilityActive = false; abilityUseTime = Time.time; lineEffect.Stop(); ((Component)lineEffect).gameObject.SetActive(false); } } public void OnBlock(BlockTriggerType triggerType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)triggerType == 0 && !(Time.time < abilityUseTime)) { abilityUseTime = Time.time + abilityCooldown; ((MonoBehaviour)this).StartCoroutine(useAbility()); } } private IEnumerator useAbility() { if (!abilityActive) { abilityActive = true; lineEffect.Play(((Component)player).transform); yield return (object)new WaitForSeconds(abilityDuration); abilityActive = false; lineEffect.Stop(); ((Component)lineEffect).gameObject.SetActive(false); } } } internal class DestroyCheck : MonoBehaviour { private void OnDestroy() { Debug.Log((object)("Object deleted: " + ((Object)((Component)this).gameObject).name)); } } internal class FleeMono : MonoBehaviour { public static readonly float speedPercentBonus = 60f; private Player player; private bool isActive; private void Start() { player = ((Component)this).GetComponentInParent<Player>(); } private void OnDisable() { turnOff(); } private void FixedUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: 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_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) bool flag = false; if (player.data.input.direction != Vector3.zero) { foreach (Player player in PlayerManager.instance.players) { if (player.teamID != this.player.teamID && !(Vector2.Angle(Vector2.op_Implicit(((Component)player).transform.position - ((Component)this.player).transform.position), Vector2.op_Implicit(-this.player.data.input.direction)) > 70f) && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this.player).transform.position), player).canSee) { flag = true; break; } } } if (flag) { turnOn(); } else { turnOff(); } } private void turnOn() { if (!isActive) { isActive = true; CharacterStatModifiers stats = player.data.stats; stats.movementSpeed *= 1f + speedPercentBonus * 0.01f; } } private void turnOff() { if (isActive) { isActive = false; CharacterStatModifiers stats = player.data.stats; stats.movementSpeed /= 1f + speedPercentBonus * 0.01f; } } } internal class GlueBulletMono : RayHitEffect { private class GlueMono : MonoBehaviour { public float glueMultiplier; private Player target; private Vector2 myPosition; private Vector2 myOffset; private static FieldInfo playerVelocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.NonPublic); private LineRenderer lineRenderer; private void Awake() { //IL_001d: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) target = ((Component)((Component)this).transform.parent).GetComponent<Player>(); myPosition = Vector2.op_Implicit(((Component)this).transform.position); myOffset = Vector2.op_Implicit(((Component)this).transform.position - ((Component)target).transform.position); lineRenderer = ((Component)this).gameObject.AddComponent<LineRenderer>(); lineRenderer.startWidth = 0.1f; lineRenderer.endWidth = lineRenderer.startWidth; lineRenderer.positionCount = 2; ((Renderer)lineRenderer).material = new Material(Shader.Find("Sprites/Default")); lineRenderer.startColor = Color.white; lineRenderer.endColor = Color.white; } private void OnDisable() { Object.Destroy((Object)(object)((Component)this).gameObject); } private void FixedUpdate() { //IL_000b: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)target).transform.position); PlayerVelocity playerVel = target.data.playerVel; float x = ((Component)target).transform.localScale.x; x *= x; Vector2 val2 = (myPosition - (val + myOffset)) * 15f * glueMultiplier; Vector2 val3 = (Vector2)playerVelocityField.GetValue(playerVel); val3 += val2 * (Time.fixedDeltaTime / x); playerVelocityField.SetValue(playerVel, val3); lineRenderer.SetPosition(0, Vector2.op_Implicit(myPosition)); lineRenderer.SetPosition(1, Vector2.op_Implicit(val + myOffset)); } } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0080: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown if (!((Object)(object)hit.transform == (Object)null)) { if (!((Object)(object)((Component)hit.transform).GetComponent<Player>() == (Object)null)) { if (!((Component)hit.transform).gameObject.activeSelf) { GlueMono[] componentsInChildren = ((Component)hit.transform).GetComponentsInChildren<GlueMono>(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)((Component)componentsInChildren[i]).gameObject); } return (HasToReturn)1; } GameObject val = new GameObject("Glue"); val.transform.position = Vector2.op_Implicit(hit.point); val.transform.SetParent(hit.transform, true); val.AddComponent<GlueMono>().glueMultiplier = ((Component)this).transform.localScale.x; Object.Destroy((Object)val, 5f); return (HasToReturn)1; } return (HasToReturn)1; } return (HasToReturn)1; } internal static IEnumerator OnPointEnd() { GlueMono[] array = Object.FindObjectsOfType<GlueMono>(); for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)((Component)array[i]).gameObject); } yield break; } } internal class HealthTaxesMono : MonoBehaviour { private Player player; private void Start() { player = ((Component)this).GetComponentInParent<Player>(); foreach (Player player in PlayerManager.instance.players) { if (this.player.teamID != player.teamID) { Gun gun = player.data.weaponHandler.gun; gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(ShootProjectile)); } } } private void ShootProjectile(GameObject projectile) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) ProjectileHit component = projectile.GetComponent<ProjectileHit>(); ((Damagable)component.ownPlayer.data.healthHandler).TakeDamage(Vector2.right * (component.damage / 55f) * 3f, Vector2.zero, (GameObject)null, (Player)null, false, false); } private void OnDestroy() { foreach (Player player in PlayerManager.instance.players) { if (this.player.teamID != player.teamID) { Gun gun = player.data.weaponHandler.gun; gun.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(gun.ShootPojectileAction, new Action<GameObject>(ShootProjectile)); } } } } internal class KineticBatteryMono : MonoBehaviour { public static readonly float absorbFactor = 0.75f; private Player player; private Gun gun; private float damageStored; private void Start() { player = ((Component)this).GetComponentInParent<Player>(); CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(WasDealthDamage)); Gun obj = player.data.weaponHandler.gun; obj.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(obj.ShootPojectileAction, new Action<GameObject>(ShootAction)); } private void ResetDamageStored() { damageStored = 0f; } internal static IEnumerator OnPointEnd() { foreach (Player player in PlayerManager.instance.players) { KineticBatteryMono componentInChildren = ((Component)player).GetComponentInChildren<KineticBatteryMono>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.ResetDamageStored(); } } yield break; } private void OnDisable() { if (player.data.dead) { ResetDamageStored(); } } private void OnDestroy() { CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(WasDealthDamage)); Gun obj = gun; obj.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(obj.ShootPojectileAction, new Action<GameObject>(ShootAction)); } private void WasDealthDamage(Vector2 damage, bool selfDamage) { if (!((Object)(object)player.data.lastSourceOfDamage == (Object)null) && player.data.lastSourceOfDamage.teamID != player.teamID) { damageStored += ((Vector2)(ref damage)).magnitude * absorbFactor; } } private void ShootAction(GameObject projectile) { if (!(damageStored <= 0f) && Object.op_Implicit((Object)(object)projectile.GetComponent<SpawnedAttack>())) { ProjectileHit component = projectile.GetComponent<ProjectileHit>(); component.damage += damageStored; damageStored = 0f; } } } internal class MagneticBulletMono : MonoBehaviour { private MoveTransform moveTransform; private ProjectileHit bullet; public int ignoreTeamID; private static FieldInfo playerVelocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.NonPublic); private void Start() { if (!((Object)(object)((Component)this).transform.parent == (Object)null)) { moveTransform = ((Component)((Component)this).transform.parent).GetComponent<MoveTransform>(); bullet = ((Component)((Component)this).transform.parent).GetComponent<ProjectileHit>(); } } private void FixedUpdate() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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) //IL_00b4: 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: 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_00e2: 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_0115: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bullet == (Object)null) { return; } float num = 120f; float num2 = bullet.damage / 55f * bullet.dealDamageMultiplierr; num2 = Mathf.Min(40f, 3.37f * num2); foreach (Player player in PlayerManager.instance.players) { if (player.teamID != ignoreTeamID) { Vector2 val = Vector2.op_Implicit(((Component)player).transform.position) - Vector2.op_Implicit(((Component)this).transform.position); float magnitude = ((Vector2)(ref val)).magnitude; if (magnitude < 5f) { Object.Destroy((Object)(object)this); } Vector2 val2 = ((Vector2)(ref val)).normalized / Mathf.Max(5f, magnitude) * Time.fixedDeltaTime * num; float x = ((Component)player).transform.localScale.x; x = Mathf.Min(20f, x * x); moveTransform.velocity.x += (x * val2).x; moveTransform.velocity.y += (x * val2).y; PlayerVelocity playerVel = player.data.playerVel; Vector2 val3 = (Vector2)playerVelocityField.GetValue(playerVel); playerVelocityField.SetValue(playerVel, val3 - num2 * val2); } } } } internal class NoSelfCollide : MonoBehaviour { } internal class RewindMono : MonoBehaviour { public static readonly float abilityCooldown = 15f; public static readonly float rewindDelay = 3f; private Player player; private float abilityUseTime; private bool abilityActive; private void Start() { abilityUseTime = Time.time; player = ((Component)this).GetComponentInParent<Player>(); Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnDestroy() { Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnDisable() { if (abilityActive) { ((MonoBehaviour)this).StopAllCoroutines(); abilityActive = false; abilityUseTime = Time.time; } } public void OnBlock(BlockTriggerType triggerType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)triggerType == 0 && !(Time.time < abilityUseTime)) { abilityUseTime = Time.time + abilityCooldown; ((MonoBehaviour)this).StartCoroutine(useAbility()); } } private IEnumerator useAbility() { if (!abilityActive) { abilityActive = true; Vector3 position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(rewindDelay); ((Component)player).GetComponent<PlayerCollision>().IgnoreWallForFrames(2); ((Component)player).transform.position = position; abilityActive = false; } } } internal class SandwichMono : MonoBehaviour { public static readonly float abilityCooldown = 10f; public static readonly float abilityDuration = 2f; public static readonly float heal = 300f; public static readonly float abilitySpeedDivider = 4f; private static readonly int bitesCount = 5; private float abilityUseTime; private Player player; private CharacterStatModifiers stats; private HealthHandler healthHandler; private bool abilityActive; private AudioSource playerAudioSource; private void Start() { abilityUseTime = Time.time; player = ((Component)this).GetComponentInParent<Player>(); Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); stats = player.data.stats; healthHandler = player.data.healthHandler; playerAudioSource = ((Component)this).gameObject.AddComponent<AudioSource>(); } private void OnDestroy() { Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnDisable() { if (abilityActive) { ((MonoBehaviour)this).StopAllCoroutines(); abilityActive = false; abilityUseTime = Time.time; DisableEffect(); } } public void OnBlock(BlockTriggerType triggerType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)triggerType == 0 && !(Time.time < abilityUseTime) && !(player.data.health >= player.data.maxHealth)) { abilityUseTime = Time.time + abilityCooldown; ((MonoBehaviour)this).StartCoroutine(useAbility()); } } private IEnumerator useAbility() { if (!abilityActive) { abilityActive = true; EnableEffect(); playerAudioSource.PlayOneShot(Assets.eatingSandwich); for (int i = 0; i < bitesCount; i++) { healthHandler.Heal(heal / (float)bitesCount); yield return (object)new WaitForSeconds(abilityDuration / (float)bitesCount); } DisableEffect(); abilityActive = false; } } private void EnableEffect() { CharacterStatModifiers obj = stats; obj.movementSpeed /= abilitySpeedDivider; } private void DisableEffect() { CharacterStatModifiers obj = stats; obj.movementSpeed *= abilitySpeedDivider; } } internal class SoftBodyMono : MonoBehaviour { public static int segmentsCount = 500; public static float segmentLength = 5f; public static float k = 45f; private bool isActive; private Player player; private Vector3 lastPlayerPosition; private LineRenderer lineRenderer; private static FieldInfo velocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.NonPublic); private void Start() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0052: 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_00bc: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponentInParent<Player>(); lineRenderer = ((Component)this).gameObject.AddComponent<LineRenderer>(); lineRenderer.startWidth = 0.1f; ((Renderer)lineRenderer).material = new Material(Shader.Find("Unlit/Color")); ((Renderer)lineRenderer).material.color = Color.white; lineRenderer.positionCount = segmentsCount + 1; lineRenderer.useWorldSpace = true; Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); lastPlayerPosition = ((Component)player).transform.position; } private void OnBlock(BlockTriggerType triggerType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)triggerType == 0) { isActive = !isActive; ((Renderer)lineRenderer).enabled = isActive; } } private void OnDestroy() { Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void FixedUpdate() { //IL_001f: 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_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0171: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_00fd: 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_010c: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!isActive) { lastPlayerPosition = ((Component)player).transform.position; return; } Vector2 val = Vector2.zero; int num = 393217; float num2 = MathF.PI * 2f / (float)segmentsCount; Vector2 val3 = default(Vector2); for (int i = 0; i < segmentsCount; i++) { float num3 = (float)i * num2; float num4 = Mathf.Cos(num3); float num5 = Mathf.Sin(num3); Vector2 val2 = Vector2.op_Implicit(((Component)player).transform.position); ((Vector2)(ref val3))..ctor(num4, num5); RaycastHit2D val4 = Physics2D.Raycast(val2, val3, segmentLength, num); if ((Object)(object)((RaycastHit2D)(ref val4)).collider == (Object)null) { lineRenderer.SetPosition(i, Vector2.op_Implicit(val2 + val3 * segmentLength)); continue; } float distance = ((RaycastHit2D)(ref val4)).distance; float num6 = (segmentLength - distance) / segmentLength; num6 = 1f - num6; num6 *= num6; num6 = 1f - num6; float num7 = (0f - k) * num6; val += val3 * (num7 * Time.fixedDeltaTime); lineRenderer.SetPosition(i, Vector2.op_Implicit(val2 + val3 * distance)); } Vector2 val5 = Vector2.op_Implicit((((Component)player).transform.position - lastPlayerPosition) / Time.fixedDeltaTime); val5 += val; velocityField.SetValue(player.data.playerVel, val5); lineRenderer.SetPosition(segmentsCount, lineRenderer.GetPosition(0)); Debug.Log((object)$"{(((Component)player).transform.position.y - lastPlayerPosition.y) / Time.fixedDeltaTime} {val.y}"); lastPlayerPosition = ((Component)player).transform.position; } } public class SpawnSplitBulletsEffect : MonoBehaviour { private float initialDelay = 1f; private int numBullets = 1; private int numShot; public Gun gunToShootFrom; private List<Vector3> directionsToShoot = new List<Vector3>(); private Vector3 positionToShootFrom; private float timeBetweenShots; private float timeSinceLastShot; private GameObject newWeaponsBase; private Player player; private void Awake() { player = ((Component)this).gameObject.GetComponent<Player>(); ObjectsToSpawn[] objectsToSpawn = gunToShootFrom.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide Awake"); break; } } } private void Start() { ObjectsToSpawn[] objectsToSpawn = gunToShootFrom.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide Start"); break; } } } private void Update() { ObjectsToSpawn[] objectsToSpawn = gunToShootFrom.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide Update"); break; } } Shoot(); Object.Destroy((Object)(object)this); } private void OnDisable() { Object.Destroy((Object)(object)this); } private void OnDestroy() { Object.Destroy((Object)(object)newWeaponsBase); } private void Shoot() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) int numberOfProjectiles = gunToShootFrom.numberOfProjectiles; for (int i = 0; i < gunToShootFrom.projectiles.Length; i++) { for (int j = 0; j < gunToShootFrom.numberOfProjectiles; j++) { Vector3 val = directionsToShoot[numShot % directionsToShoot.Count]; if (gunToShootFrom.spread != 0f) { float multiplySpread = gunToShootFrom.multiplySpread; float num = Random.Range(0f - gunToShootFrom.spread, gunToShootFrom.spread); num /= (1f + gunToShootFrom.projectileSpeed * 0.5f) * 0.5f; val += Vector3.Cross(val, Vector3.forward) * num * multiplySpread; } if ((bool)typeof(Gun).InvokeMember("CheckIsMine", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gunToShootFrom, new object[0])) { GameObject val2 = PhotonNetwork.Instantiate(((Object)gunToShootFrom.projectiles[i].objectToSpawn.gameObject).name, positionToShootFrom, Quaternion.LookRotation(val), (byte)0, (object[])null); if (PhotonNetwork.OfflineMode) { RPCA_Shoot(val2.GetComponent<PhotonView>().ViewID, numberOfProjectiles, 1f, Random.Range(0f, 1f)); continue; } ((Component)this).gameObject.GetComponent<PhotonView>().RPC("RPCA_Shoot", (RpcTarget)0, new object[4] { val2.GetComponent<PhotonView>().ViewID, numberOfProjectiles, 1f, Random.Range(0f, 1f) }); } } } ResetTimer(); } [PunRPC] private void RPCA_Shoot(int bulletViewID, int numProj, float dmgM, float seed) { GameObject gameObject = ((Component)PhotonView.Find(bulletViewID)).gameObject; ObjectsToSpawn[] objectsToSpawn = gunToShootFrom.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 5"); break; } } gunToShootFrom.BulletInit(gameObject, numProj, dmgM, seed, true); numShot++; if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 6"); } } public void SetGun(Gun gun) { //IL_002a: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown newWeaponsBase = Object.Instantiate<GameObject>(((Component)((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>()).gameObject, new Vector3(500f, 500f, -100f), Quaternion.identity); Object.DontDestroyOnLoad((Object)(object)newWeaponsBase); foreach (Transform item in newWeaponsBase.transform) { Transform val = item; if ((Object)(object)((Component)val).GetComponentInChildren<Renderer>() != (Object)null) { Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } } gunToShootFrom = newWeaponsBase.GetComponent<Gun>(); CopyGunStats(gun, gunToShootFrom); ObjectsToSpawn[] objectsToSpawn = gunToShootFrom.objectsToSpawn; foreach (ObjectsToSpawn val2 in objectsToSpawn) { if ((Object)(object)val2.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val2.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 4"); break; } } } public void SetNumBullets(int num) { numBullets = num; } public void SetDirection(Vector3 dir) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) directionsToShoot = new List<Vector3> { dir }; } public void SetPosition(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) positionToShootFrom = pos; } public void SetDirections(List<Vector3> dir) { directionsToShoot = dir; } public void SetTimeBetweenShots(float delay) { timeBetweenShots = delay; } public void SetInitialDelay(float delay) { initialDelay = delay; } private void ResetTimer() { timeSinceLastShot = Time.time; } public static void CopyGunStats(Gun copyFromGun, Gun copyToGun) { //IL_0206: 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_03fb: Unknown result type (might be due to invalid IL or missing references) copyToGun.ammo = copyFromGun.ammo; copyToGun.ammoReg = copyFromGun.ammoReg; copyToGun.attackID = copyFromGun.attackID; copyToGun.attackSpeed = copyFromGun.attackSpeed; copyToGun.attackSpeedMultiplier = copyFromGun.attackSpeedMultiplier; copyToGun.bodyRecoil = copyFromGun.bodyRecoil; copyToGun.bulletDamageMultiplier = copyFromGun.bulletDamageMultiplier; copyToGun.bulletPortal = copyFromGun.bulletPortal; copyToGun.bursts = copyFromGun.bursts; copyToGun.chargeDamageMultiplier = copyFromGun.chargeDamageMultiplier; copyToGun.chargeEvenSpreadTo = copyFromGun.chargeEvenSpreadTo; copyToGun.chargeNumberOfProjectilesTo = copyFromGun.chargeNumberOfProjectilesTo; copyToGun.chargeRecoilTo = copyFromGun.chargeRecoilTo; copyToGun.chargeSpeedTo = copyFromGun.chargeSpeedTo; copyToGun.chargeSpreadTo = copyFromGun.chargeSpreadTo; copyToGun.cos = copyFromGun.cos; copyToGun.currentCharge = copyFromGun.currentCharge; copyToGun.damage = copyFromGun.damage; copyToGun.damageAfterDistanceMultiplier = copyFromGun.damageAfterDistanceMultiplier; copyToGun.defaultCooldown = copyFromGun.defaultCooldown; copyToGun.dmgMOnBounce = copyFromGun.dmgMOnBounce; copyToGun.dontAllowAutoFire = copyFromGun.dontAllowAutoFire; copyToGun.drag = copyFromGun.drag; copyToGun.dragMinSpeed = copyFromGun.dragMinSpeed; copyToGun.evenSpread = copyFromGun.evenSpread; copyToGun.explodeNearEnemyDamage = copyFromGun.explodeNearEnemyDamage; copyToGun.explodeNearEnemyRange = copyFromGun.explodeNearEnemyRange; copyToGun.forceSpecificAttackSpeed = copyFromGun.forceSpecificAttackSpeed; copyToGun.forceSpecificShake = copyFromGun.forceSpecificShake; copyToGun.gravity = copyFromGun.gravity; copyToGun.hitMovementMultiplier = copyFromGun.hitMovementMultiplier; copyToGun.ignoreWalls = copyFromGun.ignoreWalls; copyToGun.isProjectileGun = copyFromGun.isProjectileGun; copyToGun.isReloading = copyFromGun.isReloading; copyToGun.knockback = copyFromGun.knockback; copyToGun.lockGunToDefault = copyFromGun.lockGunToDefault; copyToGun.multiplySpread = copyFromGun.multiplySpread; copyToGun.numberOfProjectiles = copyFromGun.numberOfProjectiles; copyToGun.objectsToSpawn = copyFromGun.objectsToSpawn; copyToGun.overheatMultiplier = copyFromGun.overheatMultiplier; copyToGun.percentageDamage = copyFromGun.percentageDamage; copyToGun.player = copyFromGun.player; copyToGun.projectielSimulatonSpeed = copyFromGun.projectielSimulatonSpeed; copyToGun.projectileColor = copyFromGun.projectileColor; copyToGun.projectiles = copyFromGun.projectiles; copyToGun.projectileSize = copyFromGun.projectileSize; copyToGun.projectileSpeed = copyFromGun.projectileSpeed; copyToGun.randomBounces = copyFromGun.randomBounces; copyToGun.recoil = copyFromGun.recoil; copyToGun.recoilMuiltiplier = copyFromGun.recoilMuiltiplier; copyToGun.reflects = copyFromGun.reflects; copyToGun.reloadTime = copyFromGun.reloadTime; copyToGun.reloadTimeAdd = copyFromGun.reloadTimeAdd; copyToGun.shake = copyFromGun.shake; copyToGun.shakeM = copyFromGun.shakeM; copyToGun.ShootPojectileAction = copyFromGun.ShootPojectileAction; ((Weapon)copyToGun).sinceAttack = ((Weapon)copyFromGun).sinceAttack; copyToGun.size = copyFromGun.size; copyToGun.slow = copyFromGun.slow; copyToGun.smartBounce = copyFromGun.smartBounce; copyToGun.spawnSkelletonSquare = copyFromGun.spawnSkelletonSquare; copyToGun.speedMOnBounce = copyFromGun.speedMOnBounce; copyToGun.spread = copyFromGun.spread; copyToGun.teleport = copyFromGun.teleport; copyToGun.timeBetweenBullets = copyFromGun.timeBetweenBullets; copyToGun.timeToReachFullMovementMultiplier = copyFromGun.timeToReachFullMovementMultiplier; copyToGun.unblockable = copyFromGun.unblockable; copyToGun.useCharge = copyFromGun.useCharge; copyToGun.waveMovement = copyFromGun.waveMovement; Traverse.Create((object)copyToGun).Field("attackAction").SetValue((object)(Action)Traverse.Create((object)copyFromGun).Field("attackAction").GetValue()); Traverse.Create((object)copyToGun).Field("gunID").SetValue((object)(int)Traverse.Create((object)copyFromGun).Field("gunID").GetValue()); Traverse.Create((object)copyToGun).Field("spreadOfLastBullet").SetValue((object)(float)Traverse.Create((object)copyFromGun).Field("spreadOfLastBullet").GetValue()); Traverse.Create((object)copyToGun).Field("forceShootDir").SetValue((object)(Vector3)Traverse.Create((object)copyFromGun).Field("forceShootDir").GetValue()); ObjectsToSpawn[] objectsToSpawn = copyFromGun.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 2"); break; } } objectsToSpawn = copyToGun.objectsToSpawn; foreach (ObjectsToSpawn val2 in objectsToSpawn) { if ((Object)(object)val2.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val2.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 3"); break; } } } public void Destroy() { Object.Destroy((Object)(object)this); } } internal class SplitBulletMono2 : MonoBehaviour { public static readonly int bulletsAfterSplitCount = 10; public static readonly float splitDelay = 0.5f; private float splitTime; public Player player; private List<GameObject>? newInstacesOfAddToProjectile; private void Start() { if (!((Object)(object)((Component)this).transform.parent == (Object)null)) { splitTime = Time.time + splitDelay; } } private void OnDestroy() { if (newInstacesOfAddToProjectile == null) { return; } foreach (GameObject item in newInstacesOfAddToProjectile) { Object.Destroy((Object)(object)item); } newInstacesOfAddToProjectile.Clear(); } private void Update() { if (!((Object)(object)((Component)this).transform.parent == (Object)null) && Time.time >= splitTime) { Shoot(); Object.Destroy((Object)(object)((Component)((Component)this).transform.parent).gameObject); } } private void Shoot() { //IL_030c: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown Gun gun = player.data.weaponHandler.gun; Gun val = (Gun)(object)((Component)player).GetComponent<SplitBulletGun>(); if ((Object)(object)val == (Object)null) { val = (Gun)(object)((Component)player).gameObject.AddComponent<SplitBulletGun>(); } SpawnSplitBulletsEffect spawnSplitBulletsEffect = ((Component)player).GetComponent<SpawnSplitBulletsEffect>(); if ((Object)(object)spawnSplitBulletsEffect == (Object)null) { spawnSplitBulletsEffect = ((Component)player).gameObject.AddComponent<SpawnSplitBulletsEffect>(); } Debug.Log((object)"\nSHOOT:"); SpawnSplitBulletsEffect.CopyGunStats(gun, val); List<ObjectsToSpawn> list = new List<ObjectsToSpawn>(); newInstacesOfAddToProjectile = new List<GameObject>(); ObjectsToSpawn[] objectsToSpawn = gun.objectsToSpawn; foreach (ObjectsToSpawn val2 in objectsToSpawn) { GameObject val3 = val2.AddToProjectile; if ((Object)(object)val3 != (Object)null) { bool flag = false; if ((Object)(object)val3.GetComponent<SplitBulletMono2>() != (Object)null) { val3 = Object.Instantiate<GameObject>(val3); newInstacesOfAddToProjectile.Add(val3); flag = true; Object.Destroy((Object)(object)val3.GetComponent<SplitBulletMono2>()); val3.AddComponent<NoSelfCollide>(); } if ((Object)(object)val3.GetComponent<ScreenEdgeBounce>() != (Object)null) { if (!flag) { val3 = Object.Instantiate<GameObject>(val3); newInstacesOfAddToProjectile.Add(val3); flag = true; } Object.Destroy((Object)(object)val3.GetComponent<ScreenEdgeBounce>()); } } list.Add(new ObjectsToSpawn { effect = val2.effect, direction = val2.direction, spawnOn = val2.spawnOn, spawnAsChild = val2.spawnAsChild, numberOfSpawns = val2.numberOfSpawns, normalOffset = val2.normalOffset, stickToBigTargets = val2.stickToBigTargets, stickToAllTargets = val2.stickToAllTargets, zeroZ = val2.zeroZ, AddToProjectile = val3, removeScriptsFromProjectileObject = false, scaleStacks = val2.scaleStacks, scaleStackM = val2.scaleStackM, scaleFromDamage = val2.scaleFromDamage, stacks = val2.stacks }); } val.objectsToSpawn = list.ToArray(); val.numberOfProjectiles = bulletsAfterSplitCount; val.bursts = 1; val.timeBetweenBullets = 0f; ProjectileHit component = ((Component)((Component)this).transform.parent).GetComponent<ProjectileHit>(); val.spread = 0f; val.evenSpread = 0f; val.damage = component.damage / 55f / (float)bulletsAfterSplitCount * 2f; val.bulletDamageMultiplier = component.dealDamageMultiplierr; val.damageAfterDistanceMultiplier = 1.5f; val.projectileSpeed = 0.5f; val.projectielSimulatonSpeed = 1f; val.reflects = 0; val.destroyBulletAfter = 20f; val.gravity = 1f; val.drag = 0f; val.chargeDamageMultiplier = 1f; val.chargeEvenSpreadTo = 0f; val.chargeNumberOfProjectilesTo = 0f; val.chargeRecoilTo = 0f; val.chargeSpeedTo = 0f; val.chargeSpreadTo = 0f; List<Vector3> directions = GetDirections(); spawnSplitBulletsEffect.SetPosition(((Component)this).transform.position); spawnSplitBulletsEffect.SetDirections(directions); objectsToSpawn = val.objectsToSpawn; foreach (ObjectsToSpawn val4 in objectsToSpawn) { if ((Object)(object)val4.AddToProjectile != (Object)null && Object.op_Implicit((Object)(object)val4.AddToProjectile.GetComponent<NoSelfCollide>())) { Debug.Log((object)"Found NoSelfCollide 1"); break; } } spawnSplitBulletsEffect.SetGun(val); } private List<Vector3> GetDirections() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3>(); float num = MathF.PI * 2f / (float)bulletsAfterSplitCount; Vector3 item = default(Vector3); for (int i = 0; i < bulletsAfterSplitCount; i++) { float num2 = (float)i * num; float num3 = Mathf.Cos(num2); float num4 = Mathf.Sin(num2); ((Vector3)(ref item))..ctor(num3, num4, 0f); list.Add(item); } return list; } } internal class SplitBulletGun : Gun { } internal class StompMono : MonoBehaviour { private class StompRaycastInfo { public float dx; public float distance = -1f; public float stompDistance = -1f; public Vector2 point = Vector2.zero; public Vector2 normal = Vector2.zero; } public static readonly float abilityCooldown = 2f; private static readonly float stompMinHeight = 4f; private static readonly float stompMaxHeight = 15f; private float abilityUseTime; private Player player; private bool playerIsMine; private CharacterData characterData; private CircleCollider2D collider; private Explosion explosion; private static readonly int raycastHitsCount = 5; private static readonly int positionIndicatorSegments = 25; private LineRenderer positionIndicatorLineRenderer; private static FieldInfo velocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.NonPublic); private void Start() { //IL_0074: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) abilityUseTime = Time.time; player = ((Component)this).GetComponentInParent<Player>(); Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); characterData = player.data; collider = ((Component)player).GetComponent<CircleCollider2D>(); GameObject val = Object.Instantiate<GameObject>(((GameObject)Resources.Load("0 cards/Explosive bullet")).GetComponent<Gun>().objectsToSpawn[0].effect); ((Object)val).hideFlags = (HideFlags)61; val.transform.position = new Vector3(1000f, 0f, 0f); ((Object)val).name = "A_SANYA_StompExplosion"; Object.Destroy((Object)(object)val.GetComponent<RemoveAfterSeconds>()); val.AddComponent<SpawnedAttack>().spawner = player; explosion = val.GetComponent<Explosion>(); explosion.scaleRadius = true; explosion.scaleDmg = true; explosion.scaleForce = true; playerIsMine = player.data.view.IsMine && (Object)(object)((Component)player).GetComponentInChildren<PlayerAI>() == (Object)null; if (playerIsMine) { positionIndicatorLineRenderer = ((Component)this).gameObject.AddComponent<LineRenderer>(); positionIndicatorLineRenderer.positionCount = positionIndicatorSegments + 1; positionIndicatorLineRenderer.useWorldSpace = true; ((Renderer)positionIndicatorLineRenderer).material = new Material(Shader.Find("Unlit/Color")); positionIndicatorLineRenderer.startColor = Color.white; positionIndicatorLineRenderer.endColor = positionIndicatorLineRenderer.startColor; positionIndicatorLineRenderer.startWidth = 0.1f; positionIndicatorLineRenderer.endWidth = positionIndicatorLineRenderer.startWidth; } } private void FixedUpdate() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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) //IL_00b8: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (!playerIsMine) { return; } StompRaycastInfo stompRaycastInfo = DoRaycasts(); if (stompRaycastInfo == null) { ((Renderer)positionIndicatorLineRenderer).enabled = false; return; } ((Renderer)positionIndicatorLineRenderer).enabled = true; Bounds bounds = ((Collider2D)collider).bounds; float y = ((Bounds)(ref bounds)).extents.y; float num = Mathf.Sqrt(y * y - stompRaycastInfo.dx * stompRaycastInfo.dx); float num2 = ((Collider2D)collider).offset.y - num - 0.05f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)player).transform.position.x, ((Component)player).transform.position.y + num2 - stompRaycastInfo.distance + y, ((Component)player).transform.position.z); float num3 = 0f; float num4 = 360f / (float)positionIndicatorSegments; float num5 = Mathf.Min(1f, 1f - (abilityUseTime - Time.time) / abilityCooldown); int num6 = Mathf.CeilToInt(num5 * (float)positionIndicatorSegments); positionIndicatorLineRenderer.positionCount = num6 + 1; for (int i = 0; i < positionIndicatorLineRenderer.positionCount; i++) { float num7 = Mathf.Cos(MathF.PI / 180f * num3) * y; float num8 = Mathf.Sin(MathF.PI / 180f * num3) * y; positionIndicatorLineRenderer.SetPosition(i, val + new Vector3(num7, num8, 0f)); num3 += num4; } } private void DoRaycastAt(int i, ref StompRaycastInfo info) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = ((Collider2D)collider).bounds; float x = ((Bounds)(ref bounds)).extents.x; LayerMask val = LayerMask.op_Implicit(394241); float num = Mathf.Min(x * 0.5f, 1f); float num2 = (-1f + 2f * (float)i / (float)(raycastHitsCount - 1)) * num; float num3 = Mathf.Sqrt(x * x - num2 * num2); float num4 = -1f; float num5 = ((Collider2D)collider).offset.y - num3 - 0.05f; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Component)player).transform.position.x + num2, ((Component)player).transform.position.y + num5); RaycastHit2D val3 = Physics2D.Raycast(val2, Vector2.down, 100f, LayerMask.op_Implicit(val)); num4 = ((RaycastHit2D)(ref val3)).distance; if ((Object)(object)((RaycastHit2D)(ref val3)).collider == (Object)null || (Object)(object)((Component)((RaycastHit2D)(ref val3)).collider).gameObject == (Object)null || ((RaycastHit2D)(ref val3)).distance >= GetHeightToBottomEdge(Vector2.op_Implicit(val2))) { num4 = -1f; } info.dx = num2; info.distance = num4; info.stompDistance = num4 - (x - num3); info.point = ((RaycastHit2D)(ref val3)).point; info.normal = ((RaycastHit2D)(ref val3)).normal; } private StompRaycastInfo? DoRaycasts() { StompRaycastInfo info = new StompRaycastInfo(); int num = raycastHitsCount / 2; DoRaycastAt(num, ref info); if (info.stompDistance >= stompMinHeight) { return info; } for (int i = 1; i <= num; i++) { DoRaycastAt(num - i, ref info); if (info.stompDistance >= stompMinHeight) { return info; } DoRaycastAt(num + i, ref info); if (info.stompDistance >= stompMinHeight) { return info; } } return null; } private void OnDisable() { abilityUseTime = Time.time; } private void OnDestroy() { Block block = player.data.block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private static Vector2 GetMapSize() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) CustomMap currentCustomMap = MapManagerExtensions.GetCurrentCustomMap(MapManager.instance); if (currentCustomMap != null) { return ConversionUtils.ScreenToWorldUnits(currentCustomMap.Settings.MapSize); } return new Vector2(71.12f, 40f); } private static float GetHeightToBottomEdge(Vector3 worldPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) float num = (0f - GetMapSize().y) * 0.5f; return worldPosition.y - num; } public void OnBlock(BlockTriggerType triggerType) { //IL_0000: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) if ((int)triggerType == 0 && !(Time.time < abilityUseTime)) { StompRaycastInfo stompRaycastInfo = DoRaycasts(); if (stompRaycastInfo != null) { abilityUseTime = Time.time + abilityCooldown; float num = Mathf.Min((stompRaycastInfo.stompDistance - stompMinHeight) / (stompMaxHeight - stompMinHeight), 1f); explosion.damage = Mathf.Lerp(10f, 120f, num); explosion.force = Mathf.Lerp(1f, 5f, num) * 1000f; explosion.range = Mathf.Lerp(4f, 7f, num); Bounds bounds = ((Collider2D)collider).bounds; float y = ((Bounds)(ref bounds)).extents.y; float num2 = Mathf.Sqrt(y * y - stompRaycastInfo.dx * stompRaycastInfo.dx); float num3 = ((Collider2D)collider).offset.y - num2 - 0.05f; ((Component)player).GetComponent<PlayerCollision>().IgnoreWallForFrames(2); ((Component)player).transform.position = new Vector3(((Component)player).transform.position.x, ((Component)player).transform.position.y - num3 - stompRaycastInfo.distance, ((Component)player).transform.position.z); Vector2 val = (Vector2)velocityField.GetValue(characterData.playerVel); val.y = 0f; velocityField.SetValue(characterData.playerVel, val); Vector3 val2 = Vector2.op_Implicit(stompRaycastInfo.point + stompRaycastInfo.normal * 0.1f); Object.Instantiate<GameObject>(((Component)explosion).gameObject, val2, Quaternion.identity).transform.localScale = Vector3.one * ((Component)player).transform.localScale.x; } } } } internal class TeamSpiritMono : MonoBehaviour { public static readonly float activationRange = 5f; public static readonly float regenerationEffect = 10f; public static readonly float damageEffect = 1.2f; private Player player; private List<Player> playersUnderEffect; private bool isActive; private void Start() { player = ((Component)this).GetComponentInParent<Player>(); playersUnderEffect = new List<Player>(); } private void OnDisable() { turnOff(); foreach (Player item in playersUnderEffect) { turnOffAnother(item); } } private void FixedUpdate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) int num = 0; float playerRadius = getPlayerRadius(player); Player[] playersInTeam = PlayerManager.instance.GetPlayersInTeam(player.teamID); foreach (Player val in playersInTeam) { if (player.playerID != val.playerID) { if (Vector3.Distance(((Component)player).transform.position, ((Component)val).transform.position) - playerRadius - getPlayerRadius(val) < activationRange && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player).transform.position), val).canSee) { turnOnAnother(val); num++; } else { turnOffAnother(val); } } } if (num > 0) { turnOn(); } else { turnOff(); } } private static float getPlayerRadius(Player player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = ((Collider2D)((Component)player).GetComponent<CircleCollider2D>()).bounds; return ((Bounds)(ref bounds)).extents.y; } private void turnOn() { if (!isActive) { turnOnNoCheck(player); isActive = true; } } private void turnOff() { if (isActive) { turnOffNoCheck(player); isActive = false; } } private void turnOnAnother(Player player) { if (!playersUnderEffect.Contains(player)) { turnOnNoCheck(player); playersUnderEffect.Add(player); } } private void turnOffAnother(Player player) { if (playersUnderEffect.Contains(player)) { turnOffNoCheck(player); playersUnderEffect.Remove(player); } } private void turnOnNoCheck(Player player) { HealthHandler healthHandler = player.data.healthHandler; healthHandler.regeneration += regenerationEffect; Gun gun = player.data.weaponHandler.gun; gun.damage *= damageEffect; } private void turnOffNoCheck(Player player) { HealthHandler healthHandler = player.data.healthHandler; healthHandler.regeneration -= regenerationEffect; Gun gun = player.data.weaponHandler.gun; gun.damage /= damageEffect; } } } namespace SanyaCards.Extensions { public class CharacterStatModifiersAdditionalData { public float explosionResistance; public CharacterStatModifiersAdditionalData() { explosionResistance = 0f; } } public static class CharacterStatModifiersExtension { public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>(); public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers data_) { return data.GetOrCreateValue(data_); } public static void AddData(this CharacterStatModifiers data_, CharacterStatModifiersAdditionalData value) { try { data.Add(data_, value); } catch (Exception) { } } } } namespace SanyaCards.Cards { internal class AccuracyCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); if (gun.spread > 0f) { gun.spread = Mathf.Max(0f, gun.spread - 0.05f); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Accuracy"; } protected override string GetDescription() { return "Decrease spread"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Spread", amount = "-5%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } public override string GetModName() { return "SANYA"; } } internal class AcidShieldCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); GameObject val = new GameObject("A_SANYA_AcidShield"); val.transform.SetParent(((Component)player).transform); val.AddComponent<AcidShieldMono>(); characterStats.objectsAddedToPlayer.Add(val); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Acid shield"; } protected override string GetDescription() { return "Creates field, that reduces bullets damage and speed"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)2; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0043: 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) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = false, stat = "Ability cooldown", amount = $"{AcidShieldMono.abilityCooldown}s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Ability duration", amount = $"{AcidShieldMono.abilityDuration}s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)5; } public override string GetModName() { return "SANYA"; } } internal class AmmoBoostCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); gun.ammo = 5; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Ammo boost"; } protected override string GetDescription() { return "+5 ammo. Just enough to miss a few extra shots"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+5", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } public override string GetModName() { return "SANYA"; } } internal class BloodySpeedCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); gun.attackSpeed = 0.5f; statModifiers.health = 0.8f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Bloody speed"; } protected override string GetDescription() { return "Sacrifice health for attack speed"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_005e: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Attack speed", amount = "+100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Health", amount = "-20%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } public override string GetModName() { return "SANYA"; } } internal class BouncesToDamageCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); if (gun.reflects <= 0) { return; } int num = Mathf.Min(gun.reflects, 5); gun.reflects -= num; gun.damage *= 1f + 0.25f * (float)num; if (gun.reflects > 0) { return; } for (int i = 0; i < gun.objectsToSpawn.Length; i++) { GameObject addToProjectile = gun.objectsToSpawn[i].AddToProjectile; if (!((Object)(object)addToProjectile == (Object)null) && !((Object)(object)addToProjectile.GetComponent<ScreenEdgeBounce>() == (Object)null)) { GameObject val = Object.Instantiate<GameObject>(addToProjectile); gun.objectsToSpawn[i].AddToProjectile = val; Object.Destroy((Object)(object)val.GetComponent<ScreenEdgeBounce>()); } } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Bounces to damage"; } protected override string GetDescription() { return "Get +25% damage per removed bounce"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = false, stat = "Bounces", amount = "-5", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } public override string GetModName() { return "SANYA"; } public static bool Validation(Player player, CardInfo card) { if (((Object)card).name != "__SANYA__Bounces to damage") { return true; } if (player.data.weaponHandler.gun.reflects > 0) { return true; } return false; } } internal class ExplosionResistanceCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); CharacterStatModifiersAdditionalData additionalData = characterStats.GetAdditionalData(); additionalData.explosionResistance = Mathf.Min(0.5f, additionalData.explosionResistance + 0.25f); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Explosion resistance"; } protected override string GetDescription() { return "Increase your explosion resistance by 25% (50% max)"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Explosive resistance", amount = "+25%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "SANYA"; } public static bool Validation(Player player, CardInfo card) { if (((Object)card).name != "__SANYA__Explosion resistance") { return true; } if (((Component)player).GetComponent<CharacterStatModifiers>().GetAdditionalData().explosionResistance >= 0.5f) { return false; } return true; } } internal class FleeCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); cardInfo.allowMultiple = false; statModifiers.health = 1.3f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); GameObject val = new GameObject("A_SANYA_Flee"); val.transform.SetParent(((Component)player).transform); val.AddComponent<FleeMono>(); characterStats.objectsAddedToPlayer.Add(val); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Flee"; } protected override string GetDescription() { return "+" + (int)FleeMono.speedPercentBonus + "% movement when moving from the opponent"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Health", amount = "+30%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "SANYA"; } } internal class GlueCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { Debug.Log((object)("[SANYA][Card] " + ((CustomCard)this).GetTitle() + " has been setup.")); gun.attackSpeed = 1.1111112f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_0067: 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) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); bool flag = true; ObjectsToSpawn[] objectsToSpawn = gun.objectsToSpawn; foreach (ObjectsToSpawn val in objectsToSpawn) { if ((Object)(object)val.AddToProjectile != (Object)null && ((Object)val.AddToProjectile).name == "SANYA_glueBullet") { Transform transform = val.AddToProjectile.transform; transform.localScale += Vector3.right; flag = false; break; } } if (flag) { GameObject val2 = new GameObject("SANYA_glueBullet"); ((Object)val2).hideFlags = (HideFlags)61; val2.AddComponent<GlueBulletMono>(); List<ObjectsToSpawn> list = gun.objectsToSpawn.ToList(); list.Add(new ObjectsToSpawn { AddToProjectile = val2, scaleFromDamage = 1f }); gun.objectsToSpawn = list.ToArray(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "SANYA", ((CustomCard)this).GetTitle(), player.playerID)); } protected override string GetTitle() { return "Glue"; } protected override string GetDescription() { return "Your shots pull enemies back to where they hit. Glue stickiness depends on bullet damage"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unkno