Exemple #1
0
        public ShareSuite()
        {
            InitWrap();
            On.RoR2.Console.Awake += (orig, self) =>
            {
                FrogtownInterface.Init(Config);
                orig(self);
            };
            CommandHelper.AddToConsoleWhenReady();

            #region Hook registration

            // Register all the hooks
            GeneralHooks.OverrideBossScaling();
            GeneralHooks.OnPlaceTeleporter();
            GeneralHooks.OnTpInteraction();
            ItemSharingHooks.OnGrantItem();
            ItemSharingHooks.OnShopPurchase();
            ItemSharingHooks.OnPurchaseDrop();
            MoneySharingHooks.SharedMoneyValue = 0;
            MoneySharingHooks.ModifyGoldReward();
            MoneySharingHooks.BrittleCrownHook();
            MoneySharingHooks.SplitTpMoney();
            EquipmentSharingHooks.OnGrantEquipment();

            #endregion
        }
Exemple #2
0
        public ShareSuite()
        {
            InitConfig();
            CommandHelper.AddToConsoleWhenReady();

            foreach (var pluginInfo in BepInEx.Bootstrap.Chainloader.PluginInfos)
            {
                if (pluginInfo.Value.Metadata.GUID.Equals("dev.wildbook.multitudes"))
                {
                    pluginInfo.Value.Instance.Config.TryGetEntry("Game", "Multiplier", out _multitudesMultiplierConfig);
                    break;
                }
            }

            //On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };

            // Assign the amount of default max drops the scavenger gives.
            DefaultMaxScavItemDropCount = EntityStates.ScavBackpack.Opening.maxItemDropCount;

            #region Hook registration

            // Register all the hooks
            ReloadHooks();
            MoneySharingHooks.SharedMoneyValue = 0;

            #endregion
        }
Exemple #3
0
        public void Awake()
        {
            SetupConfig();

            CommandHelper.AddToConsoleWhenReady();

            On.RoR2.UI.CharacterSelectController.Awake += CharacterSelectController_Awake;
            //On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += UpdateSurvivorCache;

            switch (LobbyViewType)
            {
            case LobbyViewType.Default:
                break;

            case LobbyViewType.Hide:
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += HideOnSelected;
                break;

            case LobbyViewType.Zoom:
                On.RoR2.UI.CharacterSelectController.SelectSurvivor += ZoomOnSelected;
                break;
            }
            if (ReplayAnim.Value)
            {
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += ReplayAnimationOnSelect;
            }
            if (DisableShaking.Value)
            {
                On.RoR2.PreGameShakeController.Awake += SetShakerInactive;
            }
            if (SurvivorsInLobby.Value && LivePreview.Value)
            {
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += UpdateCharacterPreview;
            }
        }
Exemple #4
0
        public static void InitializeHooks()
        {
            IL.RoR2.Console.Awake       += UnlockConsole;
            On.RoR2.Console.InitConVars += InitCommandsAndFreeConvars;
            CommandHelper.AddToConsoleWhenReady();

            var runCmdHook = new Hook(typeof(Console).GetMethodCached("RunCmd"),
                                      typeof(Hooks).GetMethodCached(nameof(LogNetworkCommandsAndCheckPermissions)), new HookConfig {
                Priority = 1
            });

            _origRunCmd = runCmdHook.GenerateTrampoline <On.RoR2.Console.orig_RunCmd>();

            On.RoR2.Console.AutoComplete.SetSearchString += BetterAutoCompletion;
            On.RoR2.Console.AutoComplete.ctor            += CommandArgsAutoCompletion;
            IL.RoR2.UI.ConsoleWindow.Update += SmoothDropDownSuggestionNavigation;
            IL.RoR2.Networking.GameNetworkManager.CCSetScene += EnableCheatsInCCSetScene;

            // Noclip hooks
            var hookConfig = new HookConfig()
            {
                ManualApply = true
            };

            Command_Noclip.OnServerChangeSceneHook = new Hook(typeof(NetworkManager).GetMethodCached("ServerChangeScene"),
                                                              typeof(Command_Noclip).GetMethodCached("DisableOnServerSceneChange"), hookConfig);
            Command_Noclip.origServerChangeScene   = Command_Noclip.OnServerChangeSceneHook.GenerateTrampoline <Command_Noclip.d_ServerChangeScene>();
            Command_Noclip.OnClientChangeSceneHook = new Hook(typeof(NetworkManager).GetMethodCached("ClientChangeScene"),
                                                              typeof(Command_Noclip).GetMethodCached("DisableOnClientSceneChange"), hookConfig);
            Command_Noclip.origClientChangeScene = Command_Noclip.OnClientChangeSceneHook.GenerateTrampoline <Command_Noclip.d_ClientChangeScene>();
        }
