From 5e65ca8dbde4d9164cf3b8d23a95f6a826500091 Mon Sep 17 00:00:00 2001 From: Mohammad Shoaib Date: Sat, 19 Mar 2022 13:12:45 +0530 Subject: [PATCH] Added the Missing Bundle --- stardew-access/Features/ReadTile.cs | 38 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/stardew-access/Features/ReadTile.cs b/stardew-access/Features/ReadTile.cs index 85b4498..caee167 100644 --- a/stardew-access/Features/ReadTile.cs +++ b/stardew-access/Features/ReadTile.cs @@ -326,23 +326,31 @@ namespace stardew_access.Features public static string? getJunimoBundleAt(int x, int y) { - if (Game1.currentLocation is not CommunityCenter) + if (Game1.currentLocation is not CommunityCenter communityCenter || Game1.currentLocation is not AbandonedJojaMart abandonedJojaMart) return null; - CommunityCenter communityCenter = ((CommunityCenter)Game1.currentLocation); + string? name = null; + if (communityCenter != null) + name = (x, y) switch + { + (14, 5) => "Pantry", + (14, 23) => "Crafts Room", + (40, 10) => "Fish Tank", + (63, 14) => "Boiler Room", + (55, 6) => "Vault", + (46, 11) => "Bulletin Board", + _ => null, + }; + else if (abandonedJojaMart != null) + name = (x, y) switch + { + (8, 8) => "Missing", + _ => null, + }; - string? name = (x, y) switch - { - (14, 5) => "Pantry", - (14, 23) => "Crafts Room", - (40, 10) => "Fish Tank", - (63, 14) => "Boiler Room", - (55, 6) => "Vault", - (46, 11) => "Bulletin Board", - _ => null, - }; - - if (name != null && communityCenter.shouldNoteAppearInArea(CommunityCenter.getAreaNumberFromName(name))) + if (name != null && communityCenter != null && communityCenter.shouldNoteAppearInArea(CommunityCenter.getAreaNumberFromName(name))) + return $"{name} bundle"; + else if (name != null && abandonedJojaMart != null) return $"{name} bundle"; else return null; @@ -655,6 +663,7 @@ namespace stardew_access.Features return seedName; } + #region Objects public static (string? name, CATEGORY category) getObjectAtTile(int x, int y) { (string? name, CATEGORY category) toReturn = (null, CATEGORY.Others); @@ -827,6 +836,7 @@ namespace stardew_access.Features return (null, CATEGORY.Others); } + #endregion public static bool isMineDownLadderAtTile(int x, int y) {