示例#1
0
        private void Awake() //Sourced almost entirely from ThinkInvis' Classic Items. It is also extremely handy.
        {
            _logger = Logger;

#if DEBUG
            Logger.LogWarning("DEBUG mode is enabled! Ignore this message if you are actually debugging.");
            On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };
#endif

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aetherium.aetherium_assets"))
            {
                var bundle   = AssetBundle.LoadFromStream(stream);
                var provider = new AssetBundleResourcesProvider("@Aetherium", bundle);
                ResourcesAPI.AddProvider(provider);
            }

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

            masterItemList = T2Module.InitAll <CatalogBoilerplate>(new T2Module.ModInfo
            {
                displayName     = "Aetherium",
                longIdentifier  = "AETHERIUMMOD",
                shortIdentifier = "ATHRM",
                mainConfigFile  = ConfigFile
            });


            T2Module.SetupAll_PluginAwake(masterItemList);
            T2Module.SetupAll_PluginStart(masterItemList);
        }
        private void Awake()
        {
            ModLogger = Logger;

            // Don't know how to create/use an asset bundle, or don't have a unity project set up?
            // Look here for info on how to set these up: https://github.com/KomradeSpectre/AetheriumMod/blob/rewrite-master/Tutorials/Item%20Mod%20Creation.md#unity-project

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ItemModCreationBoilerplate.my_assetbundlefile"))
            {
                MainAssets = AssetBundle.LoadFromStream(stream);
            }

            //This section automatically scans the project for all artifacts
            var ArtifactTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)));

            foreach (var artifactType in ArtifactTypes)
            {
                ArtifactBase artifact = (ArtifactBase)Activator.CreateInstance(artifactType);
                if (ValidateArtifact(artifact, Artifacts))
                {
                    artifact.Init(Config);
                }
            }

            //This section automatically scans the project for all items
            var ItemTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)));

            foreach (var itemType in ItemTypes)
            {
                ItemBase item = (ItemBase)System.Activator.CreateInstance(itemType);
                if (ValidateItem(item, Items))
                {
                    item.Init(Config);
                }
            }

            //this section automatically scans the project for all equipment
            var EquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)));

            foreach (var equipmentType in EquipmentTypes)
            {
                EquipmentBase equipment = (EquipmentBase)System.Activator.CreateInstance(equipmentType);
                if (ValidateEquipment(equipment, Equipments))
                {
                    equipment.Init(Config);
                }
            }

            //this section automatically scans the project for all elite equipment
            var EliteEquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)));

            foreach (var eliteEquipmentType in EliteEquipmentTypes)
            {
                EliteEquipmentBase eliteEquipment = (EliteEquipmentBase)System.Activator.CreateInstance(eliteEquipmentType);
                if (ValidateEliteEquipment(eliteEquipment, EliteEquipments))
                {
                    eliteEquipment.Init(Config);
                }
            }
        }
        private void Awake()
        {
#if DEBUG
            On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };
#endif
            _logger = Logger;

            Logger.LogDebug("Loading assets...");
            ResourcesAPI.AddProvider(Assets.PopulateAssets());


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

            Logger.LogDebug("Replacing Item Shaders with Hopoo shaders...");
            Assets.ReplaceShaders();

            masterItemList = T2Module.InitAll <CatalogBoilerplate>(new T2Module.ModInfo
            {
                displayName     = "Kevin's Additional Items",
                longIdentifier  = "KevinsAdditions",
                shortIdentifier = "KAI",
                mainConfigFile  = cfgFile
            });

            T2Module.SetupAll_PluginAwake(masterItemList);

            Logger.LogDebug("Adding Imp Mechanics...");
            ImpPlayerAdjustments.AddExtras();
        }
示例#4
0
        public void Awake()
        {
            Logger = base.Logger;

            // initialize artifacts and other things here
            exampleArtifact = new ExampleArtifact();
        }
示例#5
0
        private void Awake()
        {
            _logger = Logger;

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TinkersSatchel.tinkerssatchel_assets")) {
                resources = AssetBundle.LoadFromStream(stream);
            }

            try {
                UnstubShaders();
            } catch (Exception ex) {
                _logger.LogError($"Shader unstub failed: {ex} {ex.Message}");
            }

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

            var modInfo = new T2Module.ModInfo {
                displayName     = "Tinker's Satchel",
                longIdentifier  = "TinkersSatchel",
                shortIdentifier = "TKSAT",
                mainConfigFile  = cfgFile
            };

            allModules = T2Module.InitAll <T2Module>(modInfo);

            var earlyLoad = new[] { CommonCode.instance };

            T2Module.SetupAll_PluginAwake(earlyLoad);
            T2Module.SetupAll_PluginAwake(allModules.Except(earlyLoad));
        }
