Skip to content

Commit

Permalink
Don't allow atrophying of the material bait spots
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Sep 2, 2024
1 parent 36d40d3 commit 5d0784a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Winch/Data/MaterialBaitPOIDataModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Winch.Util;

namespace Winch.Data
{
public class MaterialBaitPOIDataModel : BaitPOIDataModel
{
public override ItemSubtype GetHarvestableItemSubType()
{
return new ItemSubtype[2] { ItemSubtype.MATERIAL, ItemSubtype.TRINKET }.CombineFlagsValues();
}
}
}
2 changes: 1 addition & 1 deletion Winch/Util/WinchExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ public static List<HarvestableItemData> GetRangedBaitMaterials(this ItemManager

public static bool DeployBaitModified(this BaitAbility baitAbility, SpatialItemInstance baitInstance)
{
BaitPOIDataModel baitPOIDataModel = new BaitPOIDataModel();
SpatialItemData spatialItemData = baitInstance.GetItemData<SpatialItemData>();
BaitType baitType = spatialItemData.GetBaitTypeFromItemData();
BaitPOIDataModel baitPOIDataModel = baitType.IsFish() ? new BaitPOIDataModel() : new MaterialBaitPOIDataModel();
baitPOIDataModel.doesRestock = false;
bool deepForm = baitType == BaitType.ABERRATED && GameManager.Instance.QuestManager.IsQuestCompleted(baitAbility.deepFormItemData.QuestCompleteRequired.name) && baitAbility.deepFormItemData.zonesFoundIn.HasFlag(GameManager.Instance.Player.PlayerZoneDetector.GetCurrentZone()) && UnityEngine.Random.value <= baitAbility.deepFormItemData.BaitChanceOverride;
List<HarvestableItemData> items = deepForm ? new List<HarvestableItemData> { baitAbility.deepFormItemData } : spatialItemData.GetBaitItemsFromItemData();
Expand Down

0 comments on commit 5d0784a

Please sign in to comment.