using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using Pixelplacement; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Blood Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Blood Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5220cd9b-f564-40be-bae0-549090a841ec")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BloodStrike; public static class BloodStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance(); ((Object)val).name = "Blood Strike"; val.rulebookName = "Blood Strike"; val.metaCategories = new List { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Blood_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, it attacks again."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodStrikeBehaviour), imageAsTexture); } } public class BloodStrikeBehaviour : AbilityBehaviour { public override Ability Ability => BloodStrikeAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { yield break; } CardSlot attackingSlot = ((AbilityBehaviour)this).Card.Slot; CardSlot opposingSlot = attackingSlot.opposingSlot; if ((Object)(object)opposingSlot == (Object)null) { yield break; } CombatPhaseManager combat = Singleton.Instance; if (!((Object)(object)combat == (Object)null)) { int damageBefore = combat.DamageDealtThisPhase; yield return combat.SlotAttackSlot(attackingSlot, opposingSlot, 0f); int damageAfter = combat.DamageDealtThisPhase; int directDamage = damageAfter - damageBefore; if (directDamage > 0) { yield return MoveDamageWeightsToScales(combat, attackingSlot.IsPlayerSlot); yield return Singleton.Instance.ShowDamageSequence(directDamage, directDamage, !attackingSlot.IsPlayerSlot, 0f, (GameObject)null, 0f, true); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } private IEnumerator MoveDamageWeightsToScales(CombatPhaseManager combat, bool playerIsAttacker) { CombatPhaseManager3D combat3D = (CombatPhaseManager3D)(object)((combat is CombatPhaseManager3D) ? combat : null); if ((Object)(object)combat3D == (Object)null) { yield return (object)new WaitForSeconds(0.25f); yield break; } FieldInfo field = typeof(CombatPhaseManager3D).GetField("damageWeights", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { yield return (object)new WaitForSeconds(0.25f); yield break; } if (!(field.GetValue(combat3D) is List damageWeights)) { yield return (object)new WaitForSeconds(0.25f); yield break; } if ((Object)(object)Singleton.Instance.Scales3D != (Object)null) { Vector3 scalesPos = (playerIsAttacker ? Singleton.Instance.Scales3D.OpponentSide : Singleton.Instance.Scales3D.PlayerSide); foreach (Transform transform in damageWeights) { if ((Object)(object)transform != (Object)null) { Tween.Position(transform, scalesPos, 0.2f, 0f, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true); Object.Destroy((Object)(object)((Component)transform).gameObject, 0.2f); } yield return (object)new WaitForSeconds(0.02f); } } else { foreach (Transform transform2 in damageWeights) { if ((Object)(object)transform2 != (Object)null) { Part1Scales.DissolveWeight(((Component)transform2).gameObject); } yield return (object)new WaitForSeconds(0.02f); } } yield return (object)new WaitForSeconds(0.25f); damageWeights.Clear(); } } [BepInPlugin("OLD_SA.BloodStrike", "OLD SA Blood Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.BloodStrike"); val.PatchAll(); BloodStrikeAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Blood Strike Loaded"); } }