-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPrismHelper.cs
127 lines (111 loc) · 4.25 KB
/
PrismHelper.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using prismmod.Tiles.Blox;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace prismmod
{
public class PrismHelper
{
public static void UnlockWaterTown()
{
if (Main.netMode != 2)
{
Main.NewText("The gateway to a restricted land has opened... the fish people want your money.", 0, 0, 255);
}
for (int x = 0; x < Main.maxTilesX; x++)
{
int y = ModContent.GetInstance<PrismWorld>().bsb;
Tile tile = Framing.GetTileSafely(x, y);
if (tile.type == (ushort)ModContent.TileType<Tiles.Blox.UnbreakableGate>())
{
tile.ClearEverything();
}
}
ModContent.GetInstance<PrismWorld>().accessedWaterTown = true;
}
public static Point drawBaseFishHouse(int xStart, int yStart, int height, int width, int block, char direction)
{
for (int x = xStart; x <= (xStart + width); x++)
{
for (int y = yStart; y >= (yStart-height); y--)
{
if (x == xStart || x == xStart + width || y == yStart || y == yStart - height)
{
WorldGen.PlaceTile(x, y, block);
}
else
{
Tile target = Framing.GetTileSafely(x, y);
target.liquid = 255;
target.liquidType(0);
target.liquid = 255;
}
}
}
int xDoor=0;
if (direction == 'l')
{
xDoor = xStart + width;
}
for (int y = yStart - 1; y >= yStart - 5; y--)
{
Framing.GetTileSafely(xDoor, y).ClearTile();
}
Point spawnPoint = new Point(xStart+(width/2), yStart+1);
return spawnPoint;
}
public static void drawGroundFromWall(int xStart, int yStart, int height, int width, int block, char direction)
{
if (direction == 'l')
{
for (int y = yStart; y <= (yStart + height); y++)
{
if ((y - yStart) / (height) <= 0.25)
{
width -= 1;
}
if ((y - yStart) / (height) <= 0.5)
{
width -= 1;
}
if ((y - yStart) / (height) <= 0.75)//at each interval, decrease width by an increasing amount
{
width -= 1;
}
for (int x = xStart; x <= (xStart + width); x++)
{
Tile tile = Framing.GetTileSafely(x, y);
if (tile.type != ModContent.TileType<MoistChiseledStone>())
{
tile.ClearTile();
WorldGen.PlaceTile(x, y, block);
}
}
}
}
}
public static void drawIsland(int xLeft, int yTop, int height, int width, int block)
{
for (int x = xLeft; x <= xLeft + width; x++)
{
for (int y = yTop; y <= yTop + height; y++)
{
Tile tile = Framing.GetTileSafely(x, y);
if (tile.type != ModContent.TileType<MoistChiseledStone>())
{
tile.ClearTile();
WorldGen.PlaceTile(x, y, block);
}
}
}
}
//Building Section
//other values
public static string[] fishNames = { "Coral","Jerry","Mark","Bubbles","Octavius, Destroyer of Worlds",
"Reefback", "Gerald", "Markus", "Vincent", "Tom", "Bofa", "Gex", "Salmonelly",
"Jeb", "Joel", "[REDACTED]", "Guppy","Sharko","Natalie","Lance","Louie","Alph","Skinner",
"Travis", "Joe", "Carl", "Smokey", "Toad", "Magnus", "Devin", "Blart"};
}
}