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

◆ CreateGroup()

static List< HellBatsGoupSkyEntity > Terraria.GameContent.Skies.AmbientSky.HellBatsGoupSkyEntity.CreateGroup ( Player player,
FastRandom random )
inlinestatic

Definition at line 872 of file AmbientSky.cs.

873 {
875 int num = 100;
876 int num2 = random.Next(20, 40);
878 SpriteEffects spriteEffects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
879 Vector2 vector = default(Vector2);
880 if (spriteEffects == SpriteEffects.FlipHorizontally)
881 {
882 vector.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
883 }
884 else
885 {
886 vector.X = virtualCamera.Position.X - (float)num;
887 }
888 vector.Y = random.NextFloat() * 800f + (float)(Main.UnderworldLayer * 16);
889 float num3 = random.NextFloat() * 5f + 3f;
890 int num4 = random.Next(30, 61) * 60;
891 Vector2 vector2 = new Vector2(random.NextFloat() * 0.5f + 0.5f, random.NextFloat() * 0.5f + 0.5f);
892 Vector2 targetOffset = new Vector2(random.NextFloat() * 2f - 1f, random.NextFloat() * 2f - 1f) * 100f;
893 for (int i = 0; i < num2; i++)
894 {
896 hellBatsGoupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f;
897 hellBatsGoupSkyEntity.Position = vector + new Vector2(random.NextFloat() * 20f - 10f, random.NextFloat() * 3f) * 50f;
898 hellBatsGoupSkyEntity.Effects = spriteEffects;
899 hellBatsGoupSkyEntity.SetPositionInWorldBasedOnScreenSpace(hellBatsGoupSkyEntity.Position);
900 hellBatsGoupSkyEntity.LifeTime = num4 + random.Next(301);
901 hellBatsGoupSkyEntity.SetMagnetization(vector2 * (random.NextFloat() * 0.3f + 0.85f) * 0.05f, targetOffset);
903 }
904 return list;
905 }
void Add(TKey key, TValue value)
HellBatsGoupSkyEntity(Player player, FastRandom random)

References Terraria.GameContent.Skies.AmbientSky.HellBatsGoupSkyEntity.HellBatsGoupSkyEntity(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.list, Terraria.Utilities.FastRandom.Next(), Terraria.Utilities.FastRandom.NextFloat(), Terraria.Main.UnderworldLayer, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.GameContent.Skies.AmbientSky.Spawn().