private void Start()
    {
        instance = HarmonyInstance.Create("com.aquatikjustice.rainwaterscrops");
        instance.PatchAll(Assembly.GetExecutingAssembly());

        RConsole.registerCommand("rwcChance", "Let's you set the difficulty to High, Medium, Low", "rwcChance", new Action(SetChance));

        settingsPath = Directory.GetCurrentDirectory() + @"\mods\configs\RWC-Config.cfg";

        if (!Directory.Exists(Directory.GetCurrentDirectory() + @"\mods\configs"))
        {
            Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\mods\configs");
        }

        if (!File.Exists(settingsPath))
        {
            using (var writer = new StreamWriter(settingsPath))
            {
                writer.Write(rwcChance);
            }
        }
        else
        {
            LoadSavedSettings();
        }
    }
예제 #2
0
 private void RegisterCommands()
 {
     RConsole.registerCommand(typeof(BasicSpawner), "Spawns the item", "spawn", SpawnItem);
     RConsole.registerCommand(typeof(BasicSpawner), "Opens your default browser to the list of items", "itemList", OpenBrowerList);
     RConsole.registerCommand(typeof(BasicSpawner), "List all the items into the console", "itemListConsole", PrintItems);
     RConsole.registerCommand(typeof(BasicSpawner), "Exports the list of items to a .txt file", "exportItemList", ExportList);
 }
예제 #3
0
        public IEnumerator Start()
        {
            var request = AssetBundle.LoadFromFileAsync("mods/ModData/MoreRareAnimals/llama_animator_fix.assets");

            yield return(request);

            m_assetBundle = request.assetBundle;

            m_harmony = HarmonyInstance.Create(HarmonyId);
            m_harmony.PatchAll(Assembly.GetExecutingAssembly());
            RConsole.registerCommand(typeof(MoreRareAnimals),
                                     "Gives you the ability to change the rare animal spanwn rate.",
                                     "morerareanimals",
                                     SetRareProbabilities);

            RConsole.registerCommand(typeof(MoreRareAnimals),
                                     "Gives you the ability to change the domestic animal spawn rate.",
                                     "moreanimals",
                                     SetSpawnRate);

            RConsole.registerCommand(typeof(MoreRareAnimals),
                                     "Gives you the ability to change the default animal scale factors.",
                                     "moreanimalscales",
                                     SetAnimalScales);

            RConsole.Log(string.Format("{0} has been loaded!", ModNamePrefix));
        }
예제 #4
0
    public void Start()
    {
        if (instance != null)
        {
            throw new Exception("Earls Mod singleton was already set");
        }
        instance = this;

        harmony = HarmonyInstance.Create(harmonyID);
        harmony.PatchAll(Assembly.GetExecutingAssembly());

        settingsPath = Path.Combine(Directory.GetCurrentDirectory(), "mods", "ModData", "EarlsMod.json");
        settings     = LoadSettings();
        if (SceneManager.GetActiveScene().name == network.gameSceneName)
        {
            StartCoroutine(ForceSettings());
        }

        SceneManager.sceneLoaded += OnSceneLoaded;

        List <Item_Base> items = ItemManager.GetAllItems();

        foreach (var item in items)
        {
            defaultStackSizes.Add(item.UniqueIndex, item.settings_Inventory.StackSize);
            defaultMaxUses.Add(item.UniqueIndex, item.MaxUses);
        }

        RConsole.registerCommand(typeof(EarlsMod), "Toggles on/off Earls Mod menu.", "ybmenu", ToggleUI);

        StartCoroutine(LoadBundle());
    }
