public static void EnterSubworld(string whereto, bool vote = false)
        {
            if (Main.netMode != NetmodeID.SinglePlayer)
            {
                return;
            }


            DimDungeonsProxy.DungeonSeeds = (int)(System.DateTime.Now.Millisecond * 1370.3943162338);
            //DimDungeons.DungeonSeeds = (int)((Main.time+SGAWorld.dungeonlevel) * (double)(Math.PI*17));
            SGAmod.cachedata = true;
            if (SGAPocketDim.WhereAmI != null)
            {
                if (SGAPocketDim.WhereAmI == typeof(LimboDim))
                {
                    SGAWorld.dungeonlevel = 0;
                    SLWorld.noReturn      = true;
                }
            }
            Subworld.Enter(whereto, !vote);
            if (SGAPocketDim.WhereAmI == typeof(DeeperDungeon))
            {
                SGAWorld.dungeonlevel += 1;
            }

            SGAWorld.highestDimDungeonFloor = (byte)Math.Max(SGAWorld.dungeonlevel, SGAWorld.highestDimDungeonFloor);
        }
Example #2
0
 public override bool UseItem(Player player)
 {
     if (!Subworld.AnyActive <Macrocosm>())
     {
         Subworld.Enter <Moon>();
     }
     else
     {
         Subworld.Exit();
     }
     return(true);
 }
Example #3
0
        public override void OnInitialize()
        {                                  // 1
            UIPanel panel = new UIPanel(); // 2

            panel.Width.Set(1000, 0);      // 3
            panel.Height.Set(1000, 0);     // 3
            panel.HAlign = 0.5f;
            panel.VAlign = 0.5f;
            Append(panel); // 4
            UIList worldSelect = new UIList();

            worldSelect.Width.Set(800, 0);
            worldSelect.Height.Set(800, 0);
            worldSelect.HAlign = 0.5f;
            worldSelect.VAlign = 0.5f;
            int i = 5;
            UIClickableButton worldButton;

            foreach (string name in SubworldManager.WorldsEnter.Keys)
            {
                void OnButtonClick(UIMouseEvent evt, UIElement listeningElement)
                {
                    if (Main.netMode != NetmodeID.Server)
                    {
                        Subworld.Enter(SubworldManager.WorldsEnter[name]);
                    }
                    Multiverse.instance.HideMyUI();
                }

                worldButton = new UIClickableButton(name, OnButtonClick);
                worldButton.Width.Set(600, 0);
                worldButton.Height.Set(100, 0);
                worldButton.HAlign = 0.5f;
                worldButton.Top.Set(i, 0);
                i += 105;
                worldSelect.Add(worldButton);
            }
            panel.Append(worldSelect);
            UIImageButton closeButton = new UIImageButton(ModContent.GetTexture("Terraria/UI/ButtonDelete"));

            closeButton.OnClick += OnCloseClick;
            closeButton.Width.Set(22, 0);  // 5
            closeButton.Height.Set(22, 0); // 5
            closeButton.HAlign = 1.0f;
            closeButton.VAlign = 0.0f;
            void OnCloseClick(UIMouseEvent evt, UIElement listeningElement)
            {
                Multiverse.instance.HideMyUI();
            }

            panel.Append(closeButton);
        }
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (firstButton && NPC.downedBoss3 && !DungeonWorld.DungeonSubworld.inDungeon)
            {
                Subworld.Enter <DungeonSubworld>();
            }

            var obj = typeof(Subworld).GetField("subworlds", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);

            if (firstButton && DungeonWorld.DungeonSubworld.inDungeon)
            {
                Subworld.Exit();
            }

            base.OnChatButtonClicked(firstButton, ref shop);
        }
Example #5
0
 public static void TeleportCorrectWorld(bool noVote = false)
 {
     if (Subworld.IsActive <ShipSubworld>())//based on active subworld, may change to use active subworld ID
     {
         //Main.NewText(planetArray[SelectedPlanet].EntryString);
         if (planetArray[SelectedPlanet].EntryString == string.Empty)
         {
             Subworld.Exit(noVote);
         }
         else
         {
             Subworld.Enter(planetArray[SelectedPlanet].EntryString, noVote);
         }
     }
     else
     {
         Subworld.Enter <ShipSubworld>(noVote);
     }
 }
Example #6
0
        public override void Action(CommandCaller caller, string input, string[] args)
        {
            if (args.Length > 0 && Main.netMode != NetmodeID.Server)
            {
                switch (args[0])
                {
                case "enter":
                    Subworld.Enter(SubworldManager.WorldsEnter[args[1]]);
                    Main.NewText(caller.Player.name + " Entered " + args[1], 0, 255, 0);
                    break;

                case "leave":
                    Subworld.Exit();
                    Main.NewText(caller.Player.name + " Entered Main World", 0, 255, 0);
                    break;

                case "list":
                    foreach (KeyValuePair <string, string> entry in SubworldManager.WorldsEnter)
                    {
                        Main.NewText(entry.Key, 0, 255, 0);
                    }
                    break;

                case "gui":
                    switch (args[1])
                    {
                    case "on":
                        Multiverse.instance.ShowMyUI();
                        break;

                    case "off":
                        Multiverse.instance.HideMyUI();
                        break;
                    }
                    break;
                }
            }
            else
            {
                throw new UsageException();
            }
        }
