Skip to content

Commit

Permalink
add v116
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianV85 committed Sep 19, 2023
1 parent 11c5972 commit e5688c5
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Bannerlord.Diplomacy/Actions/GiveGoldToKingdomAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static void GetMoneyFromGiver(Kingdom giverKingdom, int amount, WalletTy
{
foreach ((var settlement, var amountToCoverBySettlement) in MBMath.DistributeShares(amountToCover, giverKingdom.Settlements.Where(s => s.IsCastle || s.IsTown), CalculateSettlementShare))
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
settlement.Prosperity -= amountToCoverBySettlement / GoldPerProsperity;
#else
settlement.Town.Prosperity -= amountToCoverBySettlement / GoldPerProsperity;
Expand Down Expand Up @@ -145,7 +145,7 @@ private static void GiveGoldToKingdom(int gold, Kingdom kingdom)

private static int CalculateShare(Clan clan) => Math.Max(clan.Tier / 2, 1) + (clan == clan.Kingdom?.Leader?.Clan ? 1 : 0);
private static int CalculateMercenaryShare(Clan clan) => Math.Max((int) clan.Influence, 1);
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
private static int CalculateSettlementShare(Settlement settlement) => Math.Max((int) settlement.Prosperity, 1);
#else
private static int CalculateSettlementShare(Settlement settlement) => Math.Max((int) settlement.Town.Prosperity, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/Actions/GrantFiefAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static int CalculateBaseRelationChange(Settlement settlement)
{
// TODO: Consider basing the relationship change with the granted clan upon the fief's value
// normalized to the average fief value in the kingdom.
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
var baseRelationChange = (int) Math.Round(Math.Max(5, Math.Log(settlement.Prosperity / 1000, 1.1f)));
#else
var baseRelationChange = (int) Math.Round(Math.Max(5, Math.Log(settlement.Town.Prosperity / 1000, 1.1f)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void Apply(Kingdom kingdom, uint backgroundColor, uint sigilColor)

if (clanKingdom == kingdom)
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
var visuals = mobileParty.Party!.Visuals;
if (visuals != null)
{
Expand All @@ -80,7 +80,7 @@ public static void Apply(Kingdom kingdom, uint backgroundColor, uint sigilColor)

foreach (var settlement in kingdom.Settlements)
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
var visuals = settlement.Party.Visuals;
if (visuals != null)
{
Expand All @@ -95,7 +95,7 @@ public static void Apply(Kingdom kingdom, uint backgroundColor, uint sigilColor)
var party = settlement.Village.VillagerPartyComponent.MobileParty.Party;
if (party != null)
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
party.Visuals.SetMapIconAsDirty();
#else
party.SetVisualAsDirty();
Expand All @@ -107,7 +107,7 @@ public static void Apply(Kingdom kingdom, uint backgroundColor, uint sigilColor)
var party = settlement.Town.GarrisonParty.Party;
if (party != null)
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
party.Visuals.SetMapIconAsDirty();
#else
party.SetVisualAsDirty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject
if (kingdom == playerKingdom || otherKingdom == playerKingdom)
{
var besiegedKingdom = PlayerSiege.PlayerSiegeEvent?.BesiegedSettlement?.OwnerClan.Kingdom;
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
var besiegingKingdom = PlayerSiege.PlayerSiegeEvent?.BesiegerCamp?.BesiegerParty.LeaderHero.MapFaction as Kingdom;
#else
var besiegingKingdom = PlayerSiege.PlayerSiegeEvent?.BesiegerCamp?.LeaderParty.LeaderHero.MapFaction as Kingdom;
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class RebelKingdomPatches : PatchClass<RebelKingdomPatches>
{
protected override IEnumerable<Patch> Prepare()
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
var conversationBehaviorType = Type.GetType("SandBox.CampaignBehaviors.LordConversationsCampaignBehavior, SandBox, Version=1.0.0.0, Culture=neutral")!;
#else
var conversationBehaviorType = Type.GetType("TaleWorlds.CampaignSystem.CampaignBehaviors.LordConversationsCampaignBehavior, TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")!;
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Settings : AttributeGlobalSettings<Settings>
[SettingPropertyGroup(HeadingKingdomDiplomacy)]
public bool EnableFiefFirstRight { get; set; } = true;

#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
[SettingPropertyBool("{=8VKC3jtN}Enable Fiefless Kingdom Elimination", Order = 10, RequireRestart = false, HintText = "{=TlymwwPZ}If enabled, kingdoms without any fiefs are destroyed when they sign a peace treaty ending the last ongoing war they participate in. Default value is enabled.")]
[SettingPropertyGroup(HeadingKingdomDiplomacy)]
public bool EnableKingdomElimination { get; set; } = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public GrantFiefItemVM(Settlement settlement, Hero targetHero, Action<GrantFiefI
}
else if (settlement.IsCastle)
{
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
Prosperity = (int) Math.Round(settlement.Prosperity);
#else
Prosperity = (int) Math.Round(settlement.Town.Prosperity);
Expand Down
1 change: 1 addition & 0 deletions supported-game-versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.6
v1.1.5
v1.1.4
v1.1.3
Expand Down

0 comments on commit e5688c5

Please sign in to comment.