示例#6
0
        public override void Load()
        {
            log = Log;
            log.LogMessage("Jester Mod Loaded");

            Harmony.PatchAll();
        }
示例#7
0
        public void Start()
        {
            _logger = Logger;

            On.RoR2.UI.MainMenu.MainMenuController.Start += MainMenuController_Start;
            On.RoR2.ContentManagement.ContentPack.Copy   += ContentPack_Copy;
        }
        private void Awake()
        {
            _logger = Logger;

            Logger.LogDebug("Loading assets...");

            //BundleInfo bundleInfo = new BundleInfo("@RiskOfBulletstorm", "RiskOfBulletstorm.riskofgungeonassets", BundleType.UnityAssetBundle);
            BundleInfo bundleInfo = new BundleInfo("RiskOfBulletstorm.riskofgungeonassets", BundleType.UnityAssetBundle);

            assetBundle = new AssetsManager(bundleInfo).Register() as AssetBundle;

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

            masterItemList = T2Module.InitAll <CatalogBoilerplate>(new T2Module.ModInfo
            {
                displayName     = displayName,
                longIdentifier  = "RISKOFBULLETSTORMMOD",
                shortIdentifier = "RBS",
                mainConfigFile  = ConfigFile
            });
            T2Module.SetupAll_PluginAwake(masterItemList);

            Shared.Buffs.BuffsController.Init();

            R2API.Utils.CommandHelper.AddToConsoleWhenReady();
        }
示例#9
0
        public override void Load()
        {
            Logger = Log;

            OEFJGMAEENB.HLNGFFNMJOP = OEFJGMAEENB.ALNGMJFMDHA = Enumerable.Repeat <int>(255, 255).ToArray <int>();
            _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
        }
示例#10
0
        private void Awake()
        {
            _logger         = Logger;
            pluginInfo      = Info;
            Language.config = Config;

            LocationOfProgram = Path.GetDirectoryName(Info.Location);
            //_logger.LogMessage($"Directory: {LocationOfProgram}");

            // Don't know how to create/use an asset bundle, or don't have a unity project set up?
            // Look here for info on how to set these up: https://github.com/KomradeSpectre/AetheriumMod/blob/rewrite-master/Tutorials/Item%20Mod%20Creation.md#unity-project

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("RiskOfBulletstormRewrite.riskofgungeonassets"))
            {
                MainAssets = AssetBundle.LoadFromStream(stream);
            }

            Utils.Buffs.CreateBuffs();

            FunnyLanguage();

            AddToAssembly();

            //todo enemy essembly thing
            //Enemies.LordofTheJammedMonster.CreatePrefab();
            RiskOfBulletstormRewrite.Language.Initialize();
        }
示例#11
0
        public void Start()
        {
            _logger = Logger;
            DoshContent.LoadResources();
            DoshContent.CreateObjects();

            keyToDrop       = Config.Bind("", "Keybind", KeyCode.B, "Button to press to drop money").Value;
            percentToDrop   = Config.Bind("", "Amount to Drop (Server-Side)", 0.5f, "Drop money equivalent to this percentage of the cost of a small chest.").Value;
            performanceMode = Config.Bind("", "Performance Mode", true, "If true, then money dropped by clients will try to be combined to prevent clients flooding the map with dropped money objects." +
                                          "\nOnly applied to thrown money, otherwise normal.").Value;
            preventModUseOnStageEnd = Config.Bind("", "Prevent On Stage End", true, "If true, then money will be prevented from being dropped on ending the stage.").Value;
            refundOnStageEnd        = Config.Bind("", "Refund Drops On Stage End", true, "If true, then money will get refunded to owners upon ending the stage.").Value;
            england = Config.Bind("", "English (England)", true, "Renames the English translation for Money to a more regionally appropriate term.").Value;

            On.RoR2.CharacterBody.Update += CharacterBody_Update;
            if (performanceMode)
            {
                On.RoR2.CharacterBody.FixedUpdate += CharacterBody_FixedUpdate_PerformanceMode;
            }
            else
            {
                On.RoR2.CharacterBody.FixedUpdate += CharacterBody_FixedUpdate;
            }
            SetupLanguage();

            On.RoR2.SceneExitController.SetState += SceneExitController_SetState;
            Stage.onServerStageBegin             += Stage_onServerStageBegin;
            On.RoR2.OutsideInteractableLocker.LockPurchasable += OutsideInteractableLocker_LockPurchasable;

            //R2API.Utils.CommandHelper.AddToConsoleWhenReady();

            // Sure would be a shame if this thing fell out of bounds.
            //On.RoR2.MapZone.OnTriggerEnter += MapZone_OnTriggerEnter;
        }
