void OnPlayerWarped(object sender, EventArgsPlayerWarped e) { if (!SweepedLocations.Contains(e.NewLocation)) { CaskSweep(); } }
private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { /*if(e.NewLocation is MineShaft && (Game1.player.currentLocation as MineShaft).mineLevel == 10) * { * (Game1.player.currentLocation as MineShaft).mineLevel = 219; * }*/ }
private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { if (!e.NewLocation.IsFarm) { livelyPet?.warpToFarmer(); } }
private void afterLocationChange(object sender, EventArgsPlayerWarped args) { if (args.NewLocation is BuildableGameLocation) { syncTexturesWithChoices(); } }
private void PlayerEvents_Warped(object s, EventArgsPlayerWarped e) { if (e.NewLocation.Name == "Farm" || (e.PriorLocation != null && e.PriorLocation.IsOutdoors != e.NewLocation.IsOutdoors)) { this.UpdateTextures(); } }
private void LocationEvents_CurrentLocationChanged(object sender, EventArgsPlayerWarped e) { if (e.NewLocation is GameLocation g && g.map is Map m && m.Properties.ContainsKey("EntryAction")) { TileAction.invokeCustomTileActions("EntryAction", g, Vector2.Zero, "Map"); } }
private void locChanged(object sender, EventArgsPlayerWarped args) { if (args.NewLocation is SeedShop ss) { ss.setTileProperty(1, 25, "Buildings", "Action", "SeedCatalogue"); } }
/********* ** Private methods *********/ private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { if (Context.IsWorldReady) { this.location = e.NewLocation.Name; } }
private void locChanged(object sender, EventArgsPlayerWarped args) { if (args.PriorLocation != null) { args.PriorLocation.netObjects.OnValueAdded -= locObjectsChanged; } args.NewLocation.netObjects.OnValueAdded += locObjectsChanged; }
/********* ** Private methods *********/ /**** ** Event handlers ****/ /// <summary>The method called when the player warps to a new location.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { // when player enters farmhouse (including on new day), back up crops in case they're // about to end the day if (e.NewLocation is FarmHouse) { this.StashCrops(); } }
/// <summary>The event called when the player warps to a new location.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { if (!this.IsEnabled) { return; } this.Tractor?.UpdateForNewLocation(e.PriorLocation, e.NewLocation); }
private void PlayerWarped(object sender, EventArgsPlayerWarped e) { if (e.NewLocation.Name == _locationOfLetterbox) { // Only watch for mouse events while at the location of the letterbox, for performance ControlEvents.MouseChanged += MouseChanged; } else { ControlEvents.MouseChanged -= MouseChanged; } }
/// <summary>The method invoked after the player warps to a new location.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { if (!Context.IsWorldReady || Game1.eventUp || !this.Handlers.Any()) { return; } foreach (IAnimationHandler handler in this.Handlers) { handler.OnNewLocation(e.NewLocation); } }
//Revert the hoppers in the location player left to normal hoppers, convert hoppers in new location to hay anytime hoppers private void HandleHopperLocationChanged(object sender, EventArgsPlayerWarped e) { //this.Monitor.Log($"Player warped from {e.PriorLocation.Name} to {e.NewLocation.Name}"); if (!this.AreAnyPlayersInLocation(e.PriorLocation)) { this.ConvertHopper <BetterHayHopper, SObject>(e.PriorLocation); } if (!this.AreAnyPlayersBesidesMeInLocation(e.NewLocation)) { this.ConvertHopper <SObject, BetterHayHopper>(e.NewLocation); } this.CurrentLocation = e.NewLocation; }
private void EnteredNewLocation(object sender, EventArgsPlayerWarped e) { this.gateList = new SerializableDictionary <Vector2, StardewValley.Object>(); OverlaidDictionary <Vector2, SObject> objects = Game1.currentLocation.objects; foreach (Vector2 key in objects.Keys) { if (objects[key].name.Equals("Gate")) { this.gateList.Add(key, objects[key]); //this.Monitor.Log(string.Format("{0}", (object)key.ToString()), (LogLevel)1); } } }
private void OnLocationChange(object sender, EventArgsPlayerWarped e) { if (e.NewLocation is AnimalHouse || e.NewLocation is Farm) { _timer.Interval = 1000; _timer.Start(); } else { _timer.Stop(); StopDrawingPetNeeds(); } }
private void AdjustIconXToBlackBorder(object sender, EventArgsPlayerWarped e) { _icon = new ClickableTextureComponent("", new Rectangle(Tools.GetWidthInPlayArea() - 134, 290, 10 * Game1.pixelZoom, 10 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(50, 428, 10, 14), Game1.pixelZoom, false); }
private static void eventChecks(object sender, EventArgsPlayerWarped args) { if (args.NewLocation.Name == "WizardHouse" && !Game1.player.eventsSeen.Contains(90000) && Game1.player.friendshipData.ContainsKey("Wizard") && Game1.player.friendshipData["Wizard"].Points > 750) { args.NewLocation.currentEvent = new Event("WizardSong/0 5/Wizard 8 5 0 farmer 8 15 0/move farmer 0 -8 0/speak Wizard \"TODO#$b#Find one of the five altars and learn some magic.#$b#Q to start casting, then 1-4 to choose the spell.#$b#TAB to switch between spell sets.\"/textAboveHead Wizard \"MAGIC\"/pause 750/fade 750/end", 90000); Game1.eventUp = true; Game1.displayHUD = false; Game1.player.CanMove = false; Game1.player.showNotCarrying(); Game1.player.addMagicExp(Game1.player.getMagicExpForNextLevel()); Game1.player.addMana(Game1.player.getMaxMana()); Game1.player.eventsSeen.Add(90000); } }
private void PlayerEvents_Warped(object s, EventArgsPlayerWarped e) { if (e.PriorLocation != null && (e.PriorLocation.Name == "DynamicDungeonEntrance" || e.PriorLocation.Name == "WizardHouse")) { ControlEvents.ControllerButtonPressed -= this.ControlEvents_ControllerButtonPressed; ControlEvents.ControllerButtonReleased -= this.ControlEvents_ControllerButtonReleased; ControlEvents.MouseChanged -= this.ControlEvents_MouseChanged; if (e.PriorLocation.Name == "DynamicDungeonEntrance") { GraphicsEvents.OnPreRenderHudEvent -= this.GraphicsEvents_OnPreRenderHudEvent; } } if (e.NewLocation.Name == "DynamicDungeonEntrance" || e.NewLocation.Name == "WizardHouse") { ControlEvents.ControllerButtonPressed += this.ControlEvents_ControllerButtonPressed; ControlEvents.ControllerButtonReleased += this.ControlEvents_ControllerButtonReleased; ControlEvents.MouseChanged += this.ControlEvents_MouseChanged; if (e.NewLocation.Name == "DynamicDungeonEntrance") { GraphicsEvents.OnPreRenderHudEvent += this.GraphicsEvents_OnPreRenderHudEvent; } } }
private void onLocationChanged(object sender, EventArgsPlayerWarped args) { if (Game1.CurrentEvent != null) { return; } foreach (var entry in CritterEntry.critters) { for (int i = 0; i < entry.Value.SpawnAttempts; ++i) { if (entry.Value.check(args.NewLocation)) { var spot = entry.Value.pickSpot(args.NewLocation); if (spot == null) { continue; } args.NewLocation.addCritter(entry.Value.makeCritter(spot.Value)); } } } }
private void locChanged(object sender, EventArgsPlayerWarped args) { if (args.PriorLocation is MiniSpaLocation) { Game1.player.changeOutOfSwimSuit(); Game1.player.swimming.Value = false; } BuildableGameLocation farm = args.NewLocation as BuildableGameLocation; if (farm == null) { farm = args.PriorLocation as BuildableGameLocation; } if (farm != null) { for (int i = 0; i < farm.buildings.Count; ++i) { var b = farm.buildings[i]; // This is probably a new building if it hasn't been converted yet. if (b.buildingType.Value == "Shed2" && !(b is BigShedBuilding)) { Log.debug($"Converting big shed at ({b.tileX}, {b.tileY}) to actual big shed."); farm.buildings[i] = new BigShedBuilding(); farm.buildings[i].buildingType.Value = b.buildingType.Value; farm.buildings[i].daysOfConstructionLeft.Value = b.daysOfConstructionLeft.Value; farm.buildings[i].indoors.Value = b.indoors.Value; farm.buildings[i].tileX.Value = b.tileX.Value; farm.buildings[i].tileY.Value = b.tileY.Value; farm.buildings[i].tilesWide.Value = b.tilesWide.Value; farm.buildings[i].tilesHigh.Value = b.tilesHigh.Value; farm.buildings[i].load(); } else if (b.buildingType.Value == "SpookyShed" && !(b is SpookyShedBuilding)) { Log.debug($"Converting spooky shed at ({b.tileX}, {b.tileY}) to actual spooky shed."); farm.buildings[i] = new SpookyShedBuilding(); farm.buildings[i].buildingType.Value = b.buildingType.Value; farm.buildings[i].daysOfConstructionLeft.Value = b.daysOfConstructionLeft.Value; farm.buildings[i].indoors.Value = b.indoors.Value; farm.buildings[i].tileX.Value = b.tileX.Value; farm.buildings[i].tileY.Value = b.tileY.Value; farm.buildings[i].tilesWide.Value = b.tilesWide.Value; farm.buildings[i].tilesHigh.Value = b.tilesHigh.Value; farm.buildings[i].load(); } else if (b.buildingType.Value == "FishShack" && !(b is FishingShackBuilding)) { Log.debug($"Converting fishing shack at ({b.tileX}, {b.tileY}) to actual fishing shack."); farm.buildings[i] = new FishingShackBuilding(); farm.buildings[i].buildingType.Value = b.buildingType.Value; farm.buildings[i].daysOfConstructionLeft.Value = b.daysOfConstructionLeft.Value; farm.buildings[i].indoors.Value = b.indoors.Value; //farm.buildings[i].nameOfIndoors = b.nameOfIndoors; farm.buildings[i].tileX.Value = b.tileX.Value; farm.buildings[i].tileY.Value = b.tileY.Value; farm.buildings[i].tilesWide.Value = b.tilesWide.Value; farm.buildings[i].tilesHigh.Value = b.tilesHigh.Value; farm.buildings[i].load(); } else if (b.buildingType.Value == "MiniSpa" && !(b is MiniSpaBuilding)) { Log.debug($"Converting mini spa at ({b.tileX}, {b.tileY}) to actual mini spa."); farm.buildings[i] = new MiniSpaBuilding(); farm.buildings[i].buildingType.Value = b.buildingType.Value; farm.buildings[i].daysOfConstructionLeft.Value = b.daysOfConstructionLeft.Value; farm.buildings[i].indoors.Value = b.indoors.Value; farm.buildings[i].tileX.Value = b.tileX.Value; farm.buildings[i].tileY.Value = b.tileY.Value; farm.buildings[i].tilesWide.Value = b.tilesWide.Value; farm.buildings[i].tilesHigh.Value = b.tilesHigh.Value; farm.buildings[i].load(); } } } }
private void Warped(object sender, EventArgsPlayerWarped e) { Monitor.Log(e.NewLocation.name); Monitor.Log(e.NewLocation.uniqueName); Monitor.Log(e.NewLocation.Name); }
//Revert the hoppers in the location player left to normal hoppers, convert hoppers in new location to hay anytime hoppers private void HandleHopperLocationChanged(object sender, EventArgsPlayerWarped e) { ConvertHopper <BetterHayHopper, SObject>(e.PriorLocation); ConvertHopper <SObject, BetterHayHopper>(e.NewLocation); currentLocation = e.NewLocation; }
//Update the last list of terrain features private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { this.lastTerrainFeatures = e.NewLocation?.terrainFeatures?.FieldDict.ToDictionary(item => item.Key, item => item.Value.Value); this.CurrentLocation = e.NewLocation; }
private void PlayerEvents_Warped(object send, EventArgsPlayerWarped e) { }
//Update the last list of terrain features private void CurrentLocationChanged(object sender, EventArgsPlayerWarped e) { lastTerrainFeatures = Game1.currentLocation?.terrainFeatures?.Pairs.ToDictionary(entry => entry.Key, entry => entry.Value); }
/// <summary>The method invoked when the player warps to a new location.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { this.ResetOverlayIfShown(); }
private void PlayerEvents_Warped(object sender, EventArgsPlayerWarped e) { isMovingAutomaticaly = false; }
internal static void onLocationChanged(object sender, EventArgsPlayerWarped args) { enterX = Game1.player.position.X; enterY = Game1.player.position.Y; }
private void RemoveAllExperiencePointDisplays(object sender, EventArgsPlayerWarped e) { _experiencePointDisplays.Clear(); }