Exemple #5
0
        private void Awake()
        {
            _logger = Logger;
            CommandHelper.AddToConsoleWhenReady();
            Hooks();
            FreeTheLockedMage();

            //On.RoR2.BodyCatalog.Init += BodyCatalog_Init;
        }
Exemple #6
0
 public static void InitializeHooks()
 {
     IL.RoR2.Console.Awake       += UnlockConsole;
     On.RoR2.Console.InitConVars += InitCommandsAndFreeConvars;
     CommandHelper.AddToConsoleWhenReady();
     On.RoR2.Console.RunCmd += LogNetworkCommands;
     On.RoR2.Console.AutoComplete.SetSearchString += BetterAutoCompletion;
     On.RoR2.Console.AutoComplete.ctor            += CommandArgsAutoCompletion;
 }
Exemple #7
0
        public void Awake()
        {
            Debug.LogError("Warning, this mod is hardcoded, which means that new survivors have to be inputted manually.");

            CommandHelper.AddToConsoleWhenReady();

            On.RoR2.UI.MainMenu.MainMenuController.Start += MainMenuController_Start;

            //On.RoR2.UI.CharacterSelectController.SelectSurvivor += CharacterSelectController_SelectSurvivor;
            On.RoR2.UI.CharacterSelectController.Start += CharacterSelectController_Start;
        }
        public void Awake()
        {
            CommandHelper.AddToConsoleWhenReady();

            On.RoR2.UI.CharacterSelectController.SelectSurvivor += CharacterSelectController_SelectSurvivor;
            On.RoR2.UI.CharacterSelectController.Start          += CharacterSelectController_Start;

            On.RoR2.TeamManager.GetTeamExperience  += TeamManager_GetTeamExperience;
            On.RoR2.CharacterBody.RecalculateStats += CharacterBody_RecalculateStats;

            //On.EntityStates.SpawnTeleporterState.OnEnter += SpawnTeleporterState_OnEnter1;
            //On.EntityStates.SpawnTeleporterState.OnExit += SpawnTeleporterState_OnExit;
        }
        public ShareSuite()
        {
            InitConfig();
            CommandHelper.AddToConsoleWhenReady();

            #region Hook registration

            // Register all the hooks
            ReloadHooks();
            MoneySharingHooks.SharedMoneyValue = 0;

            #endregion
        }
Exemple #10
0
        public void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else
            {
                Destroy(this);
            }

            PopulateSavesMetadata();

            IsOldTLCDefined = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.MagnusMagnuson.TemporaryLunarCoins");
            IsTLCDefined    = IsOldTLCDefined || BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.blazingdrummer.TemporaryLunarCoins");
            IsSIGUIDefined  = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.Phedg1Studios.StartingItemsGUI");

            CommandHelper.AddToConsoleWhenReady();

            if (IsOldTLCDefined)
            {
                try
                {
                    RegisterTLCOverride();
                }
                catch (Exception e)
                {
                    Debug.LogError("Failed to add support for TemporaryLunarCoins");
                }
            }

            if (IsSIGUIDefined)
            {
                try
                {
                    RegisterSIGUIOverride();
                }
                catch (Exception e)
                {
                    Debug.LogError("Failed to add support for StartingItemsGUI");
                }
            }

            RegisterGameLoading();

            RegisterGameSaving();

            RegisterLobbyButton();
        }
