diff --git a/ExpandAssets/Assets/AssetBundles/AssetBundles b/ExpandAssets/Assets/AssetBundles/AssetBundles index 339ecbf..70db5d1 100644 Binary files a/ExpandAssets/Assets/AssetBundles/AssetBundles and b/ExpandAssets/Assets/AssetBundles/AssetBundles differ diff --git a/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest b/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest index c163a2b..e4c0564 100644 --- a/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest +++ b/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest @@ -1,5 +1,5 @@ ManifestFileVersion: 0 -CRC: 3935064738 +CRC: 2940580124 AssetBundleManifest: AssetBundleInfos: Info_0: diff --git a/ExpandAssets/Assets/AssetBundles/expandsharedauto b/ExpandAssets/Assets/AssetBundles/expandsharedauto index 7254f19..26f3aa1 100644 Binary files a/ExpandAssets/Assets/AssetBundles/expandsharedauto and b/ExpandAssets/Assets/AssetBundles/expandsharedauto differ diff --git a/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest b/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest index c6b80c5..aae70c6 100644 --- a/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest +++ b/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest @@ -1,9 +1,9 @@ ManifestFileVersion: 0 -CRC: 448914758 +CRC: 67696902 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 2ae2cf88026e0f4048d648031c5627e4 + Hash: 9deb45a9503e598885a647facfc500e6 TypeTreeHash: serializedVersion: 2 Hash: 2241b0dac22d22b9de2222ad79842819 diff --git a/ExpandAssets/Assets/ExpandPrefabs/AIActors/Clownkin_Wig.prefab b/ExpandAssets/Assets/ExpandPrefabs/AIActors/Clownkin_Wig.prefab index b7c3e3c..1499f9f 100644 --- a/ExpandAssets/Assets/ExpandPrefabs/AIActors/Clownkin_Wig.prefab +++ b/ExpandAssets/Assets/ExpandPrefabs/AIActors/Clownkin_Wig.prefab @@ -19,7 +19,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4816379484175378} - m_Layer: 0 + m_Layer: 22 m_Name: Clownkin_Wig m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/ExpandAssets/Assets/ExpandTextures/EXLogo.png b/ExpandAssets/Assets/ExpandTextures/EXLogo.png index cbe1c16..c21a833 100644 Binary files a/ExpandAssets/Assets/ExpandTextures/EXLogo.png and b/ExpandAssets/Assets/ExpandTextures/EXLogo.png differ diff --git a/ExpandTheGungeon/ExpandComponents/ExpandBalloonController.cs b/ExpandTheGungeon/ExpandComponents/ExpandBalloonController.cs index 32d9733..55487ac 100644 --- a/ExpandTheGungeon/ExpandComponents/ExpandBalloonController.cs +++ b/ExpandTheGungeon/ExpandComponents/ExpandBalloonController.cs @@ -313,6 +313,12 @@ public class ExpandBalloonController : BraveBehaviour { Destroy(gameObject); return; } + + /*if (!AttachTarget && !AlternateAttachTarget && !DoDetachAndFloatAfterTargetDeath && !DestroyOnDeath) { + Destroy(m_BalloonString); + Destroy(gameObject); + return; + }*/ } diff --git a/ExpandTheGungeon/ExpandComponents/ExpandCompanionManager.cs b/ExpandTheGungeon/ExpandComponents/ExpandCompanionManager.cs index 610a0b9..839fcd5 100644 --- a/ExpandTheGungeon/ExpandComponents/ExpandCompanionManager.cs +++ b/ExpandTheGungeon/ExpandComponents/ExpandCompanionManager.cs @@ -1,4 +1,5 @@ -using System; +using Dungeonator; +using System; using UnityEngine; namespace ExpandTheGungeon.ExpandComponents { @@ -19,9 +20,12 @@ public class ExpandCompanionManager : BraveBehaviour { Scale = 0.65f; m_WasRescaled = false; + m_Awake = false; UpdateTimer = 1.5f; + m_Timer = UpdateTimer; + m_AwakeTimer = 1; } public AIAnimator.FacingType NoTargetFaceType; @@ -34,6 +38,7 @@ public class ExpandCompanionManager : BraveBehaviour { public bool SwapFaceTypesOnTarget; public bool ToggleFaceSouthWhenStopped; public bool HideGunsWhenNoTarget; + [NonSerialized] private AIActor m_AIActor; @@ -42,19 +47,44 @@ public class ExpandCompanionManager : BraveBehaviour { [NonSerialized] private bool m_WasRescaled; [NonSerialized] + private bool m_Awake; + [NonSerialized] private float m_Timer; + [NonSerialized] + private float m_AwakeTimer; private void Awake() { - m_AIActor = aiActor; - m_AIShooter = aiShooter; - if (HideGunsWhenNoTarget && (!m_AIActor | !m_AIShooter | m_AIActor.TargetRigidbody)) { return; } - m_AIShooter.ToggleGunAndHandRenderers(false, "Companion gun toggle for target change"); + m_Awake = false; + m_AwakeTimer = 1f; } private void Start() { } + private void LateUpdate() { + if (Dungeon.IsGenerating | GameManager.Instance.IsLoadingLevel | m_Awake) { return; } + + m_AwakeTimer -= BraveTime.DeltaTime; + + if (m_AwakeTimer < 0) { + m_Awake = true; + m_AIActor = aiActor; + m_AIShooter = aiShooter; + if (HideGunsWhenNoTarget && (!m_AIActor | !m_AIShooter | m_AIActor.TargetRigidbody)) { return; } + try { + m_AIShooter.ToggleGunAndHandRenderers(false, "Companion gun toggle for target change"); + } catch (Exception ex) { + if (ExpandSettings.debugMode) { Debug.LogException(ex); } + } + } + } + private void Update() { + if (!m_Awake) { return; } if (!m_AIActor) { Destroy(this); return; } + + if (m_Awake && (!m_AIShooter | !m_AIActor)) { + + } if (Rescale && !m_WasRescaled) { m_WasRescaled = true; @@ -64,6 +94,7 @@ public class ExpandCompanionManager : BraveBehaviour { sprite.UpdateZDepth(); } + if (UpdateTimer != -1 && m_AIActor && !m_AIActor.TargetRigidbody) { m_Timer -= BraveTime.DeltaTime; } else if (UpdateTimer != -1 && m_AIActor && m_AIActor.TargetRigidbody && m_Timer != UpdateTimer) { diff --git a/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs b/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs index 91b5b41..5ddfec8 100644 --- a/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs +++ b/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs @@ -206,7 +206,7 @@ public static class ExpandCustomEnemyDatabase { BuildJungleBossPrefab(out com4nd0BossPrefab); // Add R&G enemies to MTG spawn command because Zatherz hasn't done it. :P - UpdateMTGSpawnPool(); + // UpdateMTGSpawnPool(); } public static AIActor GetOrLoadByGuidHook(Func orig, string guid) { @@ -321,7 +321,6 @@ public static class ExpandCustomEnemyDatabase { ExpandUtility.DuplicateSpriteAnimation(BulletManEyepatchCollection, BulletManEyepatchCollection.AddComponent(), BulletManEyepatchEnemy.spriteAnimator.Library, BulletManEyepatchCollectionData); BulletManEyepatchEnemy.spriteAnimator.Library = BulletManEyepatchCollection.GetComponent(); BulletManEyepatchEnemy.optionalPalette = null; - } public static void AddEnemyToDatabase(GameObject EnemyPrefab, string EnemyGUID, bool IsNormalEnemy = false, bool AddToMTGSpawnPool = true) { @@ -3106,6 +3105,7 @@ public static class ExpandCustomEnemyDatabase { AIActor m_CachedAIActor = m_CachedTargetObject.GetComponent(); + m_CachedAIActor.IsHarmlessEnemy = true; m_CachedAIActor.HasShadow = false; m_CachedAIActor.MovementSpeed = 0.65f; m_CachedAIActor.PathableTiles = CellTypes.FLOOR; diff --git a/ExpandTheGungeon/ExpandPrefab/ExpandMorePrefabs.cs b/ExpandTheGungeon/ExpandPrefab/ExpandMorePrefabs.cs index f9856b1..8fe94ef 100644 --- a/ExpandTheGungeon/ExpandPrefab/ExpandMorePrefabs.cs +++ b/ExpandTheGungeon/ExpandPrefab/ExpandMorePrefabs.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using UnityEngine; using Dungeonator; -using ExpandTheGungeon.ExpandComponents; using ExpandTheGungeon.ExpandUtilities; using ExpandTheGungeon.SpriteAPI; diff --git a/ExpandTheGungeon/ExpandPrefab/ExpandPrefabs.cs b/ExpandTheGungeon/ExpandPrefab/ExpandPrefabs.cs index a794815..d7dfad0 100644 --- a/ExpandTheGungeon/ExpandPrefab/ExpandPrefabs.cs +++ b/ExpandTheGungeon/ExpandPrefab/ExpandPrefabs.cs @@ -228,6 +228,10 @@ public class ExpandPrefabs { public static GameObject CandleGuy; public static GameObject WallMimic; public static GameObject AK47BulletKin; + public static GameObject PirateShotgunKin; + public static GameObject PirateShotgunKinHat; + public static GameObject PirateBulletKin; + public static GameObject PirateBulletKinHat; public static GameObject RatJailDoor; public static GameObject CurrsedMirror; @@ -1370,10 +1374,26 @@ public class ExpandPrefabs { SerManuel = EnemyDatabase.GetOrLoadByGuid("fc809bd43a4d41738a62d7565456622c").gameObject; SkusketHead = EnemyDatabase.GetOrLoadByGuid("c2f902b7cbe745efb3db4399927eab34").gameObject; AK47BulletKin = EnemyDatabase.GetOrLoadByGuid("db35531e66ce41cbb81d507a34366dfe").gameObject; + PirateShotgunKin = EnemyDatabase.GetOrLoadByGuid("86dfc13486ee4f559189de53cfb84107").gameObject; + PirateShotgunKinHat = PirateShotgunKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].effect; + PirateBulletKin = EnemyDatabase.GetOrLoadByGuid("6f818f482a5c47fd8f38cce101f6566c").gameObject; + PirateBulletKinHat = PirateBulletKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].effect; + // Fix missing death sound AK47BulletKin.GetComponent().EnemySwitchState = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5").EnemySwitchState; + + // Fix corpse hat zDepth + PirateShotgunKinHat.GetComponent().CachedPerpState = tk2dBaseSprite.PerpendicularState.FLAT; + PirateShotgunKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].usesZHeight = true; + PirateShotgunKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].zHeight = -1.5f; + + PirateBulletKinHat.GetComponent().CachedPerpState = tk2dBaseSprite.PerpendicularState.FLAT; + PirateBulletKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].usesZHeight = true; + PirateBulletKin.GetComponent().OtherVFX[0].vfxPool.effects[0].effects[0].zHeight = -1.5f; + + RatJailDoor = ratDungeon.PatternSettings.flows[0].AllNodes[13].overrideExactRoom.placedObjects[1].nonenemyBehaviour.gameObject; CurrsedMirror = basic_special_rooms.includedRooms.elements[1].room.placedObjects[0].nonenemyBehaviour.gameObject; diff --git a/ExpandTheGungeon/ExpandTheGungeon.cs b/ExpandTheGungeon/ExpandTheGungeon.cs index 342fa47..e636de1 100644 --- a/ExpandTheGungeon/ExpandTheGungeon.cs +++ b/ExpandTheGungeon/ExpandTheGungeon.cs @@ -23,7 +23,7 @@ public class ExpandTheGungeon : BaseUnityPlugin { public const string GUID = "ApacheThunder.etg.ExpandTheGungeon"; public const string ModName = "ExpandTheGungeon"; - public const string VERSION = "2.7.8"; + public const string VERSION = "2.7.9"; public static string ZipFilePath; public static string FilePath; public static string ResourcesPath; @@ -525,7 +525,6 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; } /*private void ExpandTestCommand(string[] consoleText) { - GameStatsManager.Instance.ClearStatValueGlobal(TrackedStats.META_CURRENCY); GameStatsManager.Instance.SetStat(TrackedStats.META_CURRENCY, float.Parse(consoleText[0])); // GameStatsManager.Instance.RegisterStatChange(TrackedStats.META_CURRENCY_SPENT_AT_META_SHOP, 0); diff --git a/ExpandTheGungeon/ItemAPI/Items/ClownFriend.cs b/ExpandTheGungeon/ItemAPI/Items/ClownFriend.cs index cd840ff..c1af286 100644 --- a/ExpandTheGungeon/ItemAPI/Items/ClownFriend.cs +++ b/ExpandTheGungeon/ItemAPI/Items/ClownFriend.cs @@ -143,6 +143,10 @@ public class ClownFriend : PassiveItem { private void DestroyCompanion() { if (!m_extantCompanion) { return; } + if (m_extantCompanion.GetComponent() && m_extantCompanion.GetComponent().m_Balloon) { + Destroy(m_extantCompanion.GetComponent().m_Balloon); + Destroy(m_extantCompanion.GetComponent()); + } Destroy(m_extantCompanion); m_extantCompanion = null; } diff --git a/ExpandTheGungeon/ItemAPI/Items/TheLeadKey.cs b/ExpandTheGungeon/ItemAPI/Items/TheLeadKey.cs index d537e30..8ed7238 100644 --- a/ExpandTheGungeon/ItemAPI/Items/TheLeadKey.cs +++ b/ExpandTheGungeon/ItemAPI/Items/TheLeadKey.cs @@ -456,15 +456,14 @@ public class TheLeadKey : PlayerItem { FXController.UseCorruptionAmbience = m_CopyCurrentRoom; GlitchShaderObject.transform.SetParent(dungeon.gameObject.transform); } - - GameObject[] Objects = FindObjectsOfType(); - + try { - foreach (GameObject Object in Objects) { - if (Object && Object.transform.parent == currentRoom.hierarchyParent && IsValidObject(Object)) { - Vector3 OrigPosition = (Object.transform.position - currentRoom.area.basePosition.ToVector3()); + for(int i = 0; i < currentRoom.hierarchyParent.childCount; i++) { + Transform childTransform = currentRoom.hierarchyParent.GetChild(i); + if (childTransform?.gameObject && IsValidObject(childTransform.gameObject)) { + Vector3 OrigPosition = (childTransform.position - currentRoom.area.basePosition.ToVector3()); Vector3 NewPosition = (OrigPosition + GlitchRoom.area.basePosition.ToVector3()); - GameObject newObject = Instantiate(Object, NewPosition, Quaternion.identity); + GameObject newObject = Instantiate(childTransform.gameObject, NewPosition, Quaternion.identity); newObject.transform.SetParent(GlitchRoom.hierarchyParent); if (newObject.GetComponent()) { Destroy(newObject.GetComponent()); } @@ -496,7 +495,7 @@ public class TheLeadKey : PlayerItem { ExpandShaders.Instance.BecomeGlitched(newObject, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat); } } - } + } } } catch (Exception ex) { if (ExpandSettings.debugMode) { diff --git a/ExpandTheGungeon/Properties/AssemblyInfo.cs b/ExpandTheGungeon/Properties/AssemblyInfo.cs index 5170d4a..df1ad58 100644 --- a/ExpandTheGungeon/Properties/AssemblyInfo.cs +++ b/ExpandTheGungeon/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.8")] -[assembly: AssemblyFileVersion("2.7.8")] +[assembly: AssemblyVersion("2.7.9")] +[assembly: AssemblyFileVersion("2.7.9")] diff --git a/ExpandTheGungeon/SpriteAPI/SpriteAPI.cs b/ExpandTheGungeon/SpriteAPI/SpriteAPI.cs index 5bce29c..4b4d1c9 100644 --- a/ExpandTheGungeon/SpriteAPI/SpriteAPI.cs +++ b/ExpandTheGungeon/SpriteAPI/SpriteAPI.cs @@ -8,8 +8,8 @@ namespace ExpandTheGungeon.SpriteAPI { - public static class SpriteSerializer { - + public static class SpriteSerializer { + private static tk2dSpriteCollectionData newCollection; private static RuntimeAtlasPacker AtlasPacker; diff --git a/GraphicAssets/EXLogo.xcf b/GraphicAssets/EXLogo.xcf index 183b0f8..2539962 100644 Binary files a/GraphicAssets/EXLogo.xcf and b/GraphicAssets/EXLogo.xcf differ