forked from Katarn2000x/DiplomacyFixes
-
Notifications
You must be signed in to change notification settings - Fork 6
/
MySubModule.cs
47 lines (45 loc) · 1.79 KB
/
MySubModule.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using DiplomacyFixes.CampaignEventBehaviors;
using HarmonyLib;
using TaleWorlds.CampaignSystem;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.MountAndBlade;
namespace DiplomacyFixes
{
class MySubModule : MBSubModuleBase
{
protected override void OnSubModuleLoad()
{
base.OnSubModuleLoad();
new Harmony("mod.diplomacyfixes").PatchAll();
}
protected override void OnBeforeInitialModuleScreenSetAsRoot()
{
base.OnBeforeInitialModuleScreenSetAsRoot();
InformationManager.DisplayMessage(new InformationMessage("Loaded Diplomacy Fixes!!!", Color.FromUint(4282569842U)));
}
protected override void OnGameStart(Game game, IGameStarter gameStarterObject)
{
if (game.GameType is Campaign)
{
Events.Instance = new Events();
CampaignGameStarter gameStarter = (CampaignGameStarter)gameStarterObject;
gameStarter.AddBehavior(new DiplomaticAgreementBehavior());
gameStarter.AddBehavior(new CooldownBehavior());
gameStarter.AddBehavior(new MessengerBehavior());
if (Settings.Instance.EnableWarExhaustion)
{
gameStarter.AddBehavior(new WarExhaustionBehavior());
}
if (Settings.Instance.EnableFiefFirstRight)
{
gameStarter.AddBehavior(new KeepFiefAfterSiegeBehavior());
}
gameStarter.AddBehavior(new AllianceBehavior());
gameStarter.AddBehavior(new MaintainInfluenceBehavior());
gameStarter.AddBehavior(new ExpansionismBehavior());
}
base.OnGameStart(game, gameStarterObject);
}
}
}