Exemple #11
0
        public static void InitializeHooks()
        {
            IL.RoR2.Console.Awake       += UnlockConsole;
            On.RoR2.Console.InitConVars += InitCommandsAndFreeConvars;
            CommandHelper.AddToConsoleWhenReady();

            On.RoR2.PreGameController.Awake += SeedHook;

            On.RoR2.CombatDirector.SetNextSpawnAsBoss += CombatDirector_SetNextSpawnAsBoss;
            IL.RoR2.ClassicStageInfo.Awake            += ClassicStageInfo_Awake;
            On.RoR2.Stage.Start += Stage_Start;

            //IL.RoR2.Networking.GameNetworkManager.FixedUpdateServer += GameNetworkManager_FixedUpdateServer;
            //IL.RoR2.Networking.GameNetworkManager.cctor += GameNetworkManager_cctor;
        }
Exemple #12
0
        public ShareSuite()
        {
            InitConfig();
            CommandHelper.AddToConsoleWhenReady();

            //On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };

            #region Hook registration

            // Register all the hooks
            ReloadHooks();
            MoneySharingHooks.SharedMoneyValue = 0;

            #endregion
        }
Exemple #13
0
 private void Awake()
 {
     //Thank SOM for being a poggers
     EggsUtils.EggsUtils.LogToConsole("Thanks SOM for the icon work <3");
     //Add our commands to the console
     CommandHelper.AddToConsoleWhenReady();
     //Load up the config file
     Configuration.LoadConfig();
     //Load up all the resources
     Assets.LoadResources();
     //Load up achievements and unlockables before skills
     UnlocksRegistering.RegisterUnlockables();
     //Finally load up the skills
     RegisterSkills();
     //Tell the console that things went just as expected :)
     EggsUtils.EggsUtils.LogToConsole("EggsSkills fully loaded!");
 }
    public void Awake()
    {
        //We create an empty gameobject to hold all our networked components. The name of this GameObject is largely irrelevant.
        var tmpGo = new GameObject("tmpGo");

        //Add the networkidentity so that Unity knows which Object it's going to be networking all about.
        tmpGo.AddComponent <NetworkIdentity>();
        //Thirdly, we use InstantiateClone from the PrefabAPI to make sure we have full control over our GameObject.
        CentralNetworkObject = tmpGo.InstantiateClone("somethingUnique");
        // Delete the now useless temporary GameObject
        GameObject.Destroy(tmpGo);
        //Finally, we add a specific component that we want networked. In this example, we will only be adding one, but you can add as many components here as you like. Make sure these components inherit from NetworkBehaviour.
        CentralNetworkObject.AddComponent <MyNetworkComponent>();

        //In this specific example, we use a console command. You can look at https://github.com/risk-of-thunder/R2Wiki/wiki/Console-Commands for more information on that.
        CommandHelper.AddToConsoleWhenReady();
    }
