Initial version.
This commit is contained in:
55
Patches/PlayerFishingControllerPatches.cs
Normal file
55
Patches/PlayerFishingControllerPatches.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace WalleyeFix.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(PlayerFishingController), "pickFish")]
|
||||
public static class PlayerFishingControllerPatches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
public static void PickFishPrefix()
|
||||
{
|
||||
List<FishConfig> allFish = ConfigManager.GetAllByType<FishConfig>();
|
||||
if (allFish == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < allFish.Count; i++)
|
||||
{
|
||||
FishConfig fishConfig = allFish[i];
|
||||
if (fishConfig == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fishConfig._FishName != "Walleye")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
List<TierWeight> newWeights = new List<TierWeight>
|
||||
{
|
||||
new TierWeight
|
||||
{
|
||||
_Tier = 1,
|
||||
_Weight = 3
|
||||
},
|
||||
new TierWeight
|
||||
{
|
||||
_Tier = 2,
|
||||
_Weight = 3
|
||||
},
|
||||
new TierWeight
|
||||
{
|
||||
_Tier = 3,
|
||||
_Weight = 3
|
||||
}
|
||||
};
|
||||
|
||||
Traverse.Create(fishConfig).Field("_spawnWeights").SetValue(newWeights);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user