Example #1
0
 public static void LoadResources()
 {
     using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Pyro.pyrobundle"))
     {
         var bundle   = AssetBundle.LoadFromStream(stream);
         var provider = new R2API.AssetBundleResourcesProvider(assetPrefix, bundle);
         R2API.ResourcesAPI.AddProvider(provider);
     }
 }
Example #2
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);
            }
        }
Example #3
0
        public void Awake()
        {
            //acquire my assetbundle and give it to the resource api.
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Diluvian.Resources.diluvian"))
            {
                var bundle   = AssetBundle.LoadFromStream(stream);
                var provider = new R2API.AssetBundleResourcesProvider(assetPrefix, bundle);
                ResourcesAPI.AddProvider(provider);
            }
            //Check ESO existence.
            if (BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.jarlyk.eso"))
            {
                ESOenabled = true;
                Logger.LogWarning("Using ESO's elite cards!");
            }

            diluvianArtist = Config.Bind(new ConfigDefinition("Art", "Diluvian"), "avizvul", new ConfigDescription("The artist for the diluvian icon. Options: \"harb\",\"avizvul\",\"horus\"", new AcceptableValueList <string>(new string[] { "avizvul", "harb", "horus" })));
            syzygyArtist   = Config.Bind(new ConfigDefinition("Art", "OTHER"), "avizvul", new ConfigDescription("The artist for the other icon.Options: \"harb\",\"avizvul\"", new AcceptableValueList <string>(new string[] { "avizvul", "harb" })));

            UnlockablesAPI.AddUnlockable <DiluvianCompletedAchievement>(true);
            UnlockablesAPI.AddUnlockable <SZGAchievement>(true);
            LanguageAPI.Add("COMPLETE_MAINENDING_DILUVIAN_NAME", "Unobscured. Unblinking. Unrelenting.");
            LanguageAPI.Add("COMPLETE_MAINENDING_DILUVIAN_DESC", "Completed the game on Diluvian.");
            LanguageAPI.Add("COMPLETE_AAO_SYZYGY_NAME", "Crescendo");
            LanguageAPI.Add("COMPLETE_AAO_SYZYGY_DESC", "Obliterate on Syzygy difficulty with all artifacts enabled.");

            DiluvianDifficulty.def = new DiluvianDifficulty();
            Dindex = DifficultyAPI.AddDifficulty(DiluvianDifficulty.def.DifficultyDef);
            myDefs.Add(Dindex, DiluvianDifficulty.def);
            Syzygy.def = new Syzygy();
            EDindex    = DifficultyAPI.AddDifficulty(Syzygy.def.DifficultyDef, true);
            myDefs.Add(EDindex, Syzygy.def);

            On.RoR2.RuleDef.FromDifficulty            += RuleDef_FromDifficulty;
            On.RoR2.UI.RuleCategoryController.SetData += RuleCategoryController_SetData;


            //This is where my hooks live. They themselves are events, not ONhooks
            Run.onRunStartGlobal   += Run_onRunStartGlobal;
            Run.onRunDestroyGlobal += Run_onRunDestroyGlobal;
        }