Exemple #15
0
        public void Awake()
        {
            #if DEBUG
            Logger.LogWarning("Running TurboEdition DEBUG build. PANIC!");
            #endif
            instance = this;
            _logger  = Logger;

            if (BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.Starstorm2"))
            {
                starstormInstalled = true;
            }
            ;
            BootUp();


            CommandHelper.AddToConsoleWhenReady();
        }
Exemple #16
0
        public ShareSuite()
        {
            InitConfig();
            CommandHelper.AddToConsoleWhenReady();

            //On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };

            // Assign the amount of default max drops the scavenger gives.
            DefaultMaxScavItemDropCount = EntityStates.ScavBackpack.Opening.maxItemDropCount;

            #region Hook registration

            // Register all the hooks
            ReloadHooks();
            MoneySharingHooks.SharedMoneyValue = 0;

            #endregion
        }
Exemple #17
0
        public void Awake()
        {
            _logger = this.Logger;
            ConfigFile cfgFile = new ConfigFile(Paths.ConfigPath + "\\" + ModGuid + ".cfg", true);

            /*var cfgRegrabCooldown = cfgFile.Bind(new ConfigDefinition("Yeet", "RegrabCooldown"), 5f, new ConfigDescription(
             *  "Time (in seconds) to prevent picking an item back up after dropping it. Does not apply to other players, only the dropper. Set to <= 0 to disable.",
             *  new AcceptableValueRange<float>(0f,float.MaxValue)));*/

            var cfgLowThrowForce = cfgFile.Bind(new ConfigDefinition("YeetServer", "LowThrowForce"), 30f, new ConfigDescription(
                                                    "Minimum speed, in player view direction, to add to droplets for dropped items.",
                                                    new AcceptableValueRange <float>(0f, float.MaxValue)));
            var cfgHighThrowForce = cfgFile.Bind(new ConfigDefinition("YeetServer", "HighThrowForce"), 150f, new ConfigDescription(
                                                     "Maximum speed, in player view direction, to add to droplets for dropped items.",
                                                     new AcceptableValueRange <float>(0f, float.MaxValue)));
            var cfgHighThrowTime = cfgFile.Bind(new ConfigDefinition("YeetClient", "HoldTime"), 2f, new ConfigDescription(
                                                    "Click hold time (sec) required to reach HighThrowForce.",
                                                    new AcceptableValueRange <float>(0f, float.MaxValue)));

            var cfgPreventLunar = cfgFile.Bind(new ConfigDefinition("YeetServer", "PreventLunar"), true, new ConfigDescription(
                                                   "If true, lunar items cannot be dropped (to preserve the consequences of picking one up)."));
            var cfgPreventEquipment = cfgFile.Bind(new ConfigDefinition("YeetServer", "PreventEquipment"), false, new ConfigDescription(
                                                       "If true, equipment items cannot be dropped."));
            var cfgPreventItems = cfgFile.Bind(new ConfigDefinition("YeetServer", "PreventItems"), false, new ConfigDescription(
                                                   "If true, all non-equipment items cannot be dropped."));

            //regrabCooldown = cfgRegrabCooldown.Value;
            lowThrowForce  = cfgLowThrowForce.Value;
            highThrowForce = cfgHighThrowForce.Value;
            highThrowTime  = cfgHighThrowTime.Value;

            preventLunar     = cfgPreventLunar.Value;
            preventEquipment = cfgPreventEquipment.Value;
            preventItems     = cfgPreventItems.Value;

            On.RoR2.UI.ItemIcon.Awake       += ItemIcon_Awake;
            On.RoR2.UI.EquipmentIcon.Update += EquipmentIcon_Update;
            On.RoR2.PickupDropletController.OnCollisionEnter += PickupDropletController_OnCollisionEnter;

            CommandHelper.AddToConsoleWhenReady();
        }
Exemple #18
0
        public void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else
            {
                Destroy(this);
            }

            IsTLCDefined = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.MagnusMagnuson.TemporaryLunarCoins");

            RegisterLanguage();

            CommandHelper.AddToConsoleWhenReady();

            RegisterGameLoading();

            RegisterContinueButton();
        }
Exemple #19
0
        public void Awake()
        {
            SetupConfig();
            LobbyViewType = (StaticValues.LobbyViewType)SelectViewMode.Value;
            SceneType     = (StaticValues.SceneType)SelectedScene.Value;

            CommandHelper.AddToConsoleWhenReady();

            On.RoR2.UI.CharacterSelectController.Awake += CharacterSelectController_Awake;

            // BACKGROUND ELEMENTS //
            if (DisableShaking.Value)
            {
                On.RoR2.PreGameShakeController.Awake += SetShakerInactive;
            }

            // SURVIVORS IN LOBBY //

            switch (LobbyViewType)
            {
            case LobbyViewType.Default:
                break;

            case LobbyViewType.Hide:
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += HideOnSelected;
                break;

            case LobbyViewType.Zoom:
                On.RoR2.UI.CharacterSelectController.SelectSurvivor += ZoomOnSelected;
                break;
            }
            if (SurvivorsInLobby.Value && LivePreview.Value)
            {
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += UpdateCharacterPreview;
            }
            if (ReplayAnim.Value)
            {
                On.RoR2.UI.CharacterSelectController.OnNetworkUserLoadoutChanged += ReplayAnimationOnSelect;
            }
        }
