Skip to content

Commit

Permalink
Add package info.
Browse files Browse the repository at this point in the history
  • Loading branch information
int19h committed Jun 24, 2022
1 parent 6c54ec1 commit b4ef06f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions PettyKingdoms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<GameFolder Condition="'$(GameFolder)' == ''">C:\Program Files (x86)\Steam\steamapps\common\Mount &amp; Blade II Bannerlord</GameFolder>
<AssemblyName>Int19h.Bannerlord.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Int19h.Bannerlord.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<Product>Petty Kingdoms for Mount &amp; Blade II: Bannerlord</Product>
<Copyright>Copyright © 2022 Pavel "int19h" Minaev</Copyright>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageProjectUrl>https://github.com/int19h/Bannerlord.PettyKingdoms</PackageProjectUrl>
<RepositoryUrl>https://github.com/int19h/Bannerlord.PettyKingdoms</RepositoryUrl>
<Authors>Pavel Minaev</Authors>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 9 additions & 1 deletion PettyKingdomsCampaignBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using TaleWorlds.CampaignSystem;
using System.Linq;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Actions;

namespace Int19h.Bannerlord.PettyKingdoms {
internal class PettyKingdomsCampaignBehavior : CampaignBehaviorBase {
Expand All @@ -13,6 +15,12 @@ public override void SyncData(IDataStore dataStore) {
}

private void OnDailyTick() {
foreach (var kingdom in Kingdom.All.ToArray()) {
if (!kingdom.IsEliminated && kingdom.Fiefs.Count == 0 && kingdom.Clans.Count <= 1) {
ChangeKingdomAction.ApplyByLeaveWithRebellionAgainstKingdom(kingdom.RulingClan, false);
DestroyKingdomAction.Apply(kingdom);
}
}
}
}
}

0 comments on commit b4ef06f

Please sign in to comment.