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

◆ nearbyChlorophyte()

static bool Terraria.WorldGen.nearbyChlorophyte ( int i,
int j )
inlinestaticprivate

Definition at line 60028 of file WorldGen.cs.

60029 {
60030 double num = 0.0;
60031 int num2 = 5;
60032 if (i <= num2 + 5 || i >= Main.maxTilesX - num2 - 5)
60033 {
60034 return false;
60035 }
60036 if (j <= num2 + 5 || j >= Main.maxTilesY - num2 - 5)
60037 {
60038 return false;
60039 }
60040 for (int k = i - num2; k <= i + num2; k++)
60041 {
60042 for (int l = j - num2; l <= j + num2; l++)
60043 {
60044 if (Main.tile[k, l].active() && (Main.tile[k, l].type == 211 || Main.tile[k, l].type == 346))
60045 {
60046 num += 1.0;
60047 if (num >= 3.0)
60048 {
60049 return true;
60050 }
60051 }
60052 }
60053 }
60054 if (num > 0.0)
60055 {
60056 if (Main.remixWorld)
60057 {
60058 if ((double)genRand.Next(-1, 3) < num)
60059 {
60060 return true;
60061 }
60062 }
60063 else if ((double)genRand.Next(-1, 4) < num)
60064 {
60065 return true;
60066 }
60067 }
60068 return false;
60069 }
static UnifiedRandom genRand
Definition WorldGen.cs:1215

References Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.remixWorld, and Terraria.Main.tile.