Skip to content

Commit

Permalink
- Fixed the missing bundle in the theater
Browse files Browse the repository at this point in the history
  • Loading branch information
agilbert1412 committed Nov 20, 2024
1 parent 88e5905 commit a76f2c2
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using StardewValley;
using StardewValley.Locations;
using xTile.Tiles;
using StardewValley.Extensions;

namespace StardewArchipelago.GameModifications.CodeInjections
{
Expand Down Expand Up @@ -39,6 +40,12 @@ public static bool MakeMapModifications_PlaceMissingBundleNote_Prefix(GameLocati
return true; // run original logic
}

if (force)
{
// __instance._appliedMapOverrides.Clear();
}
__instance.interiorDoors.MakeMapModifications();

var abandonedJojaMart = Game1.getLocationFromName(ABANDONED_JOJA_MART);
var junimoNotePoint = GetMissingBundleTile(__instance);

Expand All @@ -50,16 +57,17 @@ public static bool MakeMapModifications_PlaceMissingBundleNote_Prefix(GameLocati

if (__instance.map.TileSheets.Count < 3)
{
// The MovieTheater doesn't have an "indoor" layer, but it needs one to pull the tilesheet from in the CC method below. So we just duplicate the one from the abandoned joja mart.
var abandonedJojaIndoorTileSheet = abandonedJojaMart.map.GetTileSheet("indoor");

// aaa is to make it get sorted to index 0, because the dumbass CC assumes the first tilesheet is the correct one
var indoorTileSheet = new TileSheet("aaa" + abandonedJojaIndoorTileSheet.Id, __instance.map, abandonedJojaIndoorTileSheet.ImageSource, abandonedJojaIndoorTileSheet.SheetSize, abandonedJojaIndoorTileSheet.TileSize);
var indoorTileSheet = new TileSheet(abandonedJojaIndoorTileSheet.Id, __instance.map, abandonedJojaIndoorTileSheet.ImageSource, abandonedJojaIndoorTileSheet.SheetSize, abandonedJojaIndoorTileSheet.TileSize);
__instance.map.AddTileSheet(indoorTileSheet);
}

var junimoNoteTileFrames = CommunityCenter.getJunimoNoteTileFrames(0, __instance.map);
var layerId = "Buildings";
__instance.map.GetLayer(layerId).Tiles[junimoNotePoint.X, junimoNotePoint.Y] = new AnimatedTile(__instance.map.GetLayer(layerId), junimoNoteTileFrames, 70L);
// __instance.map.GetLayer(layerId).Tiles[junimoNotePoint.X, junimoNotePoint.Y] = new AnimatedTile(__instance.map.GetLayer(layerId), junimoNoteTileFrames, 70L);
var layer = __instance.map.RequireLayer(layerId);
layer.Tiles[junimoNotePoint.X, junimoNotePoint.Y] = new AnimatedTile(layer, junimoNoteTileFrames, 70L);

return false; // don't run original logic
}
Expand Down

0 comments on commit a76f2c2

Please sign in to comment.