public override void Entry(IModHelper helperIn) { helper = helperIn; Logger = this.Monitor; config = helper.ReadConfig <Config>(); if (config.Enable_Twitch_Integration) { TwitchIntergration.LoadConfig(helperIn); } MineEvents.MineLevelChanged += MineBuffManager.mineLevelChanged; BookcaseEvents.GameQuaterSecondTick.Add(QuaterSecondUpdate); BookcaseEvents.GameFullSecondTick.Add(FullSecondTick); TimeEvents.AfterDayStarted += NewDayEvent; SaveEvents.AfterSave += SaveEvent; SaveEvents.AfterLoad += LoadEvent; SaveEvents.BeforeSave += BeforeSaveEvent; SaveEvents.AfterReturnToTitle += OnReturnToTitle; BuffManager.Init(); MineBuffManager.Init(); Spawner.Init(); //////if(DebugMode) //InputEvents.ButtonPressed += this.InputEvents_ButtonPressed; }
public static void mineLevelChanged(object sender, WarpedEventArgs e) { if (e.NewLocation is MineShaft mine) { if (shouldUpdateAugment(e)) { if (TwitchIntergration.isConnected()) { if (!TwitchIntergration.hasMinePollStarted) { TwitchIntergration.StartMinePoll(getRandomBuff(3)); } } else { AugmentOption aug = getRandomBuff(1)[0]; CurrentAugment = aug.id; Game1.addHUDMessage(new HUDMessage(aug.DisplayName + ": " + aug.desc, null)); } } if (CurrentAugment != null) { UpdateLocation(e); } } }
public override void Entry(IModHelper helperIn) { helper = helperIn; Logger = this.Monitor; config = helper.ReadConfig <Config>(); if (config.Enable_Twitch_Integration) { TwitchIntergration.LoadConfig(helperIn); } helper.Events.Player.Warped += MineBuffManager.mineLevelChanged; helper.Events.GameLoop.UpdateTicked += this.updateTick; helper.Events.GameLoop.DayStarted += NewDayEvent; helper.Events.GameLoop.Saving += BeforeSaveEvent; helper.Events.GameLoop.Saved += SaveEvent; helper.Events.GameLoop.SaveLoaded += LoadEvent; helper.Events.GameLoop.ReturnedToTitle += OnReturnToTitle; //old // MineEvents.MineLevelChanged += MineBuffManager.mineLevelChanged; /* BookcaseEvents.GameQuaterSecondTick.Add(QuaterSecondUpdate); * BookcaseEvents.GameFullSecondTick.Add(FullSecondTick); * TimeEvents.AfterDayStarted += NewDayEvent; * SaveEvents.AfterSave += SaveEvent; * SaveEvents.AfterLoad += LoadEvent; * SaveEvents.BeforeSave += BeforeSaveEvent; * SaveEvents.AfterReturnToTitle += OnReturnToTitle; */ BuffManager.Init(); MineBuffManager.Init(); Spawner.Init(); //Debug button helper.Events.Input.ButtonPressed += this.InputEvents_ButtonPressed; }
public override void Entry(IModHelper helperIn) { helper = helperIn; Logger = this.Monitor; config = helper.ReadConfig <Config>(); if (config.Enable_Twitch_Integration) { TwitchIntergration.LoadConfig(helperIn); } actionManager = new ActionManager(); augmentManager = new AugmentManager(); connection = new TwitchAppIntergration.AppIntergration("GenDeathrow_Stardew"); connection.Start(); BuffManager.Init(); MineBuffManager.Init(); Spawner.Init(); augmentManager.Init(); // read an image file meteorTileSheet = helper.Content.Load <Texture2D>("assets/Meteor.png", ContentSource.ModFolder); //helper.Events.Player.Warped += MineBuffManager.mineLevelChanged; helper.Events.GameLoop.UpdateTicked += this.updateTick; helper.Events.GameLoop.DayStarted += NewDayEvent; helper.Events.GameLoop.Saving += BeforeSaveEvent; helper.Events.GameLoop.Saved += SaveEvent; helper.Events.GameLoop.SaveLoaded += LoadEvent; helper.Events.GameLoop.ReturnedToTitle += OnReturnToTitle; //Debug button helper.Events.Input.ButtonPressed += this.InputEvents_ButtonPressed; }
public static void UpdateDay() { if (BNC_Core.BNCSave.nextBuffDate <= -1) { int[] Min_Max = Config.getBuffMinMax(); BNC_Core.BNCSave.nextBuffDate = setNextBuffDay(Min_Max[0], Min_Max[1]); } if (BNC_Core.BNCSave.nextBuffDate-- == 0) { BuffOption[] buffs = getRandomBuff(3); if (Config.ShowDebug()) { foreach (BuffOption buff in buffs) { BNC_Core.Logger.Log($"buff selecting from {buff.displayName}"); } } if (TwitchIntergration.isConnected()) { TwitchIntergration.StartBuffPoll(buffs); } else { BuffOption selected = buffs[rand.Next(buffs.Count() - 1)]; if (Config.ShowDebug()) { BNC_Core.Logger.Log($"Selected {selected.displayName}"); } buffPlayer(selected); int[] Min_Max = Config.getBuffMinMax(); BNC_Core.BNCSave.nextBuffDate = setNextBuffDay(Min_Max[0], Min_Max[1]); } } }