Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Feb 18, 2021
1 parent fe19343 commit e4899a4
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 47 deletions.
89 changes: 46 additions & 43 deletions MultiStoryFarmhouse/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ public T Load<T>(IAssetInfo asset)

private void AddStairs(ref Map map, int floorNo)
{
TileSheet indoor = map.TileSheets.FirstOrDefault(s => s.Id == "indoor");
TileSheet untitled = map.TileSheets.FirstOrDefault(s => s.Id == "untitled tile sheet");
Vector2 stairs = floorsList[config.FloorNames[floorNo]].stairsStart;
int x = (int)stairs.X;
int y = (int)stairs.Y;
try
{
TileSheet indoor = map.TileSheets.First(s => s.Id == "indoor");
TileSheet untitled = map.TileSheets.First(s => s.Id == "untitled tile sheet");
Vector2 stairs = floorsList[config.FloorNames[floorNo]].stairsStart;
int x = (int)stairs.X;
int y = (int)stairs.Y;
// left
map.GetLayer("Buildings").Tiles[x + 1, y + 1] = null;
map.GetLayer("Buildings").Tiles[x + 2, y + 1] = null;
Expand All @@ -289,16 +289,16 @@ private void AddStairs(ref Map map, int floorNo)
map.GetLayer("Front").Tiles[x + 2, y] = null;
map.GetLayer("Front").Tiles[x + 1, y + 1] = null;
map.GetLayer("Front").Tiles[x + 2, y + 1] = null;
map.GetLayer("Front").Tiles[x, y] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 162);
map.GetLayer("Front").Tiles[x + 3, y] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 163);
map.GetLayer("Front").Tiles[x, y] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 162);
map.GetLayer("Front").Tiles[x + 3, y] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 163);

map.GetLayer("Buildings").Tiles[x, y + 1] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 64);
map.GetLayer("Front").Tiles[x, y + 1] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 64);
map.GetLayer("Buildings").Tiles[x, y + 1] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 64);
map.GetLayer("Front").Tiles[x, y + 1] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 64);

map.GetLayer("Buildings").Tiles[x, y + 2] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 96);
map.GetLayer("Buildings").Tiles[x, y + 2] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 96);

map.GetLayer("Front").Tiles[x + 1, y + 2] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 2, y + 2] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 1, y + 2] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 2, y + 2] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 165);

map.GetLayer("Back").Tiles[x + 1, y + 1] = new StaticTile(map.GetLayer("Back"), indoor, BlendMode.Alpha, 1043);
map.GetLayer("Back").Tiles[x + 2, y + 1] = new StaticTile(map.GetLayer("Back"), indoor, BlendMode.Alpha, 1043);
Expand All @@ -313,12 +313,12 @@ private void AddStairs(ref Map map, int floorNo)
map.GetLayer("Back").Tiles[x + 1, y + 2].Properties["NoFurniture"] = "t";
map.GetLayer("Back").Tiles[x + 2, y + 2].Properties["NoFurniture"] = "t";

map.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 68);
map.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 68);
map.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 130);
map.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 68);
map.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 68);
map.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 130);

map.GetLayer("Front").Tiles[x + 1, y + 3] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 2, y + 3] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 1, y + 3] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 2, y + 3] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 0);


if (floorNo < config.FloorNames.Count - 1)
Expand All @@ -335,17 +335,17 @@ private void AddStairs(ref Map map, int floorNo)
map.GetLayer("Front").Tiles[x + 4, y + 1] = null;
map.GetLayer("Front").Tiles[x + 5, y + 1] = null;

map.GetLayer("Front").Tiles[x + 3, y] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 100);
map.GetLayer("Front").Tiles[x + 6, y] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 163);
map.GetLayer("Front").Tiles[x + 3, y] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 100);
map.GetLayer("Front").Tiles[x + 6, y] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 163);


map.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 132);
map.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 132);
map.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 132);
map.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 132);

map.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 164);
map.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 164);

map.GetLayer("Front").Tiles[x + 4, y + 2] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 5, y + 2] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 4, y + 2] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 165);
map.GetLayer("Front").Tiles[x + 5, y + 2] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 165);


map.GetLayer("Back").Tiles[x + 4, y + 1] = new StaticTile(map.GetLayer("Back"), untitled, BlendMode.Alpha, 181);
Expand All @@ -365,12 +365,12 @@ private void AddStairs(ref Map map, int floorNo)
map.GetLayer("Back").Tiles[x + 4, y + 2].Properties["NoFurniture"] = "t";
map.GetLayer("Back").Tiles[x + 5, y + 2].Properties["NoFurniture"] = "t";

