Example #1
0
        public static void ModdedLootAdditions()
        {
            GenericLootTable Table = MunitionsChestController.MChest.lootTable.lootTable;

            ETGModConsole.Log("Test 1");
            Table.defaultItemDrops          = new WeightedGameObjectCollection();
            Table.defaultItemDrops.elements = new List <WeightedGameObject>();
            try
            {
                if (ModdedMunitionsIDs.Any())
                {
                    ETGModConsole.Log("Test 2");
                    foreach (string s in ModdedMunitionsIDs)
                    {
                        if (Game.Items.ContainsID(s))
                        {
                            ETGModConsole.Log("Test 3");
                            int id = ETGMod.Databases.Items[s].PickupObjectId;
                            ETGModConsole.Log("Test 4");
                            Table.defaultItemDrops.elements.Add(new WeightedGameObject()
                            {
                                pickupId = id,
                                weight   = 1,
                                forceDuplicatesPossible = false,
                                additionalPrerequisites = new DungeonPrerequisite[0]
                            });
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.ToString());
            }
        }
        private void HandleRatBossSetup()
        {
            GameObject SpecialRatBoss = DungeonPlaceableUtility.InstantiateDungeonPlaceable(EnemyDatabase.GetOrLoadByGuid("6868795625bd46f3ae3e4377adce288b").gameObject, m_ParentRoom, new IntVector2(17, 28), true, AIActor.AwakenAnimationType.Awaken, true);
            AIActor    RatBossAIActor = SpecialRatBoss.GetComponent <AIActor>();

            if (RatBossAIActor != null)
            {
                PickupObject.ItemQuality targetQuality = (UnityEngine.Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.B;
                GenericLootTable         lootTable     = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
                PickupObject             item          = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);
                PickupObject             item2         = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);
                Destroy(RatBossAIActor.gameObject.GetComponent <ResourcefulRatDeathController>());
                Destroy(RatBossAIActor.gameObject.GetComponent <ResourcefulRatRewardRoomController>());
                RatBossAIActor.State        = AIActor.ActorState.Awakening;
                RatBossAIActor.StealthDeath = true;
                RatBossAIActor.healthHaver.gameObject.AddComponent <ExpandSpawnGlitchObjectOnDeath>();
                ExpandSpawnGlitchObjectOnDeath ObjectSpawnerComponent = RatBossAIActor.healthHaver.gameObject.GetComponent <ExpandSpawnGlitchObjectOnDeath>();
                ObjectSpawnerComponent.spawnRatCorpse     = true;
                ObjectSpawnerComponent.ratCorpseSpawnsKey = true;
                ObjectSpawnerComponent.parentEnemyWasRat  = true;
                if (item && item2)
                {
                    RatBossAIActor.AdditionalSafeItemDrops = new List <PickupObject> {
                        item, item2
                    };
                }
                RatBossAIActor.healthHaver.enabled = true;
                RatBossAIActor.healthHaver.forcePreventVictoryMusic = true;
                RatBossAIActor.ConfigureOnPlacement(m_ParentRoom);
                RatBossAIActor.specRigidbody.CollideWithOthers = true;
            }
        }
Example #3
0
        private void RerollItem(DebrisObject debris)
        {
            int          checkLimit   = 0;
            PickupObject targetedItem = debris.gameObject.GetComponent <PickupObject>();

            if (targetedItem != null)
            {
                ItemQuality  targetTier               = targetedItem.quality;
                int          chanceToDowngrade        = 10;
                int          chanceToUpgrade          = 80;
                ItemQuality  newItemQuality           = targetTier;
                PickupObject newItemObject            = PickupObjectDatabase.GetByName("cel:test_item");
                int          RollToCheckUpgradeStatus = UnityEngine.Random.Range(0, 101);
                if (RollToCheckUpgradeStatus <= chanceToDowngrade && targetTier != ItemQuality.D)
                {
                    newItemQuality = targetTier - 1;
                }
                else if (RollToCheckUpgradeStatus >= chanceToUpgrade && targetTier != ItemQuality.S)
                {
                    newItemQuality = targetTier + 1;
                }
                GenericLootTable lootTableItems = GameManager.Instance.RewardManager.ItemsLootTable;

                if (targetedItem is PassiveItem)
                {
                    do
                    {
                        newItemObject = LootEngine.GetItemOfTypeAndQuality <PassiveItem>(newItemQuality, lootTableItems);
                        checkLimit++;
                    } while (newItemObject.PickupObjectId == targetedItem.PickupObjectId && checkLimit < 10);
                }
                else if (targetedItem is PlayerItem)
                {
                    do
                    {
                        newItemObject = LootEngine.GetItemOfTypeAndQuality <PlayerItem>(newItemQuality, lootTableItems);
                        checkLimit++;
                    } while (newItemObject.PickupObjectId == targetedItem.PickupObjectId && checkLimit < 10);
                }

                if (UnityEngine.Random.Range(0, 101) <= 1)
                {
                    Chest rainbow_Chest = GameManager.Instance.RewardManager.Rainbow_Chest;
                    Chest chest2        = Chest.Spawn(rainbow_Chest, targetedItem.sprite.WorldCenter.ToIntVector2(VectorConversions.Round));
                    chest2.BecomeGlitchChest();
                    chest2.sprite.renderer.material.shader = ShaderCache.Acquire("Brave/Internal/RainbowChestShader");

                    chest2.RegisterChestOnMinimap(chest2.GetAbsoluteParentRoom());
                }
                else
                {
                    LootEngine.DoDefaultPurplePoof(targetedItem.sprite.WorldCenter);
                    LootEngine.SpawnItem(newItemObject.gameObject, targetedItem.sprite.WorldCenter, Vector2.zero, 0);
                }
                Destroy(targetedItem.gameObject);
            }
        }
Example #4
0
        private IEnumerator HandleEnemySuck(AIActor target)
        {
            Transform copySprite = this.CreateEmptySprite(target);

            if (this.m_owner.PlayerHasActiveSynergy("#RELODIN_-_EXPLODIN"))
            {
                ExplosionData explosionData = new ExplosionData();
                explosionData.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData);
                explosionData.damageToPlayer = 0f;
                Exploder.Explode(target.sprite.WorldCenter, explosionData, new Vector2());
            }
            if (this.m_owner.PlayerHasActiveSynergy("RECYCLE_COLLECT_AND_USE") && UnityEngine.Random.value <= 0.05f)
            {
                GenericLootTable singleItemRewardTable = GameManager.Instance.RewardManager.CurrentRewardData.SingleItemRewardTable;
                LootEngine.SpawnItem(singleItemRewardTable.SelectByWeight(false), this.m_owner.CenterPosition, Vector2.up, 1f, true, false, false);
            }
            Vector3 startPosition = copySprite.transform.position;
            float   elapsed       = 0f;
            float   duration      = 0.5f;

            while (elapsed < duration)
            {
                elapsed += BraveTime.DeltaTime;
                if (this.m_owner.CurrentGun && copySprite)
                {
                    Vector3 position = this.m_owner.CurrentGun.PrimaryHandAttachPoint.position;
                    float   t        = elapsed / duration * (elapsed / duration);
                    copySprite.position   = Vector3.Lerp(startPosition, position, t);
                    copySprite.rotation   = Quaternion.Euler(0f, 0f, 360f * BraveTime.DeltaTime) * copySprite.rotation;
                    copySprite.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), t);
                }
                yield return(null);
            }
            if (copySprite)
            {
                UnityEngine.Object.Destroy(copySprite.gameObject);
            }
            if (this.m_owner.CurrentGun)
            {
                this.m_owner.CurrentGun.GainAmmo(1);
                if (this.m_owner.PlayerHasActiveSynergy("#OILER_CYLINDER") && UnityEngine.Random.value <= 0.25f)
                {
                    this.m_owner.CurrentGun.GainAmmo(1);
                }
            }
            if (this.m_owner.PlayerHasActiveSynergy("#SIXTHER_CHAMBER"))
            {
                DevilishSynergy();
            }
            if (this.m_owner.PlayerHasActiveSynergy("#YELLOWER_CHAMBER"))
            {
                KaliberSynergy();
            }
            yield break;
        }
 /// <summary>
 /// Adds an item to a loot table via PickupObject
 /// </summary>
 /// <param name="lootTable">The loot table you want to add to</param>
 /// <param name="po">The PickupObject you're adding</param>
 /// <param name="weight">The Weight of the item you're adding (default is 1)</param>
 /// <returns></returns>
 public static void AddItemToPool(this GenericLootTable lootTable, PickupObject po, float weight = 1)
 {
     lootTable.defaultItemDrops.Add(new WeightedGameObject()
     {
         pickupId                = po.PickupObjectId,
         weight                  = weight,
         rawGameObject           = po.gameObject,
         forceDuplicatesPossible = false,
         additionalPrerequisites = new DungeonPrerequisite[0]
     });
 }
        private void DoItemSpawn()
        {
            if (ItemList == null)
            {
                ItemList = new List <PickupObject>();

                if (numberOfDefaultItemsToSpawn == 1)
                {
                    PickupObject.ItemQuality targetQuality = (Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.B;
                    GenericLootTable         lootTable     = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
                    PickupObject             item          = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);
                    if (item)
                    {
                        LootEngine.SpawnItem(item.gameObject, specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, 0f, true, true, false);
                    }
                    return;
                }
                else
                {
                    for (int i = 0; i < numberOfDefaultItemsToSpawn; i++)
                    {
                        PickupObject.ItemQuality targetQuality = (Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.B;
                        GenericLootTable         lootTable     = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
                        PickupObject             item          = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);
                        if (item)
                        {
                            ItemList.Add(item);
                        }
                    }
                }
            }

            if (ItemList.Count <= 0)
            {
                return;
            }
            if (ItemList.Count == 1)
            {
                LootEngine.SpawnItem(ItemList[0].gameObject, specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, 0f, true, true, false);
                return;
            }
            else if (ItemList.Count > 1)
            {
                foreach (PickupObject pickupObject in ItemList)
                {
                    LootEngine.SpawnItem(pickupObject.gameObject, specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, 0f, true, true, false);
                }
            }
            return;
        }
        public void SpawnAirDrop(IntVector2 roomVector, GenericLootTable overrideTable = null, float EnemyOdds = 0f, float ExplodeOdds = 0f, bool playSoundFX = true, bool usePlayerPosition = true, string EnemyGUID = "01972dee89fc4404a5c408d50007dad5")
        {
            EmergencyCrateController lootCrate = Instantiate(EmergancyCratePrefab, roomVector.ToVector2().ToVector3ZUp(1f), Quaternion.identity).GetComponent <EmergencyCrateController>();
            Dungeon          dungeon           = GameManager.Instance.Dungeon;
            PlayerController player            = GameManager.Instance.PrimaryPlayer;
            RoomHandler      currentRoom       = GameManager.Instance.PrimaryPlayer.CurrentRoom;
            IntVector2       currentRoomSize   = currentRoom.area.dimensions;
            int RoomSizeX = currentRoomSize.x;
            int RoomSizeY = currentRoomSize.y;

            lootCrate.ChanceToExplode    = ExplodeOdds;
            lootCrate.ChanceToSpawnEnemy = EnemyOdds;
            lootCrate.EnemyPlaceable     = CustomEnemyPlacable(EnemyGUID);


            if (overrideTable != null)
            {
                lootCrate.gunTable = overrideTable;
            }

            IntVector2 bestRewardLocation = new IntVector2(1, 1);

            if (RoomSizeX < 8 && RoomSizeY < 8)
            {
                currentRoomSize = bestRewardLocation;
            }

            if (!usePlayerPosition)
            {
                bestRewardLocation = player.CurrentRoom.GetBestRewardLocation(currentRoom.area.dimensions, RoomHandler.RewardLocationStyle.CameraCenter, true);
                lootCrate.Trigger(new Vector3(-5f, -5f, -5f), bestRewardLocation.ToVector3() + new Vector3(15f, 15f, 15f), player.CurrentRoom, overrideTable == null);
                GameManager.Instance.Dungeon.data[bestRewardLocation].PreventRewardSpawn = true;
            }
            else
            {
                bestRewardLocation = player.CurrentRoom.GetBestRewardLocation(new IntVector2(1, 1), RoomHandler.RewardLocationStyle.CameraCenter, true);
                lootCrate.Trigger(new Vector3(-5f, -5f, -5f), bestRewardLocation.ToVector3() + new Vector3(15f, 15f, 15f), player.CurrentRoom, overrideTable == null);
                GameManager.Instance.Dungeon.data[bestRewardLocation].PreventRewardSpawn = true;
            }

            dungeon.data[bestRewardLocation].PreventRewardSpawn = true;
            player.CurrentRoom.ExtantEmergencyCrate             = lootCrate.gameObject;
            if (playSoundFX)
            {
                AkSoundEngine.PostEvent("Play_OBJ_supplydrop_activate_01", player.CurrentRoom.ExtantEmergencyCrate);
            }
            return;
        }
