public MapStatisticsDialog(Map map, xTile.Dimensions.Rectangle viewport) { InitializeComponent(); m_map = map; m_viewport = viewport; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here xnaDisplayDevice = new xTile.Display.XnaDisplayDevice(Content, GraphicsDevice); viewport = new xTile.Dimensions.Rectangle(new xTile.Dimensions.Size(this.Window.ClientBounds.Width, this.Window.ClientBounds.Height)); base.Initialize(); }
xTile.Dimensions.Rectangle _viewport; //camera #endregion Fields #region Constructors public Level(int levelNumber, ProgressData progressData) { //set camera size based on screen size _viewport = new xTile.Dimensions.Rectangle( new xTile.Dimensions.Size( Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT)); //load the map for the specified level _tileMap = Content.Load<Map>("Maps\\Level" + levelNumber.ToString()); //load tile sheet _tileMap.LoadTileSheets(MapDisplayDevice); scanMapLayers(); //_instructionScreen = Content.Load _progressData = progressData; _progressData.CurrentLevel = levelNumber; Weapon.Initialize(); _gino.addHealth(progressData.addHealth); _gino.SetWeapon(new Weapon(progressData.shopWeapon, _gino)); _gino.addAmmo(progressData.addAmmo); //_gino.SetWeapon(new Weapon("Revolver", _gino)); _endTimer = TimeSpan.FromSeconds(TIME_AFTER_LOSS); }
public override void MovePosition(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation) { base.MovePosition(time, viewport, currentLocation); return; if (Health < MaxHealth / 2) { base.MovePosition(time, viewport, currentLocation); } }
/// <summary>Get the tile area currently visible to the player.</summary> /// <param name="location">The game location.</param> /// <param name="viewport">The game viewport.</param> protected Rectangle GetVisibleArea(GameLocation location, XRectangle viewport) { int tileSize = Game1.tileSize; int left = viewport.X / tileSize; int top = viewport.Y / tileSize; int width = (int)Math.Ceiling(viewport.Width / (decimal)tileSize); int height = (int)Math.Ceiling(viewport.Height / (decimal)tileSize); return(new Rectangle(left - 1, top - 1, width + 2, height + 2)); // extend slightly off-screen to avoid tile pop-in at the edges }
/********* ** Protected methods *********/ /**** ** Implementation ****/ /// <summary>Construct an instance.</summary> /// <param name="keepAlive">Indicates whether to keep the overlay active. If <c>null</c>, the overlay is kept until explicitly disposed.</param> protected BaseOverlay(Func <bool> keepAlive = null) { this.KeepAliveCheck = keepAlive; this.LastViewport = new Rectangle(Game1.viewport.X, Game1.viewport.Y, Game1.viewport.Width, Game1.viewport.Height); GraphicsEvents.OnPostRenderGuiEvent += this.OnPostRenderGuiEvent; GameEvents.UpdateTick += this.OnUpdateTick; ControlEvents.KeyPressed += this.OnKeyPressed; ControlEvents.ControllerButtonPressed += this.OnControllerButtonPressed; ControlEvents.ControllerTriggerPressed += this.OnControllerTriggerPressed; ControlEvents.MouseChanged += this.OnMouseChanged; }
/// <summary>Used to move the npc. Different code is used depending if the character renderer is null or not.</summary> public override void MovePosition(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation) { if (this.characterRenderer != null) { this.ModularMovement(time, viewport, currentLocation); } else { this.NonModularMovement(time, viewport, currentLocation); } }
public override bool checkAction(xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, Farmer who) { int xTile = tileLocation.X, yTile = tileLocation.Y; if (xTile >= 7 && xTile <= 11 && yTile >= 28 && yTile <= 29) { createQuestionDialogue(I18n.Message_Ufo_Travel(), createYesNoResponses(), "TravelUfo"); return(true); } return(base.checkAction(tileLocation, viewport, who)); }
public override void MovePosition(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation) { base.MovePosition(time, viewport, currentLocation); if (!Position.Equals(lastPosition) && (stepSoundCooldown == 0L || updateTimer >= stepSoundCooldown)) { currentLocation.playSound("grassyStep"); stepSoundCooldown = updateTimer + 500L; } }
public override void MovePosition(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation) { base.MovePosition(time, viewport, currentLocation); if (thudCooldown == 0L || updateTimer >= thudCooldown && yJumpVelocity <= 0f) { currentLocation.playSound("treethud"); thudCooldown = updateTimer + 600L; } }
/********* ** Protected methods *********/ /**** ** Implementation ****/ /// <summary>Construct an instance.</summary> /// <param name="events">The SMAPI events available for mods.</param> /// <param name="inputHelper">An API for checking and changing input state.</param> /// <param name="keepAlive">Indicates whether to keep the overlay active. If <c>null</c>, the overlay is kept until explicitly disposed.</param> protected InterfaceHost(IModEvents events, IInputHelper inputHelper, Func <bool> keepAlive = null) { _events = events; InputHelper = inputHelper; _keepAliveCheck = keepAlive; _lastViewport = new Rectangle(Game1.viewport.X, Game1.viewport.Y, Game1.viewport.Width, Game1.viewport.Height); events.Display.RenderedActiveMenu += OnRendered; events.GameLoop.UpdateTicked += OnUpdateTicked; events.Input.ButtonPressed += OnButtonPressed; events.Input.CursorMoved += OnCursorMoved; events.Input.MouseWheelScrolled += OnMouseWheelScrolled; }
static public void Prefix(GameLocation __instance, Rectangle position, xTile.Dimensions.Rectangle viewport, bool isFarmer, int damagesFarmer, bool glider, Character character, bool pathfinding, bool projectile = false, bool ignoreCharacterRequirement = false) { if (companion != null && character != null && character.Name != null && character.Name.Equals(companion) && !character.eventActor) { flag = true; name = character.Name; character.Name = bypass; } }
/// <summary>Raised after the game window is resized.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> private void OnWindowResized(object sender, WindowResizedEventArgs e) { Rectangle newViewport = Game1.viewport; if (this.LastViewport.Width != newViewport.Width || this.LastViewport.Height != newViewport.Height) { newViewport = new Rectangle(newViewport.X, newViewport.Y, newViewport.Width, newViewport.Height); UpdatePingsPosition = true; this.LastViewport = newViewport; } }
/********* ** Protected methods *********/ /**** ** Implementation ****/ /// <summary>Construct an instance.</summary> /// <param name="events">The SMAPI events available for mods.</param> /// <param name="inputHelper">An API for checking and changing input state.</param> /// <param name="keepAlive">Indicates whether to keep the overlay active. If <c>null</c>, the overlay is kept until explicitly disposed.</param> protected BaseOverlay(IModEvents events, IInputHelper inputHelper, Func <bool> keepAlive = null) { this.Events = events; this.InputHelper = inputHelper; this.KeepAliveCheck = keepAlive; this.LastViewport = new Rectangle(Game1.viewport.X, Game1.viewport.Y, Game1.viewport.Width, Game1.viewport.Height); events.Display.Rendered += this.OnRendered; events.GameLoop.UpdateTicked += this.OnUpdateTicked; events.Input.ButtonPressed += this.OnButtonPressed; events.Input.CursorMoved += this.OnCursorMoved; events.Input.MouseWheelScrolled += this.OnMouseWheelScrolled; }
public static bool IsTilePassable(xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, GameLocation location) { xTile.ObjectModel.PropertyValue propertyValue = (xTile.ObjectModel.PropertyValue)null; Tile tile1 = location.map.GetLayer("Back").PickTile(new xTile.Dimensions.Location(tileLocation.X * 64, tileLocation.Y * 64), viewport.Size); tile1?.TileIndexProperties.TryGetValue("Passable", out propertyValue); Tile tile2 = location.map.GetLayer("Buildings").PickTile(new xTile.Dimensions.Location(tileLocation.X * 64, tileLocation.Y * 64), viewport.Size); if (propertyValue == null && tile2 == null) { return(tile1 != null); } return(false); }
xTile.Dimensions.Rectangle _viewport; //camera #endregion Fields #region Constructors public Level(int levelNumber) { //set camera size based on screen size _viewport = new xTile.Dimensions.Rectangle( new xTile.Dimensions.Size( Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT)); //load the map for the specified level _tileMap = Content.Load<Map>("Maps\\" + levelNumber); //load tile sheet _tileMap.LoadTileSheets(MapDisplayDevice); _collisionLayer = _tileMap.Layers[0]; }
/// <summary>Calculates the intersection of two rectangles.</summary> /// <param name="a">The first rectangle.</param> /// <param name="b">The second rectangle.</param> /// <returns>A rectangle representing the intersection, or null if they do not intersect.</returns> public static XTileRectangle?Intersection(this XTileRectangle a, XTileRectangle b) { int x1 = Math.Max(a.X, b.X); int y1 = Math.Max(a.Y, b.Y); int x2 = Math.Min(a.X + a.Width, b.X + b.Width); int y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); // Make sure it's a valid rectangle (the rectangles intersect) if (x1 >= x2 || y1 >= y2) { return(null); } return(new XTileRectangle(x1, y1, x2 - x1, y2 - y1)); }
public override bool checkAction(xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, StardewValley.Farmer who) { if (tileLocation.X == 10 && tileLocation.Y == 10) { if (who.CurrentItem != null && who.CurrentItem is StardewValley.Object obj) { if (!obj.bigCraftable.Value) { Log.trace("Changing active spawning item to " + obj.ParentSheetIndex); currSpawnerItem.Value = obj.ParentSheetIndex; } } return(true); } return(base.checkAction(tileLocation, viewport, who)); }
public InLevel(int levelNumber, ContentManager content) { //general purpose hit detection rectangle _hitRect = new Rectangle(0, 0, 0, 0); _sprite = new Sprite(content.Load<Texture2D>("character"), 48, 48, 2, 2, TimeSpan.FromSeconds(0.2), 4); _sprite.SetLocation(60, Game1.SCREEN_HEIGHT - 2 * Tile.TILE_WIDTH); _tileMap = content.Load<Map>("Maps/level1"); _tileMap.LoadTileSheets(MapDisplayDevice); _viewport = new xTile.Dimensions.Rectangle( new xTile.Dimensions.Size( Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT)); _collisionLayer = _tileMap.Layers[0]; }
/// <summary>The method called once per event tick.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The event arguments.</param> private void OnUpdateTicked(object sender, UpdateTickedEventArgs e) { // detect end of life if (this.KeepAliveCheck != null && !this.KeepAliveCheck()) { this.Dispose(); return; } // trigger window resize event Rectangle newViewport = Game1.viewport; if (this.LastViewport.Width != newViewport.Width || this.LastViewport.Height != newViewport.Height) { newViewport = new Rectangle(newViewport.X, newViewport.Y, newViewport.Width, newViewport.Height); this.ReceiveGameWindowResized(this.LastViewport, newViewport); this.LastViewport = newViewport; } }
/// <summary>Get all tiles currently visible to the player.</summary> /// <param name="location">The game location.</param> /// <param name="viewport">The game viewport.</param> protected IEnumerable <Vector2> GetVisibleTiles(GameLocation location, XRectangle viewport) { int tileSize = Game1.tileSize; int left = viewport.X / tileSize; int top = viewport.Y / tileSize; int right = (int)Math.Ceiling((viewport.X + viewport.Width) / (decimal)tileSize); int bottom = (int)Math.Ceiling((viewport.Y + viewport.Height) / (decimal)tileSize); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (location.isTileOnMap(x, y)) { yield return(new Vector2(x, y)); } } } }
public void update(xTile.Dimensions.Rectangle viewport) { Vector2 mapOrigin = Game1.GlobalToLocal(viewport, Vector2.Zero); position.X = mapOrigin.X * depth; position.Y = mapOrigin.Y * depth + (onHorizon ? horizonOffset : 0); foreach (Particles.ParticleSystem system in particleSystems) { system.update(Game1.currentGameTime, Game1.currentLocation); } foreach (Vector2 location in objects.Keys) { objects[location].updateWhenCurrentLocation(Game1.currentGameTime, Game1.currentLocation); } foreach (Vector2 location in features.Keys) { features[location].tickUpdate(Game1.currentGameTime, new Vector2(location.X + position.X, location.Y + position.Y), Game1.currentLocation); } }
public override bool checkAction(xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, Farmer who) { int xTile = tileLocation.X, yTile = tileLocation.Y; if (yTile == 22 && xTile >= 20 && xTile <= 25) { if (ufoRepaired.Value) { //Game1.warpFarmer( "Custom_MM_UfoInterior", 12, 16, Game1.up ); createQuestionDialogue(I18n.Message_Ufo_Travel(), createYesNoResponses(), "TravelUfo"); } else { createQuestionDialogue(I18n.Message_Ufo_Repair(), createYesNoResponses(), "RepairUfo"); } return(true); } return(base.checkAction(tileLocation, viewport, who)); }
public static bool Prefix(GameLocation __instance, Rectangle position, xTile.Dimensions.Rectangle viewport, bool isFarmer, int damagesFarmer, bool glider, Character character, bool pathfinding, bool projectile, bool ignoreCharacterRequirement, ref bool __result) { if (!Config.EnableMod) { return(true); } foreach (var obj in __instance.objects.Values) { if (!customSignTypeDict.ContainsKey(obj.Name) || !obj.modData.ContainsKey(templateKey)) { continue; } if (obj.getBoundingBox(obj.TileLocation).Intersects(position)) { __result = true; return(false); } } return(true); }
public static bool Prefix(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation, Farmer __instance) { try { Layer slope = currentLocation.map.GetLayer("Slope" + Pseudo3D.LevelHandler.getLevelSuffixForCharacter(__instance)); if (slope != null && slope.Tiles[__instance.getTileX(), __instance.getTileY()] != null) { SlopeHandler.modifyVelocity(__instance, slope.Tiles[__instance.getTileX(), __instance.getTileY()]); } } catch (NullReferenceException) { } string currentLevel = Pseudo3D.LevelHandler.getLevelForCharacter(__instance); string backLayer = "Back" + Pseudo3D.LevelHandler.getLevelSuffixForCharacter(__instance); if (currentLocation.map.GetLayer(backLayer).Tiles[__instance.getTileX(), __instance.getTileY()] != null) { xTile.Tiles.Tile currentTile = currentLocation.map.GetLayer(backLayer).Tiles[__instance.getTileX(), __instance.getTileY()]; if (currentTile.Properties.ContainsKey("Level")) { Logger.log("Checking level..."); xTile.ObjectModel.PropertyValue layerSwitch = currentLocation.map.GetLayer(backLayer).Tiles[__instance.getTileX(), __instance.getTileY()].Properties["Level"]; string layer = layerSwitch.ToString(); if (layer.Equals("0")) { layer = "Base"; } if (!currentLevel.Equals(layer)) { Logger.log("Applying level " + layer + "..."); //Pseudo3D.MapHandler.setPassableTiles(currentLocation, layer); Pseudo3D.LevelHandler.setLevelForCharacter(__instance, layer); } } } //Logger.log("Colliding position? " + currentLocation.isCollidingPosition(__instance.nextPosition(__instance.facingDirection), viewport, true, 0, false, (Character)__instance).ToString()); return(true); }
/// <summary>Set's the npc to move a certain direction and then executes the movement.</summary> /// <param name="moveDirection">The direction to move the npc.</param> /// <param name="Move">Set's the npc's sprite to halt if Move=false. Else set it to true.</param> public virtual void SetMovingAndMove(GameTime time, xTile.Dimensions.Rectangle viewport, GameLocation currentLocation, Direction moveDirection, bool Move = true) { switch (moveDirection) { case Direction.down: this.SetMovingDown(Move); break; case Direction.left: this.SetMovingLeft(Move); break; case Direction.up: this.SetMovingUp(Move); break; case Direction.right: this.SetMovingRight(Move); break; } this.MovePosition(time, viewport, currentLocation); }
/********* ** Protected methods *********/ /**** ** Implementation ****/ /// <summary>Construct an instance.</summary> /// <param name="events">The SMAPI events available for mods.</param> /// <param name="inputHelper">An API for checking and changing input state.</param> /// <param name="reflection">Simplifies access to private code.</param> /// <param name="keepAlive">Indicates whether to keep the overlay active. If <c>null</c>, the overlay is kept until explicitly disposed.</param> /// <param name="assumeUiMode">The UI mode to use for pixel coordinates in <see cref="ReceiveLeftClick"/> and <see cref="ReceiveCursorHover"/>, or <c>null</c> to use the current UI mode at the time the event is raised.</param> protected BaseOverlay(IModEvents events, IInputHelper inputHelper, IReflectionHelper reflection, Func <bool>?keepAlive = null, bool?assumeUiMode = null) { this.Events = events; this.InputHelper = inputHelper; this.Reflection = reflection; this.KeepAliveCheck = keepAlive; this.LastViewport = new Rectangle(Game1.uiViewport.X, Game1.uiViewport.Y, Game1.uiViewport.Width, Game1.uiViewport.Height); this.ScreenId = Context.ScreenId; this.AssumeUiMode = assumeUiMode; events.GameLoop.UpdateTicked += this.OnUpdateTicked; if (this.IsMethodOverridden(nameof(this.DrawUi))) { events.Display.Rendered += this.OnRendered; } if (this.IsMethodOverridden(nameof(this.DrawWorld))) { events.Display.RenderedWorld += this.OnRenderedWorld; } if (this.IsMethodOverridden(nameof(this.ReceiveLeftClick))) { events.Input.ButtonPressed += this.OnButtonPressed; } if (this.IsMethodOverridden(nameof(this.ReceiveButtonsChanged))) { events.Input.ButtonsChanged += this.OnButtonsChanged; } if (this.IsMethodOverridden(nameof(this.ReceiveCursorHover))) { events.Input.CursorMoved += this.OnCursorMoved; } if (this.IsMethodOverridden(nameof(this.ReceiveScrollWheelAction))) { events.Input.MouseWheelScrolled += this.OnMouseWheelScrolled; } }
public static bool Prefix(xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, Farmer who, ref bool __result, Farm __instance) { if (tileLocation.X >= FarmState.shippingCrateLocation.X && tileLocation.X <= FarmState.shippingCrateLocation.X + 1 && (tileLocation.Y >= FarmState.shippingCrateLocation.Y - 1 && tileLocation.Y <= FarmState.shippingCrateLocation.Y)) { //IReflectedMethod shipItem = FarmHouseStates.reflector.GetMethod(__instance, "shipItem"); ItemGrabMenu itemGrabMenu = new ItemGrabMenu((IList <Item>)null, true, false, new InventoryMenu.highlightThisItem(StardewValley.Utility.highlightShippableObjects), new ItemGrabMenu.behaviorOnItemSelect(shipItem), "", (ItemGrabMenu.behaviorOnItemSelect)null, true, true, false, true, false, 0, (Item)null, -1, (object)__instance); itemGrabMenu.initializeUpperRightCloseButton(); int num1 = 0; itemGrabMenu.setBackgroundTransparency(num1 != 0); int num2 = 1; itemGrabMenu.setDestroyItemOnClick(num2 != 0); itemGrabMenu.initializeShippingBin(); Game1.activeClickableMenu = (IClickableMenu)itemGrabMenu; __instance.playSound("shwip"); if (Game1.player.FacingDirection == 1) { Game1.player.Halt(); } Game1.player.showCarrying(); __result = true; return(false); } return(true); }
private Vector2 GetLocalPosition(xTile.Dimensions.Rectangle viewport, Vector2 vector2) => new Vector2( vector2.X * 64f - viewport.X, vector2.Y * 64f - viewport.Y);
public TitleScreen(xTile.Dimensions.Rectangle viewport) : this(0, 0, viewport.Width, viewport.Height) { }
public static Vector2 toVector2(this xTile.Dimensions.Rectangle r) { return(new Vector2(r.X, r.Y)); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. mapDisplayDevice = new XnaDisplayDevice(Content, GraphicsDevice); spriteBatch = new SpriteBatch(GraphicsDevice); map = Content.Load<xTile.Map>("Background"); map.LoadTileSheets(mapDisplayDevice); viewport = new xTile.Dimensions.Rectangle(0, 0, 1280, 1280); projectiles = Content.Load<Texture2D>("New Projectiles"); FootSoldiers = Content.Load<Texture2D>("FootSoldiers"); towers = Content.Load<Texture2D>("Towers"); titleScreen = Content.Load<Texture2D>("dday"); screenBounds = new Rectangle(0, 0, 1920, 1280); naziManager = new NaziManager( FootSoldiers, new Rectangle(79, 51, 24, 26), 3, new Rectangle( 0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height)); towerManager = new TowerManager( towers, new Rectangle(4, 3, 33, 46) ); //TowerShotManager = new ShotManager( // projectiles, // new Rectangle(18, 9, 6, 6), // 4, // 2, // 250f, // screenBounds); // TODO: use this.Content to load your game content here }
protected override void ReceiveGameWindowResized(xTile.Dimensions.Rectangle oldBounds, xTile.Dimensions.Rectangle newBounds) { this.ReinitializeComponents(); }
/// <summary>The method invoked when the player resizes the game windoww.</summary> /// <param name="oldBounds">The previous game window bounds.</param> /// <param name="newBounds">The new game window bounds.</param> protected virtual void ReceiveGameWindowResized(Rectangle oldBounds, Rectangle newBounds) { }
internal static void CheckActionPatch(Beach __instance, ref bool __result, xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, Farmer who) { if (__result) { return; } if (ModEntry.murphyNPC != null && ModEntry.murphyNPC.getTileX() == tileLocation.X && Enumerable.Range(ModEntry.murphyNPC.getTileY() - 1, 3).Contains(tileLocation.Y)) { __result = ModEntry.murphyNPC.checkAction(who, __instance); return; } // Check to see if player is trying to access Trawler's reward chest Tile tile = __instance.map.GetLayer("Buildings").PickTile(new xTile.Dimensions.Location(tileLocation.X * 64, tileLocation.Y * 64), viewport.Size); if (tile is null || !tile.Properties.ContainsKey("CustomAction")) { return; } switch (tile.Properties["CustomAction"].ToString()) { case "TrawlerRewardStorage": __result = true; if (ModEntry.rewardChest.items.Count() == 0) { Game1.drawObjectDialogue(ModEntry.i18n.Get("game_message.empty_crate")); break; } __instance.playSound("fishSlap"); ModEntry.rewardChest.ShowMenu(); break; case "TrawlerNote": if (!who.mailReceived.Contains("PeacefulEnd.FishingTrawler_WillyIntroducesMurphy")) { Game1.drawObjectDialogue(ModEntry.i18n.Get("game_message.messy_note")); break; } Game1.drawObjectDialogue(String.Format(ModEntry.i18n.Get("game_message.readable_note"), Game1.MasterPlayer.modData[ModEntry.MURPHY_DAY_TO_APPEAR])); break; default: break; } }
internal static void CheckActionPatch(IslandSouthEast __instance, ref bool __result, xTile.Dimensions.Location tileLocation, xTile.Dimensions.Rectangle viewport, Farmer who) { if (__result) { return; } if (ModEntry.murphyNPC != null && ModEntry.murphyNPC.getTileX() == tileLocation.X && Enumerable.Range(ModEntry.murphyNPC.getTileY() - 1, 3).Contains(tileLocation.Y)) { __result = ModEntry.murphyNPC.checkAction(who, __instance); return; } // Check to see if player is trying to access Trawler's reward chest Tile tile = __instance.map.GetLayer("Buildings").PickTile(new xTile.Dimensions.Location(tileLocation.X * 64, tileLocation.Y * 64), viewport.Size); if (tile is null || !tile.Properties.ContainsKey("CustomAction")) { return; } switch (tile.Properties["CustomAction"].ToString()) { case "TrawlerRewardStorage": __result = true; if (ModEntry.rewardChest.items.Count() == 0) { Game1.drawObjectDialogue(ModEntry.i18n.Get("game_message.empty_crate")); break; } __instance.playSound("fishSlap"); ModEntry.rewardChest.ShowMenu(); break; case "TrawlerNote": if (!who.mailReceived.Contains("PeacefulEnd.FishingTrawler_WillyIntroducesMurphy")) { Game1.drawObjectDialogue(ModEntry.i18n.Get("game_message.messy_note")); break; } if (LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.en) { Game1.drawObjectDialogue(String.Format("There's a note here...#It is from Murphy! It says he will be docked every {0} and to speak with him before nightfall if you wish to go on a fishing trip.", Game1.MasterPlayer.modData[ModEntry.MURPHY_DAY_TO_APPEAR_ISLAND])); break; } Game1.drawObjectDialogue(String.Format(ModEntry.i18n.Get("game_message.readable_note"), Game1.MasterPlayer.modData[ModEntry.MURPHY_DAY_TO_APPEAR])); break; default: break; } }