private void HandlePreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
 {
     try
     {
         if (otherRigidbody)
         {
             if (otherRigidbody.GetComponent <GameActor>())
             {
                 PhysicsEngine.SkipCollision = true;
             }
             if (otherRigidbody.GetComponent <Projectile>())
             {
                 if (otherRigidbody.GetComponent <Projectile>().ProjectilePlayerOwner())
                 {
                     PhysicsEngine.SkipCollision = true;
                 }
                 else
                 {
                     myRigidbody.GetComponentInChildren <MinorBreakable>().Break();
                     //otherRigidbody.GetComponent<Projectile>().DieInAir();
                 }
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
        private IEnumerator Start()
        {
            while (!hasBeenSetup)
            {
                yield return(null);
            }

            if (!m_Destination.HasValue)
            {
                if (ExpandStats.debugMode)
                {
                    ETGModConsole.Log("[ExpandTheGungeon] [" + gameObject.name + "] ERROR: Destination Door was not found!");
                }
                m_Disabled = true;
            }

            if (!m_Disabled)
            {
                if (specRigidbody)
                {
                    specRigidbody.OnTriggerCollision = (SpeculativeRigidbody.OnTriggerDelegate)Delegate.Combine(specRigidbody.OnTriggerCollision, new SpeculativeRigidbody.OnTriggerDelegate(HandleTriggerCollision));
                }
            }

            SetupExitElevator();

            if (MinimapIcon)
            {
                Minimap.Instance.RegisterRoomIcon(m_parentRoom, MinimapIcon, false);
            }

            yield break;
        }
Example #3
0
        /*public override void Pickup(PlayerController player)
         * {
         *  player.OnItemPurchased += Restocker;
         *  base.Pickup(player);
         * }
         *
         * public override DebrisObject Drop(PlayerController player)
         * {
         *  player.OnItemPurchased -= Restocker;
         *  return base.Drop(player);
         * }*/

        private void Restocker(PlayerController arg1, ShopItemController arg2)
        {
            arg2.item.PersistsOnPurchase = true;
            if (!arg2.gameObject || !arg2)
            {
                ETGModConsole.Log("my coffins all i see");
            }
            ETGModConsole.Log("time to drop");
            FieldInfo      _parentShop = typeof(ShopItemController).GetField("m_parentShop", BindingFlags.NonPublic | BindingFlags.Instance);
            ShopController shop        = (ShopController)_parentShop.GetValue(arg2);

            if (shop)
            {
                arg2.Initialize(Gungeon.Game.Items["psm:randy"], shop);
            }
            else
            {
                ETGModConsole.Log("loosen up");
                FieldInfo          _parentBaseShop = typeof(ShopItemController).GetField("m_baseParentShop", BindingFlags.NonPublic | BindingFlags.Instance);
                BaseShopController baseShop        = (BaseShopController)_parentBaseShop.GetValue(arg2);
                if (baseShop)
                {
                    ETGModConsole.Log("dont forget about it");
                    arg2.Initialize(Gungeon.Game.Items["psm:randy"], baseShop);
                }
                else
                {
                    ETGModConsole.Log("f**k shit up");
                }
            }
        }
Example #4
0
        /// <summary>
        /// Converts an embedded resource to a Texture2D object
        /// </summary>
        public static Texture2D GetTextureFromResource(string resourceName)
        {
            string file = resourceName;

            file = file.Replace("/", ".");
            file = file.Replace("\\", ".");
            byte[] bytes = ExtractEmbeddedResource(file);
            if (bytes == null)
            {
                ETGModConsole.Log("No bytes found in " + file);
                return(null);
            }
            Texture2D texture = new Texture2D(1, 1, TextureFormat.RGBA32, false);

            ImageConversion.LoadImage(texture, bytes);
            texture.filterMode = FilterMode.Point;

            string name = file.Substring(0, file.LastIndexOf('.'));

            if (name.LastIndexOf('.') >= 0)
            {
                name = name.Substring(name.LastIndexOf('.') + 1);
            }
            texture.name = name;

            return(texture);
        }
Example #5
0
 public override void Start()
 {
     FakePrefabHooks.Init();
     ItemBuilder.Init();
     BasicGun.Add();
     ETGModConsole.Log("shit", false);
 }
Example #6
0
		public static DungeonFlow F1b_Hat_flow_01()
		{
			try
			{

				DungeonFlow m_CachedFlow = ScriptableObject.CreateInstance<DungeonFlow>();
				DungeonFlowNode entranceNode = GenerateDefaultNode(m_CachedFlow, PrototypeDungeonRoom.RoomCategory.ENTRANCE, ModRoomPrefabs.Mod_Entrance_Room);
				DungeonFlowNode exitNode = GenerateDefaultNode(m_CachedFlow, PrototypeDungeonRoom.RoomCategory.EXIT, ModRoomPrefabs.Mod_Exit_Room);
				DungeonFlowNode HatRoomNode_01 = GenerateDefaultNode(m_CachedFlow, PrototypeDungeonRoom.RoomCategory.HUB);
				DungeonFlowNode HatRoomNode_02 = GenerateDefaultNode(m_CachedFlow, PrototypeDungeonRoom.RoomCategory.NORMAL);

				m_CachedFlow.name = "F1b_FloorName_Flow_01";
				m_CachedFlow.fallbackRoomTable = ModPrefabs.FloorNameRoomTable;
				m_CachedFlow.phantomRoomTable = null;
				m_CachedFlow.subtypeRestrictions = new List<DungeonFlowSubtypeRestriction>(0);
				m_CachedFlow.flowInjectionData = new List<ProceduralFlowModifierData>(0);
				m_CachedFlow.sharedInjectionData = new List<SharedInjectionData>() { BaseSharedInjectionData };

				m_CachedFlow.Initialize();

				m_CachedFlow.AddNodeToFlow(entranceNode, null);
				// First Looping branch
				m_CachedFlow.AddNodeToFlow(HatRoomNode_01, entranceNode);
				m_CachedFlow.AddNodeToFlow(HatRoomNode_02, HatRoomNode_01);
				m_CachedFlow.AddNodeToFlow(exitNode, HatRoomNode_02);
				m_CachedFlow.FirstNode = entranceNode;

				return m_CachedFlow;
			}
			catch (Exception e)
			{
				ETGModConsole.Log(e.ToString());
				return null;
			}
		}
Example #7
0
        private void PostProcessProjectile(Projectile sourceProjectile, float effectChanceScalar)
        {
            float procChance = 0.12f;

            //ETGModConsole.Log("Scaler: " + effectChanceScalar);
            procChance *= effectChanceScalar;
            bool DoFirstShotOverrideSynergy = (Owner.CurrentGun.LastShotIndex == 0) && Owner.PlayerHasActiveSynergy("Added Effect - Lockdown");
            bool DoLastShotOverrideSynergy  = (Owner.CurrentGun.LastShotIndex == Owner.CurrentGun.ClipCapacity - 1) && Owner.PlayerHasActiveSynergy("Moonstone Weapon");

            //ETGModConsole.Log("PostScaleChance: " + procChance);
            try
            {
                if (UnityEngine.Random.value <= procChance || DoFirstShotOverrideSynergy || DoLastShotOverrideSynergy)
                {
                    ApplyLockdownBulletBehaviour orAddComponent = sourceProjectile.gameObject.GetOrAddComponent <ApplyLockdownBulletBehaviour>();
                    orAddComponent.duration             = 4f;
                    orAddComponent.useSpecialBulletTint = true;
                    orAddComponent.bulletTintColour     = Color.grey;
                    orAddComponent.TintEnemy            = true;
                    orAddComponent.procChance           = 1;
                }
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.Message);
            }
        }
Example #8
0
 public void ChangeOpacityAmount(string[] args)
 {
     if (args != null && args.Length == 1)
     {
         float opacity = 0.9f;
         bool  success = float.TryParse(args[0], out opacity);
         if (success)
         {
             if (opacity >= 0 && opacity <= 1)
             {
                 Larry.opacityAmount = opacity;
                 ETGModConsole.Log("names opacity amount will now be " + Larry.opacityAmount);
                 onOpacityAmountChanged();
             }
             else
             {
                 ETGModConsole.Log("opacity must be between 0 and 1!");
             }
         }
         else
         {
             ETGModConsole.Log("incorrect format, make sure to input a number");
         }
     }
     else
     {
         ETGModConsole.Log("incorrect amount of arguments. one argument required");
     }
 }
        // Use to serialize an existing set of sprites in your mod.
        // Create a list of sprite names (case sensitive by the way) you want put into an atlas and this will output the atlas texture and JSON txt dump of the new sprite collection.
        // Note you may get exceptions if you don't give it a large enough atlas size to work with. I have been using the same defaultsize, Xres, and Yres.
        // Someone who better understands these fields could probably create better defaults but that's what worked for me.
        public static void SerializeSpriteCollection(string CollectionName, List <string> spriteNames, int Xres, int Yres, string pathOverride = null)
        {
            if (!ExpandSettings.spritesBundlePresent)
            {
                ETGModConsole.Log("[ExpandTheGungeon] Unserialized sprite textures stored in optional asset bundle but it is missing! Ensure you have it setup properly!");
                return;
            }
            GameObject m_TempObject = new GameObject(CollectionName);

            newCollection = GenerateNewSpriteCollection(m_TempObject);
            AtlasPacker   = new RuntimeAtlasPacker(Xres, Yres);
            AddSpriteToObject(m_TempObject, ExpandAssets.LoadSpriteAsset <Texture2D>(spriteNames[0]));
            if (spriteNames.Count > 0)
            {
                for (int i = 1; i < spriteNames.Count; i++)
                {
                    AddSpriteToCollection(ExpandAssets.LoadSpriteAsset <Texture2D>(spriteNames[i]), newCollection);
                }
            }
            DumpSpriteCollection(newCollection, pathOverride);
            if (!string.IsNullOrEmpty(pathOverride))
            {
                SaveStringToFile(JsonUtility.ToJson(newCollection), pathOverride, CollectionName + "Collection" + ".txt");
            }
            else
            {
                SaveStringToFile(JsonUtility.ToJson(newCollection), ETGMod.ResourcesDirectory, CollectionName + "Collection" + ".txt");
            }
            newCollection = null;
            AtlasPacker   = null;
        }
Example #10
0
        public static void DebugBulletBank(AIBulletBank bank, string path = "")
        {
            List <string> logs = new List <string>();

            logs.Add("bullet bank report");
            logs.Add("");

            logs.Add("");
            if (bank)
            {
                logs.Add("--- Beginning bullet bank report");

                foreach (var b in bank.Bullets)
                {
                    logs.Add(ReturnPropertiesAndFields(b, "Logging bullet " + b.Name));
                }
                logs.Add("--- End of bullet bank report");
            }
            else
            {
                logs.Add("--- Actor does not have a bullet bank.");
            }

            var retstr = string.Join("\n", logs.ToArray());

            if (string.IsNullOrEmpty(path))
            {
                ETGModConsole.Log(retstr);
            }
            else
            {
                File.WriteAllText(path, retstr);
            }
        }
Example #11
0
 public void ChangeNameSize(string[] args)
 {
     if (args != null && args.Length == 1)
     {
         float size    = 1;
         bool  success = float.TryParse(args[0], out size);
         if (success)
         {
             if (size >= 0)
             {
                 Larry.nameSize = size;
                 ETGModConsole.Log("names from now on will be size = " + Larry.nameSize);
                 onNameSizeChanged();
             }
             else
             {
                 ETGModConsole.Log("size must be a positive number");
             }
         }
         else
         {
             ETGModConsole.Log("incorrect format, make sure to input a number");
         }
     }
     else
     {
         ETGModConsole.Log("incorrect amount of arguments. one argument required");
     }
 }
 public static void SetupEXItem(PickupObject item, string name, string shortDesc, string longDesc, string idPool = "ex", bool createEncounterTrackable = true)
 {
     try {
         item.encounterTrackable = null;
         ETGMod.Databases.Items.SetupItem(item, item.name);
         SpriteBuilder.AddToAmmonomicon(item.sprite.GetCurrentSpriteDef());
         item.encounterTrackable.journalData.AmmonomiconSprite = item.sprite.GetCurrentSpriteDef().name;
         GunExt.SetName(item, name);
         GunExt.SetShortDescription(item, shortDesc);
         GunExt.SetLongDescription(item, longDesc);
         bool isPlayerItem = item is PlayerItem;
         if (isPlayerItem)
         {
             (item as PlayerItem).consumable = false;
         }
         Game.Items.Add(idPool + ":" + name.ToLower().Replace(" ", "_"), item);
         ETGMod.Databases.Items.Add(item, false, "ANY");
         if (!createEncounterTrackable)
         {
             UnityEngine.Object.Destroy(item.encounterTrackable);
         }
     } catch (Exception ex) {
         UnityEngine.Debug.LogException(ex);
         ETGModConsole.Log(ex.Message, false);
         ETGModConsole.Log(ex.StackTrace, false);
     }
 }
Example #13
0
        private static void DeconstructVFXPool(VFXPool pool)
        {
            int iterator = 0;

            if (pool.effects != null && pool.effects.Length > 0)
            {
                foreach (VFXComplex comp in pool.effects)
                {
                    ETGModConsole.Log("<color=#ff0000ff>      VFXPoolEffect: </color>" + iterator);
                    if (comp.effects != null && comp.effects.Length > 0)
                    {
                        foreach (VFXObject obj in comp.effects)
                        {
                            ETGModConsole.Log("<color=#ff0000ff>      VFXObject: </color>" + iterator);
                            if (obj.effect != null)
                            {
                                ETGModConsole.Log("<color=#ff0000ff>           Effect: </color>" + obj.effect.name);
                            }
                            else
                            {
                                ETGModConsole.Log("<color=#ff0000ff>           Effect: </color>" + "NULL");
                            }
                        }
                    }
                    else
                    {
                        ETGModConsole.Log("<color=#ff0000ff>        VFXObject: </color>" + "NULL");
                    }
                }
            }
            else
            {
                ETGModConsole.Log("<color=#ff0000ff>      VFXPoolEffects: </color>" + "NULL");
            }
        }
Example #14
0
 public void EnemyDiesLol(Vector2 theposition)
 {
     try
     {
         for (int count = 0; count < 11; count++)
         {
             Projectile projectile2   = ((Gun)ETGMod.Databases.Items[51]).DefaultModule.projectiles[0];
             GameObject gameObject    = SpawnManager.SpawnProjectile(projectile2.gameObject, theposition, Quaternion.Euler(0f, 0f, (UnityEngine.Random.Range(0, 360))), true);
             Projectile component     = gameObject.GetComponent <Projectile>();
             bool       componentless = component != null;
             if (componentless)
             {
                 component.Owner           = thingy;
                 component.Shooter         = thingy.specRigidbody;
                 component.baseData.speed  = UnityEngine.Random.Range(3, 6);
                 component.baseData.damage = 12;
                 PierceProjModifier pp = component.gameObject.AddComponent <PierceProjModifier>();
                 pp.penetration = 1;
             }
         }
     } catch (Exception errorinator)
     {
         ETGModConsole.Log($"{errorinator}");
     }
 }
Example #15
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());
            }
        }