Example #8
0
 protected override void DoEffect(PlayerController user)
 {
     base.DoEffect(user);
     foreach (AIActor aiactor in user.CurrentRoom.GetActiveEnemies(Dungeonator.RoomHandler.ActiveEnemyType.All))
     {
         if (aiactor != null && aiactor.healthHaver != null && aiactor.healthHaver.IsAlive && !aiactor.healthHaver.IsBoss && !aiactor.IsMimicEnemy && !aiactor.IsHarmlessEnemy)
         {
             int         num = UnityEngine.Random.Range(1, 5);
             ItemQuality quality;
             if (num == 1)
             {
                 quality = ItemQuality.D;
             }
             else if (num == 2)
             {
                 quality = ItemQuality.C;
             }
             else if (num == 3)
             {
                 quality = ItemQuality.B;
             }
             else if (num == 4)
             {
                 quality = ItemQuality.A;
             }
             else
             {
                 quality = ItemQuality.S;
             }
             GenericLootTable lootTable       = UnityEngine.Random.value <= 0.5f ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
             bool             spawnsExtraItem = false;
             if (UnityEngine.Random.value < 0.5f && user.PlayerHasActiveSynergy("#WONDA-WONDER_WONDER-WONDA!!!"))
             {
                 spawnsExtraItem = true;
                 GenericLootTable singleItemRewardTable = GameManager.Instance.RewardManager.CurrentRewardData.SingleItemRewardTable;
                 LootEngine.SpawnItem(singleItemRewardTable.SelectByWeight(false), aiactor.sprite.WorldCenter, Vector2.right, 1f, true, false, false);
             }
             PickupObject po = LootEngine.GetItemOfTypeAndQuality <PickupObject>(quality, lootTable);
             LootEngine.SpawnItem(po.gameObject, aiactor.sprite.WorldCenter, spawnsExtraItem ? Vector2.left : Vector2.zero, spawnsExtraItem ? 1f : 0f, true, false, false);
             LootEngine.DoDefaultItemPoof(aiactor.sprite.WorldCenter);
             aiactor.EraseFromExistence(true);
         }
     }
 }
        private IEnumerator DoSurprise()
        {
            yield return(new WaitForSeconds(0.7f));

            AkSoundEngine.PostEvent("play_obj_chest_open_01", gameObject);
            DoConfetti(sprite.WorldBottomCenter);
            PickupObject.ItemQuality targetQuality = PickupObject.ItemQuality.D;
            float   m_RandomFloat = UnityEngine.Random.value;
            Vector2 SpawnPosition = specRigidbody.GetPixelCollider(ColliderType.HitBox).UnitCenter;

            if (UnityEngine.Random.value < 0.3)
            {
                targetQuality = (m_RandomFloat >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.B : PickupObject.ItemQuality.C) : PickupObject.ItemQuality.B;
            }
            else
            {
                targetQuality = (m_RandomFloat >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.C;
            }
            SurpriseChestEnemySpawnPool = SurpriseChestEnemySpawnPool.Shuffle();
            AIActor Enemy = AIActor.Spawn(EnemyDatabase.GetOrLoadByGuid(BraveUtility.RandomElement(SurpriseChestEnemySpawnPool)), SpawnPosition, m_room, true, AIActor.AwakenAnimationType.Spawn, true);

            if (Enemy)
            {
                Enemy.IgnoreForRoomClear = false;
                GenericLootTable lootTable = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
                PickupObject     item      = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);
                if (item)
                {
                    Enemy.AdditionalSafeItemDrops.Add(item);
                }
                ExpandParadropController paraDropController = Enemy.gameObject.AddComponent <ExpandParadropController>();
                paraDropController.Configured = true;
            }
            yield return(null);

            if (Enemy && !Enemy.IgnoreForRoomClear)
            {
                m_room.SealRoom();
            }
            yield break;
        }
        /// <summary>
        /// Creates a shop object along with an npc
        /// </summary>
        /// <param name="name">Name of the npc</param>
        /// <param name="prefix">Mod prefix (for example Bot)</param>
        ///
        /// <param name="idleSpritePaths">List of *FULL* sprite paths for the idle animation</param>
        /// <param name="idleFps">Fps of the idle animation (base game tends to use around 6)</param>
        ///
        /// <param name="talkSpritePaths">List of *FULL* sprite paths for the talk animation</param>
        /// <param name="talkFps">Fps of the talk animation (base game tends to use around 8)</param>
        ///
        /// <param name="lootTable">Shop loot table</param>
        /// <param name="currency">What is used to buy items at the shop</param>
        ///
        /// <param name="runBasedMultilineGenericStringKey">String key for normal convos</param>
        /// <param name="runBasedMultilineStopperStringKey">String key for if you try talking to an npc to much</param>
        /// <param name="purchaseItemStringKey">String key for when the player buys something</param>
        /// <param name="purchaseItemFailedStringKey">String key for when the player tries but fails to buy something</param>
        /// <param name="introStringKey">String key for when the player enters the room</param>
        /// <param name="attackedStringKey">String key for when the player shoots at the npc</param>
        /// <param name="costModifier">The multiplier for shop prices</param>
        /// <param name="itemPositions">The offset for the item(s) sold by your npc, the amount of items sold is based off how many offsets you add here (if you just want the 3 normally items spots you can use ItsDaFuckinShopApi.defaultItemPositions)</param>
        /// <param name="giveStatsOnPurchase">Whether the shop modifies stats after the player buys an item for example how cursula gives curse</param>
        /// <param name="statsToGiveOnPurchase"> The stats given when the player buys an item (will be ingored if statsToGiveOnPurchase is false)</param>
        ///
        /// <param name="CustomCanBuy">The method that gets called to check if the player can buy an item (useless if currency isnt set to CUSTOM)</param>
        /// <param name="CustomRemoveCurrency">The method that gets called remove currency from the player (useless if currency isnt set to CUSTOM)</param>
        /// <param name="CustomPrice">The method that gets called to get the price of an item (useless if currency isnt set to CUSTOM)</param>
        ///
        /// <param name="currencyIconPath">Sprite path for your custom currency sprite</param>
        /// <param name="currencyName">The name you want your custom currecy sprite to have (i should probably remove this...)</param>
        ///
        /// <param name="hasCarpet">Whether the shop has a carpet or something else that they sit on</param>
        /// <param name="carpetSpritePath">Sprite path for the carpet or whatever</param>
        ///
        /// <param name="hasMinimapIcon">Whether the shop has a minimap icon to show what room theyre in</param>
        /// <param name="minimapIconSpritePath">Sprite path minimap icon leave blank to just use deafult smiley face</param>
        ///
        /// <param name="addToMainNpcPool">Whether the shop should be added to the pool of npcs that show up in the main shop a long side bello</param>
        /// <param name="percentChanceForMainPool">How likely it is for the shop to show up in the main pool base game shops use 0.1</param>
        ///
        /// <param name="prerequisites">These do unlocks and shit</param>
        /// <returns></returns>
        public static GameObject SetUpShop(string name, string prefix, List <string> idleSpritePaths, int idleFps, List <string> talkSpritePaths, int talkFps, GenericLootTable lootTable, CustomShopItemController.ShopCurrencyType currency, string runBasedMultilineGenericStringKey,
                                           string runBasedMultilineStopperStringKey, string purchaseItemStringKey, string purchaseItemFailedStringKey, string introStringKey, string attackedStringKey, Vector3 talkPointOffset, Vector3[] itemPositions = null, float costModifier = 1, bool giveStatsOnPurchase = false,
                                           StatModifier[] statsToGiveOnPurchase = null, Func <CustomShopController, PlayerController, int, bool> CustomCanBuy           = null, Func <CustomShopController, PlayerController, int, int> CustomRemoveCurrency = null, Func <CustomShopController, CustomShopItemController, PickupObject, int> CustomPrice = null,
                                           Func <PlayerController, PickupObject, int, bool> OnPurchase = null, Func <PlayerController, PickupObject, int, bool> OnSteal = null, string currencyIconPath = "", string currencyName = "", bool canBeRobbed = true, bool hasCarpet = false, string carpetSpritePath = "", bool hasMinimapIcon = false,
                                           string minimapIconSpritePath = "", bool addToMainNpcPool = false, float percentChanceForMainPool = 0.1f, DungeonPrerequisite[] prerequisites = null)
        {
            try
            {
                if (prerequisites == null)
                {
                    prerequisites = new DungeonPrerequisite[0];
                }
                //bool isBreachShop = false;
                Vector3 breachPos = Vector3.zero;

                var shared_auto_001 = ResourceManager.LoadAssetBundle("shared_auto_001");
                var shared_auto_002 = ResourceManager.LoadAssetBundle("shared_auto_002");
                var SpeechPoint     = new GameObject("SpeechPoint");
                SpeechPoint.transform.position = talkPointOffset;



                var npcObj = SpriteBuilder.SpriteFromResource(idleSpritePaths[0], new GameObject(prefix + ":" + name));

                FakePrefab.MarkAsFakePrefab(npcObj);
                UnityEngine.Object.DontDestroyOnLoad(npcObj);
                npcObj.SetActive(false);

                npcObj.layer = 22;

                var collection = npcObj.GetComponent <tk2dSprite>().Collection;
                SpeechPoint.transform.parent = npcObj.transform;

                FakePrefab.MarkAsFakePrefab(SpeechPoint);
                UnityEngine.Object.DontDestroyOnLoad(SpeechPoint);
                SpeechPoint.SetActive(true);


                var idleIdsList = new List <int>();
                var talkIdsList = new List <int>();

                foreach (string sprite in idleSpritePaths)
                {
                    idleIdsList.Add(SpriteBuilder.AddSpriteToCollection(sprite, collection));
                }

                foreach (string sprite in talkSpritePaths)
                {
                    talkIdsList.Add(SpriteBuilder.AddSpriteToCollection(sprite, collection));
                }

                tk2dSpriteAnimator spriteAnimator = npcObj.AddComponent <tk2dSpriteAnimator>();

                SpriteBuilder.AddAnimation(spriteAnimator, collection, idleIdsList, name + "_idle", tk2dSpriteAnimationClip.WrapMode.Loop, idleFps);
                SpriteBuilder.AddAnimation(spriteAnimator, collection, talkIdsList, name + "_talk", tk2dSpriteAnimationClip.WrapMode.Loop, talkFps);

                SpeculativeRigidbody rigidbody = GenerateOrAddToRigidBody(npcObj, CollisionLayer.BulletBlocker, PixelCollider.PixelColliderGeneration.Manual, true, true, true, false, false, false, false, true, new IntVector2(20, 18), new IntVector2(5, 0));

                TalkDoerLite talkDoer = npcObj.AddComponent <TalkDoerLite>();

                talkDoer.placeableWidth  = 4;
                talkDoer.placeableHeight = 3;
                talkDoer.difficulty      = 0;
                talkDoer.isPassable      = true;
                talkDoer.usesOverrideInteractionRegion = false;
                talkDoer.overrideRegionOffset          = Vector2.zero;
                talkDoer.overrideRegionDimensions      = Vector2.zero;
                talkDoer.overrideInteractionRadius     = -1;
                talkDoer.PreventInteraction            = false;
                talkDoer.AllowPlayerToPassEventually   = true;
                talkDoer.speakPoint              = SpeechPoint.transform;
                talkDoer.SpeaksGleepGlorpenese   = false;
                talkDoer.audioCharacterSpeechTag = "oldman";
                talkDoer.playerApproachRadius    = 5;
                talkDoer.conversationBreakRadius = 5;
                talkDoer.echo1 = null;
                talkDoer.echo2 = null;
                talkDoer.PreventCoopInteraction = false;
                talkDoer.IsPaletteSwapped       = false;
                talkDoer.PaletteTexture         = null;
                talkDoer.OutlineDepth           = 0.5f;
                talkDoer.OutlineLuminanceCutoff = 0.05f;
                talkDoer.MovementSpeed          = 3;
                talkDoer.PathableTiles          = CellTypes.FLOOR;


                UltraFortunesFavor dreamLuck = npcObj.AddComponent <UltraFortunesFavor>();

                dreamLuck.goopRadius          = 2;
                dreamLuck.beamRadius          = 2;
                dreamLuck.bulletRadius        = 2;
                dreamLuck.bulletSpeedModifier = 0.8f;

                dreamLuck.vfxOffset      = 0.625f;
                dreamLuck.sparkOctantVFX = shared_auto_001.LoadAsset <GameObject>("FortuneFavor_VFX_Spark");


                AIAnimator aIAnimator = GenerateBlankAIAnimator(npcObj);
                aIAnimator.spriteAnimator = spriteAnimator;
                aIAnimator.IdleAnimation  = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.Single,
                    Prefix    = name + "_idle",
                    AnimNames = new string[]
                    {
                        ""
                    },
                    Flipped = new DirectionalAnimation.FlipType[]
                    {
                        DirectionalAnimation.FlipType.None
                    }
                };

                aIAnimator.TalkAnimation = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.Single,
                    Prefix    = name + "_talk",
                    AnimNames = new string[]
                    {
                        ""
                    },
                    Flipped = new DirectionalAnimation.FlipType[]
                    {
                        DirectionalAnimation.FlipType.None
                    }
                };

                var basenpc = ResourceManager.LoadAssetBundle("shared_auto_001").LoadAsset <GameObject>("Merchant_Key").transform.Find("NPC_Key").gameObject;

                PlayMakerFSM iHaveNoFuckingClueWhatThisIs = npcObj.AddComponent <PlayMakerFSM>();

                UnityEngine.JsonUtility.FromJsonOverwrite(UnityEngine.JsonUtility.ToJson(basenpc.GetComponent <PlayMakerFSM>()), iHaveNoFuckingClueWhatThisIs);

                FieldInfo fsmStringParams = typeof(ActionData).GetField("fsmStringParams", BindingFlags.NonPublic | BindingFlags.Instance);

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[1].ActionData) as List <FsmString>)[0].Value = runBasedMultilineGenericStringKey;
                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[1].ActionData) as List <FsmString>)[1].Value = runBasedMultilineStopperStringKey;

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[4].ActionData) as List <FsmString>)[0].Value = purchaseItemStringKey;

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[5].ActionData) as List <FsmString>)[0].Value = purchaseItemFailedStringKey;

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[7].ActionData) as List <FsmString>)[0].Value = introStringKey;

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[8].ActionData) as List <FsmString>)[0].Value = attackedStringKey;

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[9].ActionData) as List <FsmString>)[0].Value = "#SUBSHOP_GENERIC_CAUGHT_STEALING";

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[10].ActionData) as List <FsmString>)[0].Value = "#SHOP_GENERIC_NO_SALE_LABEL";

                (fsmStringParams.GetValue(iHaveNoFuckingClueWhatThisIs.FsmStates[12].ActionData) as List <FsmString>)[0].Value = "#COOP_REBUKE";


                npcObj.name = prefix + ":" + name;

                var posList = new List <Transform>();
                for (int i = 0; i < itemPositions.Length; i++)
                {
                    var ItemPoint = new GameObject("ItemPoint" + i);
                    ItemPoint.transform.position = itemPositions[i];
                    FakePrefab.MarkAsFakePrefab(ItemPoint);
                    UnityEngine.Object.DontDestroyOnLoad(ItemPoint);
                    ItemPoint.SetActive(true);
                    posList.Add(ItemPoint.transform);
                }

                var ItemPoint1 = new GameObject("ItemPoint1");
                ItemPoint1.transform.position = new Vector3(1.125f, 2.125f, 1);
                FakePrefab.MarkAsFakePrefab(ItemPoint1);
                UnityEngine.Object.DontDestroyOnLoad(ItemPoint1);
                ItemPoint1.SetActive(true);
                var ItemPoint2 = new GameObject("ItemPoint2");
                ItemPoint2.transform.position = new Vector3(2.625f, 1f, 1);
                FakePrefab.MarkAsFakePrefab(ItemPoint2);
                UnityEngine.Object.DontDestroyOnLoad(ItemPoint2);
                ItemPoint2.SetActive(true);
                var ItemPoint3 = new GameObject("ItemPoint3");
                ItemPoint3.transform.position = new Vector3(4.125f, 2.125f, 1);
                FakePrefab.MarkAsFakePrefab(ItemPoint3);
                UnityEngine.Object.DontDestroyOnLoad(ItemPoint3);
                ItemPoint3.SetActive(true);


                var shopObj = new GameObject(prefix + ":" + name + "_Shop").AddComponent <CustomShopController>();
                FakePrefab.MarkAsFakePrefab(shopObj.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(shopObj.gameObject);

                shopObj.gameObject.SetActive(false);

                shopObj.currencyType = currency;

                shopObj.ActionAndFuncSetUp(CustomCanBuy, CustomRemoveCurrency, CustomPrice, OnPurchase, OnSteal);

                if (!string.IsNullOrEmpty(currencyIconPath))
                {
                    shopObj.customPriceSprite = AddCustomCurrencyType(currencyIconPath, $"{prefix}:{currencyName}");
                }
                else
                {
                    shopObj.customPriceSprite = currencyName;
                }


                //GungeonAPI.ToolsGAPI.AddNewItemToAtlas()

                shopObj.canBeRobbed = canBeRobbed;

                shopObj.placeableHeight = 5;
                shopObj.placeableWidth  = 5;
                shopObj.difficulty      = 0;
                shopObj.isPassable      = true;
                shopObj.baseShopType    = BaseShopController.AdditionalShopType.TRUCK;//shopType;

                shopObj.FoyerMetaShopForcedTiers = false;
                shopObj.IsBeetleMerchant         = false;
                shopObj.ExampleBlueprintPrefab   = null;
                shopObj.shopItems      = lootTable;
                shopObj.spawnPositions = posList.ToArray();//{ ItemPoint1.transform, ItemPoint2.transform, ItemPoint3.transform };

                foreach (var pos in shopObj.spawnPositions)
                {
                    pos.parent = shopObj.gameObject.transform;
                }

                shopObj.shopItemsGroup2          = null;
                shopObj.spawnPositionsGroup2     = null;
                shopObj.spawnGroupTwoItem1Chance = 0.5f;
                shopObj.spawnGroupTwoItem2Chance = 0.5f;
                shopObj.spawnGroupTwoItem3Chance = 0.5f;
                shopObj.shopkeepFSM          = npcObj.GetComponent <PlayMakerFSM>();
                shopObj.shopItemShadowPrefab = shared_auto_001.LoadAsset <GameObject>("Merchant_Key").GetComponent <BaseShopController>().shopItemShadowPrefab;

                shopObj.prerequisites = prerequisites;
                //shopObj.shopItemShadowPrefab =

                shopObj.cat = null;


                if (hasMinimapIcon)
                {
                    if (!string.IsNullOrEmpty(minimapIconSpritePath))
                    {
                        shopObj.OptionalMinimapIcon = SpriteBuilder.SpriteFromResource(minimapIconSpritePath);
                        UnityEngine.Object.DontDestroyOnLoad(shopObj.OptionalMinimapIcon);
                        FakePrefab.MarkAsFakePrefab(shopObj.OptionalMinimapIcon);
                    }
                    else
                    {
                        shopObj.OptionalMinimapIcon = ResourceCache.Acquire("Global Prefabs/Minimap_NPC_Icon") as GameObject;
                    }
                }

                shopObj.ShopCostModifier     = costModifier;
                shopObj.FlagToSetOnEncounter = GungeonFlags.NONE;

                shopObj.giveStatsOnPurchase = giveStatsOnPurchase;
                shopObj.statsToGive         = statsToGiveOnPurchase;

                //shopObj.

                /*if (isBreachShop)
                 * {
                 *  shopObj.gameObject.AddComponent<BreachShopComp>().offset = breachPos;
                 *  BreachShopTools.registeredShops.Add(prefix + ":" + name, shopObj.gameObject);
                 *
                 *  shopObj.FoyerMetaShopForcedTiers = true;
                 *
                 *  var exampleBlueprintObj = SpriteBuilder.SpriteFromResource(carpetSpritePath, new GameObject(prefix + ":" + name + "_ExampleBlueprintPrefab"));
                 *  exampleBlueprintObj.GetComponent<tk2dSprite>().SortingOrder = 2;
                 *  FakePrefab.MarkAsFakePrefab(exampleBlueprintObj);
                 *  UnityEngine.Object.DontDestroyOnLoad(exampleBlueprintObj);
                 *  exampleBlueprintObj.SetActive(false);
                 *
                 *  //var item = exampleBlueprintObj.AddComponent<ItemBlueprintItem>();
                 *  //item.quality = PickupObject.ItemQuality.SPECIAL;
                 *  //item.PickupObjectId = 99999999;
                 *
                 *
                 *
                 *  shopObj.ExampleBlueprintPrefab = shared_auto_001.LoadAsset<GameObject>("NPC_Beetle_Merchant_Foyer").GetComponent<BaseShopController>().ExampleBlueprintPrefab;
                 * }*/

                npcObj.transform.parent   = shopObj.gameObject.transform;
                npcObj.transform.position = new Vector3(1.9375f, 3.4375f, 5.9375f);



                if (hasCarpet)
                {
                    var carpetObj = SpriteBuilder.SpriteFromResource(carpetSpritePath, new GameObject(prefix + ":" + name + "_Carpet"));
                    carpetObj.GetComponent <tk2dSprite>().SortingOrder = 2;
                    FakePrefab.MarkAsFakePrefab(carpetObj);
                    UnityEngine.Object.DontDestroyOnLoad(carpetObj);
                    carpetObj.SetActive(true);

                    carpetObj.transform.position = new Vector3(0, 0, 1.7f);
                    carpetObj.transform.parent   = shopObj.gameObject.transform;
                    carpetObj.layer = 20;
                }
                npcObj.SetActive(true);

                if (addToMainNpcPool)
                {
                    shared_auto_002.LoadAsset <DungeonPlaceable>("shopannex_contents_01").variantTiers.Add(new DungeonPlaceableVariant
                    {
                        percentChance           = percentChanceForMainPool,
                        unitOffset              = new Vector2(-0.5f, -1.25f),
                        nonDatabasePlaceable    = shopObj.gameObject,
                        enemyPlaceableGuid      = "",
                        pickupObjectPlaceableId = -1,
                        forceBlackPhantom       = false,
                        addDebrisObject         = false,
                        prerequisites           = prerequisites, //shit for unlocks gose here sooner or later
                        materialRequirements    = new DungeonPlaceableRoomMaterialRequirement[0],
                    });
                }

                ItsDaFuckinShopApi.builtShops.Add(prefix + ":" + name, shopObj.gameObject);
                return(shopObj.gameObject);
            }
            catch (Exception message)
            {
                ETGModConsole.Log(message.ToString());
                return(null);
            }
        }
        private IEnumerator BecomeMimic()
        {
            if (m_hands == null)
            {
                StartCoroutine(DoIntro());
            }

            if (!ChaosConsole.WallMimicsUseRewardManager)
            {
                m_ChaosModeActive = true;
            }
            if (m_GlitchModeActive)
            {
                m_ItemDropOdds += 0.2f; m_FriendlyMimicOdds += 0.2f;
            }

            m_isHidden = false;
            SpeculativeRigidbody specRigidbody = this.specRigidbody;

            specRigidbody.OnRigidbodyCollision = (SpeculativeRigidbody.OnRigidbodyCollisionDelegate)Delegate.Remove(specRigidbody.OnRigidbodyCollision, new SpeculativeRigidbody.OnRigidbodyCollisionDelegate(HandleRigidbodyCollision));
            SpeculativeRigidbody specRigidbody2 = this.specRigidbody;

            specRigidbody2.OnBeamCollision = (SpeculativeRigidbody.OnBeamCollisionDelegate)Delegate.Remove(specRigidbody2.OnBeamCollision, new SpeculativeRigidbody.OnBeamCollisionDelegate(HandleBeamCollision));
            AIAnimator tongueAnimator = aiAnimator.ChildAnimator;

            tongueAnimator.renderer.enabled       = true;
            tongueAnimator.spriteAnimator.enabled = true;
            AIAnimator spitAnimator = tongueAnimator.ChildAnimator;

            spitAnimator.renderer.enabled       = true;
            spitAnimator.spriteAnimator.enabled = true;
            tongueAnimator.PlayUntilFinished("spawn", false, null, -1f, false);
            float delay        = tongueAnimator.CurrentClipLength;
            float timer        = 0f;
            bool  hasPlayedVFX = false;

            while (timer < delay)
            {
                yield return(null);

                timer += BraveTime.DeltaTime;
                if (!hasPlayedVFX && delay - timer < 0.1f)
                {
                    hasPlayedVFX = true;
                    if (WallDisappearVFX)
                    {
                        Vector2 zero  = Vector2.zero;
                        Vector2 zero2 = Vector2.zero;
                        DungeonData.Direction facingDirection = m_facingDirection;
                        if (facingDirection != DungeonData.Direction.SOUTH)
                        {
                            if (facingDirection != DungeonData.Direction.EAST)
                            {
                                if (facingDirection == DungeonData.Direction.WEST)
                                {
                                    zero  = new Vector2(0f, -1f);
                                    zero2 = new Vector2(0f, 1f);
                                }
                            }
                            else
                            {
                                zero  = new Vector2(0f, -1f);
                                zero2 = new Vector2(0f, 1f);
                            }
                        }
                        else
                        {
                            zero  = new Vector2(0f, -1f);
                            zero2 = new Vector2(0f, 1f);
                        }
                        Vector2 min = Vector2.Min(pos1.ToVector2(), pos2.ToVector2()) + zero;
                        Vector2 max = Vector2.Max(pos1.ToVector2(), pos2.ToVector2()) + new Vector2(1f, 1f) + zero2;
                        for (int i = 0; i < 5; i++)
                        {
                            Vector2        v              = BraveUtility.RandomVector2(min, max, new Vector2(0.25f, 0.25f)) + new Vector2(0f, 1f);
                            GameObject     gameObject     = SpawnManager.SpawnVFX(WallDisappearVFX, v, Quaternion.identity);
                            tk2dBaseSprite tk2dBaseSprite = (!gameObject) ? null : gameObject.GetComponent <tk2dBaseSprite>();
                            if (tk2dBaseSprite)
                            {
                                tk2dBaseSprite.HeightOffGround = 8f;
                                tk2dBaseSprite.UpdateZDepth();
                            }
                        }
                    }
                }
            }
            if (!m_failedWallConfigure && m_GlitchModeActive)
            {
                if (aiActor.ParentRoom != null && GlitchEnemyList != null && GlitchEnemyList.Count > 0 && UnityEngine.Random.value <= m_spawnGitchEnemyOdds)
                {
                    float RandomIntervalFloat       = UnityEngine.Random.Range(0.02f, 0.06f);
                    float RandomDispFloat           = UnityEngine.Random.Range(0.1f, 0.16f);
                    float RandomDispIntensityFloat  = UnityEngine.Random.Range(0.1f, 0.4f);
                    float RandomColorProbFloat      = UnityEngine.Random.Range(0.05f, 0.2f);
                    float RandomColorIntensityFloat = UnityEngine.Random.Range(0.1f, 0.25f);

                    int count2 = this.specRigidbody.PixelColliders.Count;
                    this.specRigidbody.PixelColliders.RemoveAt(count2 - 1);
                    this.specRigidbody.PixelColliders.RemoveAt(count2 - 2);
                    StaticReferenceManager.AllShadowSystemDepthHavers.Remove(m_fakeWall.transform);
                    Destroy(m_fakeWall);
                    Destroy(m_fakeCeiling);

                    Vector3 targetPosForSpawn = m_startingPos + DungeonData.GetIntVector2FromDirection(m_facingDirection).ToVector3();
                    while (timer < delay)
                    {
                        aiAnimator.LockFacingDirection = true;
                        aiAnimator.FacingDirection     = DungeonData.GetAngleFromDirection(m_facingDirection);
                        yield return(null);

                        timer += BraveTime.DeltaTime;
                        transform.position = Vector3.Lerp(m_startingPos, targetPosForSpawn, Mathf.InverseLerp(0.42f, 0.58f, timer));
                        this.specRigidbody.Reinitialize();
                    }
                    yield return(null);

                    Vector3 FinalSpawnLocation             = transform.position;
                    Vector3 VFXExplosionLocation           = transform.position;
                    Vector2 VFXExplosionSource             = Vector2.zero;
                    DungeonData.Direction CurrentDirection = m_facingDirection;
                    if (CurrentDirection == DungeonData.Direction.WEST)
                    {
                        FinalSpawnLocation   += new Vector3(2.5f, 3.5f);
                        VFXExplosionLocation += new Vector3(3.5f, 3.5f);
                        VFXExplosionSource    = new Vector2(1, 0);
                    }
                    else if (CurrentDirection == DungeonData.Direction.EAST)
                    {
                        FinalSpawnLocation   += new Vector3(4f, 3.5f);
                        VFXExplosionLocation += new Vector3(3f, 3.5f);
                    }
                    else if (CurrentDirection == DungeonData.Direction.NORTH)
                    {
                        FinalSpawnLocation   += new Vector3(3.5f, 4f);
                        VFXExplosionLocation += new Vector3(3.5f, 3f);
                        VFXExplosionSource    = new Vector2(0, 1);
                    }
                    else if (CurrentDirection == DungeonData.Direction.SOUTH)
                    {
                        FinalSpawnLocation   += new Vector3(3.5f, 1.5f);
                        VFXExplosionLocation += new Vector3(3.5f, 2.5f);
                    }
                    yield return(null);

                    string        SelectedEnemy          = BraveUtility.RandomElement(GlitchEnemyList);
                    ExplosionData wallMimicExplosionData = new ExplosionData();
                    wallMimicExplosionData.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData);
                    wallMimicExplosionData.damage = 0f;
                    wallMimicExplosionData.force /= 1.6f;

                    if (SelectedEnemy != "RATCORPSE")
                    {
                        Exploder.Explode(VFXExplosionLocation, wallMimicExplosionData, VFXExplosionSource, ignoreQueues: true, damageTypes: CoreDamageTypes.None);
                        GameObject     SpawnVFXObject          = Instantiate((GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof"));
                        tk2dBaseSprite SpawnVFXObjectComponent = SpawnVFXObject.GetComponent <tk2dBaseSprite>();
                        SpawnVFXObjectComponent.PlaceAtPositionByAnchor(FinalSpawnLocation + new Vector3(0f, 0.5f, 0f), tk2dBaseSprite.Anchor.MiddleCenter);
                        SpawnVFXObjectComponent.HeightOffGround = 1f;
                        SpawnVFXObjectComponent.UpdateZDepth();
                        AIActor glitchActor = AIActor.Spawn(EnemyDatabase.GetOrLoadByGuid(SelectedEnemy), FinalSpawnLocation, aiActor.ParentRoom, true, AIActor.AwakenAnimationType.Awaken, true);

                        /*if (aiActor.ParentRoom != null && !aiActor.ParentRoom.IsSealed && !glitchActor.IgnoreForRoomClear) {
                         *  if (GameManager.Instance.PrimaryPlayer.CurrentRoom == aiActor.ParentRoom && aiActor.ParentRoom.EverHadEnemies) {
                         *      aiActor.ParentRoom.SealRoom();
                         *  }
                         * }*/
                        PickupObject.ItemQuality targetGlitchEnemyItemQuality = (UnityEngine.Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.B;
                        GenericLootTable         glitchEnemyLootTable         = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
                        PickupObject             glitchEnemyItem = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetGlitchEnemyItemQuality, glitchEnemyLootTable, false);

                        /*if (BraveUtility.RandomBool()) {
                         *  ChaosUtility.MakeCompanion(glitchActor);
                         * } else {
                         *  ChaosShaders.Instance.ApplyGlitchShader(glitchActor, glitchActor.sprite, true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat);
                         * }*/

                        ChaosShaders.Instance.ApplyGlitchShader(glitchActor, glitchActor.sprite, true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat);

                        if (glitchEnemyItem)
                        {
                            glitchActor.AdditionalSafeItemDrops.Add(glitchEnemyItem);
                        }
                    }
                    else
                    {
                        Exploder.Explode(VFXExplosionLocation, wallMimicExplosionData, VFXExplosionSource, ignoreQueues: true, damageTypes: CoreDamageTypes.None);
                        GameObject     SpawnVFXObject          = Instantiate((GameObject)ResourceCache.Acquire("Global VFX/VFX_Item_Spawn_Poof"));
                        tk2dBaseSprite SpawnVFXObjectComponent = SpawnVFXObject.GetComponent <tk2dBaseSprite>();
                        SpawnVFXObjectComponent.PlaceAtPositionByAnchor(FinalSpawnLocation + new Vector3(0f, 0.5f, 0f), tk2dBaseSprite.Anchor.MiddleCenter);
                        SpawnVFXObjectComponent.HeightOffGround = 1f;
                        SpawnVFXObjectComponent.UpdateZDepth();
                        GameObject   spawnedRatCorpseObject = Instantiate(ChaosPrefabs.RatCorpseNPC, FinalSpawnLocation, Quaternion.identity);
                        TalkDoerLite talkdoerComponent      = spawnedRatCorpseObject.GetComponent <TalkDoerLite>();
                        talkdoerComponent.transform.position.XY().GetAbsoluteRoom().RegisterInteractable(talkdoerComponent);
                        talkdoerComponent.transform.position.XY().GetAbsoluteRoom().TransferInteractableOwnershipToDungeon(talkdoerComponent);
                        talkdoerComponent.playmakerFsm.SetState("Set Mode");
                        ChaosUtility.AddHealthHaver(talkdoerComponent.gameObject, 60, flashesOnDamage: false, exploderSpawnsItem: true);
                    }
                    yield return(null);

                    Destroy(aiActor.gameObject);
                    yield break;
                }
            }
            PickupObject.ItemQuality targetQuality = (UnityEngine.Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.C : PickupObject.ItemQuality.D) : PickupObject.ItemQuality.B;
            GenericLootTable         lootTable     = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
            PickupObject             item          = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);

            if (item)
            {
                if (m_ChaosModeActive)
                {
                    if (UnityEngine.Random.value <= m_ItemDropOdds)
                    {
                        aiActor.AdditionalSafeItemDrops.Add(item);
                    }
                    else
                    {
                        aiActor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(70));
                        if (BraveUtility.RandomBool())
                        {
                            aiActor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(70));
                        }
                        if (m_GlitchModeActive)
                        {
                            aiActor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(70));
                        }
                    }
                    if (UnityEngine.Random.value <= m_FriendlyMimicOdds)
                    {
                        m_isFriendlyMimic = true;
                    }
                }
                else
                {
                    aiActor.AdditionalSafeItemDrops.Add(item);
                }
            }
            else
            {
                if (m_ChaosModeActive && UnityEngine.Random.value <= m_FriendlyMimicOdds)
                {
                    m_isFriendlyMimic = true;
                }
            }
            aiActor.enabled            = true;
            behaviorSpeculator.enabled = true;
            if (aiActor.ParentRoom != null && aiActor.ParentRoom.IsSealed && !m_isFriendlyMimic)
            {
                aiActor.IgnoreForRoomClear = false;
            }
            // if (m_isFriendlyMimic) { ChaosUtility.MakeCompanion(aiActor); }
            if (m_isFriendlyMimic)
            {
                aiActor.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null);
            }
            if (!m_failedWallConfigure)
            {
                int count = this.specRigidbody.PixelColliders.Count;
                for (int j = 0; j < count - 2; j++)
                {
                    this.specRigidbody.PixelColliders[j].Enabled = true;
                }
                this.specRigidbody.PixelColliders.RemoveAt(count - 1);
                this.specRigidbody.PixelColliders.RemoveAt(count - 2);
                StaticReferenceManager.AllShadowSystemDepthHavers.Remove(m_fakeWall.transform);
                Destroy(m_fakeWall);
                Destroy(m_fakeCeiling);
            }
            else
            {
                int count = this.specRigidbody.PixelColliders.Count;
                for (int j = 0; j < count; j++)
                {
                    this.specRigidbody.PixelColliders[j].Enabled = true;
                }
            }
            for (int k = 0; k < m_hands.Length; k++)
            {
                m_hands[k].gameObject.SetActive(true);
            }
            aiActor.ToggleRenderers(true);
            if (aiShooter)
            {
                aiShooter.ToggleGunAndHandRenderers(true, "ChaosWallMimicController");
            }
            aiActor.IsGone           = false;
            healthHaver.IsVulnerable = true;
            aiActor.State            = AIActor.ActorState.Normal;
            for (int l = 0; l < m_hands.Length; l++)
            {
                m_hands[l].gameObject.SetActive(false);
            }
            m_isFinished = true;
            delay        = 0.58f;
            timer        = 0f;
            Vector3 targetPos = m_startingPos + DungeonData.GetIntVector2FromDirection(m_facingDirection).ToVector3();

            while (timer < delay)
            {
                aiAnimator.LockFacingDirection = true;
                aiAnimator.FacingDirection     = DungeonData.GetAngleFromDirection(m_facingDirection);
                yield return(null);

                timer += BraveTime.DeltaTime;
                transform.position = Vector3.Lerp(m_startingPos, targetPos, Mathf.InverseLerp(0.42f, 0.58f, timer));
                this.specRigidbody.Reinitialize();
            }
            aiAnimator.LockFacingDirection = false;
            knockbackDoer.SetImmobile(false, "ChaosWallMimicController");
            aiActor.CollisionDamage            = 0.5f;
            aiActor.CollisionKnockbackStrength = m_collisionKnockbackStrength;
            yield break;
        }
        private IEnumerator DoRickRoll()
        {
            yield return(new WaitForSeconds(0.1f));

            GameObject m_RickRollInstance = Instantiate(RickRollAnimationObject, (transform.position + new Vector3(0.1f, 0.5f, 0)), Quaternion.identity);
            Vector3    RickScale          = new Vector2(0.2f, 0.2f).ToVector3ZUp(1f);

            m_RickRollInstance.layer = LayerMask.NameToLayer("Unpixelated");
            m_RickRollInstance.transform.localScale = RickScale;
            if (majorBreakable)
            {
                majorBreakable.TemporarilyInvulnerable = true;
            }
            if (sprite)
            {
                sprite.HeightOffGround = -2f; sprite.UpdateZDepth();
            }
            tk2dSpriteAnimator m_RickRollAnimator = m_RickRollInstance.GetComponent <tk2dSpriteAnimator>();

            m_RickRollAnimator.Play("RickRollAnimation_Rise");
            while (m_RickRollAnimator.IsPlaying("RickRollAnimation_Rise"))
            {
                yield return(null);
            }
            m_RickRollAnimator.Play("RickRollAnimation");
            if (!ExpandSettings.youtubeSafeMode)
            {
                AkSoundEngine.PostEvent("Play_EX_RickRollMusic_01", gameObject);
            }
            else
            {
                GameManager.Instance.StartCoroutine(DoYouTubeSafeAnnouncement(new Vector3(1.5f, 3.5f)));
            }
            yield return(new WaitForSeconds(10));

            Destroy(m_RickRollInstance);
            if (majorBreakable)
            {
                majorBreakable.TemporarilyInvulnerable = false;
            }
            yield return(null);

            spriteAnimator.Play(breakAnimName);
            specRigidbody.enabled = false;
            IsBroken = true;
            Transform shadowTransform = transform.Find("Expand_RickRollChestShadow");

            if (shadowTransform != null)
            {
                Destroy(shadowTransform.gameObject);
            }
            if (m_room.npcSealState != RoomHandler.NPCSealState.SealNone)
            {
                m_room.npcSealState = RoomHandler.NPCSealState.SealNone;
            }
            Exploder.DoDefaultExplosion(sprite.WorldCenter, Vector2.zero, null, true, CoreDamageTypes.None, false);
            yield return(null);

            PickupObject.ItemQuality targetQuality = (UnityEngine.Random.value >= 0.2f) ? ((!BraveUtility.RandomBool()) ? PickupObject.ItemQuality.B : PickupObject.ItemQuality.C) : PickupObject.ItemQuality.B;
            GenericLootTable         lootTable     = (!BraveUtility.RandomBool()) ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable;
            PickupObject             item          = LootEngine.GetItemOfTypeAndQuality <PickupObject>(targetQuality, lootTable, false);

            if (item)
            {
                LootEngine.SpawnItem(item.gameObject, sprite.WorldCenter, Vector2.zero, 0f, true, true, false);
            }
            yield break;
        }
        public static void Init()
        {
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "I sell, yes, you! Buy! Cash yes money yes yes yes!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "Rusty sells trash people throw at him. Make easy money. Heheh. Fools.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "You want to talk to Rusty? Nobody ever talks to Rusty.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "I used to be taaaaall once, yes, yes. Taaaall, and red. Red.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "They laugh at Rusty, yes... they all laugh...");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "Rusty has seen things... things you are not ready to see.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "Chambers lurk below. Places you've never seen. Perhaps you will be ready one day, yes.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "Don't trust the mad bullet Alhazard. Rusty trusted him, and is now Rusty.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "What is it like. To have skin. Rusty wonders?");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "One day you and Rusty will be not so different, rustythinks yes.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_GENERIC_TALK", "One day, the skies will run black with the ichor of ages, and all will be unloaded...  what?");

            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_STOPPER_TALK", "You are boring. Rusty is bored yes bored no yes");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_STOPPER_TALK", "Rusty has no more to say to you, no, no.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_STOPPER_TALK", "Mmmmm, yesyesyesyesyesyesyes.");

            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_PURCHASE_TALK", "YesYes! Deal Yes! Buy!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_PURCHASE_TALK", "A good choice, yes!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_PURCHASE_TALK", "A poor choice, yes!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_PURCHASE_TALK", "Rusty lives another day.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_PURCHASE_TALK", "Rusty will buy a new can of polish!");


            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_NOSALE_TALK", "No. TooCheap. Even for me, hehehehehehh");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_NOSALE_TALK", "Cash, upfront. No credit.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_NOSALE_TALK", "Rusty no give credit. You come back when you're richer!");

            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_INTRO_TALK", "Oh! You are back! Yes! Heheh! BuyBuy!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_INTRO_TALK", "You Live! Rusty is Glad! Yes!");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_INTRO_TALK", "Wallet person returns, yes, with wallet gold?");

            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_ATTACKED_TALK", "Rusty no die. Rusty live forever.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_ATTACKED_TALK", "If killing Rusty was that easy, Rusty would be dead.");
            ETGMod.Databases.Strings.Core.AddComplex("#RUSTY_ATTACKED_TALK", "Rusty think you are a %&**@. Yes.");

            List<int> LootTable = new List<int>()
            {
                120, //Armour
                224, //Blank
                127, //Junk
                558, //Bottle
                108, //Bomb
                109, //Ice Bomb
                66, //Proximity Mine
                308, //Cluster Mine
                136, //C4
                366, //Molotov
                234, //iBomb Companion App
                77, //Supply Drop
                403, //Melted Rock
                432, //Jar of Bees
                447, //Shield of the Maiden
                644, //Portable Table Device
                573, //Chest Teleporter
                65, //Knife Shield
                250, //Grappling Hook
                353, //Enraging Photo
                488, //Ring of Chest Vampirism
                256, //Heavy Boots
                137, //Map
                565, //Glass Guon Stone
                306, //Escape Rope
                106, //Jetpack
                487, //Book of Chest Anatomy
                197, //Pea Shooter
                56, //38 Special
                378, //Derringer
                539, //Boxing Glove
                79, //Makarov
                8, //Bow
                9, //Dueling Pistol
                202, //Sawed Off
                122, //Blunderbuss
                12, //Crossbow
                31, //Klobbe
                181, //Winchester Rifle
                327, //Corsair
                577, //Turbo Gun
                196, //Fossilized Gun
                10, //Mega Douser
                363, //Trick Gun
                33, //Tear Jerker
                176, //Gungeon Ant
                440, //Ruby Bracelet

                //MY ITEMS
                MistakeBullets.MistakeBulletsID,
                TracerRound.TracerRoundsID,
                IronSights.IronSightsID,
                GlassChamber.GlassChamberID,
                BulletBoots.BulletBootsID,
                DiamondBracelet.DiamondBraceletID,
                PearlBracelet.PearlBraceletID,
                RingOfAmmoRedemption.RingOfAmmoRedemptionID,
                MapFragment.MapFragmentID,
                GunGrease.GunGreaseID,
                LuckyCoin.LuckyCoinID,
                AppleActive.AppleID,
                SpeedPotion.SpeedPotionID,
                ShroomedGun.ShroomedGunID,
                Glock42.Glock42ID,
                DiscGun.DiscGunID,
                Purpler.PurplerID,
                TheLodger.TheLodgerID,
                HeatRay.HeatRayID,
            };

            RustyLootTable = LootTableTools.CreateLootTable();
            foreach (int i in LootTable)
            {
                RustyLootTable.AddItemToPool(i);
            }

            GameObject rustyObj = ItsDaFuckinShopApi.SetUpShop(
                         "Rusty", //Name
                         "omitb", //ModName
                         new List<string>() //Idle Sprite Paths
                         {
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_001",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_002",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_003",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_004",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_005",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_idle_006",
                         },
                         12, //Idle FPS
                         new List<string>() //Talk Sprite Paths
                         {
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_talk_001",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_talk_002",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_talk_003",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_talk_004",
                        "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_talk_005",
                         },

                         12, //Talk FPS
                         //Loot Table
                         RustyLootTable, 
                         //Currency
                         CustomShopItemController.ShopCurrencyType.COINS,
                         //Dialogue Strings
                         "#RUSTY_GENERIC_TALK", 
                         "#RUSTY_STOPPER_TALK",
                         "#RUSTY_PURCHASE_TALK",
                         "#RUSTY_NOSALE_TALK",
                         "#RUSTY_INTRO_TALK",
                         "#RUSTY_ATTACKED_TALK",
                         //Text Box Offset
                         new Vector3(1, 1.5f, 0),
                         //Item positions
                         ItsDaFuckinShopApi.defaultItemPositions,
                         //Price mult
                         0.5f,
                         //Give Stats on Purchase
                         false,
                         //Stats to give on purchase
                         null,
                         //Custom Can Buy
                         null,
                         //Custom Remove Currency
                         null,
                         //Custom Price
                         null,
                         //On Purchase
                         RustyBuy,
                         // On Steal
                         RustySteal,
                         //Currency Icon
                         null,
                         //Currency name
                         null,
                         //Can be robbed
                         true,
                         //Has Carpet
                         true,
                         //Carpet Sprite
                         "NevernamedsItems/Resources/NPCSprites/Rusty/rustycarpet",
                         //Has Minimap Icon
                         true,
                         //Minimap icon path
                         "NevernamedsItems/Resources/NPCSprites/Rusty/rusty_mapicon",
                         //Add to bello shop
                         true,
                         0.1f
                         );

            PrototypeDungeonRoom Mod_Shop_Room = RoomFactory.BuildFromResource("NevernamedsItems/Resources/EmbeddedRooms/RustyRoom.room").room;
            ItsDaFuckinShopApi.RegisterShopRoom(rustyObj, Mod_Shop_Room, new UnityEngine.Vector2(7f, 6));
        }