Exemple #20
0
        public void Awake()
        {
            _logger = Logger;

            cfgFile = new ConfigFile(System.IO.Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);

            T2Module.SetupModuleClass();

            allModules = T2Module.InitModules(new T2Module.ModInfo {
                displayName     = "TILER2",
                mainConfigFile  = cfgFile,
                longIdentifier  = "TILER2",
                shortIdentifier = "TILER2"
            });

            T2Module.SetupAll_PluginAwake(allModules);

            MiscUtil.Setup();
            DebugUtil.Setup();

            CommandHelper.AddToConsoleWhenReady();
        }
Exemple #21
0
        public void Awake()
        {
            Logger = base.Logger;
            NetworkingAPI.RegisterMessageType <DropItemMessage>();

            IL.RoR2.UI.ItemInventoryDisplay.AllocateIcons += OnItemIconAddedHook;
            IL.RoR2.UI.ScoreboardStrip.SetMaster          += OnEquipmentIconAddedHook;

            RootObject = new GameObject("DropItemsMod");
            DontDestroyOnLoad(RootObject);
            DropItemHandler = RootObject.AddComponent <DropItemHandler>();

            CommandHelper.AddToConsoleWhenReady();

            OnItemIconAdded += (itemIcon) => {
                if (itemIcon.GetComponent <DropItemHandler>() != null)
                {
                    return;
                }

                Func <CharacterMaster> getCharacterMaster = () => itemIcon.rectTransform.parent.GetComponent <ItemInventoryDisplay>().GetFieldValue <Inventory>("inventory").GetComponent <CharacterMaster>();

                var dropItemHandler = itemIcon.transform.gameObject.AddComponent <DropItemHandler>();
                dropItemHandler.SetData(getCharacterMaster, () => PickupCatalog.FindPickupIndex(itemIcon.GetFieldValue <ItemIndex>("itemIndex")));
            };

            OnEquipmentIconAdded += (equipmentIcon) => {
                if (equipmentIcon.GetComponent <DropItemHandler>() != null)
                {
                    return;
                }

                var dropItemHandler = equipmentIcon.transform.gameObject.AddComponent <DropItemHandler>();
                dropItemHandler.SetData(() => equipmentIcon.targetInventory.GetComponent <CharacterMaster>(), () => PickupCatalog.FindPickupIndex(equipmentIcon.targetInventory.GetEquipmentIndex()));
            };
        }
Exemple #22
0
 private void Awake()
 {
     _logger = Logger;
     CommandHelper.AddToConsoleWhenReady();
     Other();
 }
 private void Awake() //Called when loaded by BepInEx.
 {
     CommandHelper.AddToConsoleWhenReady();
 }
 public void Awake()
 {
     CommandHelper.AddToConsoleWhenReady();
 }
 internal static void RegisterCommands()
 {
     CommandHelper.AddToConsoleWhenReady();
 }
Exemple #26
0
 public void Awake()
 {
     CommandHelper.AddToConsoleWhenReady();
     R2API.SceneAssetAPI.AddAssetRequest("moon", GetSceneObjects);
 }