예제 #5
0
    public void Start()
    {
        if (instance != null)
        {
            throw new Exception("MoreSailsMoreSpeed singleton was already set");
        }
        instance = this;

        harmony = HarmonyInstance.Create(harmonyID);
        harmony.PatchAll(Assembly.GetExecutingAssembly());

        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Lower all sails", "sailsOpen", SailsOpen);
        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Raise all sails", "sailsClose", SailsClose);
        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Rotate sails by a certain number", "sailsRotate", SailsRotate);
        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Toggle all engines at once", "toggleEngines", ToggleAllEngines);
        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Toggle all engines's direction at once", "toggleEnginesDir", ToggleAllEnginesDir);
        RConsole.registerCommand(typeof(MoreSailsMoreSpeed), "Tells you your current speed, 1.5 = default drift speed", "raftSpeed", PrintSpeed);

        if (SceneManager.GetActiveScene().isLoaded&& SceneManager.GetActiveScene().name == network.gameSceneName)
        {
            WorldEvent_WorldLoaded();
        }

        RConsole.Log(modPrefix + "loaded!");
    }
 public void Start()
 {
     RConsole.Log(string.Format("{0} has been loaded!", ModNamePrefix));
     RConsole.registerCommand(typeof(LongerDayNightCycles),
                              "Gives you the ability to change the duration of a day.",
                              "daylength",
                              SetDaylength);
 }
예제 #7
0
    private void Start()
    {
        instance = HarmonyInstance.Create("com.aquatikjustice.GameOptions");
        instance.PatchAll(Assembly.GetExecutingAssembly());

        RConsole.registerCommand("gamemode", "Change the gamemode. Usage: gamemode <mode> (Options: Creative, Easy, Normal, Hardcore)", "gamemode", new Action(SwitchMode));
        RConsole.registerCommand("joinable", "Set whether your friends can join your game or not. Usage: joinable <true|false>", "joinable", new Action(ChangeAllowFriends));
        RConsole.registerCommand("friendlyFire", "Toggles whether Friendly Fire is on or off.", "friendlyFire", new Action(SetFriendlyFire));
        Log("<color=#ffcf01>GameOptions</color> - LOADED");
    }
예제 #8
0
    public void Start()
    {
        RConsole.Log("StackMod has been loaded!");
        RConsole.registerCommand(typeof(StackMod), "", "stacksize", getCommand);

        lastSize = PlayerPrefs.GetInt("lastSize", 0);

        if (lastSize != 0)
        {
            Change(lastSize);
        }
    }
예제 #9
0
        public void Start()
        {
            m_harmony = HarmonyInstance.Create(HarmonyId);
            m_harmony.PatchAll(Assembly.GetExecutingAssembly());
            RConsole.registerCommand(typeof(MoreRareAnimals),
                                     "Gives you the ability to change the rare animal spanwn rate.",
                                     "morerareanimals",
                                     SetRareProbabilities);

            RConsole.registerCommand(typeof(MoreRareAnimals),
                                     "Gives you the ability to change the domestic animal spawn rate.",
                                     "moreanimals",
                                     SetSpawnRate);
            RConsole.Log(string.Format("{0} has been loaded!", ModNamePrefix));
        }
예제 #10
0
        public void Start()
        {
            // Register "TestMod" console command
            const string commandUsage =
                "Usage: TestMod [command]."
                + " Use the command \"help\" for a list of commands.";

            RConsole.registerCommand(
                typeof(TestMod),
                commandUsage,
                "TestMod",
                RunCommand
                );

            Log(LogType.Log, "loaded");
        }
예제 #11
0
 public void Start()
 {
     CLIU.CONSOLE_PREFIX = CLIU.Cyan("[") + "MoreSailsMoreSpeed" + CLIU.Cyan("] ");
     harmony             = HarmonyInstance.Create(harmonyID);
     harmony.PatchAll(Assembly.GetExecutingAssembly());
     settingsPath = Directory.GetCurrentDirectory() + "\\mods\\MoreSailsMoreSpeed.json";
     modSettings  = LoadSettings();
     RaftFixedUpdatePatch.rate = modSettings.decayRateExponent;
     //RConsole.registerCommand(typeof(MoreSailsMoreSpeedMod), "Lower all sails", "sailsOpen", SailsOpen);
     //RConsole.registerCommand(typeof(MoreSailsMoreSpeedMod), "Raise all sails", "sailsClose", SailsClose);
     //RConsole.registerCommand(typeof(MoreSailsMoreSpeedMod), "The exponent x for i/i^x (default: 1.9; constrained to 1 <= x <= 5)", "sailsDecay", SailsDecay);
     RConsole.registerCommand("sailsOpen", "Lower all sails", "sailsOpen", SailsOpen);
     RConsole.registerCommand("sailsClose", "Raise all sails", "sailsClose", SailsClose);
     RConsole.registerCommand("sailsDecay", "The exponent x for i/i^x (default: 1.9; constrained to 1 <= x <= 5)", "sailsDecay", SailsDecay);
     CLIU.Echo("loaded!");
 }
