Ejemplo n.º 1
0
 internal AI_StateMachine(CompanionStateMachine csm, CompanionDisplay hud, IModEvents events, IMonitor monitor)
 {
     this.events  = events ?? throw new ArgumentException(nameof(events));
     this.Monitor = monitor ?? throw new ArgumentNullException(nameof(monitor));
     this.Csm     = csm ?? throw new ArgumentNullException(nameof(csm));
     this.hud     = hud ?? throw new ArgumentNullException(nameof(hud));
     this.loader  = csm.ContentLoader;
     this.npc     = csm.Companion;
     this.farmer  = csm.CompanionManager.Farmer;
 }
Ejemplo n.º 2
0
        private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Setup third party mod compatibility bridge
            TPMC.Setup(this.Helper.ModRegistry);

            // Mod's services and drivers
            this.SpecialEvents    = new SpecialModEvents();
            this.DialogueDriver   = new DialogueDriver(this.Helper.Events);
            this.HintDriver       = new HintDriver(this.Helper.Events);
            this.StuffDriver      = new StuffDriver(this.Helper.Data, this.Monitor);
            this.contentLoader    = new ContentLoader(this.Helper.Content, this.Helper.ContentPacks, this.ModManifest.UniqueID, "assets", this.Helper.DirectoryPath, this.Monitor);
            this.companionHud     = new CompanionDisplay(this.config, this.contentLoader);
            this.companionManager = new CompanionManager(this.DialogueDriver, this.HintDriver, this.companionHud, this.config, this.Monitor);
            this.StuffDriver.RegisterEvents(this.Helper.Events);

            // Harmony
            HarmonyInstance harmony = HarmonyInstance.Create("Purrplingcat.NpcAdventure");

            Patches.SpouseReturnHomePatch.Setup(harmony);
            Patches.CompanionSayHiPatch.Setup(harmony, this.companionManager);
            Patches.GameLocationDrawPatch.Setup(harmony, this.SpecialEvents);
        }
Ejemplo n.º 3
0
        public CompanionManager(DialogueDriver dialogueDriver, HintDriver hintDriver, CompanionDisplay hud, Config config, IMonitor monitor)
        {
            this.dialogueDriver     = dialogueDriver ?? throw new ArgumentNullException(nameof(dialogueDriver));
            this.hintDriver         = hintDriver ?? throw new ArgumentNullException(nameof(hintDriver));
            this.Hud                = hud;
            this.monitor            = monitor ?? throw new ArgumentNullException(nameof(monitor));
            this.PossibleCompanions = new Dictionary <string, CompanionStateMachine>();
            this.Config             = config;

            this.dialogueDriver.DialogueRequested += this.DialogueDriver_DialogueRequested;
            this.dialogueDriver.DialogueChanged   += this.DialogueDriver_DialogueChanged;
            this.hintDriver.CheckHint             += this.HintDriver_CheckHint;
        }
Ejemplo n.º 4
0
        public CompanionManager(IGameMaster gameMaster, DialogueDriver dialogueDriver, HintDriver hintDriver, CompanionDisplay hud, Config config, IConditionsChecker epu, IMonitor monitor)
        {
            this.GameMaster         = gameMaster ?? throw new ArgumentNullException(nameof(gameMaster));
            this.dialogueDriver     = dialogueDriver ?? throw new ArgumentNullException(nameof(dialogueDriver));
            this.hintDriver         = hintDriver ?? throw new ArgumentNullException(nameof(hintDriver));
            this.Hud                = hud ?? throw new ArgumentNullException(nameof(hud));
            this.monitor            = monitor ?? throw new ArgumentNullException(nameof(monitor));
            this.PossibleCompanions = new Dictionary <string, CompanionStateMachine>();
            this.Config             = config ?? throw new ArgumentNullException(nameof(config));
            this.EPU                = epu ?? throw new ArgumentNullException(nameof(epu));

            this.dialogueDriver.DialogueChanged += this.DialogueDriver_DialogueChanged;
            this.hintDriver.CheckHint           += this.HintDriver_CheckHint;
        }
Ejemplo n.º 5
0
 void OnEnable()
 {
     group    = GetComponent <CanvasGroup>();
     Instance = this;
     Hide();
 }