map.GetLayer("Buildings").Tiles[x + 6, y + 1] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 68);
map.GetLayer("Front").Tiles[x + 6, y + 1] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 68);
map.GetLayer("Buildings").Tiles[x + 6, y + 2] = new StaticTile(map.GetLayer("Buildings"), map.TileSheets[0], BlendMode.Alpha, 130);
map.GetLayer("Buildings").Tiles[x + 6, y + 1] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 68);
map.GetLayer("Front").Tiles[x + 6, y + 1] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 68);
map.GetLayer("Buildings").Tiles[x + 6, y + 2] = new StaticTile(map.GetLayer("Buildings"), indoor, BlendMode.Alpha, 130);

map.GetLayer("Front").Tiles[x + 4, y + 3] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 5, y + 3] = new StaticTile(map.GetLayer("Front"), map.TileSheets[0], BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 4, y + 3] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 0);
map.GetLayer("Front").Tiles[x + 5, y + 3] = new StaticTile(map.GetLayer("Front"), indoor, BlendMode.Alpha, 0);

map.GetLayer("Buildings").Tiles[x + 4, y + 1] = null;
map.GetLayer("Buildings").Tiles[x + 5, y + 1] = null;
Expand Down Expand Up @@ -409,6 +409,9 @@ public void Edit<T>(IAssetData asset)
{
var mapData = asset.AsMap();

TileSheet indoor = mapData.Data.TileSheets.First(s => s.Id == "indoor");
TileSheet untitled = mapData.Data.TileSheets.First(s => s.Id == "untitled tile sheet");

int x = config.MainFloorStairsX;
int y = config.MainFloorStairsY;

Expand All @@ -421,33 +424,33 @@ public void Edit<T>(IAssetData asset)
mapData.Data.GetLayer("Buildings").Tiles[x + 3,y].TileIndex = 68;
mapData.Data.GetLayer("Front").Tiles[x + 3,y].TileIndex = 68;

mapData.Data.GetLayer("Buildings").Tiles[x,y + 1] = new StaticTile(mapData.Data.GetLayer("Buildings"), mapData.Data.TileSheets[0], BlendMode.Alpha, 64);
mapData.Data.GetLayer("Front").Tiles[x, y + 1] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 64);
mapData.Data.GetLayer("Buildings").Tiles[x,y + 1] = new StaticTile(mapData.Data.GetLayer("Buildings"), indoor, BlendMode.Alpha, 64);
mapData.Data.GetLayer("Front").Tiles[x, y + 1] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 64);

mapData.Data.GetLayer("Buildings").Tiles[x, y + 2] = new StaticTile(mapData.Data.GetLayer("Buildings"), mapData.Data.TileSheets[0], BlendMode.Alpha, 96);
mapData.Data.GetLayer("Buildings").Tiles[x, y + 2] = new StaticTile(mapData.Data.GetLayer("Buildings"), indoor, BlendMode.Alpha, 96);

mapData.Data.GetLayer("Front").Tiles[x + 1, y + 2] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 165);
mapData.Data.GetLayer("Front").Tiles[x + 2, y + 2] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 165);
mapData.Data.GetLayer("Front").Tiles[x + 1, y + 2] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 165);
mapData.Data.GetLayer("Front").Tiles[x + 2, y + 2] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 165);


mapData.Data.GetLayer("Back").Tiles[x + 1, y + 1] = new StaticTile(mapData.Data.GetLayer("Back"), mapData.Data.TileSheets[2], BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 2, y + 1] = new StaticTile(mapData.Data.GetLayer("Back"), mapData.Data.TileSheets[2], BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 1, y + 1] = new StaticTile(mapData.Data.GetLayer("Back"), untitled, BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 2, y + 1] = new StaticTile(mapData.Data.GetLayer("Back"), untitled, BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 1,y + 1].Properties["NoFurniture"] = "t";
mapData.Data.GetLayer("Back").Tiles[x + 2,y + 1].Properties["NoFurniture"] = "t";
mapData.Data.GetLayer("Back").Tiles[x + 1,y + 1].Properties["NPCBarrier"] = "t";
mapData.Data.GetLayer("Back").Tiles[x + 2,y + 1].Properties["NPCBarrier"] = "t";

mapData.Data.GetLayer("Back").Tiles[x + 1, y + 2] = new StaticTile(mapData.Data.GetLayer("Back"), mapData.Data.TileSheets[2], BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 2, y + 2] = new StaticTile(mapData.Data.GetLayer("Back"), mapData.Data.TileSheets[2], BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 1, y + 2] = new StaticTile(mapData.Data.GetLayer("Back"), untitled, BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 2, y + 2] = new StaticTile(mapData.Data.GetLayer("Back"), untitled, BlendMode.Alpha, 181);
mapData.Data.GetLayer("Back").Tiles[x + 1,y + 2].Properties["NoFurniture"] = "t";
mapData.Data.GetLayer("Back").Tiles[x + 2,y + 2].Properties["NoFurniture"] = "t";