예제 #12
0
    public void Start()
    {
        if (instance != null)
        {
            throw new Exception("BetterMovement singleton was already set");
        }
        instance = this;

        harmony = HarmonyInstance.Create(harmonyID);
        harmony.PatchAll(Assembly.GetExecutingAssembly());

        settingsPath = Directory.GetCurrentDirectory() + "/mods/ModData/BetterMovement.json";
        settings     = LoadSettings();
        PersonController_GroundControll_Patch.sprintByDefault = settings.sprintByDefault;

        RConsole.registerCommand(typeof(BetterMovement), "If true, sprint key becomes a walk key, and you sprint by default (true or false, default: true)", "sprintByDefault", SprintByDefault);
        RConsole.registerCommand(typeof(BetterMovement), "If true, you no longer need to hold the crouch key, just tap it to toggle (true or false, default: false)", "crouchIsToggle", CrouchIsToggle);

        //menuBundle = AssetBundle.LoadFromFile("mods/quitgamemod.assets");
        //menu = Instantiate(menuBundle.LoadAsset<GameObject>("QuitGameMod"), gameObject.transform);
        //menu.transform.Find("QuitGame").GetComponent<Button>().onClick.AddListener(QuitGame);

        RConsole.Log(modPrefix + "loaded!");
    }
예제 #13
0
    }//This finds the users steam ID

    private void CreateCommands()//Creates the commands
    {
        RConsole.registerCommand(typeof(BackUp), "Use backup help for help about BackUp", "backup", CheckCommands);
    }
예제 #14
0
 private void CreateCommands()
 {
     RConsole.registerCommand("or", "Use or help for help about object replace", "or", CheckCommand);
 }
