Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FinishRemixWorld()

static void Terraria.WorldGen.FinishRemixWorld ( )
inlinestaticprivate

Definition at line 18179 of file WorldGen.cs.

18180 {
18181 for (int i = 25; i < Main.maxTilesX - 25; i++)
18182 {
18183 for (int j = 25; j < Main.maxTilesY - 25; j++)
18184 {
18185 int conversionType = 1;
18186 if (crimson)
18187 {
18188 conversionType = 4;
18189 }
18190 if (notTheBees && (double)j < Main.worldSurface)
18191 {
18192 if (Main.tile[i, j].honey())
18193 {
18194 if (Main.tileLavaDeath[Main.tile[i, j].type])
18195 {
18196 KillTile(i, j);
18197 }
18198 Main.tile[i, j].lava(lava: true);
18199 }
18200 if (Main.tile[i, j].type == 375)
18201 {
18202 Main.tile[i, j].type = 374;
18203 }
18204 if (Main.tile[i, j].type == 230 || Main.tile[i, j].type == 229 || Main.tile[i, j].type == 659 || Main.tile[i, j].type == 56)
18205 {
18206 KillTile(i, j);
18207 }
18208 if (Main.tile[i, j].type == 82 || Main.tile[i, j].type == 83 || Main.tile[i, j].type == 84)
18209 {
18210 TileFrame(i, j);
18211 }
18212 }
18213 if ((double)j < Main.worldSurface + (double)genRand.Next(3))
18214 {
18215 if (drunkWorldGen)
18216 {
18217 if (GenVars.crimsonLeft)
18218 {
18219 if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18220 {
18221 Convert(i, j, 4, 1);
18222 }
18223 else
18224 {
18225 Convert(i, j, 1, 1);
18226 }
18227 }
18228 else if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18229 {
18230 Convert(i, j, 1, 1);
18231 }
18232 else
18233 {
18234 Convert(i, j, 4, 1);
18235 }
18236 }
18237 else
18238 {
18239 Convert(i, j, conversionType, 1);
18240 }
18241 }
18242 if ((double)j < Main.worldSurface - (double)genRand.Next(19, 22) && (Main.tile[i, j].wall == 178 || Main.tile[i, j].wall == 180))
18243 {
18244 Main.tile[i, j].wall = 0;
18245 }
18246 if (Main.tile[i, j].active() && Main.tile[i, j].type == 56)
18247 {
18248 KillTile(i, j);
18249 }
18250 if (Main.tile[i, j].type == 189 || Main.tile[i, j].type == 196 || Main.tile[i, j].type == 202)
18251 {
18252 if (drunkWorldGen)
18253 {
18254 if (GenVars.crimsonLeft)
18255 {
18256 if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18257 {
18258 Main.tile[i, j].type = 195;
18259 }
18260 else
18261 {
18262 Main.tile[i, j].type = 474;
18263 }
18264 }
18265 else if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18266 {
18267 Main.tile[i, j].type = 474;
18268 }
18269 else
18270 {
18271 Main.tile[i, j].type = 195;
18272 }
18273 }
18274 else if (crimson)
18275 {
18276 Main.tile[i, j].type = 195;
18277 }
18278 else
18279 {
18280 Main.tile[i, j].type = 474;
18281 }
18282 }
18283 if (Main.tile[i, j].wall == 73 || Main.tile[i, j].wall == 82)
18284 {
18285 if (drunkWorldGen)
18286 {
18287 if (GenVars.crimsonLeft)
18288 {
18289 if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18290 {
18291 Main.tile[i, j].wall = 77;
18292 }
18293 else
18294 {
18295 Main.tile[i, j].wall = 233;
18296 }
18297 }
18298 else if (i < Main.maxTilesX / 2 + genRand.Next(-2, 3))
18299 {
18300 Main.tile[i, j].wall = 233;
18301 }
18302 else
18303 {
18304 Main.tile[i, j].wall = 77;
18305 }
18306 }
18307 else if (crimson)
18308 {
18309 Main.tile[i, j].wall = 77;
18310 }
18311 else
18312 {
18313 Main.tile[i, j].wall = 233;
18314 }
18315 }
18316 if ((double)j > Main.rockLayer && j < Main.maxTilesY - 350 && Main.tile[i, j].type == 0 && Main.tile[i, j].active() && (!Main.tile[i - 1, j - 1].active() || !SolidTile(i, j - 1) || !Main.tile[i + 1, j - 1].active() || !Main.tile[i - 1, j].active() || !Main.tile[i + 1, j].active() || !Main.tile[i - 1, j + 1].active() || !Main.tile[i, j + 1].active() || !Main.tile[i + 1, j + 1].active()))
18317 {
18318 Main.tile[i, j].type = 2;
18319 }
18320 }
18321 }
18322 Liquid.QuickWater(-2);
18323 int num = (int)((double)Main.maxTilesX * 0.38);
18324 int num2 = (int)((double)Main.maxTilesX * 0.62);
18325 _ = Main.maxTilesY;
18326 int num3 = Main.maxTilesY - 135;
18327 _ = Main.maxTilesY;
18328 for (int k = num; k < num2 + 15; k++)
18329 {
18330 for (int l = Main.maxTilesY - 200; l < num3 + 10; l++)
18331 {
18332 Main.tile[k, l].liquid = 0;
18333 if (Main.tile[k, l].type == 58)
18334 {
18335 Main.tile[k, l].type = 57;
18336 }
18337 }
18338 }
18340 for (int m = 0; m < Main.maxTilesX; m++)
18341 {
18342 byte color = 22;
18343 byte color2 = 22;
18344 if (drunkWorldGen)
18345 {
18346 if ((GenVars.crimsonLeft && m < Main.maxTilesX / 2) || (!GenVars.crimsonLeft && m > Main.maxTilesX / 2))
18347 {
18348 color2 = 13;
18349 color = 13;
18350 }
18351 }
18352 else if (crimson)
18353 {
18354 color2 = 13;
18355 color = 13;
18356 }
18357 for (int n = 0; n < Main.maxTilesY; n++)
18358 {
18359 if (Main.tile[m, n].active() && (Main.tileDungeon[Main.tile[m, n].type] || TileID.Sets.CrackedBricks[Main.tile[m, n].type]))
18360 {
18361 Main.tile[m, n].color(color);
18362 }
18363 if (Main.wallDungeon[Main.tile[m, n].wall])
18364 {
18365 Main.tile[m, n].wallColor(25);
18366 if (Main.tile[m, n].type == 19 && Main.tile[m, n].frameY != 180)
18367 {
18368 Main.tile[m, n].color(color);
18369 }
18370 }
18371 if (Main.tile[m, n].active())
18372 {
18373 bool flag = false;
18374 if (Main.tenthAnniversaryWorld)
18375 {
18376 if (Main.tile[m, n].type == 191)
18377 {
18378 flag = true;
18379 }
18380 if (Main.tile[m, n].active() && Main.tile[m, n].type == 151)
18381 {
18382 Main.tile[m, n].color(color);
18383 }
18384 }
18385 if (Main.tile[m, n].type == 226)
18386 {
18387 flag = true;
18388 }
18389 if (Main.tile[m, n].type == 137)
18390 {
18391 int num4 = Main.tile[m, n].frameY / 18;
18392 if (num4 >= 1 && num4 <= 4)
18393 {
18394 flag = true;
18395 }
18396 }
18397 if (flag)
18398 {
18399 Main.tile[m, n].color(color2);
18400 }
18401 }
18402 if (Main.tile[m, n].wall == 244)
18403 {
18404 Main.tile[m, n].wallColor(25);
18405 }
18406 if (Main.tile[m, n].wall == 34)
18407 {
18408 Main.tile[m, n].wallColor(25);
18409 }
18410 if (Main.tile[m, n].wall == 87)
18411 {
18412 Main.tile[m, n].wallColor(25);
18413 Main.tile[m, n].color(color2);
18414 }
18415 }
18416 }
18417 double num5 = (double)Main.maxTilesX / 4200.0;
18418 num5 *= (double)genRand.Next(2, 5);
18419 for (int num6 = 0; (double)num6 < num5; num6++)
18420 {
18421 int num7 = genRand.Next((int)((double)Main.maxTilesX * 0.39), (int)((double)Main.maxTilesX * 0.61));
18422 int num8 = genRand.Next(10, 31);
18423 for (int num9 = num7 - num8; num9 <= num7 + num8; num9++)
18424 {
18425 for (int num10 = Main.maxTilesY - 250; num10 < Main.maxTilesY - 25; num10++)
18426 {
18427 if (Main.tile[num9, num10].type == 637)
18428 {
18429 Main.tile[num9, num10].frameX = (short)(18 * Main.rand.Next(6, 11));
18430 }
18431 }
18432 }
18433 }
18434 if (notTheBees)
18435 {
18436 for (int num11 = 3; num11 < Main.maxTilesX - 3; num11++)
18437 {
18438 bool flag2 = true;
18439 for (int num12 = 0; (double)num12 < Main.worldSurface; num12++)
18440 {
18441 if (flag2)
18442 {
18443 if (Main.tile[num11, num12].wall == 86)
18444 {
18445 Main.tile[num11, num12].wall = 0;
18446 }
18447 if (Main.tile[num11, num12].active())
18448 {
18449 flag2 = false;
18450 }
18451 }
18452 else if (Main.tile[num11, num12].wall == 0 && Main.tile[num11, num12 + 1].wall == 0 && Main.tile[num11, num12 + 2].wall == 0 && Main.tile[num11, num12 + 3].wall == 0 && Main.tile[num11, num12 + 4].wall == 0 && Main.tile[num11 - 1, num12].wall == 0 && Main.tile[num11 + 1, num12].wall == 0 && Main.tile[num11 - 2, num12].wall == 0 && Main.tile[num11 + 2, num12].wall == 0 && !Main.tile[num11, num12].active() && !Main.tile[num11, num12 + 1].active() && !Main.tile[num11, num12 + 2].active() && !Main.tile[num11, num12 + 3].active())
18453 {
18454 flag2 = true;
18455 }
18456 }
18457 }
18458 }
18459 Liquid.QuickWater(-2);
18460 for (int num13 = 0; num13 < Main.maxTilesX; num13++)
18461 {
18462 for (int num14 = 0; num14 < Main.maxTilesY; num14++)
18463 {
18464 if (Main.tile[num13, num14].type == 518)
18465 {
18467 }
18468 }
18469 }
18470 }
static bool[] CrackedBricks
Definition TileID.cs:113
static void CheckLilyPad(int x, int y)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static bool crimson
Definition WorldGen.cs:932
static void Convert(int i, int j, int conversionType, int size=4)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool drunkWorldGen
Definition WorldGen.cs:1154
static bool notTheBees
Definition WorldGen.cs:1164
static void AddTrees(bool undergroundOnly=false)

References Terraria.ID.TileID.Sets.CrackedBricks, Terraria.WorldBuilding.GenVars.crimsonLeft, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Liquid.QuickWater(), Terraria.Main.rand, Terraria.Main.rockLayer, Terraria.Enums.SolidTile, Terraria.Main.tenthAnniversaryWorld, Terraria.Main.tile, Terraria.Main.tileDungeon, Terraria.Main.tileLavaDeath, Terraria.Main.wallDungeon, and Terraria.Main.worldSurface.