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

◆ Spider()

static void Terraria.WorldGen.Spread.Spider ( int x,
int y )
inlinestatic

Definition at line 430 of file WorldGen.cs.

431 {
432 if (!InWorld(x, y))
433 {
434 return;
435 }
436 byte wall = 62;
440 list2.Add(new Point(x, y));
441 while (list2.Count > 0)
442 {
443 list.Clear();
445 list2.Clear();
446 while (list.Count > 0)
447 {
448 Point item = list[0];
449 if (!InWorld(item.X, item.Y, 1))
450 {
451 list.Remove(item);
452 continue;
453 }
456 Tile tile = Main.tile[item.X, item.Y];
457 if (SolidTile(item.X, item.Y) || tile.wall != 0)
458 {
459 if (tile.active() && tile.wall == 0)
460 {
461 tile.wall = wall;
462 }
463 continue;
464 }
465 tile.wall = wall;
467 if (!tile.active())
468 {
469 tile.liquid = 0;
470 tile.lava(lava: false);
471 if (SolidTile(item.X, item.Y + 1) && genRand.Next(3) == 0)
472 {
473 if (genRand.Next(15) == 0)
474 {
476 }
477 else
478 {
479 PlacePot(item.X, item.Y, 28, genRand.Next(19, 21));
480 }
481 }
482 if (!tile.active())
483 {
484 if (SolidTile(item.X, item.Y - 1) && genRand.Next(3) == 0)
485 {
487 }
488 else if (SolidTile(item.X, item.Y + 1))
489 {
490 PlaceTile(item.X, item.Y, 187, mute: true, forced: false, -1, 9 + genRand.Next(5));
491 if (genRand.Next(3) == 0)
492 {
493 if (!tile.active())
494 {
495 PlaceSmallPile(item.X, item.Y, 34 + genRand.Next(4), 1, 185);
496 }
497 if (!tile.active())
498 {
499 PlaceSmallPile(item.X, item.Y, 48 + genRand.Next(6), 0, 185);
500 }
501 }
502 }
503 }
504 }
505 Point item2 = new Point(item.X - 1, item.Y);
506 if (!hashSet.Contains(item2))
507 {
508 list2.Add(item2);
509 }
510 item2 = new Point(item.X + 1, item.Y);
511 if (!hashSet.Contains(item2))
512 {
513 list2.Add(item2);
514 }
515 item2 = new Point(item.X, item.Y - 1);
516 if (!hashSet.Contains(item2))
517 {
518 list2.Add(item2);
519 }
520 item2 = new Point(item.X, item.Y + 1);
521 if (!hashSet.Contains(item2))
522 {
523 list2.Add(item2);
524 }
525 }
526 }
527 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
static bool PlaceSmallPile(int i, int j, int X, int Y, ushort type=185)
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static bool AddBuriedChest(Point point, int contain=0, bool notNearOtherChests=false, int Style=-1)
static bool PlacePot(int x, int y, ushort type=28, int style=0)
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816
static void PlaceTight(int x, int y, bool spiders=false)

References Terraria.Tile.active(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), Terraria.WorldGen.AddBuriedChest(), System.Collections.Generic.Dictionary< TKey, TValue >.AddRange(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.WorldGen.genRand, Terraria.WorldGen.InWorld(), System.item, Terraria.Tile.lava(), System.list, Terraria.WorldGen.PlacePot(), Terraria.WorldGen.PlaceSmallPile(), Terraria.WorldGen.PlaceTight(), Terraria.WorldGen.PlaceTile(), System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), Terraria.Enums.SolidTile, Terraria.WorldGen.SquareWallFrame(), Terraria.Main.tile, and Terraria.Tile.wall.