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

◆ CreateGroup()

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

Definition at line 670 of file AmbientSky.cs.

671 {
673 int num = 100;
674 int num2 = random.Next(3, 8);
676 SpriteEffects spriteEffects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
677 Vector2 vector = default(Vector2);
678 if (spriteEffects == SpriteEffects.FlipHorizontally)
679 {
680 vector.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
681 }
682 else
683 {
684 vector.X = virtualCamera.Position.X - (float)num;
685 }
686 vector.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 3200f) + 3200f;
687 float num3 = random.NextFloat() * 3f + 2f;
688 int num4 = random.Next(30, 61) * 60;
689 Vector2 vector2 = new Vector2(random.NextFloat() * 0.1f + 0.1f, random.NextFloat() * 0.3f + 0.3f);
690 Vector2 targetOffset = new Vector2(random.NextFloat() * 2f - 1f, random.NextFloat() * 2f - 1f) * 120f;
691 for (int i = 0; i < num2; i++)
692 {
694 gastropodGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f;
695 gastropodGroupSkyEntity.Position = vector + new Vector2(random.NextFloat() * 20f - 10f, random.NextFloat() * 3f) * 60f;
696 gastropodGroupSkyEntity.Effects = spriteEffects;
697 gastropodGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(gastropodGroupSkyEntity.Position);
698 gastropodGroupSkyEntity.LifeTime = num4 + random.Next(301);
699 gastropodGroupSkyEntity.SetMagnetization(vector2 * (random.NextFloat() * 0.5f) * 0.05f, targetOffset);
701 }
702 return list;
703 }
void Add(TKey key, TValue value)
GastropodGroupSkyEntity(Player player, FastRandom random)

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

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