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; }
private void QuaterSecondUpdate(Bookcase.Events.Event args) { if (!Context.IsWorldReady) { return; } BuffManager.UpdateTick(); Spawner.UpdateTick(); }
private void updateTick(object sender, UpdateTickedEventArgs e) { if (!Context.IsWorldReady) { return; } // Make Death Events not as bad if (Game1.killScreen && markedForDeath == false) { markedForDeath = true; } if (Game1.killScreen == false && markedForDeath && !Game1.eventUp && (Game1.player.currentLocation.name.Equals("Hospital") || Game1.player.currentLocation.name.Equals("Mine") || Game1.player.currentLocation is IslandLocation)) { BuffManager.buffPlayer(new BuffOption("rush", "Adrenaline", true, 100).add_attack(6).addShortDesc("Buff Attack +6").setGlow(Color.OrangeRed)); BuffManager.buffPlayer(new BuffOption("pain", "Pain Medicine", true, 100).add_defense(3).addShortDesc("Buff Defense +3")); BuffManager.buffPlayer(new BuffOption("speed", "Fight or Flight", true, 100).add_speed(4).addShortDesc("Buff Speed +4").setGlow(Color.LightBlue)); markedForDeath = false; } // End of Death Event if (e.IsMultipleOf(15)) { BuffManager.UpdateTick(); Spawner.UpdateTick(); actionManager.Update(); if (!Game1.player.currentLocation.name.Equals("Hospital")) { if (!IsBusyDoingSomething()) { BombEvent.UpdateTick(); } } } if (e.IsOneSecond) { //MineBuffManager.UpdateTick(); augmentManager.UpdateTick(); BuffManager.Update(); if (!Game1.player.currentLocation.name.Equals("Hospital") || Game1.player.currentLocation.Name.Equals("FarmHouse")) { if (!IsBusyDoingSomething() && !Game1.paused && !Game1.menuUp && !Game1.isTimePaused && Game1.shouldTimePass()) { MeteorStorm.UpdateTick(); FireballEvent.UpdateTick(); } } } }
private void NewDayEvent(object sender, EventArgs e) { if (!Context.IsWorldReady) { return; } if (BNC_Core.config.Random_Day_Buffs) { BuffManager.UpdateDay(); } }
public static void EndBuffPoll() { if (Config.ShowDebug()) { BNC_Core.Logger.Log($"Poll has ended!", LogLevel.Info); } currentTick = Config.getVotingTime(); timer.Stop(); hasPollStarted = false; if (Config.ShowDebug()) { BNC_Core.Logger.Log($"Time to tally the votes!", LogLevel.Info); } BuffManager.BuffOption selectedId = null; int votecount = -1; foreach (KeyValuePair <BuffManager.BuffOption, int> vote in votes) { if (vote.Value > votecount) { votecount = vote.Value; selectedId = vote.Key; } } if (selectedId != null) { if (Config.ShowDebug()) { BNC_Core.Logger.Log($"Chat has selected {selectedId.displayName} : vote# {votecount}", LogLevel.Info); } BuffManager.AddBuffToQueue(selectedId); sendMessage($"Chat has spoken! Selected {selectedId.displayName}!"); if (selectedId.hudMessage != null) { Game1.addHUDMessage(new HUDMessage(selectedId.hudMessage, null)); } } else if (Config.ShowDebug()) { BNC_Core.Logger.Log($"Error: {selectedId} Buff was null", LogLevel.Error); } votes.Clear(); }
private void NewDayEvent(object sender, EventArgs e) { if (!Context.IsWorldReady) { return; } if (BNC_Core.config.Random_Day_Buffs) { BuffManager.UpdateDay(); } //Allow Weather to change again. Weather.clearForNewDay(); // Run Cat removeal //SpawnCat.tryRemoveCat(); }
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; }
private void updateTick(object sender, UpdateTickedEventArgs e) { if (e.IsMultipleOf(15)) { if (!Context.IsWorldReady) { return; } BuffManager.UpdateTick(); Spawner.UpdateTick(); } else if (e.IsMultipleOf(60)) { if (!Context.IsWorldReady) { return; } MineBuffManager.UpdateTick(); } }
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; }