mapData.Data.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(mapData.Data.GetLayer("Buildings"), mapData.Data.TileSheets[0], BlendMode.Alpha, 68);
mapData.Data.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 68);
mapData.Data.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(mapData.Data.GetLayer("Buildings"), mapData.Data.TileSheets[0], BlendMode.Alpha, 130);
mapData.Data.GetLayer("Buildings").Tiles[x + 3, y + 1] = new StaticTile(mapData.Data.GetLayer("Buildings"), indoor, BlendMode.Alpha, 68);
mapData.Data.GetLayer("Front").Tiles[x + 3, y + 1] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 68);
mapData.Data.GetLayer("Buildings").Tiles[x + 3, y + 2] = new StaticTile(mapData.Data.GetLayer("Buildings"), indoor, BlendMode.Alpha, 130);

mapData.Data.GetLayer("Front").Tiles[x + 1, y + 3] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 0);
mapData.Data.GetLayer("Front").Tiles[x + 2, y + 3] = new StaticTile(mapData.Data.GetLayer("Front"), mapData.Data.TileSheets[0], BlendMode.Alpha, 0);
mapData.Data.GetLayer("Front").Tiles[x + 1, y + 3] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 0);
mapData.Data.GetLayer("Front").Tiles[x + 2, y + 3] = new StaticTile(mapData.Data.GetLayer("Front"), indoor, BlendMode.Alpha, 0);

mapData.Data.GetLayer("Buildings").Tiles[x + 1,y + 1] = null;
mapData.Data.GetLayer("Buildings").Tiles[x + 2,y + 1] = null;
Expand Down
2 changes: 1 addition & 1 deletion MultiStoryFarmhouse/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Multiple Floor Farmhouse",
"Author": "aedenthorn",
"Version": "0.1.1",
"Version": "0.1.2",
"Description": "MultiStoryFarmhouse.",
"UniqueID": "aedenthorn.MultiStoryFarmhouse",
"EntryDll": "MultiStoryFarmhouse.dll",
Expand Down
12 changes: 9 additions & 3 deletions MultipleSpouses/FurniturePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ public static void Initialize(IMonitor monitor, IModHelper helper, ModConfig con
}
public static bool BedFurniture_draw_Prefix(BedFurniture __instance, SpriteBatch spriteBatch, int x, int y, float alpha, NetVector2 ___drawPosition)
{
if (!Config.EnableMod || !Config.CustomBed || __instance.isTemporarilyInvisible || __instance.bedType != BedFurniture.BedType.Double)
if (!Config.EnableMod || __instance.isTemporarilyInvisible || __instance.bedType != BedFurniture.BedType.Double)
return true;

if (!Config.CustomBed)
{
__instance.boundingBox.Width = 3 * 64;
return true;
}


Vector2 drawPosition = Furniture.isDrawingLocationFurniture ? ___drawPosition : new Vector2(x * 64, y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height));

int bedWidth = Misc.GetBedWidth(Utility.getHomeOfFarmer(Game1.getFarmer(__instance.owner)));

__instance.boundingBox.Width = (bedWidth + 1)* 64;
__instance.boundingBox.Width = (bedWidth + 1) * 64;

Rectangle drawn_rect = __instance.sourceRect.Value;
int third = drawn_rect.Width / 3;
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@

**[Multiple Spouses](https://www.nexusmods.com/stardewvalley/mods/6227)**

**[Multiple Floor Farmhouse](https://www.nexusmods.com/stardewvalley/mods/8077)**

**[Boss Creatures](https://www.nexusmods.com/stardewvalley/mods/5864)**

**[Witcher Mod](https://www.nexusmods.com/stardewvalley/mods/5797)**
Expand Down
Binary file added _releases/MultiStoryFarmhouse 0.1.2.zip
Binary file not shown.
1 change: 1 addition & 0 deletions _releases/_releases.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<None Include="$(MSBuildThisFileDirectory)MultipleSpouses 3.0.0.zip" />
<None Include="$(MSBuildThisFileDirectory)MultiStoryFarmhouse 0.1.0.zip" />
<None Include="$(MSBuildThisFileDirectory)MultiStoryFarmhouse 0.1.1.zip" />
<None Include="$(MSBuildThisFileDirectory)MultiStoryFarmhouse 0.1.2.zip" />
<None Include="$(MSBuildThisFileDirectory)Murdercrows 0.2.2.zip" />
<None Include="$(MSBuildThisFileDirectory)NonRandomPrairieKing 0.1.0.zip" />
<None Include="$(MSBuildThisFileDirectory)OverworldChests 0.4.1.zip" />
Expand Down

0 comments on commit e4899a4

Please sign in to comment.