示例#12
0
        public void Start()
        {
            _logger = Logger;

            AllyCard_ShowEquipment   = Config.Bind("Ally Cards", "Show Equipment Icon", NameEquipmentMode.Any);
            cfgNameEquipmentCategory = Config.Bind("", "Name Category", NameEquipmentCategory.AllyCard,
                                                   "AllyCard = Shows up only on the ally cards" +
                                                   "\nAny = Shows up on most, if not all, occurences.");
            cfgNameEquipmentMode = Config.Bind("General", "Name Mode", NameEquipmentMode.EquipmentDrones,
                                               "Disabled - Self Explanatory." +
                                               "\nEquipmentDrones = Only equipment drones will have their name changed." +
                                               "\nAny = Most bodies will have their name changed.");
            On.RoR2.MasterCatalog.Init += MasterCatalog_Init;

            if (AllyCard_ShowEquipment.Value > NameEquipmentMode.Disabled)
            {
                On.RoR2.UI.AllyCardController.Awake += AllyCardController_Awake;
            }

            if (cfgNameEquipmentMode.Value > NameEquipmentMode.Disabled)
            {
                switch (cfgNameEquipmentCategory.Value)
                {
                case NameEquipmentCategory.AllyCard:
                    On.RoR2.UI.AllyCardController.UpdateInfo += AllyCardController_UpdateInfo;
                    break;

                default:
                    On.RoR2.Util.GetBestBodyName   += Util_GetBestBodyName;
                    On.RoR2.Util.GetBestMasterName += Util_GetBestMasterName;
                    break;
                }
            }
        }
        public TrainerComponent(IntPtr ptr) : base(ptr)
        {
            log = BepInExLoader.log;
            //log.LogMessage("TrainerComponent Loaded");

            instance = this;
        }
示例#14
0
        public override void Load()
        {
            try {
                Logger = Log;
                GameOptionsData.RecommendedImpostors = GameOptionsData.MaxImpostors = Enumerable.Repeat <int>(255, 255).ToArray <int>();
                Logger.LogMessage("Patching harmony...");
                Logger.LogInfo("Succesfully loaded CorsacHats");

                Attribute[] attrs = Attribute.GetCustomAttributes(typeof(MyHats.HatManagerHatsPatch));

                foreach (Attribute attr in attrs)
                {
                    Logger.LogMessage($"Looking {attr.GetType()}");
                }
                if (attrs.Length == 0)
                {
                    Logger.LogError("HarmonyPatchers not found.");
                }
                _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
                Logger.LogMessage($"Is patched? {Harmony.HasAnyPatches(_harmony.Id)}");
            }
            catch (Exception e) {
                Log.LogError(e);
                throw e;
            }
        }