Example #16
0
 private void OnCollision(CollisionData data)
 {
     if (data.OtherRigidbody != null && data.OtherRigidbody.gameObject != null)
     {
         AIActor     actorness  = data.OtherRigidbody.gameObject.GetComponent <AIActor>();
         HealthHaver healthness = data.OtherRigidbody.gameObject.GetComponent <HealthHaver>();
         if (actorness != null || healthness != null)
         {
             if (healthness.IsVulnerable)
             {
                 HitStreak += 1;
             }
         }
         else if (data.OtherRigidbody.name != null && !AcceptableNonEnemyTargets.Contains(data.OtherRigidbody.name))
         {
             ETGModConsole.Log(data.OtherRigidbody.name);
             EndStreak(data.MyRigidbody.projectile);
         }
         else if (data.OtherRigidbody.name == null)
         {
             EndStreak(data.MyRigidbody.projectile);
         }
     }
     else
     {
         EndStreak(data.MyRigidbody.projectile);
     }
     if (data.MyRigidbody.projectile != null)
     {
         PunishmentRayHitOnce hitonce = data.MyRigidbody.projectile.gameObject.AddComponent <PunishmentRayHitOnce>();
     }
 }
Example #17
0
 public static void Help(string[] notused)
 {
     ETGModConsole.Log("");
     ETGModConsole.Log("To Toggle Modes example: rand 1 off");
     ETGModConsole.Log("Possible Modes:");
     ToggableSettings.DisplayStats();
 }
        public static void TeleportToSpecificRoom(string roomname)
        {
            //(this.dungeonFloors[i].dungeonSceneName == ss_ratscene)
            bool flag = false;

            RoomHandler roomHandler;
            Dungeon     d     = GameManager.Instance.Dungeon;
            int         count = d.data.rooms.Count;

            for (int i = 0; i < count; i++)
            {
                roomHandler = d.data.rooms[i];
                if (roomHandler.GetRoomName() == roomname)
                {
                    flag = true;
                    //ETGModConsole.Log("Teleporting to: " + roomname);
                    Tele(roomHandler);
                }
            }

            if (!flag)
            {
                ETGModConsole.Log(roomname + " Not Found");
            }
        }
        //Resets the player back to their original stats
        private void EndGoodEffect(PlayerController user)
        {
            //REMOVE MOVEMENT SPEED
            if (movementBuff <= 0)
            {
                ETGModConsole.Log("The variable 'movementBuff' is less than or equal to 0 (" + movementBuff + ")");
                return;
            }
            float curMovement = user.stats.GetBaseStatValue(PlayerStats.StatType.MovementSpeed);
            float newMovement = curMovement - movementBuff;

            user.stats.SetBaseStatValue(PlayerStats.StatType.MovementSpeed, newMovement, user);
            movementBuff     = -1;
            GoodEffectActive = false;

            //REMOVE DAMAGE
            if (damageBuff <= 0)
            {
                ETGModConsole.Log("The variable 'damageBuff' is less than or equal to 0 (" + damageBuff + ")");
                return;
            }
            float curDamage = user.stats.GetBaseStatValue(PlayerStats.StatType.Damage);
            float newDamage = curDamage - damageBuff;

            user.stats.SetBaseStatValue(PlayerStats.StatType.Damage, newDamage, user);
            damageBuff = -1;
        }
