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

◆ RandomizeBackgrounds()

static void Terraria.WorldGen.RandomizeBackgrounds ( UnifiedRandom random)
inlinestatic

Definition at line 4313 of file WorldGen.cs.

4314 {
4317 {
4318 }
4320 while (treeBG3 == treeBG1 || treeBG3 == treeBG2)
4321 {
4323 }
4325 while (treeBG4 == treeBG1 || treeBG4 == treeBG2 || treeBG4 == treeBG3)
4326 {
4328 }
4329 setBG(0, treeBG1);
4330 setBG(10, treeBG2);
4331 setBG(11, treeBG3);
4332 setBG(12, treeBG4);
4333 setBG(1, random.Next(5));
4334 setBG(2, random.Next(6));
4335 snowBG = random.Next(8);
4336 if (snowBG == 2 && random.Next(2) == 0)
4337 {
4338 if (random.Next(2) == 0)
4339 {
4340 snowBG = 21;
4341 }
4342 else
4343 {
4344 snowBG = 22;
4345 }
4346 }
4347 if (snowBG == 3 && random.Next(2) == 0)
4348 {
4349 if (random.Next(2) == 0)
4350 {
4351 snowBG = 31;
4352 }
4353 else
4354 {
4355 snowBG = 32;
4356 }
4357 }
4358 if (snowBG == 4 && random.Next(2) == 0)
4359 {
4360 if (random.Next(2) == 0)
4361 {
4362 snowBG = 41;
4363 }
4364 else
4365 {
4366 snowBG = 42;
4367 }
4368 }
4369 setBG(3, snowBG);
4370 setBG(4, random.Next(5));
4371 setBG(5, random.Next(6));
4372 setBG(6, random.Next(5));
4373 setBG(7, random.Next(6));
4374 setBG(8, random.Next(4));
4375 setBG(9, random.Next(3));
4376 }
static int treeBG2
Definition WorldGen.cs:902
static int treeBG3
Definition WorldGen.cs:904
static int treeBG4
Definition WorldGen.cs:906
static void setBG(int bg, int style)
Definition WorldGen.cs:3660
static int RollRandomForestBGStyle(UnifiedRandom random)
Definition WorldGen.cs:4378
static int treeBG1
Definition WorldGen.cs:900
static int snowBG
Definition WorldGen.cs:912

References Terraria.Utilities.UnifiedRandom.Next(), Terraria.WorldGen.RollRandomForestBGStyle(), Terraria.WorldGen.setBG(), Terraria.WorldGen.snowBG, Terraria.WorldGen.treeBG1, Terraria.WorldGen.treeBG2, Terraria.WorldGen.treeBG3, and Terraria.WorldGen.treeBG4.

Referenced by Terraria.WorldGen.GenerateWorld(), Terraria.Main.Initialize_AlmostEverything(), and Terraria.Main.UpdateMenu().