-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathMod.cs
35 lines (31 loc) · 1.05 KB
/
Mod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using Microsoft.Xna.Framework;
using SpaceShared;
using StardewModdingAPI;
using StardewValley;
namespace CaveFarm
{
internal class Mod : StardewModdingAPI.Mod
{
public static Mod Instance;
public override void Entry(IModHelper helper)
{
Mod.Instance = this;
Log.Monitor = this.Monitor;
helper.ConsoleCommands.Add("walls", "TODO", this.WallsCommand);
}
private void WallsCommand(string cmd, string[] args)
{
for (int ix = 0; ix < Game1.currentLocation.Map.Layers[0].LayerSize.Width; ++ix)
{
for (int iy = 0; iy < Game1.currentLocation.Map.Layers[0].LayerSize.Height; ++iy)
{
if (Math.Abs(Game1.player.getTileX() - ix) < 3 && Math.Abs(Game1.player.getTileY() - iy) < 3)
continue;
var key = new Vector2(ix, iy);
Game1.currentLocation.terrainFeatures[key] = new CaveWall();
}
}
}
}
}