private static void WindowFunction(int windowID)
 {
     if (windowID == 0)
     {
         GUILayout.BeginArea(new Rect(5f, 15f, 290f, 400f));
         GUILayout.Label(string.Format("Current Actor Name: {0}", GameManager.Instance.PrimaryPlayer.ActorName), new GUILayoutOption[0]);
         GUILayout.Label(string.Format("Current Gun Name: {0}", GameManager.Instance.PrimaryPlayer.CurrentGun.name), new GUILayoutOption[0]);
         if (GUILayout.Button(string.Format("Stealthed {0}", GameManager.Instance.PrimaryPlayer.IsStealthed ? "On" : "Off"), new GUILayoutOption[0]))
         {
             if (GameManager.Instance.PrimaryPlayer.IsStealthed)
             {
                 GameManager.Instance.PrimaryPlayer.gameActor.SetIsStealthed(false, "box");
             }
             else
             {
                 GameManager.Instance.PrimaryPlayer.gameActor.SetIsStealthed(true, "box");
             }
         }
         if (GUILayout.Button(string.Format("Clear Floor", new object[0]), new GUILayoutOption[0]))
         {
             GameManager.Instance.Dungeon.FloorCleared();
         }
         if (GUILayout.Button(string.Format("Heal All Players", new object[0]), new GUILayoutOption[0]))
         {
             for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
             {
                 if (GameManager.Instance.AllPlayers[i].healthHaver.IsAlive)
                 {
                     GameManager.Instance.AllPlayers[i].healthHaver.FullHeal();
                 }
             }
         }
         if (GUILayout.Button(string.Format("Change to Random Gun", new object[0]), new GUILayoutOption[0]))
         {
             GameManager.Instance.PrimaryPlayer.inventory.AddGunToInventory(PickupObjectDatabase.GetRandomGun(), true);
         }
         if (GUILayout.Button(string.Format("Add 100 currency", new object[0]), new GUILayoutOption[0]))
         {
             GameStatsManager.Instance.RegisterStatChange(TrackedStats.META_CURRENCY, 100f);
             GameManager.Instance.PrimaryPlayer.carriedConsumables.Currency += 100;
         }
         if (GUILayout.Button(string.Format("Unlimited Ammo {0}", ModMenu.unlimAmmo ? "On" : "Off"), new GUILayoutOption[0]))
         {
             ModMenu.unlimAmmo = !ModMenu.unlimAmmo;
         }
         if (GUILayout.Button(string.Format("Destroy Enemy Bullets", new object[0]), new GUILayoutOption[0]))
         {
             SilencerInstance.DestroyBulletsInRange(GameManager.Instance.PrimaryPlayer.transform.PositionVector2(), 100f, true, false, null, false, null, false, null);
         }
         if (GUILayout.Button(string.Format("Teleport Hax {0}", ModMenu.teleportHax ? "On" : "Off"), new GUILayoutOption[0]))
         {
             ModMenu.teleportHax = !ModMenu.teleportHax;
         }
         if (GUILayout.Button(string.Format("Spawn Currency", new object[0]), new GUILayoutOption[0]))
         {
             LootEngine.SpawnCurrency(GameManager.Instance.PrimaryPlayer.CenterPosition, 1000, false);
         }
         if (GUILayout.Button(string.Format("Can always steal {0}", ModMenu.canAlwaysSteal ? "On" : "Off"), new GUILayoutOption[0]))
         {
             ModMenu.canAlwaysSteal = !ModMenu.canAlwaysSteal;
         }
         if (GUILayout.Button(string.Format("Add Ammo Automatically {0}", ModMenu.addAmmoAutomatically ? "On" : "Off"), new GUILayoutOption[0]))
         {
             ModMenu.addAmmoAutomatically = !ModMenu.addAmmoAutomatically;
         }
         if (GUILayout.Button(string.Format("Auto Heal {0}", ModMenu.autoHeal ? "On" : "Off"), new GUILayoutOption[0]))
         {
             ModMenu.autoHeal = !ModMenu.autoHeal;
         }
         if (GUILayout.Button(string.Format("Increase Base Ammo", new object[0]), new GUILayoutOption[0]))
         {
             GameManager.Instance.PrimaryPlayer.CurrentGun.SetBaseMaxAmmo(10000);
         }
         GUILayout.EndArea();
     }
     if (windowID == 1)
     {
         GUILayout.BeginArea(new Rect(5f, 15f, 290f, 400f));
         ModMenu.scrollViewVector = GUILayout.BeginScrollView(ModMenu.scrollViewVector, new GUILayoutOption[]
         {
             GUILayout.Width(280f),
             GUILayout.Height(380f)
         });
         if (GameManager.Instance.PrimaryPlayer.inventory.AllGuns != null)
         {
             for (int j = 0; j < GameManager.Instance.PrimaryPlayer.inventory.AllGuns.Count; j++)
             {
                 if (GUILayout.Button(string.Format("Get Ammo for {0}", GameManager.Instance.PrimaryPlayer.inventory.AllGuns[j].DisplayName), ModMenu.BtnStyle, new GUILayoutOption[0]))
                 {
                     GameManager.Instance.PrimaryPlayer.inventory.AllGuns[j].GainAmmo(1000);
                 }
                 GUILayout.Label(string.Concat(new object[]
                 {
                     "Gun Name: ",
                     GameManager.Instance.PrimaryPlayer.inventory.AllGuns[j].name,
                     "\nDisplay Name: ",
                     GameManager.Instance.PrimaryPlayer.inventory.AllGuns[j].DisplayName,
                     "\nGun Ammo: ",
                     GameManager.Instance.PrimaryPlayer.inventory.AllGuns[j].ammo,
                     "\n================"
                 }), new GUILayoutOption[0]);
             }
         }
         GUILayout.EndScrollView();
         GUILayout.EndArea();
     }
     if (windowID == 2)
     {
         GUILayout.BeginArea(new Rect(5f, 15f, 490f, 400f));
         ModMenu.scrollViewVector2 = GUILayout.BeginScrollView(ModMenu.scrollViewVector2, new GUILayoutOption[]
         {
             GUILayout.Width(480f),
             GUILayout.Height(380f)
         });
         int count = PickupObjectDatabase.Instance.Objects.Count;
         for (int k = 0; k < PickupObjectDatabase.Instance.Objects.Count; k++)
         {
             if (PickupObjectDatabase.Instance.Objects[k] != null && PickupObjectDatabase.Instance.Objects[k] is Gun)
             {
                 EncounterTrackable component = PickupObjectDatabase.Instance.Objects[k].GetComponent <EncounterTrackable>();
                 if (component && component.PrerequisitesMet())
                 {
                     if (GUILayout.Button(string.Format("Add {0} to your Inventory", PickupObjectDatabase.Instance.Objects[k].DisplayName), ModMenu.BtnStyle, new GUILayoutOption[0]))
                     {
                         GameManager.Instance.PrimaryPlayer.inventory.AddGunToInventory(PickupObjectDatabase.Instance.Objects[k] as Gun, true);
                     }
                     GUILayout.Label(string.Concat(new object[]
                     {
                         "Gun Name: ",
                         PickupObjectDatabase.Instance.Objects[k].name,
                         "\nDisplay Name: ",
                         PickupObjectDatabase.Instance.Objects[k].DisplayName,
                         "\nItem Quality: ",
                         PickupObjectDatabase.Instance.Objects[k].quality.ToString(),
                         "\n================"
                     }), new GUILayoutOption[0]);
                 }
             }
         }
         GUILayout.EndScrollView();
         GUILayout.EndArea();
     }
     if (windowID == 3)
     {
         GUILayout.BeginArea(new Rect(5f, 15f, 490f, 400f));
         ModMenu.scrollViewVector3 = GUILayout.BeginScrollView(ModMenu.scrollViewVector3, new GUILayoutOption[]
         {
             GUILayout.Width(480f),
             GUILayout.Height(380f)
         });
         for (int l = 0; l < PickupObjectDatabase.Instance.Objects.Count; l++)
         {
             if (PickupObjectDatabase.Instance.Objects[l] != null && PickupObjectDatabase.Instance.Objects[l] is PassiveItem)
             {
                 EncounterTrackable component2 = PickupObjectDatabase.Instance.Objects[l].GetComponent <EncounterTrackable>();
                 if (component2 && component2.PrerequisitesMet())
                 {
                     if (GUILayout.Button(string.Format("Add {0} to your Inventory", PickupObjectDatabase.Instance.Objects[l].DisplayName), ModMenu.BtnStyle, new GUILayoutOption[0]))
                     {
                         GameManager.Instance.PrimaryPlayer.AcquirePassiveItem(PickupObjectDatabase.Instance.Objects[l] as PassiveItem);
                     }
                     GUILayout.Label(string.Concat(new object[]
                     {
                         "Item Name: ",
                         PickupObjectDatabase.Instance.Objects[l].name,
                         "\nDisplay Name: ",
                         PickupObjectDatabase.Instance.Objects[l].DisplayName,
                         "\n================"
                     }), new GUILayoutOption[0]);
                 }
             }
         }
         GUILayout.EndScrollView();
         GUILayout.EndArea();
     }
 }