Example #14
0
        public static void Init()
        {
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "The Gungeon is a tough place, it pays to have thick skin.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "My pepaw always told me to stay prepared. So that's what I do.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "The cost of being heavily armoured is never letting anyone in.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "Names Ironside. I specialise in armour and protective supplies.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "Like the carpet? I got it custom made.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "Blanks are all well and good, but you're not always going to have them. Ask yourself, do you want bullets goin' straight to your heart(s)?");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "I have done and I have dared, for everything to be prepared.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "Did you see that tarnished old slug rooting around in my garbage? What a freak.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_GENERIC_TALK", "Armour up Gungeoneer, the road ahead is long and the bullets don't get any softer.");

            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_STOPPER_TALK", "No more chit-chat.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_STOPPER_TALK", "I don't have time to talk longer.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_STOPPER_TALK", "Got things to be, places to do.");

            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_PURCHASE_TALK", "Pleasure doin' business with you.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_PURCHASE_TALK", "Pays to be prepared.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_PURCHASE_TALK", "Armoured and ready!");

            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_NOSALE_TALK", "You'd better get out there and find some more armour.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_NOSALE_TALK", "Sorry pal, no shields no sale.");

            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_INTRO_TALK", "AVAST FIEND- Oh, no. It's just you.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_INTRO_TALK", "Staying safe out there?");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_INTRO_TALK", "Welcome back, you're looking beat up.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_INTRO_TALK", "Good grief... I didn't know someone could have that many bruises.");

            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_ATTACKED_TALK", "Hah, no way you're getting through this armour!");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_ATTACKED_TALK", "Nice try, but one of us is squishy and it ain't me.");
            ETGMod.Databases.Strings.Core.AddComplex("#IRONSIDE_ATTACKED_TALK", "You're gonna wish you hadn't done that one day.");

            List <int> LootTable = new List <int>()
            {
                160, //Gunknight Stuff
                161,
                162,
                163,
                450, //Armor Synthesizer
                147, //Armor of Thorns
                64,  //Potion of Lead Skin
                65,  //Knife Shield
                380, //Betrayers Shield
                447, //Shield of the Maiden
                634, //Crisis Stone
                111, //Heavy Bullets
                256, //Heavy Boots
                564, //Full Metal Jacket
                290, //Sunglasses
                312, //Blast Helmet
                314, //Nanomachines
                454, //Hazmat Suit
                598, //Stone Dome
                545, //AC-15
                178, //Crestfaller
                154, //Trashcannon
                FullArmourJacket.FullArmourJacketID,
                KnightlyBullets.KnightlyBulletsID,
                ArmourBandage.ArmourBandageID,
                GoldenArmour.GoldenArmourID,
                ExoskeletalArmour.MeatShieldID,
                ArmouredArmour.ArmouredArmourID,
                KeyBullwark.KeyBulwarkID,
                TinHeart.TinHeartID,
                HeavyChamber.HeavyChamberID,
                TableTechInvulnerability.TableTechInvulnerabilityID,
                LiquidMetalBody.LiquidMetalBodyID,
                HornedHelmet.HornedHelmetID,
                LeadSoul.LeadSoulID,
                GSwitch.GSwitchID,
                MaidenRifle.MaidenRifleID,
                RapidRiposte.RapidRiposteID,
                Converter.ConverterID,
            };

            IronsideLootTable = LootTableTools.CreateLootTable();
            foreach (int i in LootTable)
            {
                IronsideLootTable.AddItemToPool(i);
            }

            GameObject ironsideObj = ItsDaFuckinShopApi.SetUpShop(
                "Ironside",
                "omitb",
                new List <string>()
            {
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_idle_001",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_idle_002",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_idle_003",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_idle_004",
            },
                8,
                new List <string>()
            {
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_001",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_002",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_003",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_004",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_005",
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_talk_006",
            },
                12,
                IronsideLootTable,
                CustomShopItemController.ShopCurrencyType.CUSTOM,
                "#IRONSIDE_GENERIC_TALK",
                "#IRONSIDE_STOPPER_TALK",
                "#IRONSIDE_PURCHASE_TALK",
                "#IRONSIDE_NOSALE_TALK",
                "#IRONSIDE_INTRO_TALK",
                "#IRONSIDE_ATTACKED_TALK",
                new Vector3(1, 2.5f, 0),
                ItsDaFuckinShopApi.defaultItemPositions,
                1f,
                false,
                null,
                Ironside.IronsideCustomCanBuy,
                Ironside.IronsideCustomRemoveCurrency,
                Ironside.IronsideCustomPrice,
                IronsideBuy,
                null,
                "NevernamedsItems/Resources/NPCSprites/Ironside/armourcurrency_icon.png",
                "Armor",
                true,
                true,
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_carpet",
                true,
                "NevernamedsItems/Resources/NPCSprites/Ironside/ironside_mapicon",
                true,
                0.1f
                );

            PrototypeDungeonRoom Mod_Shop_Room = RoomFactory.BuildFromResource("NevernamedsItems/Resources/EmbeddedRooms/IronsideRoom.room").room;

            ItsDaFuckinShopApi.RegisterShopRoom(ironsideObj, Mod_Shop_Room, new UnityEngine.Vector2(7f, 9));
        }