예제 #15
0
    private void Start()
    {
        RConsole.Log("RaftTech loaded!");

        var raftTechAssets = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "rafttechassets"));

        ModItem itemTinIngot    = new ModItem();
        ModItem itemBronzeIngot = new ModItem();
        ModItem itemSteelIngot  = new ModItem();

        ModItem itemCharcoal = new ModItem();
        ModItem itemTinOre   = new ModItem();

        ModItem itemMetalDust  = new ModItem();
        ModItem itemCopperDust = new ModItem();
        ModItem itemTinDust    = new ModItem();
        ModItem itemBronzeDust = new ModItem();
        ModItem itemSteelDust  = new ModItem();

        //ModItem itemChickenRaw = new ModItem();
        //itemChickenRaw.Create("Chicken_Raw", ItemType.Drinkable);
        //itemChickenRaw.setCookableSettings(1, 1f, new Cost(ItemManager.GetItemByName("Cooked_Shark"), 1));
        //RAPI.addItem(itemChickenRaw);

        //itemCharcoal.Create("Charcoal", ItemType.Inventory);
        //itemCharcoal.setCookableSettings

        //### INGOTS ###
        itemTinIngot.Create("TinIngot", ItemType.Inventory);
        itemTinIngot.setInventorySettings("Tin Ingot", "Plain old tin", raftTechAssets.LoadAsset <Sprite>("Assets/Item_TinIngot.png"), "Item/TinIngot", 20);
        RAPI.addItem(itemTinIngot);

        itemBronzeIngot.Create("BronzeIngot", ItemType.Inventory);
        itemBronzeIngot.setInventorySettings("Bronze Ingot", "Shiny Alloy", raftTechAssets.LoadAsset <Sprite>("Assets/Item_BronzeIngot.png"), "Item/BronzeIngot", 20);
        RAPI.addItem(itemBronzeIngot);

        itemSteelIngot.Create("SteelIngot", ItemType.Inventory);
        itemSteelIngot.setInventorySettings("Steel Ingot", "Harder than the other metals", raftTechAssets.LoadAsset <Sprite>("Assets/Item_SteelIngot.png"), "Item/SteelIngot", 20);
        RAPI.addItem(itemSteelIngot);

        //### ORE ###
        itemTinOre.Create("TinOre", ItemType.Inventory);
        itemTinOre.setInventorySettings("Tin Ore", "Plain ole tin", raftTechAssets.LoadAsset <Sprite>("Assets/Item_TinOre.png"), "Item/TinOre", 20);
        itemTinOre.setCookableSettings(1, 80, new Cost(itemTinIngot, 1));
        RAPI.addItem(itemTinOre);

        //### DUST ###
        itemMetalDust.Create("MetalDust", ItemType.Inventory);
        itemMetalDust.setInventorySettings("Metal Dust", "Pulverized metal", raftTechAssets.LoadAsset <Sprite>("Assets/Item_IronDust.png"), "Item/MetalDust", 20);
        itemMetalDust.setCookableSettings(1, 55, new Cost(ItemManager.GetItemByName("MetalIngot"), 1));
        RAPI.addItem(itemMetalDust);

        itemCopperDust.Create("CopperDust", ItemType.Inventory);
        itemCopperDust.setInventorySettings("Copper Dust", "Pulverized copper", raftTechAssets.LoadAsset <Sprite>("Assets/Item_CopperDust.png"), "Item/CopperDust", 20);
        itemCopperDust.setCookableSettings(1, 55, new Cost(ItemManager.GetItemByName("CopperIngot"), 1));
        RAPI.addItem(itemCopperDust);

        itemTinDust.Create("TinDust", ItemType.Inventory);
        itemTinDust.setInventorySettings("Tin Dust", "Pulverized tin", raftTechAssets.LoadAsset <Sprite>("Assets/Item_TinDust.png"), "Item/TinDust", 20);
        itemTinDust.setCookableSettings(1, 55, new Cost(itemTinIngot, 1));
        RAPI.addItem(itemTinDust);

        itemBronzeDust.Create("BronzeDust", ItemType.Inventory);
        itemBronzeDust.setInventorySettings("Bronze Dust", "Pulverized bronze", raftTechAssets.LoadAsset <Sprite>("Assets/Item_BronzeDust.png"), "Item/BronzeDust", 20);
        itemBronzeDust.setCookableSettings(1, 55, new Cost(itemBronzeIngot, 1));
        itemBronzeDust.setRecipeSettings(CraftingCategory.Resources, false, false, "MetalDust", 0, 4, new CostMultiple[]
        {
            new CostMultiple(new Item_Base[] { itemCopperDust }, 3),
            new CostMultiple(new Item_Base[] { itemTinDust }, 1)
        });
        RAPI.addItem(itemBronzeDust);

        itemSteelDust.Create("SteelDust", ItemType.Inventory);
        itemSteelDust.setInventorySettings("Steel Dust", "Pulverized steel", raftTechAssets.LoadAsset <Sprite>("Assets/Item_SteelDust.png"), "Item/SteelDust", 20);
        itemSteelDust.setCookableSettings(1, 55, new Cost(itemSteelIngot, 1));
        RAPI.addItem(itemSteelDust);

        ItemManager.GetItemByName("Raw_Shark").settings_cookable = new ItemInstance_Cookable(1, 1f, new Cost(ItemManager.GetItemByName("Hinge"), 1));

        RConsole.registerCommand("give", "give yourself an item", "give", give);

        OnWorldLoad();
    }