Esempio n. 2
0
        public override void Start()
        {
            try
            {
                FakePrefabHooks.Init();
                ItemBuilder.Init();
                PlayerEventAdder.Init();
                UnlockHookInators.AddHooks();

                MagmaticBlood.Init();
                MimicSkin.Init();             //Added to the doc
                SaplingBullets.Init();        //Added to the doc
                SlightlyLargerBullets.Init(); //Added to the doc
                WarriorsSyringe.Init();       //Added to the doc
                VultureFeather.Init();        //Added to the doc
                StraponRPG.Init();            //Added to the doc
                Jeremy.Init();                //Added to the doc
                Gasoline.Init();              //Added to the doc
                CatSnack.Init();              //Added to the doc
                ClassicCatSnack.Init();
                JunkSynthesizer.Init();

                WyrmBlood.Init(); //Added to the doc

                //GreenCandy.Init();
                //KeyCandy.Init();
                //GoldenCandy.Init();
                //BlueCandy.Init();
                //RedCandy.Init();
                //HeartCandy.Init();
                //MonsterCandy.Init();
                ImprovedCandies.CandiesInit();
                ImprovedCandies.PositiveEffectsInit();
                //TrickOTreater.Init(); //Added to the doc

                BlackSkull.Init();
                StoneSword.Init();
                StoneAmmolet.Init();
                Randy.Init();

                BeeGun.Add();
                //BloodyCannon.Add();
                //WindStaff.Add();
                RedAndWhite.Add();
                RoyalShotgun.Add();
                //Shotstool.Add();
                RescueRanger.Add();
                NuclearShotgun.Add();
                NuclearAmmoPickup.Init();
                SweeperGun.Add();
                MaliciousRailcannon.Add();
                Superbug.Add();

                PetrifyingMirror.Init();
                EnchantedTome.Init();
                BronzeKey.Init();
                StackOfCash.Init();
                ExecutionShells.Init();
                BloodBullets.Init();
                HoodedShells.Init();
                ClockworkCog.Init();
                HighPriestCloak.Init();
                LuckyCoin.Init();
                LuckyHorseshoe.Init();
                ToxicFungus.Init();
                PurpleGuonStone.Init();
                GarbageBin.Init();
                ColdAmmo.Init();
                MaidenPlating.Init();
                PlagueBullets.Init();
                CrownOfBlood.Init();
                GalacticChest.Init();
                Bravery.Init();
                RaidersAxe.Init();
                BulletSynthesizer.Init();
                ElectricRounds.Init();
                ThunderRounds.Init();
                ToxicHoneycomb.Init();

                BoomerangBullets.Init();
                OilyGreaves.Init();
                ShadyChest.Init();
                //CandyBag.Init();
                MinerHelmet.Init();
                Depthmeter.Init();
                Smore.Init();
                KeyDoubler.Init();
                BlankDoubler.Init();
                CursedCandle.Init();
                MyNameIsYoshikageKira.Init();
                MythrilBullets.Init();
                Charcoal.Init();
                CodexUmbra.Init();
                BloodyDice.Init();
                StarFruit.Init();
                HeartyKey.Init();
                DeadlyKnife.Init();
                Overloader.Init();
                Sushi.Init();
                AmmoEnhancer.Init();
                BanditHat.Init();
                Ushanka.Init();
                BigBoom.Init();
                Seashell.Init();
                //GoldenBox.Init();
                CobaltCoin.Init();

                RingOfWealth.Init();
                QuartzCrystal.Init();
                DeadRinger.Init();
                RoyalCapacitator.Init();
                Cookbook.Init();
                ParrotsFeather.Init();

                Soulbauble.Init();
                FlameWisp.Init();

                CatsEye.Init();
                GunPermit.Init();
                DormantStabiliser.Init();
                CaveCarrot.Init();

                BlueAlbum.Init();

                DoubleABattery.Init();
                ScarecrowsHead.Init();
                OnyxBracelet.Init();
                LemonPig.Init();

                IfritsHorn.Init();
                EnderHelmet.Init();
                BabyGoodRobot.Init();
                CaptainsBrooch.Init();
                SoulInator.Init();

                TwoOfHearts.Init();
                ParasiticFungus.Init();
                ExperimentalRocketLauncher.Init();

                AbyssalShield.Init();

                //Coil.Init();

                //Restock.Init();
                //ChainOfBeing.Init();
                //RangeCrystal.Init();
                //BloodyLockpick.Init();
                //Bitey.Init();
                //JestersHat.Init();
                //PrismaticLexicon.Init();
                //GhoulBullets.Init();

                IncubusStartingPassive.Init();
                IncubusStartingActive.Init();

                /*BlueExplosive.Init();
                 * RedExplosive.Init();
                 * WhiteExplosive.Init();
                 * SwarmSneak.Init();
                 * YVSwarmPickup.Init();
                 * WhiteDamageUp.Init();
                 * Drone.Init();*/

                ETGModConsole.Commands.AddGroup("psmdebug", delegate(string[] args)
                {
                    Log("Please specify a command.", TEXT_COLOR);
                });
                ETGModConsole.Commands.GetGroup("psmdebug").AddUnit("guaranteeproc", delegate(string[] args)
                {
                    DebugChance = !DebugChance;
                    Log($"Guarantee Proc is now: {DebugChance}", TEXT_COLOR);
                });
                ETGModConsole.Commands.GetGroup("psmdebug").AddUnit("unlocks", delegate(string[] args)
                {
                    int totalItems            = 0;
                    int unlockedItems         = 0;
                    List <PickupObject> list  = new List <PickupObject>();
                    List <PickupObject> list2 = new List <PickupObject>();
                    foreach (PickupObject item in ItemBuilder.AddedItems)
                    {
                        EncounterTrackable trolling = item.GetComponent <EncounterTrackable>();
                        if (trolling && trolling.prerequisites != null && trolling.prerequisites.Length > 0)
                        {
                            totalItems++;
                            if (trolling.PrerequisitesMet())
                            {
                                unlockedItems++;
                                list2.Add(item);
                            }
                            else
                            {
                                list.Add(item);
                            }
                        }
                    }
                    Log($"Unlocked: {unlockedItems}/{totalItems}", TEXT_COLOR);
                    if (list2.Count > 0)
                    {
                        Log("Items Unlocked:", TEXT_COLOR);
                        foreach (PickupObject item in list2)
                        {
                            Log(item.name, TEXT_COLOR);
                        }
                    }
                    if (list.Count > 0)
                    {
                        Log("Items Left:", TEXT_COLOR);
                        foreach (PickupObject item in list)
                        {
                            Log($"{item.name}: {Unlocks[item.PickupObjectId]}", TEXT_COLOR);
                        }
                    }
                });
                ETGModConsole.Commands.GetGroup("psmdebug").AddUnit("getcustommaximums", delegate(string[] args)
                {
                    Log($"Most Damage Had: {DaveAPIManager.GetPlayerMaximum(CustomTrackedMaximums.MAXIMUM_DAMAGE)}", TEXT_COLOR);
                    Log($"Most Health Had: {DaveAPIManager.GetPlayerMaximum(CustomTrackedMaximums.MAXIMUM_HEALTH)}", TEXT_COLOR);
                    Log($"Most Money Had: {DaveAPIManager.GetPlayerMaximum(CustomTrackedMaximums.MOST_MONEY)}", TEXT_COLOR);
                });
            }
            catch (Exception ex)
            {
                itemsLoad = $"{ex}";
            }

            ETGMod.StartGlobalCoroutine(IfOtherModsExist());
        }