Exemple #27
0
        internal static void Init()
        {
            On.RoR2.Console.Awake += (orig, self) =>
            {
                CommandHelper.AddToConsoleWhenReady();
                orig(self);
            };
            On.RoR2.HuntressTracker.Awake += (orig, self) =>
            {
                orig(self);
                Variables.DefaultHuntressTrackingDistance = self.maxTrackingDistance;
            };
            On.RoR2.CharacterBody.OnInventoryChanged += (orig, self) =>
            {
                orig(self);
                if (self.isPlayerControlled && Variables.MyCharacterIndex == 6)
                {
                    self.GetComponent <HuntressTracker>().maxTrackingDistance = Variables.DefaultHuntressTrackingDistance + (15 * self.inventory.GetItemCount(Assets.MagnifingGlassItemDef.itemIndex));
                }
                if (self.isPlayerControlled && Variables.MyCharacterIndex == 0)
                {
                    SkillLocator locator = self.GetComponent <SkillLocator>();
                    locator.primary.SetBonusStockFromBody((self.inventory.GetItemCount(Assets.ExtendedMagItemDef.itemIndex)));
                    locator.primary.stock = locator.primary.maxStock;
                }
            };
            On.RoR2.Run.Start += (orig, self) =>
            {
                foreach (var playerCharacterMasterControllerInstance in PlayerCharacterMasterController.instances)
                {
                    if (playerCharacterMasterControllerInstance.isLocalPlayer)
                    {
                        Variables.MyBody = playerCharacterMasterControllerInstance.master.bodyPrefab.GetComponent <CharacterBody>();
                        break;
                    }
                }
                orig(self);
            };
            On.RoR2.Run.BuildDropTable += (orig, self) =>
            {
                if (!Variables.HasHuntress)
                {
                    self.availableItems.Remove(Assets.MagnifingGlassItemDef.itemIndex);
                }
                if (!Variables.HasBandit)
                {
                    self.availableItems.Remove(Assets.ExtendedMagItemDef.itemIndex);
                }
                orig(self);
            };
            On.RoR2.GenericPickupController.GetInteractability += (orig, self, activator) =>
            {
                if (PickupCatalog.GetPickupDef(self.pickupIndex).itemIndex == Assets.MagnifingGlassItemDef.itemIndex && Variables.MyCharacterIndex != 6)
                {
                    return(Interactability.ConditionsNotMet);
                }
                if (PickupCatalog.GetPickupDef(self.pickupIndex).itemIndex == Assets.ExtendedMagItemDef.itemIndex && Variables.MyCharacterIndex != 0)
                {
                    return(Interactability.ConditionsNotMet);
                }
                return(orig(self, activator));
            };
            On.RoR2.GenericPickupController.OnTriggerStay += (orig, self, other) =>
            {
                if (PickupCatalog.GetPickupDef(self.pickupIndex).itemIndex == Assets.MagnifingGlassItemDef.itemIndex && Variables.MyCharacterIndex != 6)
                {
                    return;
                }
                if (PickupCatalog.GetPickupDef(self.pickupIndex).itemIndex == Assets.ExtendedMagItemDef.itemIndex && Variables.MyCharacterIndex != 0)
                {
                    return;
                }
                orig(self, other);
            };
            On.RoR2.SceneDirector.PopulateScene += (orig, self) =>
            {
                self.interactableCredit = (int)(self.interactableCredit * Variables.interactableMultiplier.Value);
                orig(self);
            };
            On.RoR2.CharacterMaster.GiveMoney += (orig, self, amount) =>
            {
                amount = (uint)(amount * Variables.moneyMultiplier.Value);
                orig(self, amount);
            };
            On.RoR2.PreGameController.StartRun += (orig, self) =>
            {
                int count = NetworkUser.readOnlyInstancesList.Count;
                for (int i = 0; i < count; i++)
                {
                    var body  = BodyCatalog.GetBodyPrefab(NetworkUser.readOnlyInstancesList[i].bodyIndexPreference);
                    int index = (int)SurvivorCatalog.FindSurvivorDefFromBody(body).survivorIndex;
                    //Stores your survivor index
                    if (i == 0)
                    {
                        Variables.MyCharacterIndex = index;
                    }
                    if (index == 0)
                    {
                        Variables.HasBandit = true;
                    }
                    if (index == 6)
                    {
                        Variables.HasHuntress = true;
                    }
                }

                orig(self);
            };
        }