diff --git a/PCE.dll b/PCE.dll index 7d4c5e7..4ff8585 100644 Binary files a/PCE.dll and b/PCE.dll differ diff --git a/PCE/PCE.cs b/PCE/PCE.cs index f097b83..d1d385b 100644 --- a/PCE/PCE.cs +++ b/PCE/PCE.cs @@ -19,7 +19,7 @@ namespace PCE { [BepInDependency("com.willis.rounds.unbound", BepInDependency.DependencyFlags.HardDependency)] - [BepInPlugin("pykess.rounds.plugins.pykesscardexpansion", "Pykess's Card Expansion (PCE)", "0.1.6.0")] + [BepInPlugin("pykess.rounds.plugins.pykesscardexpansion", "Pykess's Card Expansion (PCE)", "0.1.6.1")] [BepInProcess("Rounds.exe")] public class PCE : BaseUnityPlugin { @@ -133,16 +133,16 @@ private static void Prefix(CharacterStatModifiers __instance, Vector2 damage, bo opstats.GetAdditionalData().normalGravity = false; opgrav.gravityForce *= __instance.GetAdditionalData().gravityMultiplierOnDoDamage; - __instance.StartCoroutine(GravityEffectCountDown(__instance, opstats, opgrav, orig_gravityForce, Time.realtimeSinceStartup, __instance.GetAdditionalData().gravityDurationOnDoDamage)); + __instance.StartCoroutine(GravityEffectCountDown(__instance, damagedPlayer, opstats, opgrav, orig_gravityForce, Time.realtimeSinceStartup, __instance.GetAdditionalData().gravityDurationOnDoDamage)); } } } - private static IEnumerator GravityEffectCountDown(CharacterStatModifiers CSM_instance, CharacterStatModifiers damaged_CSM, Gravity damaged_gravity, float orig_gravityForce, float effectStart, float effectDuration) + private static IEnumerator GravityEffectCountDown(CharacterStatModifiers CSM_instance, Player damagedPlayer, CharacterStatModifiers damaged_CSM, Gravity damaged_gravity, float orig_gravityForce, float effectStart, float effectDuration) { - while(!damaged_CSM.GetAdditionalData().normalGravity && Time.realtimeSinceStartup < effectStart+effectDuration) + while((!damaged_CSM.GetAdditionalData().normalGravity && Time.realtimeSinceStartup < effectStart+effectDuration) || damagedPlayer.data.dead) { yield return new WaitForSecondsRealtime(0.1f); } @@ -1597,11 +1597,11 @@ public static void OnDiscombobulateActivate(int playerID, float duration) stats.movementSpeed *= -1f; - Unbound.Instance.StartCoroutine(DiscombobulateEffectCountdown(stats, orig_movementspeed, Time.realtimeSinceStartup, duration)); + Unbound.Instance.StartCoroutine(DiscombobulateEffectCountdown(stats, player, orig_movementspeed, Time.realtimeSinceStartup, duration)); } - private static IEnumerator DiscombobulateEffectCountdown(CharacterStatModifiers CSM_instance, float orig_movementspeed, float effectStart, float effectDuration) + private static IEnumerator DiscombobulateEffectCountdown(CharacterStatModifiers CSM_instance, Player effectedPlayer, float orig_movementspeed, float effectStart, float effectDuration) { - while (CSM_instance.movementSpeed != orig_movementspeed && Time.realtimeSinceStartup < effectStart + effectDuration) + while ((CSM_instance.movementSpeed != orig_movementspeed && Time.realtimeSinceStartup < effectStart + effectDuration) || effectedPlayer.data.dead) { yield return new WaitForSecondsRealtime(0.1f); } diff --git a/README.md b/README.md index 716b510..ce80f48 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,9 @@ A massive thanks to the people who helped me learn how to mod, especially Ascyst - Cards without art do not display properly in the card bar, this is an issue with the newest version of UnboundLib - Discombobulate does not have any particle effects when activated +- v0.1.6.1: bugfix + - Once again, fixing gravity effects between rounds + ### Suggestions, Bug Reports, and Troubleshooting -------------------------------------------------