Example #15
0
        public static void Init()
        {
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "Explosions are the spice of life! ...and death.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "Name's Boomhildr, demolitions expert, self taught, at yer service.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "My legs? Got taken clean off by a dynamite explosion! It's what made me want to go into pyrotechnics!");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "My arm? ...it was bitten off by a gator, why do you ask.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "My eye? It was shot out. By a bomb. With a gun.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "What am I here for?... none of your business.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "There was a little claymore running around here a while ago, screaming something about 'Booms'. Pretty cool guy.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "Some weirdo keeps coming by and calling me an 'Angel of Death'. What's up with that?");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "I've got all the boom you could ask for. Boom comin' out the ears.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "Me and Cursula knew each other in college... before she got into mumbo jumbo.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_GENERIC_TALK", "My mama always used to say that frag grenades are the fireworks of explosive warfare.");

            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_STOPPER_TALK", "Not now, got powder to mix, fuses to braid, you know the deal.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_STOPPER_TALK", "I'm busy riggin' up for a big blast.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_STOPPER_TALK", "Listen pal, I've only got so much patience for blabbermouths.");

            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_PURCHASE_TALK", "Thanks for the cash.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_PURCHASE_TALK", "Have fun blowing &%*! up.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_PURCHASE_TALK", "Send 'em to kingdom come for me!");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_PURCHASE_TALK", "Boom-boom-boom-boom, amirite?");

            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_NOSALE_TALK", "Sorry mate, nothin' in this world is free.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_NOSALE_TALK", "Good explosives aren't cheap.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_NOSALE_TALK", "I'm not running a charity here.");

            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_INTRO_TALK", "You're back. And with all your limbs too.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_INTRO_TALK", "Blow up anyone special lately?");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_INTRO_TALK", "See any good blasts out there in the Gungeon?");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_INTRO_TALK", "Want a bomb? I've got bombs. Let's talk.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_INTRO_TALK", "Bombs? Bombs? Bombs? You want it? It's yours, my friend- as long as you have enough cash.");

            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_ATTACKED_TALK", "Watch it buster.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_ATTACKED_TALK", "No need to be jealous.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_ATTACKED_TALK", "You're gonna blow your chances.");
            ETGMod.Databases.Strings.Core.AddComplex("#BOOMHILDR_ATTACKED_TALK", "I can bring this whole chamber down on our heads, and you're attacking me?");

            List <int> LootTable = new List <int>()
            {
                108, //Bomb
                109, //Ice Bomb
                460, //Chaff Grenade
                66,  //Proximity Mine
                308, //Cluster Mine
                136, //C4
                252, //Air Strike
                443, //Big Boy
                567, //Roll Bomb
                234, //iBomb Companion App
                438, //Explosive Decoy
                403, //Melted Rock
                304, //Explosive Rounds
                312, //Blast Helmet
                398, //Table Tech Rocket
                440, //Ruby Bracelet
                601, //Big Shotgun
                4,   //Sticky Crossbow
                542, //Strafe Gun
                96,  //M16
                6,   //Zorgun
                81,  //Deck4rd
                274, //Dark Marker
                39,  //RPG
                19,  //Grenade Launcher
                92,  //Stinger
                563, //The Exotic
                129, //Com4nd0
                372, //RC Rocket
                16,  //Yari Launcher
                332, //Lil Bomber
                180, //Grasschopper
                593, //Void Core Cannon
                362, //Bullet Bore
                186, //Machine Fist
                28,  //Mailbox
                339, //Mahoguny
                478, //Banana

                NitroBullets.NitroBulletsID,
                AntimatterBullets.AntimatterBulletsID,
                BombardierShells.BombardierShellsID,
                Blombk.BlombkID,
                Nitroglycylinder.NitroglycylinderID,
                GunpowderPheromones.GunpowderPheromonesID,
                RocketMan.RocketManID,
                ChemGrenade.ChemGrenadeID,
                InfantryGrenade.InfantryGrenadeID,
                BomberJacket.ID,
                Bombinomicon.ID,
                MagicMissile.ID,
                GrenadeShotgun.GrenadeShotgunID,
                Felissile.ID,
                TheThinLine.ID,
                RocketPistol.ID,
                Demolitionist.DemolitionistID,
                HandMortar.ID,
                FireLance.FireLanceID,
                DynamiteLauncher.DynamiteLauncherID,
                BottleRocket.ID,
                NNBazooka.BazookaID,
                BoomBeam.ID,
                Pillarocket.ID,
            };

            BoomhildrLootTable = LootTableTools.CreateLootTable();
            foreach (int i in LootTable)
            {
                BoomhildrLootTable.AddItemToPool(i);
            }

            GameObject boomhildrObj = ItsDaFuckinShopApi.SetUpShop(
                "Boomhildr",
                "omitb",
                new List <string>()
            {
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_idle_001",
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_idle_002",
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_idle_003",
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_idle_004",
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_idle_005",
            },
                7,
                new List <string>()
            {
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_talk_001",
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_talk_002",
            },
                3,
                BoomhildrLootTable,
                CustomShopItemController.ShopCurrencyType.COINS,
                "#BOOMHILDR_GENERIC_TALK",
                "#BOOMHILDR_STOPPER_TALK",
                "#BOOMHILDR_PURCHASE_TALK",
                "#BOOMHILDR_NOSALE_TALK",
                "#BOOMHILDR_INTRO_TALK",
                "#BOOMHILDR_ATTACKED_TALK",
                new Vector3(0.5f, 4, 0),
                ItsDaFuckinShopApi.defaultItemPositions,
                1f,
                false,
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                true,
                false,
                null,
                true,
                "NevernamedsItems/Resources/NPCSprites/Boomhildr/boomhildr_mapicon",
                true,
                0.1f
                );

            PrototypeDungeonRoom Mod_Shop_Room = RoomFactory.BuildFromResource("NevernamedsItems/Resources/EmbeddedRooms/BoomhildrRoom.room").room;

            ItsDaFuckinShopApi.RegisterShopRoom(boomhildrObj, Mod_Shop_Room, new UnityEngine.Vector2(9f, 11));
        }
        private void HandleChestRoomSetup()
        {
            AssetBundle          sharedAssets1  = ResourceManager.LoadAssetBundle("shared_auto_001");
            AssetBundle          sharedAssets2  = ResourceManager.LoadAssetBundle("shared_auto_002");
            ExpandObjectDatabase objectDatabase = new ExpandObjectDatabase();

            try {
                DungeonPlaceable ChestPlatform = sharedAssets2.LoadAsset <DungeonPlaceable>("Treasure_Dais_Stone_Carpet");
                GameObject       Chest_Black   = sharedAssets1.LoadAsset <GameObject>("Chest_Black");
                GameObject       Chest_Rainbow = sharedAssets1.LoadAsset <GameObject>("Chest_Rainbow");
                GameObject       Chest_Rat     = sharedAssets1.LoadAsset <GameObject>("Chest_Rat");

                IntVector2 TreasureChestCarpetPosition1 = new IntVector2(8, 29);
                IntVector2 TreasureChestCarpetPosition2 = new IntVector2(8, 54);
                IntVector2 SecretChestPosition1         = new IntVector2(8, 31);
                IntVector2 SecretChestPosition2         = new IntVector2(8, 56);
                GameObject TreasureChestStoneCarpet1    = ChestPlatform.InstantiateObject(m_ParentRoom, TreasureChestCarpetPosition1);
                GameObject TreasureChestStoneCarpet2    = ChestPlatform.InstantiateObject(m_ParentRoom, TreasureChestCarpetPosition2);
                TreasureChestStoneCarpet1.transform.position -= new Vector3(0.55f, 0);
                TreasureChestStoneCarpet2.transform.position -= new Vector3(0.55f, 0);
                TreasureChestStoneCarpet1.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                TreasureChestStoneCarpet2.transform.SetParent(m_ParentRoom.hierarchyParent, true);

                GameObject PlacedBlackChestObject   = ExpandUtility.GenerateDungeonPlacable(Chest_Black, false, true).InstantiateObject(m_ParentRoom, SecretChestPosition1);
                GameObject PlacedRainbowChestObject = ExpandUtility.GenerateDungeonPlacable(Chest_Rainbow, false, true).InstantiateObject(m_ParentRoom, SecretChestPosition2);
                PlacedBlackChestObject.transform.position    += new Vector3(0.5f, 0);
                PlacedRainbowChestObject.transform.position  += new Vector3(0.5f, 0);
                TreasureChestStoneCarpet1.transform.position += new Vector3(0.5f, 0);
                TreasureChestStoneCarpet2.transform.position += new Vector3(0.5f, 0);
                PlacedBlackChestObject.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedRainbowChestObject.transform.SetParent(m_ParentRoom.hierarchyParent, true);

                tk2dBaseSprite PlacedBlackChestSprite = PlacedBlackChestObject.GetComponentInChildren <tk2dBaseSprite>();

                GenericLootTable BlackChestLootTable = GameManager.Instance.RewardManager.ItemsLootTable;

                Chest PlacedBlackChestComponent   = PlacedBlackChestObject.GetComponent <Chest>();
                Chest PlacedRainbowChestComponent = PlacedRainbowChestObject.GetComponent <Chest>();
                PlacedBlackChestComponent.ChestType           = Chest.GeneralChestType.ITEM;
                PlacedBlackChestComponent.lootTable.lootTable = BlackChestLootTable;
                bool LootTableCheck = PlacedBlackChestComponent.lootTable.canDropMultipleItems && PlacedBlackChestComponent.lootTable.overrideItemLootTables != null && PlacedBlackChestComponent.lootTable.overrideItemLootTables.Count > 0;
                if (LootTableCheck)
                {
                    PlacedBlackChestComponent.lootTable.overrideItemLootTables[0] = BlackChestLootTable;
                }
                PlacedBlackChestComponent.overrideMimicChance = 0f;
                PlacedBlackChestComponent.ForceUnlock();
                PlacedBlackChestComponent.PreventFuse = true;
                PlacedRainbowChestComponent.ForceUnlock();
                PlacedRainbowChestComponent.PreventFuse = true;
                m_ParentRoom.RegisterInteractable(PlacedBlackChestComponent);
                m_ParentRoom.RegisterInteractable(PlacedRainbowChestComponent);

                Vector3    SpecialLockedDoorPosition = (new Vector3(9, 52.25f) + m_ParentRoom.area.basePosition.ToVector3());
                GameObject SpecialLockedDoor         = Instantiate(objectDatabase.LockedJailDoor, SpecialLockedDoorPosition, Quaternion.identity);
                SpecialLockedDoor.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                InteractableLock SpecialLockedDoorComponent = SpecialLockedDoor.GetComponentInChildren <InteractableLock>();
                SpecialLockedDoorComponent.lockMode      = InteractableLock.InteractableLockMode.RESOURCEFUL_RAT;
                SpecialLockedDoorComponent.JailCellKeyId = 0;
                tk2dBaseSprite RainbowLockSprite = SpecialLockedDoorComponent.GetComponentInChildren <tk2dBaseSprite>();
                if (RainbowLockSprite != null)
                {
                    ExpandShaders.Instance.ApplyRainbowShader(RainbowLockSprite);
                }

                IntVector2 PuzzleChestPosition1       = new IntVector2(4, 19);
                IntVector2 PuzzleChestPosition2       = new IntVector2(12, 19);
                IntVector2 PuzzleChestPosition3       = new IntVector2(4, 40);
                IntVector2 PuzzleChestPosition4       = new IntVector2(12, 40);
                IntVector2 PuzzleChestPosition5       = new IntVector2(4, 50);
                IntVector2 PuzzleChestPosition6       = new IntVector2(12, 50);
                IntVector2 PuzzleChestCarpetPosition1 = (PuzzleChestPosition1 - new IntVector2(0, 1));
                IntVector2 PuzzleChestCarpetPosition2 = (PuzzleChestPosition2 - new IntVector2(0, 1));
                IntVector2 PuzzleChestCarpetPosition3 = (PuzzleChestPosition3 - new IntVector2(0, 1));
                IntVector2 PuzzleChestCarpetPosition4 = (PuzzleChestPosition4 - new IntVector2(0, 1));
                IntVector2 PuzzleChestCarpetPosition5 = (PuzzleChestPosition5 - new IntVector2(0, 1));
                IntVector2 PuzzleChestCarpetPosition6 = (PuzzleChestPosition6 - new IntVector2(0, 1));

                GameObject PlacedPuzzleRatChest1   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition1, false, true);
                GameObject PlacedPuzzleRatChest2   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition2, false, true);
                GameObject PlacedPuzzleRatChest3   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition3, false, true);
                GameObject PlacedPuzzleRatChest4   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition4, false, true);
                GameObject PlacedPuzzleRatChest5   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition5, false, true);
                GameObject PlacedPuzzleRatChest6   = ExpandUtility.GenerateDungeonPlacable(Chest_Rat, false, true).InstantiateObject(m_ParentRoom, PuzzleChestPosition6, false, true);
                GameObject PuzzleChestStoneCarpet1 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition1);
                GameObject PuzzleChestStoneCarpet2 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition2);
                GameObject PuzzleChestStoneCarpet3 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition3);
                GameObject PuzzleChestStoneCarpet4 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition4);
                GameObject PuzzleChestStoneCarpet5 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition5);
                GameObject PuzzleChestStoneCarpet6 = ChestPlatform.InstantiateObject(m_ParentRoom, PuzzleChestCarpetPosition6);
                PlacedPuzzleRatChest1.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedPuzzleRatChest2.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedPuzzleRatChest3.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedPuzzleRatChest4.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedPuzzleRatChest5.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PlacedPuzzleRatChest6.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet1.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet2.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet3.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet4.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet5.transform.SetParent(m_ParentRoom.hierarchyParent, true);
                PuzzleChestStoneCarpet6.transform.SetParent(m_ParentRoom.hierarchyParent, true);

                Chest PuzzleRatChest1Component = PlacedPuzzleRatChest1.GetComponent <Chest>();
                Chest PuzzleRatChest2Component = PlacedPuzzleRatChest2.GetComponent <Chest>();
                Chest PuzzleRatChest3Component = PlacedPuzzleRatChest3.GetComponent <Chest>();
                Chest PuzzleRatChest4Component = PlacedPuzzleRatChest4.GetComponent <Chest>();
                Chest PuzzleRatChest5Component = PlacedPuzzleRatChest5.GetComponent <Chest>();
                Chest PuzzleRatChest6Component = PlacedPuzzleRatChest6.GetComponent <Chest>();
                PuzzleRatChest1Component.PreventFuse         = true;
                PuzzleRatChest2Component.PreventFuse         = true;
                PuzzleRatChest3Component.PreventFuse         = true;
                PuzzleRatChest4Component.PreventFuse         = true;
                PuzzleRatChest5Component.PreventFuse         = true;
                PuzzleRatChest6Component.PreventFuse         = true;
                PuzzleRatChest1Component.overrideMimicChance = 0f;
                PuzzleRatChest2Component.overrideMimicChance = 0f;
                PuzzleRatChest3Component.overrideMimicChance = 0f;
                PuzzleRatChest4Component.overrideMimicChance = 0f;
                PuzzleRatChest5Component.overrideMimicChance = 0f;
                PuzzleRatChest6Component.overrideMimicChance = 0f;

                float Seed = UnityEngine.Random.value;

                if (Seed <= 0.5f)
                {
                    PuzzleRatChest1Component.forceContentIds = new List <int> {
                        68
                    };
                    PuzzleRatChest2Component.forceContentIds = new List <int> {
                        727, 727
                    };
                }
                else
                {
                    PuzzleRatChest1Component.forceContentIds = new List <int> {
                        727, 727
                    };
                    PuzzleRatChest2Component.forceContentIds = new List <int> {
                        68
                    };
                }
                if (BraveUtility.RandomBool())
                {
                    PuzzleRatChest3Component.forceContentIds = new List <int> {
                        70, 70, 70, 70
                    };
                    PuzzleRatChest4Component.forceContentIds = new List <int> {
                        727, 727
                    };
                }
                else
                {
                    PuzzleRatChest3Component.forceContentIds = new List <int> {
                        727, 727
                    };
                    PuzzleRatChest4Component.forceContentIds = new List <int> {
                        70, 70, 70, 70
                    };
                }
                if (BraveUtility.RandomBool())
                {
                    PuzzleRatChest5Component.forceContentIds = new List <int> {
                        74
                    };
                    PuzzleRatChest6Component.forceContentIds = new List <int> {
                        316
                    };
                }
                else
                {
                    PuzzleRatChest5Component.forceContentIds = new List <int> {
                        316
                    };
                    PuzzleRatChest6Component.forceContentIds = new List <int> {
                        74
                    };
                }

                PuzzleRatChest1Component.ConfigureOnPlacement(m_ParentRoom);
                PuzzleRatChest2Component.ConfigureOnPlacement(m_ParentRoom);
                PuzzleRatChest3Component.ConfigureOnPlacement(m_ParentRoom);
                PuzzleRatChest4Component.ConfigureOnPlacement(m_ParentRoom);
                PuzzleRatChest5Component.ConfigureOnPlacement(m_ParentRoom);
                PuzzleRatChest6Component.ConfigureOnPlacement(m_ParentRoom);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest1Component);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest2Component);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest3Component);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest4Component);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest5Component);
                m_ParentRoom.RegisterInteractable(PuzzleRatChest6Component);

                Vector3 InfoSignPosition = (new Vector3(6, 4) + m_ParentRoom.area.basePosition.ToVector3());

                GameObject ChestPuzzleInfoSign = Instantiate(ExpandPrefabs.Jungle_BlobLostSign, InfoSignPosition, Quaternion.identity);
                ChestPuzzleInfoSign.name = "Lunk's Minigame Sign";
                ChestPuzzleInfoSign.GetComponent <ExpandNoteDoer>().stringKey = "A minigame Lunk created based on a game he used to play in a land far away.\nGuess the right chest to continue forward.\n If you can guess the correct chest 3 times, the ultimate prize shall be gained!";
                m_ParentRoom.RegisterInteractable(ChestPuzzleInfoSign.GetComponent <ExpandNoteDoer>());
            } catch (Exception ex) {
                if (ExpandStats.debugMode)
                {
                    string Message = "[ExpandTheGungeon] Warning: Exception caught in ExpandWestPuzzleRoomController.HandleChestRoomSetup!";
                    ETGModConsole.Log(Message);
                    Debug.Log(Message);
                    Debug.LogException(ex);
                }
            }
            sharedAssets1  = null;
            sharedAssets2  = null;
            objectDatabase = null;
        }
        private void Start()
        {
            if (autoUltra)
            {
                GlitchEnemies              = true;
                addRandomEnemy             = true;
                allowGlitchFloor           = true;
                randomEnemySizeEnabled     = true;
                isHardMode                 = true;
                isUltraMode                = true;
                isExplosionHookActive      = true;
                WallMimicsUseRewardManager = false;
                ChaosSharedHooks.InstallPrimaryHooks();
                ChaosSharedHooks.minorbreakablehook = new Hook(
                    typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                    typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                    typeof(ChaosSharedHooks)
                    );
                ChaosSharedHooks.doExplodeHook = new Hook(
                    typeof(Exploder).GetMethod("Explode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static),
                    typeof(ChaosExploder).GetMethod("Explode"),
                    typeof(ChaosExploder)
                    );
                autoUltra = false;
            }

            ETGModConsole.Commands.AddGroup("chaos", delegate(string[] e) {
                ETGModConsole.Log("[Chaos Mode]  The following options are available for Chaos Mode:\n", false);
                string[] AvailableCommands = ETGModConsole.Commands.GetGroup("chaos").GetAllUnitNames();
                foreach (string Command in AvailableCommands)
                {
                    ETGModConsole.Log(Command + "\n", false);
                }

                ETGModConsole.Log("\n\nTo turn off all modes, use 'chaos reset'\nNote that changes to wall mimic settings will take effect on next floor load.", false);
            });

            /*ETGModConsole.Commands.GetGroup("chaos").AddUnit("dumproomlayout", delegate (string[] e) { RoomFromText.DumpRoomLayoutToText(); });
             *
             * ETGModConsole.Commands.GetGroup("chaos").AddUnit("dumpsprite", delegate (string[] e) {
             *  AIActor Enemy = EnemyDatabase.GetOrLoadByGuid("14ea47ff46b54bb4a98f91ffcffb656d");
             *  ResourceExtractor.DumpSpriteCollection(Enemy.sprite.Collection);
             * });
             *
             * ETGModConsole.Commands.GetGroup("chaos").AddUnit("spawntest", delegate (string[] e) {
             *  RoomHandler CurrentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom;
             *  PlayerController Player = GameManager.Instance.PrimaryPlayer;
             *  IntVector2? position = ChaosUtility.Instance.GetRandomAvailableCellSmart(CurrentRoom, new IntVector2(2, 2), false);
             *  IntVector2? position2 = ChaosUtility.Instance.GetRandomAvailableCellSmart(CurrentRoom, new IntVector2(4, 2), true);
             *  Vector2 PlayerPosition = Player.transform.position;
             *  IntVector2 FallBackPosition = PlayerPosition.ToIntVector2(VectorConversions.Floor) - CurrentRoom.area.basePosition;
             *  if (!position.HasValue) {
             *      position = FallBackPosition + new IntVector2(4, 4);
             *  }
             *  if (!position2.HasValue) {
             *      position2 = FallBackPosition + new IntVector2(4, 4);
             *  }
             *  AIActor testActor = AIActor.Spawn(EnemyDatabase.GetOrLoadByGuid("70216cae6c1346309d86d4a0b4603045"), position.Value, CurrentRoom, true, AIActor.AwakenAnimationType.Spawn, true);
             *  // ChaosShaders.ApplyCustomTexture(testActor, ResourceExtractor.GetTextureFromResource("Textures.BulletManEyepatch.png"));
             *
             *  // ChaosGlitchedEnemies m_GlitchEnemies = new ChaosGlitchedEnemies();
             *  // m_GlitchEnemies.SpawnRandomGlitchEnemy(CurrentRoom, position2.Value, false, AIActor.AwakenAnimationType.Spawn);
             * });*/


            /*ETGModConsole.Commands.GetGroup("chaos").AddUnit("test", delegate (string[] e) {
             *  GameManager.Instance.InjectedFlowPath = ChaosDungeonFlows.SecretGlitchFloor_Flow.name;
             *  ChaosUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
             *  ChaosUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
             *  ChaosUtility.RatDungeon.tileIndices.tilesetId = GlobalDungeonData.ValidTilesets.PHOBOSGEON;
             *  ChaosUtility.Instance.DelayedLoadGlitchFloor(0.7f, "SecretGlitchFloor_Flow", true);
             *
             *  AssetBundle sharedAssets2 = ResourceManager.LoadAssetBundle("shared_auto_002");
             *  tk2dSpriteCollectionData testTileSet = sharedAssets2.LoadAsset<GameObject>("ENV_FInalScenario_Pilot").GetComponent<tk2dSpriteCollectionData>();
             *  CastlePrefabtest = DungeonDatabase.GetOrLoadByName("Base_Castle");
             *  CastlePrefabtest.tileIndices.dungeonCollection = testTileSet;
             *
             *
             *  RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom;
             *  IntVector2? Position1 = ChaosUtility.Instance.GetRandomAvailableCellSmart(currentRoom, new IntVector2(4, 4), false);
             *
             *  if (Position1.HasValue) {
             *
             *      AIActor SpawnedEnemy = AIActor.Spawn(EnemyDatabase.GetOrLoadByGuid("d4dd2b2bbda64cc9bcec534b4e920518"), Position1.Value, currentRoom, true, AIActor.AwakenAnimationType.Default, true);
             *
             *      ChaosUtility.MakeCompanion(SpawnedEnemy);
             *
             *      // roomHandler.ApplyActionToNearbyEnemies(tableCenter.XY(), Radius, AuraAction);
             *
             *      SpawnedEnemy.HandleReinforcementFallIntoRoom(0);
             *  }
             *
             *  AkSoundEngine.PostEvent("Play_AGUNIM_VO_FIGHT_LAUGH_01", GameManager.Instance.PrimaryPlayer.gameObject);
             * });*/

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("bonus", delegate(string[] e) {
                if (addRandomEnemy)
                {
                    addRandomEnemy = false;
                    ETGModConsole.Log("Bonus Enemy Spawns disabled...", false);
                }
                else
                {
                    if (!addRandomEnemy)
                    {
                        addRandomEnemy = true;
                        ETGModConsole.Log("Bonus Enemy Spawns enabled...", false);
                    }
                }
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("pots", delegate(string[] e) {
                bool potFlag = ChaosSharedHooks.minorbreakablehook != null;
                if (potFlag)
                {
                    ETGModConsole.Log("The Pots have already been filled! Use 'chaos reset' to disable it!", false);
                }
                else
                {
                    if (!potFlag)
                    {
                        ChaosSharedHooks.minorbreakablehook = new Hook(
                            typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks)
                            );
                    }

                    ETGModConsole.Log("The Pots are filled...", false);
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("pots_debug", delegate(string[] e) {
                if (!potDebug)
                {
                    potDebug = true;
                    ETGModConsole.Log("Pots Debug Mode On...", false);
                }
                else
                {
                    if (potDebug)
                    {
                        potDebug = false;
                    }
                    ETGModConsole.Log("Pots Debug Mode Off...", false);
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("walls", delegate(string[] e) {
                if (WallMimicsUseRewardManager)
                {
                    ETGModConsole.Log("The Walls can no longer be trusted...", false);
                    WallMimicsUseRewardManager = false;
                }
                else
                {
                    ETGModConsole.Log("The Walls can now be trusted...", false);
                    WallMimicsUseRewardManager = true;
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("tinybigmode", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }

                if (randomEnemySizeEnabled)
                {
                    randomEnemySizeEnabled = false;
                    ETGModConsole.Log("TinyBig mode enabled disabled...", false);
                }
                else
                {
                    if (!randomEnemySizeEnabled)
                    {
                        randomEnemySizeEnabled = true;
                        ETGModConsole.Log("TinyBig mode enabled enabled...", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("normal", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }

                bool potFlag = ChaosSharedHooks.minorbreakablehook != null;
                if (potFlag)
                {
                    ETGModConsole.Log("The Pots have already been filled! Use 'chaos reset' to disable it!", false);
                }
                else
                {
                    if (!potFlag)
                    {
                        ChaosSharedHooks.minorbreakablehook = new Hook(
                            typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks)
                            );
                    }
                }
                allowGlitchFloor           = true;
                addRandomEnemy             = false;
                randomEnemySizeEnabled     = true;
                isHardMode                 = false;
                isUltraMode                = false;
                WallMimicsUseRewardManager = true;
                ETGModConsole.Log("Prepare to have a bad time! :D", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("extreme", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }

                bool potFlag = ChaosSharedHooks.minorbreakablehook != null;
                if (potFlag)
                {
                    ETGModConsole.Log("The Pots have already been filled! Use 'chaos reset' to disable it!", false);
                }
                else
                {
                    if (!potFlag)
                    {
                        ChaosSharedHooks.minorbreakablehook = new Hook(
                            typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks)
                            );
                    }
                }

                WallMimicsUseRewardManager = true;
                addRandomEnemy             = true;
                allowGlitchFloor           = true;
                randomEnemySizeEnabled     = true;
                isHardMode  = true;
                isUltraMode = false;
                ETGModConsole.Log("Prepare to have an extremely bad time! :D", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("ultra", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }

                bool potFlag = ChaosSharedHooks.minorbreakablehook != null;
                if (potFlag)
                {
                    ETGModConsole.Log("The Pots have already been filled! Use 'chaos reset' to disable it!", false);
                }
                else
                {
                    if (!potFlag)
                    {
                        ChaosSharedHooks.minorbreakablehook = new Hook(
                            typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks)
                            );
                    }
                }

                if (!WallMimicsUseRewardManager)
                {
                    ETGModConsole.Log("The Walls are already closing in!", false);
                }
                WallMimicsUseRewardManager = false;
                addRandomEnemy             = true;
                allowGlitchFloor           = true;
                randomEnemySizeEnabled     = true;
                isHardMode  = true;
                isUltraMode = true;
                ETGModConsole.Log("Prepare to have an ultra bad time! :D", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("ultra_glitched", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }
                bool potFlag = ChaosSharedHooks.minorbreakablehook != null;
                if (potFlag)
                {
                    ETGModConsole.Log("The Pots have already been filled! Use 'chaos reset' to disable it!", false);
                }
                else
                {
                    if (!potFlag)
                    {
                        ChaosSharedHooks.minorbreakablehook = new Hook(
                            typeof(MinorBreakable).GetMethod("OnBreakAnimationComplete", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks).GetMethod("SpawnAnnoyingEnemy", BindingFlags.Instance | BindingFlags.NonPublic),
                            typeof(ChaosSharedHooks)
                            );
                    }
                }

                if (!WallMimicsUseRewardManager)
                {
                    ETGModConsole.Log("The Walls are already closing in!", false);
                }

                WallMimicsUseRewardManager = false;
                GlitchEnemies          = true;
                GlitchEverything       = true;
                addRandomEnemy         = true;
                allowGlitchFloor       = true;
                randomEnemySizeEnabled = true;
                isHardMode             = true;
                isUltraMode            = true;
                ETGModConsole.Log("Glitched Ultra mode is active...\n", false);
                ETGModConsole.Log("Prepare to have an ultra bad time! :D", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("fixexplosions", delegate(string[] e) {
                bool explodeHookFlag = ChaosSharedHooks.doExplodeHook != null;
                if (!isExplosionHookActive)
                {
                    if (!explodeHookFlag)
                    {
                        ChaosSharedHooks.doExplodeHook = new Hook(
                            typeof(Exploder).GetMethod("Explode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static),
                            typeof(ChaosExploder).GetMethod("Explode"));
                    }
                    isExplosionHookActive = true;
                    ETGModConsole.Log("The Explosion Nerf is dead!", false);
                }
                else
                {
                    if (isExplosionHookActive)
                    {
                        if (explodeHookFlag)
                        {
                            ChaosSharedHooks.doExplodeHook.Dispose(); ChaosSharedHooks.doExplodeHook = null;
                        }
                        isExplosionHookActive = false;
                        ETGModConsole.Log("The Explosion Nerf is back!", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("fixexplosionqueue", delegate(string[] e) {
                if (!explosionQueueDisabled)
                {
                    explosionQueueDisabled = true;
                    ETGModConsole.Log("The Explosion Queue is dead!", false);
                }
                else
                {
                    if (explosionQueueDisabled)
                    {
                        explosionQueueDisabled = false;
                        ETGModConsole.Log("The Explosion Queue is back!", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("fixtablesliding", delegate(string[] e) {
                bool slideHookFlag = ChaosSharedHooks.slidehook != null;
                if (!slideHookFlag)
                {
                    ChaosSharedHooks.slidehook = new Hook(
                        typeof(SlideSurface).GetMethod("Awake", BindingFlags.Public | BindingFlags.Instance),
                        typeof(ChaosSharedHooks).GetMethod("SlideAwakeHook", BindingFlags.NonPublic | BindingFlags.Instance),
                        typeof(ChaosSharedHooks)
                        );
                    isExplosionHookActive = true;
                    ETGModConsole.Log("Table sliding is dead!", false);
                }
                else
                {
                    if (slideHookFlag)
                    {
                        ChaosSharedHooks.slidehook.Dispose(); ChaosSharedHooks.slidehook = null;
                        ETGModConsole.Log("Table sliding is back!", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("enableglitchfloor", delegate(string[] e) {
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }
                if (!allowGlitchFloor)
                {
                    allowGlitchFloor = true;
                    ETGModConsole.Log("A secret floor has now been added!", false);
                }
                else
                {
                    if (allowGlitchFloor)
                    {
                        allowGlitchFloor = false;
                        ETGModConsole.Log("The secret floor will not appear...", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("spawnbulletkin", delegate(string[] e) {
                IntVector2 RoomVector = (GameManager.Instance.PrimaryPlayer.CenterPosition.ToIntVector2(VectorConversions.Floor));
                LootCrate.Instance.SpawnAirDrop(RoomVector, EnemyOdds: 1f, playSoundFX: true);
                ETGModConsole.Log("Bullet Kin to the rescue!.....Or maybe not? :P", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("spawnlootcrate", delegate(string[] e) {
                SupplyDropItem supplydrop = ETGMod.Databases.Items[77].GetComponent <SupplyDropItem>();
                RewardManager itemReward  = GameManager.Instance.RewardManager;
                // GenericLootTable lootTable = supplydrop.synergyItemTableToUse01;
                // GenericLootTable lootTable2 = supplydrop.synergyItemTableToUse02;
                GenericLootTable lootTableAmmo  = supplydrop.itemTableToUse;
                GenericLootTable lootTableItems = itemReward.ItemsLootTable;
                GenericLootTable lootTableGuns  = itemReward.GunsLootTable;
                IntVector2 RoomVector           = (GameManager.Instance.PrimaryPlayer.CenterPosition.ToIntVector2(VectorConversions.Floor));
                if (UnityEngine.Random.value <= 0.5f)
                {
                    LootCrate.Instance.SpawnAirDrop(RoomVector, lootTableItems, playSoundFX: true, usePlayerPosition: true);
                }
                else
                {
                    LootCrate.Instance.SpawnAirDrop(RoomVector, lootTableGuns, playSoundFX: true, usePlayerPosition: true);
                }

                ETGModConsole.Log("Here comes a loot crate drop. What surprise awaits?!", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("spawnlootrandom", delegate(string[] e) {
                SupplyDropItem supplydrop   = ETGMod.Databases.Items[77].GetComponent <SupplyDropItem>();
                RewardManager itemReward    = GameManager.Instance.RewardManager;
                GenericLootTable lootTable2 = supplydrop.synergyItemTableToUse02;
                IntVector2 RoomVector       = (GameManager.Instance.PrimaryPlayer.CenterPosition.ToIntVector2(VectorConversions.Floor));
                LootCrate.Instance.SpawnAirDrop(RoomVector, lootTable2, 0.3f, 0.15f, true, false, BraveUtility.RandomElement(ChaosLists.ReplacementEnemyGUIDList));
                ETGModConsole.Log("Here comes a loot crate drop. What surprise awaits?! Might have an enemy!", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("supertentacletime", delegate(string[] e) {
                ChaosTentacleTeleport.Instance.TentacleTimeRandomRoom();
                ETGModConsole.Log("Time for a suprise teleport!", false);
                return;
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("tentacletime", delegate(string[] e) {
                ChaosTentacleTeleport.Instance.TentacleTime();
                ETGModConsole.Log("Time for a suprise teleport!", false);
                return;
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("superdebug", delegate(string[] e) {
                if (!DebugExceptions)
                {
                    DebugExceptions = true;
                    ETGModConsole.Log("Exceptions Debug Mode On...", false);
                }
                else
                {
                    if (DebugExceptions)
                    {
                        DebugExceptions = false;
                        ETGModConsole.Log("Exceptions Debug Mode Off...", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("debug", delegate(string[] e) {
                if (!debugMimicFlag)
                {
                    debugMimicFlag = true;
                    ETGModConsole.Log("Debug Mode On...", false);
                }
                else
                {
                    if (debugMimicFlag)
                    {
                        debugMimicFlag = false;
                        ETGModConsole.Log("Debug Mode Off...", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("glitch", delegate(string[] e) {
                if (GlitchEnemies)
                {
                    ETGModConsole.Log("Glitched Enemy mode already active! Use 'glitch reset' if you want to disable it!", false);
                }
                else
                {
                    ETGModConsole.Log("Glitched Enemy mode now active!", false);
                }
                GlitchEnemies = true;
                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("glitch_all", delegate(string[] e) {
                GlitchEnemies    = true;
                GlitchEverything = true;

                if (!ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }

                ETGModConsole.Log("Glitched Enemy mode is active...", false);
                ETGModConsole.Log("Glitched Ultra mode is active...", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("glitch_randomizer", delegate(string[] e) {
                if (!GlitchRandomized)
                {
                    GlitchRandomized   = true;
                    GlitchRandomActors = 0.3f;
                    GlitchRandomAll    = 0.2f;
                    ETGModConsole.Log("Glitch Randomizer Enabled...", false);
                }
                else
                {
                    if (GlitchRandomized)
                    {
                        GlitchRandomized   = false;
                        GlitchRandomActors = 1f;
                        GlitchRandomAll    = 1f;
                        ETGModConsole.Log("Glitch Randomizer Disabled...", false);
                    }
                }
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("glitch_test", delegate(string[] e) {
                foreach (BraveBehaviour gameObject in FindObjectsOfType <BraveBehaviour>())
                {
                    ChaosShaders.Instance.BecomeGlitchedTest(gameObject);
                }
                ETGModConsole.Log("One time glitch all. Enjoy the mess!", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("reset", delegate(string[] e) {
                if (ChaosSharedHooks.minorbreakablehook != null)
                {
                    ChaosSharedHooks.minorbreakablehook.Dispose(); ChaosSharedHooks.minorbreakablehook = null;
                }
                if (ChaosSharedHooks.doExplodeHook != null)
                {
                    ChaosSharedHooks.doExplodeHook.Dispose(); ChaosSharedHooks.doExplodeHook = null;
                }
                if (ChaosSharedHooks.slidehook != null)
                {
                    ChaosSharedHooks.slidehook.Dispose(); ChaosSharedHooks.slidehook = null;
                }

                isExplosionHookActive      = false;
                explosionQueueDisabled     = false;
                allowGlitchFloor           = false;
                GlitchEnemies              = false;
                GlitchRandomized           = true;
                GlitchEverything           = false;
                randomEnemySizeEnabled     = false;
                isNormalMode               = false;
                isHardMode                 = false;
                isUltraMode                = false;
                WallMimicsUseRewardManager = true;
                addRandomEnemy             = false;
                debugMimicFlag             = false;
                potDebug         = false;
                DebugExceptions  = false;
                hasBeenTentacled = false;
                hasBeenTentacledToAnotherRoom = false;
                elevatorHasBeenUsed           = false;
                GlitchRandomActors            = 0.3f;
                GlitchRandomAll             = 0.2f;
                RandomResizedEnemies        = 0.3f;
                BonusEnemyChances           = 0.5f;
                MainPotSpawnChance          = 0.3f;
                SecondaryPotSpawnChance     = 0.4f;
                BonusLootChances            = 0.2f;
                MaxWallMimicsPerRoom        = 1;
                MaxWallMimicsForFloor       = 2;
                LootCrateExplodeChances     = 0.1f;
                LootCrateBigLootDropChances = 0.1f;
                EnemyCrateExplodeChances    = 0.1f;
                RandomPits                    = 0;
                RandomPitsPerRoom             = 0;
                ChallengeTimeChances          = 0f;
                TentacleTimeChances           = 0.1f;
                TentacleTimeRandomRoomChances = 0.1f;

                if (ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks(false);
                }

                ETGModConsole.Log("Everything has returned to normal...", false);
            });

            ETGModConsole.Commands.GetGroup("chaos").AddUnit("togglehooks", delegate(string[] e) {
                if (ChaosSharedHooks.IsHooksInstalled)
                {
                    ChaosSharedHooks.InstallPrimaryHooks(false);
                }
                else
                {
                    ChaosSharedHooks.InstallPrimaryHooks();
                }
            });
        }