示例#15
0
        private void Awake()
        {
            _logger = Logger;

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SupplyDrop.supplydrop_assets"))
            {
                MainAssets = AssetBundle.LoadFromStream(stream);
            }
            ConfigFile = new ConfigFile(Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);

            masterItemList = T2Module.InitAll <CatalogBoilerplate>(new T2Module.ModInfo
            {
                displayName     = "Supply Drop",
                longIdentifier  = "SUPPLYDROP",
                shortIdentifier = "SUPPDRP",
                mainConfigFile  = ConfigFile
            });

            using (var bankStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SupplyDrop.SupplyDropSounds.bnk"))
            {
                var bytes = new byte[bankStream.Length];
                bankStream.Read(bytes, 0, bytes.Length);
                SoundAPI.SoundBanks.Add(bytes);
            }

            T2Module.SetupAll_PluginAwake(masterItemList);
            T2Module.SetupAll_PluginStart(masterItemList);
        }
        /*public static Client ClientSide { get; private set; }
        *  public static Server ServerSide { get; private set; }*/

        public ServerMessagesPlugin()
        {
            InstanceLogger = Logger;
            Configs.Init(this);

            /*ServerSide = gameObject.AddComponent<Server>();
            *  ClientSide = gameObject.AddComponent<Client>();*/
        }
示例#17
0
        protected override void Init()
        {
            logSource = base.logger;

            this.enable      += this.AddHooks;
            this.disable     += this.RemoveHooks;
            this.fixedUpdate += this.Plugin_fixedUpdate;
        }
示例#18
0
        private ModEntryPoint()
        {
            instant3DMark = base.Config.Bind("General", "Instant3DMark", true, "Instant 3DMark");
            autoFPSBoost  = base.Config.Bind("General", "AutoFPSBoost", true, "Auto FPS Boost");

            Logger = base.Logger;
            Logger.LogInfo("ModEntryPoint loaded");
        }
示例#19
0
        public override void Load()
        {
            Logger = Log;
            ServersParser.Parse();

            KMOGFLPJLLK.EICIGKMJIMF = KMOGFLPJLLK.MGGHFLMODBE = Enumerable.Repeat <int>(255, 255).ToArray <int>();
            _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
        }
示例#20
0
        public override void Load()
        {
            Logger = Log;

            _harmony.PatchAll();

            Logger.LogDebug("Applied Harmony patches!");
        }
示例#21
0
        public void Awake()
        {
            _logger = Logger;
            SetupConfig();

            // ImpBody:Lunar
            On.RoR2.DirectorCore.TrySpawnObject += OverrideTeamSpawn;
        }
        public override void Load()
        {
            Logger = Log;

            _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "andruzzzhka.customserversclient");

            Logger.LogDebug("Applied Harmony patches!");
        }
示例#23
0
        public void Awake()
        {
            _logger    = Logger;
            pluginInfo = Info;

            FunnyLanguage();
            On.RoR2.UI.MainMenu.MainMenuController.Start += MainMenuController_Start;
            Language.onCurrentLanguageChanged            += Language_onCurrentLanguageChanged;
        }
示例#24
0
        private void Awake()
        {
            _logger = Logger;
            CommandHelper.AddToConsoleWhenReady();
            Hooks();
            FreeTheLockedMage();

            //On.RoR2.BodyCatalog.Init += BodyCatalog_Init;
        }
        // enfucker

        public void Start()
        {
            instance           = this;
            _logger            = Logger;
            genericPodPrefab   = RoR2Content.Survivors.Commando.bodyPrefab.GetComponent <CharacterBody>().preferredPodPrefab;
            roboCratePodPrefab = RoR2Content.Survivors.Toolbot.bodyPrefab.GetComponent <CharacterBody>().preferredPodPrefab;
            SetupBattery();

            Hooks();
        }
示例#26
0
        public ServerMessagesPlugin()
        {
            Instance       = this;
            InstanceLogger = Logger;

            Configs.Init(this);

            MessageFactory.Init();
            LoadMessages();
        }
示例#27
0
        void Awake()
        {
            sensX        = Config.Bind("", "Mouse Sensitivity X", 2.0f);
            sensY        = Config.Bind("", "Mouse Sensitivity Y", -2.0f);
            staticLogger = Logger;

            var harmony = new Harmony(PluginGuid);

            harmony.PatchAll(Assembly.GetExecutingAssembly());
        }
示例#28
0
        public override void Load()
        {
#if DEBUG
            Logger = Log;
#endif

            // GameOptionsData.RecommendedImpostors
            // to avoid IndexOutOfRangeException(s)
            KMOGFLPJLLK.EICIGKMJIMF = KMOGFLPJLLK.MGGHFLMODBE = Enumerable.Repeat <int>(127, 127).ToArray <int>();
            Harmony.PatchAll();
        }
示例#29
0
        public void Awake()
        {
            _logger = Logger;
            SetupConfig();
            Overrides.RunOverrides();
            ModifyPrefabs();

            CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;

            R2API.Utils.CommandHelper.AddToConsoleWhenReady();
        }
示例#30
0
        public HarbCratePlugin()
        {
            logger         = Logger;
            equipmentTable = new Dictionary <EquipmentIndex, Equip>();

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HarbCrate.harbcrate"))
            {
                var bundle   = AssetBundle.LoadFromStream(stream);
                var provider = new R2API.AssetBundleResourcesProvider(assetProvider, bundle);
                R2API.ResourcesAPI.AddProvider(provider);
            }
        }