Example #7
0
        public override void Load()
        {
            noxiumInstance = GetInstance <NoxiumMod>();

            SeedHotkey = RegisterHotKey("Seed Fruit", "C");

            if (!Main.dedServ)
            {
                AhmUI          = new AhmBar();
                AHMUiInterface = new UserInterface();
                AHMUiInterface.SetState(AhmUI);

                dimensionalUI = new DimensionalUI();
                dimensionalUI.LoadUI();
                dimensionalUI.Activate();

                JoiningUI.LoadLoadingSymbol();

                /* Examples:
                 *
                 *              dimensionalUI.RegisterDimension("The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), () => Main.dayTime, () => Main.NewText("Welcome to the cum zone"));
                 *              // Appears as 'The Cum Zone', shows a dirt block texture, only appears in the day, when clicked will say 'Welcome to the cum zone'.
                 *
                 *              dimensionalUI.RegisterDimension("Hell", ModContent.GetTexture("Terraria/Item_1"), () => !Main.dayTime, () => Main.NewText("Welcome to hell"));
                 *              // Appears as 'Hell', shows an iron pickaxe texture, only appears at night, when clicked will say 'Welcome to hell'.
                 *
                 *              Call("AddDimension", "The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), (Func<bool>)(() => Main.dayTime), (Action)(() => Main.NewText("Welcome to the cum zone")));
                 *              // Example of a mod.Call to add a dimension.
                 *
                 */
                // Gaming
                dimensionalUI.RegisterDimension("Plasma Desert", ModContent.GetTexture("NoxiumMod/PlasmaDesert"), () => true, () => Subworld.Enter <PlasmaDesert>());
                dimensionalUI.RegisterDimension("The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), () => true, () => Main.NewText("Welcome to the cum zone"));

                dimensionalInterface = new UserInterface();
            }

            Mod yabhb = ModLoader.GetMod("FKBossHealthBar");

            if (yabhb != null)
            {
                yabhb.Call("hbStart");
                yabhb.Call("hbSetTexture", GetTexture("UI/AhmHealthStart"), GetTexture("UI/AhmHealthMid"), GetTexture("UI/AhmHealthEnd"), GetTexture("UI/AhmHealthFill"));
                yabhb.Call("hbFinishSingle", NPCType("AncientHealingMachine"));
            }
        }
Example #8
0
 public override bool UseItem(Player player)
 {
     Subworld.Enter <PlasmaDesert>();
     return(true);
 }
Example #9
0
 public override bool UseItem(Player player)
 {
     Subworld.Enter <CelestialModSubworld>();
     return(true);
 }
Example #10
0
        public override void Load()
        {
            noxiumInstance = GetInstance <NoxiumMod>();

            vanillaScreenMatrix = typeof(SpriteViewMatrix).GetField("_transformationMatrix", BindingFlags.NonPublic | BindingFlags.Instance);
            vanillaUIMatrix     = typeof(Main).GetField("_uiScaleMatrix", BindingFlags.NonPublic | BindingFlags.Static);

            On.Terraria.Graphics.SpriteViewMatrix.ShouldRebuild += (On.Terraria.Graphics.SpriteViewMatrix.orig_ShouldRebuild orig, SpriteViewMatrix self) =>
            {
                if (doingBarrelRoll)
                {
                    return(false);
                }
                return(orig(self));
            };

            ComputerUI.PleaseForTheLoveOfGodDontOpenChatWhenIPressEnter();

            HitboxesGlobalItem.meleeHitbox = new Rectangle?[256];

            SeedHotkey = RegisterHotKey("Seed Fruit", "C");

            if (!Main.dedServ)
            {
                AhmUI          = new AhmBar();
                AHMUiInterface = new UserInterface();
                AHMUiInterface.SetState(AhmUI);

                dimensionalUI = new DimensionalUI();
                dimensionalUI.LoadUI();
                dimensionalUI.Activate();

                computerInterface = new UserInterface();
                computerUI        = new ComputerUIState();
                computerUI.Activate();

                JoiningUI.LoadLoadingSymbol();

                PlasmaDesert.LoadBubbleTextures();

                /* Examples:
                 *
                 *              dimensionalUI.RegisterDimension("The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), () => Main.dayTime, () => Main.NewText("Welcome to the cum zone"));
                 *              // Appears as 'The Cum Zone', shows a dirt block texture, only appears in the day, when clicked will say 'Welcome to the cum zone'.
                 *
                 *              dimensionalUI.RegisterDimension("Hell", ModContent.GetTexture("Terraria/Item_1"), () => !Main.dayTime, () => Main.NewText("Welcome to hell"));
                 *              // Appears as 'Hell', shows an iron pickaxe texture, only appears at night, when clicked will say 'Welcome to hell'.
                 *
                 *              Call("AddDimension", "The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), (Func<bool>)(() => Main.dayTime), (Action)(() => Main.NewText("Welcome to the cum zone")));
                 *              // Example of a mod.Call to add a dimension.
                 *
                 */
                // Gaming
                dimensionalUI.RegisterDimension("Plasma Desert", ModContent.GetTexture("NoxiumMod/PlasmaDesert"), () => true, () => Subworld.Enter <PlasmaDesert>());
                dimensionalUI.RegisterDimension("The Cum Zone", ModContent.GetTexture("Terraria/Item_2"), () => true, () => Main.NewText("Welcome to the cum zone"));

                dimensionalInterface = new UserInterface();
            }

            Mod yabhb = ModLoader.GetMod("FKBossHealthBar");

            if (yabhb != null)
            {
                yabhb.Call("hbStart");
                yabhb.Call("hbSetTexture", GetTexture("UI/AhmHealthStart"), GetTexture("UI/AhmHealthMid"), GetTexture("UI/AhmHealthEnd"), GetTexture("UI/AhmHealthFill"));
                yabhb.Call("hbFinishSingle", NPCType("AncientHealingMachine"));
            }
        }