-
Notifications
You must be signed in to change notification settings - Fork 43
/
TweakedWorkshopModel.cs
26 lines (24 loc) · 1021 Bytes
/
TweakedWorkshopModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.SandBox.GameComponents;
namespace BannerlordTweaks
{
public class TweakedWorkshopModel : DefaultWorkshopModel
{
public override int GetMaxWorkshopCountForPlayer()
{
if (!Settings.Instance.MaxWorkshopCountTweakEnabled)
return base.GetMaxWorkshopCountForPlayer();
else
return Settings.Instance.BaseWorkshopCount + Clan.PlayerClan.Tier * Settings.Instance.BonusWorkshopsPerClanTier;
}
public override int GetBuyingCostForPlayer(Workshop workshop)
{
if (workshop == null) throw new ArgumentNullException(nameof(workshop));
if (Settings.Instance.WorkshopBuyingCostTweakEnabled)
return workshop.WorkshopType.EquipmentCost + (int)workshop.Settlement.Prosperity / 2 + Settings.Instance.WorkshopBaseCost;
else
return base.GetBuyingCostForPlayer(workshop);
}
}
}