diff --git a/ExpandAssets/Assets/AssetBundles/AssetBundles b/ExpandAssets/Assets/AssetBundles/AssetBundles index 9d270eb..b1b1fd9 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 e90f9bd..af21abb 100644 --- a/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest +++ b/ExpandAssets/Assets/AssetBundles/AssetBundles.manifest @@ -1,5 +1,5 @@ ManifestFileVersion: 0 -CRC: 152274101 +CRC: 1983819566 AssetBundleManifest: AssetBundleInfos: Info_0: diff --git a/ExpandAssets/Assets/AssetBundles/expandsharedauto b/ExpandAssets/Assets/AssetBundles/expandsharedauto index 2fdfdba..a821465 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 e6c1bbc..3c6e356 100644 --- a/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest +++ b/ExpandAssets/Assets/AssetBundles/expandsharedauto.manifest @@ -1,9 +1,9 @@ ManifestFileVersion: 0 -CRC: 2336072457 +CRC: 4207470725 Hashes: AssetFileHash: serializedVersion: 2 - Hash: f8af26c8e95a7b2a44e4e826f677b426 + Hash: 3a182b004c486813864fd873202c286d TypeTreeHash: serializedVersion: 2 Hash: 2241b0dac22d22b9de2222ad79842819 diff --git a/ExpandAssets/Assets/ExpandTextures/EXLogo.png b/ExpandAssets/Assets/ExpandTextures/EXLogo.png index be0fdf1..4899798 100644 Binary files a/ExpandAssets/Assets/ExpandTextures/EXLogo.png and b/ExpandAssets/Assets/ExpandTextures/EXLogo.png differ diff --git a/ExpandTheGungeon/ExpandAssets.cs b/ExpandTheGungeon/ExpandAssets.cs index ac67a34..7533e81 100644 --- a/ExpandTheGungeon/ExpandAssets.cs +++ b/ExpandTheGungeon/ExpandAssets.cs @@ -238,8 +238,6 @@ public enum AssetSource { BraveResources, SharedAuto1, SharedAuto2, EnemiesBase, return null; } } - - } } diff --git a/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs b/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs index 72fec53..3de56c7 100644 --- a/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs +++ b/ExpandTheGungeon/ExpandPrefab/ExpandCustomEnemyDatabase.cs @@ -4245,117 +4245,61 @@ public static class ExpandCustomEnemyDatabase { } }; - // Currently my custom attack behavior will not work unless GGB version of MTG is installed. - if (ETGMod.BaseUIVersion.ToLower().Contains("ggb")) { - customBehaviorSpeculator.AttackBehaviors = new List() { - new ExpandChargeBehavior() { - avoidExits = true, - avoidWalls = false, - minRange = 0, - primeTime = -1, - stopDuringPrime = true, - leadAmount = 1, - chargeSpeed = 25, - chargeAcceleration = -1, - maxChargeDistance = -1, - chargeKnockback = 120, - chargeDamage = 25, - wallRecoilForce = 20, - stoppedByProjectiles = false, - endWhenChargeAnimFinishes = false, - switchCollidersOnCharge = true, - collidesWithDodgeRollingPlayers = true, - ShootPoint = null, - bulletScript = null, - primeAnim = "spindashcharge", - chargeAnim = "spindash_release", - hitAnim = "rebound", - HideGun = false, - launchVfx = null, - trailVfx = null, - trailVfxParent = null, - hitVfx = null, - nonActorHitVfx = null, - chargeDustUps = true, - chargeDustUpInterval = 0.25f, - Cooldown = 2, - CooldownVariance = 0, - AttackCooldown = 0, - GlobalCooldown = 0, - InitialCooldown = 0, - InitialCooldownVariance = 0, - GroupName = null, - GroupCooldown = 0, - MinRange = 0, - Range = 20, - MinWallDistance = 0, - MaxEnemiesInRoom = 0, - MinHealthThreshold = 0, - MaxHealthThreshold = 1, - HealthThresholds = new float[0], - AccumulateHealthThresholds = true, - targetAreaStyle = null, - IsBlackPhantom = false, - resetCooldownOnDamage = null, - RequiresLineOfSight = true, - MaxUsages = 0 - } - }; - } else { - customBehaviorSpeculator.AttackBehaviors = new List() { - new ChargeBehavior() { - minRange = 0, - primeTime = -1, - stopDuringPrime = true, - leadAmount = 1, - chargeSpeed = 25, - chargeAcceleration = -1, - maxChargeDistance = -1, - chargeKnockback = 120, - chargeDamage = 25, - wallRecoilForce = 20, - stoppedByProjectiles = false, - endWhenChargeAnimFinishes = false, - switchCollidersOnCharge = true, - collidesWithDodgeRollingPlayers = true, - ShootPoint = null, - bulletScript = null, - primeAnim = "spindashcharge", - chargeAnim = "spindash_release", - hitAnim = "rebound", - HideGun = false, - launchVfx = null, - trailVfx = null, - trailVfxParent = null, - hitVfx = null, - nonActorHitVfx = null, - chargeDustUps = true, - chargeDustUpInterval = 0.25f, - Cooldown = 2, - CooldownVariance = 0, - AttackCooldown = 0, - GlobalCooldown = 0, - InitialCooldown = 0, - InitialCooldownVariance = 0, - GroupName = null, - GroupCooldown = 0, - MinRange = 0, - Range = 20, - MinWallDistance = 0, - MaxEnemiesInRoom = 0, - MinHealthThreshold = 0, - MaxHealthThreshold = 1, - HealthThresholds = new float[0], - AccumulateHealthThresholds = true, - targetAreaStyle = null, - IsBlackPhantom = false, - resetCooldownOnDamage = null, - RequiresLineOfSight = true, - MaxUsages = 0 - } - }; - } - + customBehaviorSpeculator.AttackBehaviors = new List() { + new ExpandChargeBehavior() { + avoidExits = true, + avoidWalls = false, + minRange = 0, + primeTime = -1, + stopDuringPrime = true, + leadAmount = 1, + chargeSpeed = 25, + chargeAcceleration = -1, + maxChargeDistance = -1, + chargeKnockback = 120, + chargeDamage = 25, + wallRecoilForce = 20, + stoppedByProjectiles = false, + endWhenChargeAnimFinishes = false, + switchCollidersOnCharge = true, + collidesWithDodgeRollingPlayers = true, + ShootPoint = null, + bulletScript = null, + primeAnim = "spindashcharge", + chargeAnim = "spindash_release", + hitAnim = "rebound", + HideGun = false, + launchVfx = null, + trailVfx = null, + trailVfxParent = null, + hitVfx = null, + nonActorHitVfx = null, + chargeDustUps = true, + chargeDustUpInterval = 0.25f, + Cooldown = 2, + CooldownVariance = 0, + AttackCooldown = 0, + GlobalCooldown = 0, + InitialCooldown = 0, + InitialCooldownVariance = 0, + GroupName = null, + GroupCooldown = 0, + MinRange = 0, + Range = 20, + MinWallDistance = 0, + MaxEnemiesInRoom = 0, + MinHealthThreshold = 0, + MaxHealthThreshold = 1, + HealthThresholds = new float[0], + AccumulateHealthThresholds = true, + targetAreaStyle = null, + IsBlackPhantom = false, + resetCooldownOnDamage = null, + RequiresLineOfSight = true, + MaxUsages = 0 + } + }; + customBehaviorSpeculator.InstantFirstTick = false; customBehaviorSpeculator.TickInterval = 0.1f; diff --git a/ExpandTheGungeon/ExpandSharedAuto b/ExpandTheGungeon/ExpandSharedAuto new file mode 100644 index 0000000..523d66f Binary files /dev/null and b/ExpandTheGungeon/ExpandSharedAuto differ diff --git a/ExpandTheGungeon/ExpandTheGungeon.cs b/ExpandTheGungeon/ExpandTheGungeon.cs index 18e762d..4d11cd7 100644 --- a/ExpandTheGungeon/ExpandTheGungeon.cs +++ b/ExpandTheGungeon/ExpandTheGungeon.cs @@ -10,18 +10,20 @@ using ExpandTheGungeon.ExpandUtilities; using ExpandTheGungeon.ExpandMain; using ExpandTheGungeon.ExpandDungeonFlows; -using ExpandTheGungeon.ExpandComponents; +using BepInEx; namespace ExpandTheGungeon { - - public class ExpandTheGungeon : ETGModule { - + [BepInDependency("etgmodding.etg.mtgapi")] + [BepInPlugin(GUID, ModName, VERSION)] + public class ExpandTheGungeon : BaseUnityPlugin { public static Texture2D ModLogo; public static Hook GameManagerHook; public static Hook MainMenuFoyerUpdateHook; - public static string ModName; + public const string GUID = "ApacheThunder.etg.ExpandTheGungeon"; + public const string ModName = "ExpandTheGungeon"; + public const string VERSION = "2.7.1"; public static string ZipFilePath; public static string FilePath; public static string ResourcesPath; @@ -63,14 +65,13 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; private static GameObject m_FoyerCheckerOBJ; - public override void Init() { - + public void Start() { ExceptionText = string.Empty; ExceptionText2 = string.Empty; - ModName = Metadata.Name; - ZipFilePath = Metadata.Archive; - FilePath = Metadata.Directory; + FilePath = this.FolderPath(); + ZipFilePath = this.FolderPath(); + ResourcesPath = ETGMod.ResourcesDirectory; try { ExpandSettings.LoadSettings(); } catch (Exception ex) { ExceptionText2 = ex.ToString(); } @@ -107,7 +108,12 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; if (!string.IsNullOrEmpty(ExceptionText)) { return; } if (ExpandSettings.EnableLogo) { ModLogo = ExpandAssets.LoadAsset("EXLogo"); } + + ETGModMainBehaviour.WaitForGameManagerStart(GMStart); + } + + public void GMStart(GameManager gameManager) { try { ExpandSharedHooks.InstallMidGameSaveHooks(); if (ExpandSettings.EnableLogo) { @@ -117,17 +123,14 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; typeof(MainMenuFoyerController) ); } - GameManager.Instance.OnNewLevelFullyLoaded += ExpandObjectMods.InitSpecialMods; + gameManager.OnNewLevelFullyLoaded += ExpandObjectMods.InitSpecialMods; } catch (Exception ex) { // ETGModConsole can't be called by anything that occurs in Init(), so write message to static strinng and check it later. ExceptionText = "[ExpandTheGungeon] ERROR: Exception occured while installing hooks!"; Debug.LogException(ex); return; } - } - public override void Start() { - if (!string.IsNullOrEmpty(ExceptionText) | !string.IsNullOrEmpty(ExceptionText2)) { if (!string.IsNullOrEmpty(ExceptionText)) { ETGModConsole.Log(ExceptionText); } if (!string.IsNullOrEmpty(ExceptionText2)) { ETGModConsole.Log(ExceptionText2); } @@ -209,8 +212,6 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; enemiesBase = null; } - public override void Exit() { } - public static void CreateFoyerController() { if (!m_FoyerCheckerOBJ) { m_FoyerCheckerOBJ = new GameObject("ExpandTheGungeon Foyer Checker", new Type[] { typeof(ExpandFoyer) }); @@ -222,6 +223,7 @@ private enum WaitType { ShotgunSecret, LanguageFix, DebugFlow }; private void SetupItemAPI(AssetBundle expandSharedAssets1) { if (!ItemAPISetup) { try { + ETGMod.Assets.SetupSpritesFromAssembly(Assembly.GetExecutingAssembly(), "ExpandTheGungeon/Sprites"); Tools.Init(); ItemBuilder.Init(); BabyGoodHammer.Init(expandSharedAssets1); diff --git a/ExpandTheGungeon/ExpandTheGungeon.csproj b/ExpandTheGungeon/ExpandTheGungeon.csproj index 29d0d68..719081a 100644 --- a/ExpandTheGungeon/ExpandTheGungeon.csproj +++ b/ExpandTheGungeon/ExpandTheGungeon.csproj @@ -21,6 +21,10 @@ 4 + + ..\Dependencies\0Harmony.dll + False + ..\Dependencies\Assembly-CSharp.dll False @@ -29,14 +33,22 @@ ..\Dependencies\Assembly-CSharp-firstpass.dll False - - ..\Dependencies\Assembly-CSharp.Base.mm.dll + + ..\Dependencies\BepInEx.dll False ..\Dependencies\Ionic.Zip.dll False + + ..\Dependencies\ModTheGungeonAPI.dll + False + + + ..\Dependencies\Mono.Cecil.dll + False + ..\Dependencies\MonoMod.RuntimeDetour.dll False @@ -261,6 +273,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +