Skip to content

Commit

Permalink
Small feature added:
Browse files Browse the repository at this point in the history
- Breeding cost item name can now be entered in the config
  • Loading branch information
SkyKDG committed Jul 22, 2023
1 parent 0e6be6c commit 3895909
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 35 deletions.
3 changes: 1 addition & 2 deletions Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,10 @@ public void Breed(ChatCommandContext ctx)

var didRemove = InventoryUtilitiesServer.TryRemoveItem(VWorld.Server.EntityManager, invEntity,
breedItem, breedAmount);
_log?.LogWarning($"Tried to remove {breedAmount}, removed={didRemove}");
if (!didRemove)
{
BreedTimerProcess.Instance.StopCooldown();
throw ctx.Error("You must have at least one special fish in your inventory.");
throw ctx.Error($"You must have at least one {Settings.HORSE_BREED_ITEM_NAME.Value} in your inventory.");
}

var pos1 = VWorld.Server.EntityManager.GetComponentData<Translation>(horses[0]).Value;
Expand Down
3 changes: 3 additions & 0 deletions LeadAHorseToWater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
<PackageReference Include="VRising.Bloodstone" Version="0.1.4" />
<PackageReference Include="VRising.VampireCommandFramework" Version="0.8.0" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command='copy "C:\Users\bryan\OneDrive - Karel de Grote Hogeschool\programmeren 2\.net\Projects\LeadAHorseToWater\bin\Debug\net6.0\LeadAHorseToWater.dll" "G:\SteamLibrary\steamapps\common\VRising\BepInEx\plugins"' />
</Target>
</Project>
2 changes: 0 additions & 2 deletions Patches/FeedableInventorySystem_Update_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
using LeadAHorseToWater.Processes;
using ProjectM;
using System;
using BepInEx.Core.Logging.Interpolation;
using Bloodstone.API;
using LeadAHorseToWater.VCFCompat;
using Unity.Collections;
using Unity.Entities;
using Unity.Transforms;
Expand Down
2 changes: 1 addition & 1 deletion Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using HarmonyLib;
using System.Reflection;
using Bloodstone.API;
using Il2CppInterop.Runtime.Injection;

namespace LeadAHorseToWater
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ BreedingCooldown = 600
# Default value: -570287766
BreedingRequiredItem = -570287766

## This is the name of the required item that will be consumed.
# Setting type: String
# Default value: special fish
BreedingCostItemName = special fish

## This is the amount of the required item consumed.
# Setting type: Int32
# Default value: 1
Expand Down Expand Up @@ -143,7 +148,7 @@ EnabledWellPrefabs = Stone, Large
https://user-images.githubusercontent.com/62450933/175365529-f6ade327-dbd0-4500-b840-128ac52cefe7.mp4

# Support me!
I have a patreon now so please support me [Here](patreon.com/user?u=97347013) so I can mod as much as I can!
I have a patreon now so please support me [Here](https://patreon.com/user?u=97347013) so I can mod as much as I can!

# Developer & credits
<details>
Expand Down
2 changes: 2 additions & 0 deletions Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class Settings
public static ConfigEntry<bool> ENABLE_HORSE_BREED_COOLDOWN { get; private set; }
public static ConfigEntry<int> HORSE_BREED_COOLDOWN { get; private set; }
public static ConfigEntry<int> HORSE_BREED_PREFAB { get; private set; }
public static ConfigEntry<string> HORSE_BREED_ITEM_NAME { get; private set; }
public static ConfigEntry<int> HORSE_BREED_COST { get; private set; }
public static ConfigEntry<float> HORSE_BREED_MUTATION_RANGE { get; private set; }
public static ConfigEntry<float> HORSE_BREED_MAX_SPEED { get; private set; }
Expand Down Expand Up @@ -54,6 +55,7 @@ internal static void Initialize(ConfigFile config)
ENABLE_HORSE_BREED_COOLDOWN = config.Bind<bool>("Breeding", "EnableBreedingCooldown", true, "Enables the cooldown for breeding horses.");
HORSE_BREED_COOLDOWN = config.Bind<int>("Breeding", "BreedingCooldown", 600, "This is the cooldown in seconds for breeding horses.");
HORSE_BREED_PREFAB = config.Bind<int>("Breeding", "BreedingRequiredItem", -570287766, "This prefab is consumed as a cost to breed horses.");
HORSE_BREED_ITEM_NAME = config.Bind<string>("Breeding", "BreedingCostItemName", "special fish", "This is the name of the required item that will be consumed.");
HORSE_BREED_COST = config.Bind<int>("Breeding", "BreedingCostAmount", 1, "This is the amount of the required item consumed.");

HORSE_BREED_MUTATION_RANGE = config.Bind<float>("Breeding", "MutationRange", 0.05f, "This is the half range +/- this value for applied for mutation.");
Expand Down
29 changes: 0 additions & 29 deletions thunderstore.toml

This file was deleted.

0 comments on commit 3895909

Please sign in to comment.