Exemple #1
0
        public void TestGetMod()
        {
            CourierModuleMetadata mod = new CourierModuleMetadata();

            mod.Name          = "TheMessengerRandomizer";
            mod.VersionString = "3.5";
            Courier.Mods.Add(mod);

            string version = ItemRandomizerUtil.GetModVersion();

            Assert.AreEqual(mod.VersionString, version);
        }
Exemple #2
0
        public override void Load()
        {
            Console.WriteLine("Randomizer loading and ready to try things!");

            //Initialize the randomizer state manager
            RandomizerStateManager.Initialize();
            randoStateManager = RandomizerStateManager.Instance;

            //Set up save data utility
            randomizerSaveMethod = new RandomizerSaveMethod();

            //Add Randomizer Version button
            versionButton = Courier.UI.RegisterSubMenuModOptionButton(() => "Messenger Randomizer: v" + ItemRandomizerUtil.GetModVersion(), null);

            //Add current seed number button
            seedNumButton = Courier.UI.RegisterSubMenuModOptionButton(() => "Current seed number: " + GetCurrentSeedNum(), null);

            //Add load seed file button
            loadRandomizerFileForFileSlotButton = Courier.UI.RegisterTextEntryModOptionButton(() => "Load Randomizer File For File Slot", (entry) => OnEnterFileSlot(entry), 1, () => "Which save slot would you like to start a rando seed?(1/2/3)", () => "1", CharsetFlags.Number);

            //Add windmill shuriken toggle button
            windmillShurikenToggleButton = Courier.UI.RegisterSubMenuModOptionButton(() => Manager <ProgressionManager> .Instance.useWindmillShuriken ? "Active Regular Shurikens" : "Active Windmill Shurikens", OnToggleWindmillShuriken);

            //Add teleport to HQ button
            teleportToHqButton = Courier.UI.RegisterSubMenuModOptionButton(() => "Teleport to HQ", OnSelectTeleportToHq);

            //Add teleport to Ninja Village button
            teleportToNinjaVillage = Courier.UI.RegisterSubMenuModOptionButton(() => "Teleport to Ninja Village", OnSelectTeleportToNinjaVillage);


            //Plug in my code :3
            On.InventoryManager.AddItem         += InventoryManager_AddItem;
            On.InventoryManager.GetItemQuantity += InventoryManager_GetItemQuantity;
            On.ProgressionManager.SetChallengeRoomAsCompleted += ProgressionManager_SetChallengeRoomAsCompleted;
            On.HasItem.IsTrue += HasItem_IsTrue;
            On.AwardNoteCutscene.ShouldPlay              += AwardNoteCutscene_ShouldPlay;
            On.CutsceneHasPlayed.IsTrue                  += CutsceneHasPlayed_IsTrue;
            On.SaveGameSelectionScreen.OnLoadGame        += SaveGameSelectionScreen_OnLoadGame;
            On.SaveGameSelectionScreen.OnNewGame         += SaveGameSelectionScreen_OnNewGame;
            On.NecrophobicWorkerCutscene.Play            += NecrophobicWorkerCutscene_Play;
            IL.RuxxtinNoteAndAwardAmuletCutscene.Play    += RuxxtinNoteAndAwardAmuletCutscene_Play;
            On.CatacombLevelInitializer.OnBeforeInitDone += CatacombLevelInitializer_OnBeforeInitDone;
            On.DialogManager.LoadDialogs_ELanguage       += DialogChanger.LoadDialogs_Elanguage;
            On.UpgradeButtonData.IsStoryUnlocked         += UpgradeButtonData_IsStoryUnlocked;
            //temp add
            On.PowerSeal.OnEnterRoom        += PowerSeal_OnEnterRoom;
            On.DialogSequence.GetDialogList += DialogSequence_GetDialogList;

            Console.WriteLine("Randomizer finished loading!");
        }