Example #20
0
 public static void HandleCustomEnemyChanges(Action <AIActor> orig, AIActor self)
 {
     orig(self);
     try
     {
         bool harderlotj = JammedSquire.NoHarderLotJ;
         if (harderlotj)
         {
         }
         else
         {
             if (self.IsBlackPhantom)
             {
                 var obehaviors = ToolsEnemy.overrideBehaviors.Where(ob => ob.OverrideAIActorGUID == self.EnemyGuid);
                 foreach (var obehavior in obehaviors)
                 {
                     obehavior.SetupOB(self);
                     if (obehavior.ShouldOverride())
                     {
                         obehavior.DoOverride();
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.ToString());
     }
 }
        public void Open()
        {
            tk2dBaseSprite spriteComponent = GetComponentInChildren <tk2dBaseSprite>();

            sprite = spriteComponent;

            if (!loadLevelOnPitFall)
            {
                StartCoroutine(DelayedOpen());
            }
            else if (loadLevelOnPitFall)
            {
                float RandomDispIntensityFloat  = UnityEngine.Random.Range(0.001f, 0.002f);
                float RandomColorIntensityFloat = UnityEngine.Random.Range(0.01f, 0.015f);
                if (spriteComponent)
                {
                    ChaosShaders.Instance.ApplyGlitchShader(null, spriteComponent, true, DispIntensity: RandomDispIntensityFloat, ColorIntensity: RandomColorIntensityFloat);
                }
                StartCoroutine(DelayedOpen());
            }
            else
            {
                if (ChaosConsole.debugMimicFlag)
                {
                    ETGModConsole.Log("[DEBUG] ERROR: Something went wrong! m_createdRoom is null!");
                }
                Debug.Log("ERROR: Something went wrong! m_createdRoom is null!");
                return;
            }
            return;
        }
Example #22
0
        public void Setup()
        {
            if (setup)
            {
                return;
            }
            try
            {
                Tools.Init();
                ItemBuilder.Init();

                //Phase 1
                BloodBank.Init();
                BloodShield.Init();
                BossBullets.Init();
                ChestReroller.Init();
                CursedRing.Init();
                HologramItem.Init();
                IcePack.Init();
                LightningGuon.Init();
                MimicWhistle.Init();
                ScrollOfApproxKnowledge.Init();
                SlotMachine.Init();
                SweatingBullets.Init();
                TerrifyingMask.Init();

                //Phase 2
                BabyGoodBlob.Init();
                CloakAndDagger.Init();
                Drone.Init();
                MagicMirror.Init();
                Pikachu.Init();
                RubyLotus.Init();
                StickyBomb.Init();
                Thermometer.Init();
                NinjaMask.Init();

                //Phase 3
                Leveler.Init();
                BigSlime.Init();

                setup = true;
            }
            catch (Exception e)
            {
                Tools.PrintException(e);
            }


            ETGModConsole.Commands.AddUnit("kts", e =>
            {
                ETGModConsole.Log("Custom Items: ");
                foreach (string s in itemList)
                {
                    ETGModConsole.Log("    " + s);
                }
            });

            ETGModConsole.Log($"KTS Item Pack {version} Initialized");
        }
Example #23
0
        /// <summary>
        /// Gets a <see cref="Texture2D"/> from an embedded image in your project.
        /// </summary>
        /// <param name="resourcePath">The filepath to the embedded image in your project.</param>
        /// <returns>The loaded <see cref="Texture2D"/></returns>
        public static Texture2D GetTextureFromResource(string resourcePath)
        {
            if (!resourcePath.ToLower().EndsWith(".png"))
            {
                resourcePath += ".png";
            }
            byte[] bytes = GetBytesFromResource(resourcePath);
            if (bytes == null)
            {
                ETGModConsole.Log("Resource Getter couldn't find anything using the filepath " + resourcePath + ". Maybe you got the filepath wrong, forgot to add the file or forgot to embed it?");
                return(null);
            }
            Texture2D result = new Texture2D(1, 1, TextureFormat.ARGB32, false);

            ImageConversion.LoadImage(result, bytes);
            result.filterMode = FilterMode.Point;
            string name = resourcePath.Substring(0, resourcePath.LastIndexOf('.'));

            if (name.LastIndexOf('.') >= 0)
            {
                name = name.Substring(name.LastIndexOf('.') + 1);
            }
            result.name = name;
            return(result);
        }
Example #24
0
 public void BlankModHook(Action <SilencerInstance, BlankModificationItem, Vector2, PlayerController> orig, SilencerInstance silencer, BlankModificationItem bmi, Vector2 centerPoint, PlayerController user)
 {
     orig(silencer, bmi, centerPoint, user);
     try
     {
         if (user.HasPickupID(ReaverletID))
         {
             RoomHandler currentRoom = user.CurrentRoom;
             if (currentRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.All))
             {
                 //AkSoundEngine.PostEvent("Play_wpn_kthulu_soul_01", base.gameObject);
                 foreach (AIActor aiactor in currentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All))
                 {
                     if (aiactor.behaviorSpeculator != null)
                     {
                         this.AffectEnemy(aiactor);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
Example #25
0
        // Token: 0x060003CC RID: 972 RVA: 0x000247A0 File Offset: 0x000229A0
        public override void Init()
        {
            ETGModConsole.Commands.AddGroup("bny", delegate(string[] args)
            {
                ETGModConsole.Log("<size=100><color=#ff0000ff>Please specify a command. Type 'bny help' for a list of commands.</color></size>", false);
            });
            ETGModConsole.Commands.GetGroup("bny").AddUnit("help", delegate(string[] args)
            {
                ETGModConsole.Log("<size=100><color=#ff0000ff>List of Commands</color></size>", false);
                ETGModConsole.Log("<color=#ff0000ff>modular_scraps_while_blessed</color> -Turned Off By Default, Toggles whether the Modular can-auto scrap weapons in Blessed Mode.", false);
                //ETGModConsole.Log("<color=#ff0000ff>sacrifice_mode</color> -Turned Off By Default, Toggles whether the Artifact of Sacrifice is enabled even without Sacrifice.", false);
            });

            ETGModConsole.Commands.GetGroup("bny").AddUnit("modular_scraps_while_blessed", delegate(string[] args)
            {
                bool flag = Commands.ModularDoesntAutoScrapGunsInBlessed;
                if (flag)
                {
                    Commands.ModularDoesntAutoScrapGunsInBlessed = false;
                    ETGModConsole.Log("Modular Will Now Auto-Scrap Guns in Blessed Mode.", false);
                }
                else
                {
                    Commands.ModularDoesntAutoScrapGunsInBlessed = true;
                    ETGModConsole.Log("Modular Will Now Not Auto-Scrap Guns in Blessed Mode.", false);
                }
            });
        }
Example #26
0
 private void ConnectClusteredRooms(RoomHandler first, RoomHandler second, PrototypeDungeonRoom firstPrototype, PrototypeDungeonRoom secondPrototype, int firstRoomExitIndex, int secondRoomExitIndex, int room1ExitLengthPadding = 3, int room2ExitLengthPadding = 3)
 {
     if (first.area.instanceUsedExits == null | second.area.exitToLocalDataMap == null |
         second.area.instanceUsedExits == null | first.area.exitToLocalDataMap == null)
     {
         return;
     }
     try {
         first.area.instanceUsedExits.Add(firstPrototype.exitData.exits[firstRoomExitIndex]);
         RuntimeRoomExitData runtimeRoomExitData = new RuntimeRoomExitData(firstPrototype.exitData.exits[firstRoomExitIndex]);
         first.area.exitToLocalDataMap.Add(firstPrototype.exitData.exits[firstRoomExitIndex], runtimeRoomExitData);
         second.area.instanceUsedExits.Add(secondPrototype.exitData.exits[secondRoomExitIndex]);
         RuntimeRoomExitData runtimeRoomExitData2 = new RuntimeRoomExitData(secondPrototype.exitData.exits[secondRoomExitIndex]);
         second.area.exitToLocalDataMap.Add(secondPrototype.exitData.exits[secondRoomExitIndex], runtimeRoomExitData2);
         first.connectedRooms.Add(second);
         first.connectedRoomsByExit.Add(firstPrototype.exitData.exits[firstRoomExitIndex], second);
         first.childRooms.Add(second);
         second.connectedRooms.Add(first);
         second.connectedRoomsByExit.Add(secondPrototype.exitData.exits[secondRoomExitIndex], first);
         second.parentRoom = first;
         runtimeRoomExitData.linkedExit            = runtimeRoomExitData2;
         runtimeRoomExitData2.linkedExit           = runtimeRoomExitData;
         runtimeRoomExitData.additionalExitLength  = room1ExitLengthPadding;
         runtimeRoomExitData2.additionalExitLength = room2ExitLengthPadding;
     } catch (Exception) {
         ETGModConsole.Log("WARNING: Exception caused during CoonectClusteredRunTimeRooms method!");
         return;
     }
 }
Example #27
0
 public static void Init()
 {
     try
     {
         string     itemName     = "Cross Chamber";
         string     resourceName = "LichItems/Resources/Cross_Chamber";
         GameObject obj          = new GameObject(itemName);
         var        item         = obj.AddComponent <AdvancedCompanionItem>();
         ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);
         string shortDesc = "Baby Tombstoner";
         string longDesc  = "A relic that summons a Lich personal guard.";
         ItemBuilder.SetupItem(item, shortDesc, longDesc, "spapi");
         item.quality              = PickupObject.ItemQuality.SPECIAL;
         item.CompanionGuid        = "Cross_Chamber";
         item.Synergies            = new CompanionTransformSynergy[0];
         item.passiveStatModifiers = new StatModifier[0];
         item.UseAdvancedSynergies = true;
         item.AdvancedSynergies    = new AdvancedCompanionTransformSynergy[]
         {
             new AdvancedCompanionTransformSynergy()
             {
                 SynergyCompanionGuid             = "Synergy_Cross_Chamber",
                 UseStringSynergyDetectionInstead = true,
                 RequiredStringSynergy            = "Baby Peacemaker"
             }
         };
         BuildPrefab();
         BuildSynergyPrefab();
     }
     catch (Exception ex)
     {
         ETGModConsole.Log("Something bad happened when creating Cross Chamber. Here's the Exception:");
         ETGModConsole.Log(ex.ToString());
     }
 }
        public static void DropEnemy(string[] _enemyguid)
        {   //method used for debugging, not used in regular settings
            int count = EnemyDatabase.Instance.Entries.Count;

            ETGModConsole.Log(string.Format("There are : {0} in Database", count.ToString()));
            bool re = false;

            ETGModConsole.Log("Removing: " + _enemyguid[0] + " from database");

            for (int i = 0; i < count; i++)
            {
                EnemyDatabaseEntry enemyDatabaseEntry = EnemyDatabase.Instance.Entries[i];

                if (enemyDatabaseEntry != null && enemyDatabaseEntry.myGuid == _enemyguid[0])

                {
                    ETGModConsole.Log("Found: " + _enemyguid[0] + " in database");
                    EnemyDatabase.Instance.Entries.Remove(enemyDatabaseEntry);
                    ETGModConsole.Log("Removed: " + _enemyguid[0] + " from database");
                    re = true;
                    break;
                }
            }

            if (re == false)
            {
                ETGModConsole.Log(_enemyguid[0] + " Not found in database");
            }
        }
Example #29
0
        /// <summary>
        /// Finishes the item setup, adds it to the item databases, adds an encounter trackable
        /// blah, blah, blah
        /// </summary>
        public static void SetupItem(this PickupObject item, string shortDesc, string longDesc, string idPool = "ItemAPI")
        {
            try
            {
                item.encounterTrackable = null;

                ETGMod.Databases.Items.SetupItem(item, item.name);
                SpriteBuilder.AddToAmmonomicon(item.sprite.GetCurrentSpriteDef());
                item.encounterTrackable.journalData.AmmonomiconSprite = item.sprite.GetCurrentSpriteDef().name;

                item.SetName(item.name);
                item.SetShortDescription(shortDesc);
                item.SetLongDescription(longDesc);

                if (item is PlayerItem)
                {
                    (item as PlayerItem).consumable = false;
                }
                Gungeon.Game.Items.Add(idPool + ":" + item.name.ToLower().Replace(" ", "_"), item);
                ETGMod.Databases.Items.Add(item);
                item.RemovePeskyQuestionmark();
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.Message);
                ETGModConsole.Log(e.StackTrace);
            }
        }
 public override void Start()
 {
     ETGModConsole.Log("SkipAmmonomiconAnimation v1.0.0 initialised.");
     Hook AnimationHook = new Hook(
         typeof(AmmonomiconController).GetMethod("HandleOpenAmmonomicon", BindingFlags.Instance | BindingFlags.NonPublic),
         typeof(SkipAmmonomiconAnimation).GetMethod("HandleOpenAmmonomiconHook"));
 }