Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AmbientSky.cs
Go to the documentation of this file.
1using System;
11using Terraria.ID;
13
15
16public class AmbientSky : CustomSky
17{
18 private abstract class SkyEntity
19 {
21
23
25
26 public float Depth;
27
29
30 public bool IsActive = true;
31
32 public float Rotation;
33
35
36 protected void NextFrame()
37 {
38 Frame.CurrentRow = (byte)((Frame.CurrentRow + 1) % Frame.RowCount);
39 }
40
42
43 public abstract void Update(int frameCount);
44
46 {
48 Vector2 position = Main.Camera.Center + vector * (Depth / 3f);
49 Position = position;
50 }
51
52 public abstract Vector2 GetDrawPosition();
53
54 public virtual void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
55 {
56 CommonDraw(spriteBatch, depthScale, minDepth, maxDepth);
57 }
58
59 public void CommonDraw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
60 {
61 if (!(Depth <= minDepth) && !(Depth > maxDepth))
62 {
65 Vector2 origin = SourceRectangle.Size() / 2f;
66 float scale = depthScale / Depth;
67 spriteBatch.Draw(Texture.Value, drawPositionByDepth - Main.Camera.UnscaledPosition, SourceRectangle, color, Rotation, origin, scale, Effects, 0f);
68 }
69 }
70
72 {
73 return (GetDrawPosition() - Main.Camera.Center) * new Vector2(1f / Depth, 0.9f / Depth) + Main.Camera.Center;
74 }
75
77 {
78 Vector2 vector = GetDrawPositionByDepth() - Main.Camera.UnscaledPosition;
79 int num = SourceRectangle.Height / 2;
80 float t = vector.Y + (float)num;
81 float yScreenPosition = AmbientSkyDrawCache.Instance.OceanLineInfo.YScreenPosition;
83 lerpValue *= AmbientSkyDrawCache.Instance.OceanLineInfo.OceanOpacity;
84 return 1f - lerpValue;
85 }
86 }
87
88 private class FadingSkyEntity : SkyEntity
89 {
90 protected int LifeTime;
91
92 protected Vector2 Velocity;
93
94 protected int FramingSpeed;
95
96 protected int TimeEntitySpawnedIn;
97
98 protected float Opacity;
99
100 protected float BrightnessLerper;
101
102 protected float FinalOpacityMultiplier;
103
105
107
108 protected int FrameOffset;
109
119
120 public override void Update(int frameCount)
121 {
123 {
125 if ((frameCount + FrameOffset) % FramingSpeed == 0)
126 {
127 NextFrame();
128 }
131 }
132 }
133
134 public virtual void UpdateVelocity(int frameCount)
135 {
136 }
137
138 private void UpdateOpacity(int frameCount)
139 {
141 if ((float)num >= (float)LifeTime * OpacityNormalizedTimeToFadeOut)
142 {
144 }
145 else
146 {
148 }
149 }
150
151 private bool IsMovementDone(int frameCount)
152 {
153 if (TimeEntitySpawnedIn == -1)
154 {
156 }
158 {
159 IsActive = false;
160 return true;
161 }
162 return false;
163 }
164
169
171 {
172 int num = (int)((float)LifeTime * OpacityNormalizedTimeToFadeOut);
173 int num2 = currentFrameCount - num;
175 {
177 }
178 }
179
180 public override Vector2 GetDrawPosition()
181 {
182 return Position;
183 }
184 }
185
187 {
189 {
191 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
192 int num = 100;
193 if (Effects == SpriteEffects.FlipHorizontally)
194 {
195 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
196 }
197 else
198 {
199 Position.X = virtualCamera.Position.X - (float)num;
200 }
201 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 4000f) + 4000f;
202 Depth = random.NextFloat() * 3f + 3f;
204 int num2 = random.Next(2) + 1;
205 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/ButterflySwarm" + num2, (AssetRequestMode)1);
206 Frame = new SpriteFrame(1, (byte)((num2 == 2) ? 19u : 17u));
207 LifeTime = random.Next(60, 121) * 60;
210 BrightnessLerper = 0.2f;
212 FramingSpeed = 5;
213 }
214
215 public override void UpdateVelocity(int frameCount)
216 {
217 float num = 0.1f + Math.Abs(Main.WindForVisuals) * 0.05f;
218 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
219 }
220
221 public override void Update(int frameCount)
222 {
223 base.Update(frameCount);
225 {
227 }
228 }
229 }
230
232 {
233 public LostKiteSkyEntity(Player player, FastRandom random)
234 {
236 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
237 int num = 100;
238 if (Effects == SpriteEffects.FlipHorizontally)
239 {
240 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
241 }
242 else
243 {
244 Position.X = virtualCamera.Position.X - (float)num;
245 }
246 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
247 Depth = random.NextFloat() * 3f + 3f;
249 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/LostKite", (AssetRequestMode)1);
250 Frame = new SpriteFrame(1, 42);
251 LifeTime = random.Next(60, 121) * 60;
254 BrightnessLerper = 0.2f;
256 FramingSpeed = 6;
257 int num2 = random.Next(Frame.RowCount);
258 for (int i = 0; i < num2; i++)
259 {
260 NextFrame();
261 }
262 }
263
264 public override void UpdateVelocity(int frameCount)
265 {
266 float num = 1.2f + Math.Abs(Main.WindForVisuals) * 3f;
267 if (Main.IsItStorming)
268 {
269 num *= 1.5f;
270 }
271 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
272 }
273
274 public override void Update(int frameCount)
275 {
276 if (Main.IsItStorming)
277 {
278 FramingSpeed = 4;
279 }
280 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
281 base.Update(frameCount);
282 if (!Main.dayTime || Main.eclipse)
283 {
285 }
286 }
287 }
288
290 {
291 public PegasusSkyEntity(Player player, FastRandom random)
292 {
294 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
295 int num = 100;
296 if (Effects == SpriteEffects.FlipHorizontally)
297 {
298 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
299 }
300 else
301 {
302 Position.X = virtualCamera.Position.X - (float)num;
303 }
304 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
305 Depth = random.NextFloat() * 3f + 3f;
307 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Pegasus", (AssetRequestMode)1);
308 Frame = new SpriteFrame(1, 11);
309 LifeTime = random.Next(60, 121) * 60;
312 BrightnessLerper = 0.2f;
314 FramingSpeed = 5;
315 }
316
317 public override void UpdateVelocity(int frameCount)
318 {
319 float num = 1.5f + Math.Abs(Main.WindForVisuals) * 0.6f;
320 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
321 }
322
323 public override void Update(int frameCount)
324 {
325 base.Update(frameCount);
327 {
329 }
330 }
331
333 {
334 return base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[6];
335 }
336 }
337
339 {
340 public VultureSkyEntity(Player player, FastRandom random)
341 {
343 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
344 int num = 100;
345 if (Effects == SpriteEffects.FlipHorizontally)
346 {
347 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
348 }
349 else
350 {
351 Position.X = virtualCamera.Position.X - (float)num;
352 }
353 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
354 Depth = random.NextFloat() * 3f + 3f;
356 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Vulture", (AssetRequestMode)1);
357 Frame = new SpriteFrame(1, 10);
358 LifeTime = random.Next(60, 121) * 60;
361 BrightnessLerper = 0.2f;
363 FramingSpeed = 5;
364 }
365
366 public override void UpdateVelocity(int frameCount)
367 {
368 float num = 3f + Math.Abs(Main.WindForVisuals) * 0.8f;
369 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
370 }
371
372 public override void Update(int frameCount)
373 {
374 base.Update(frameCount);
376 {
378 }
379 }
380
382 {
384 }
385 }
386
388 {
389 private int pixieType = 1;
390
391 public PixiePosseSkyEntity(Player player, FastRandom random)
392 {
394 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
395 int num = 100;
396 if (Effects == SpriteEffects.FlipHorizontally)
397 {
398 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
399 }
400 else
401 {
402 Position.X = virtualCamera.Position.X - (float)num;
403 }
404 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 4000f) + 4000f;
405 Depth = random.NextFloat() * 3f + 2f;
407 if (!Main.dayTime)
408 {
409 pixieType = 2;
410 }
411 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/PixiePosse" + pixieType, (AssetRequestMode)1);
412 Frame = new SpriteFrame(1, 25);
413 LifeTime = random.Next(60, 121) * 60;
416 BrightnessLerper = 0.6f;
418 FramingSpeed = 5;
419 }
420
421 public override void UpdateVelocity(int frameCount)
422 {
423 float num = 0.12f + Math.Abs(Main.WindForVisuals) * 0.08f;
424 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
425 }
426
427 public override void Update(int frameCount)
428 {
429 base.Update(frameCount);
431 {
433 }
434 }
435
436 public override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
437 {
438 CommonDraw(spriteBatch, depthScale - 0.1f, minDepth, maxDepth);
439 }
440 }
441
443 {
444 public BirdsPackSkyEntity(Player player, FastRandom random)
445 {
447 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
448 int num = 100;
449 if (Effects == SpriteEffects.FlipHorizontally)
450 {
451 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
452 }
453 else
454 {
455 Position.X = virtualCamera.Position.X - (float)num;
456 }
457 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
458 Depth = random.NextFloat() * 3f + 3f;
460 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/BirdsVShape", (AssetRequestMode)1);
461 Frame = new SpriteFrame(1, 4);
462 LifeTime = random.Next(60, 121) * 60;
465 BrightnessLerper = 0.2f;
467 FramingSpeed = 5;
468 }
469
470 public override void UpdateVelocity(int frameCount)
471 {
472 float num = 3f + Math.Abs(Main.WindForVisuals) * 0.8f;
473 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
474 }
475
476 public override void Update(int frameCount)
477 {
478 base.Update(frameCount);
480 {
482 }
483 }
484 }
485
487 {
489
491
493
495
497 {
499 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
500 int num = 100;
501 if (Effects == SpriteEffects.FlipHorizontally)
502 {
503 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
504 }
505 else
506 {
507 Position.X = virtualCamera.Position.X - (float)num;
508 }
509 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
510 Depth = random.NextFloat() * 3f + 3f;
512 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Seagull", (AssetRequestMode)1);
513 Frame = new SpriteFrame(1, 9);
514 LifeTime = random.Next(60, 121) * 60;
517 BrightnessLerper = 0.2f;
519 FramingSpeed = 4;
520 FrameOffset = random.Next(0, Frame.RowCount);
521 int num2 = random.Next(Frame.RowCount);
522 for (int i = 0; i < num2; i++)
523 {
524 NextFrame();
525 }
526 }
527
528 public override void UpdateVelocity(int frameCount)
529 {
533 float x = 4f * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1));
534 Velocity = new Vector2(x, 0f) + _velocityVsMagnet;
535 }
536
537 public override void Update(int frameCount)
538 {
539 base.Update(frameCount);
541 {
543 }
544 }
545
551
553 {
554 return base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[4];
555 }
556
557 public override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
558 {
559 CommonDraw(spriteBatch, depthScale - 1.5f, minDepth, maxDepth);
560 }
561
563 {
565 int num = 100;
566 int num2 = random.Next(5, 9);
567 float num3 = 100f;
569 SpriteEffects spriteEffects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
570 Vector2 vector = default(Vector2);
571 if (spriteEffects == SpriteEffects.FlipHorizontally)
572 {
573 vector.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
574 }
575 else
576 {
577 vector.X = virtualCamera.Position.X - (float)num;
578 }
579 vector.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
580 float num4 = random.NextFloat() * 2f + 1f;
581 int num5 = random.Next(30, 61) * 60;
582 Vector2 vector2 = new Vector2(random.NextFloat() * 0.5f + 0.5f, random.NextFloat() * 0.5f + 0.5f);
583 Vector2 targetOffset = new Vector2(random.NextFloat() * 2f - 1f, random.NextFloat() * 2f - 1f) * num3;
584 for (int i = 0; i < num2; i++)
585 {
587 seagullsGroupSkyEntity.Depth = num4 + random.NextFloat() * 0.5f;
588 seagullsGroupSkyEntity.Position = vector + new Vector2(random.NextFloat() * 20f - 10f, random.NextFloat() * 3f) * 50f;
589 seagullsGroupSkyEntity.Effects = spriteEffects;
590 seagullsGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(seagullsGroupSkyEntity.Position);
591 seagullsGroupSkyEntity.LifeTime = num5 + random.Next(301);
592 seagullsGroupSkyEntity.SetMagnetization(vector2 * (random.NextFloat() * 0.3f + 0.85f) * 0.05f, targetOffset);
594 }
595 return list;
596 }
597 }
598
600 {
602
604
606
608
610 {
612 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
613 int num = 100;
614 if (Effects == SpriteEffects.FlipHorizontally)
615 {
616 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
617 }
618 else
619 {
620 Position.X = virtualCamera.Position.X - (float)num;
621 }
622 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 3200f) + 3200f;
623 Depth = random.NextFloat() * 3f + 2f;
625 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Gastropod", (AssetRequestMode)1);
626 Frame = new SpriteFrame(1, 1);
627 LifeTime = random.Next(60, 121) * 60;
630 BrightnessLerper = 0.75f;
632 FramingSpeed = int.MaxValue;
633 }
634
635 public override void UpdateVelocity(int frameCount)
636 {
640 float x = (1.5f + Math.Abs(Main.WindForVisuals) * 0.2f) * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1));
641 Velocity = new Vector2(x, 0f) + _velocityVsMagnet;
642 Rotation = Velocity.X * 0.1f;
643 }
644
645 public override void Update(int frameCount)
646 {
647 base.Update(frameCount);
649 {
651 }
652 }
653
658
659 public override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
660 {
661 CommonDraw(spriteBatch, depthScale - 0.1f, minDepth, maxDepth);
662 }
663
669
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 }
704 }
705
707 {
709
711
713
715
717 {
719 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
720 int num = 100;
721 if (Effects == SpriteEffects.FlipHorizontally)
722 {
723 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
724 }
725 else
726 {
727 Position.X = virtualCamera.Position.X - (float)num;
728 }
729 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 4000f) + 4000f;
730 Depth = random.NextFloat() * 3f + 3f;
732 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/SlimeBalloons", (AssetRequestMode)1);
733 Frame = new SpriteFrame(1, 7);
734 Frame.CurrentRow = (byte)random.Next(7);
735 LifeTime = random.Next(60, 121) * 60;
738 BrightnessLerper = 0.2f;
740 FramingSpeed = int.MaxValue;
741 }
742
743 public override void UpdateVelocity(int frameCount)
744 {
748 float x = (1f + Math.Abs(Main.WindForVisuals) * 1f) * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1));
749 Velocity = new Vector2(x, -0.01f) + _velocityVsMagnet;
750 Rotation = Velocity.X * 0.1f;
751 }
752
753 public override void Update(int frameCount)
754 {
755 base.Update(frameCount);
756 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
758 {
760 }
761 }
762
768
770 {
772 int num = 100;
773 int num2 = random.Next(5, 10);
775 SpriteEffects spriteEffects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
776 Vector2 vector = default(Vector2);
777 if (spriteEffects == SpriteEffects.FlipHorizontally)
778 {
779 vector.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
780 }
781 else
782 {
783 vector.X = virtualCamera.Position.X - (float)num;
784 }
785 vector.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
786 float num3 = random.NextFloat() * 3f + 3f;
787 int num4 = random.Next(80, 121) * 60;
788 Vector2 vector2 = new Vector2(random.NextFloat() * 0.1f + 0.1f, random.NextFloat() * 0.1f + 0.1f);
789 Vector2 targetOffset = new Vector2(random.NextFloat() * 2f - 1f, random.NextFloat() * 2f - 1f) * 150f;
790 for (int i = 0; i < num2; i++)
791 {
793 slimeBalloonGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f;
794 slimeBalloonGroupSkyEntity.Position = vector + new Vector2(random.NextFloat() * 20f - 10f, random.NextFloat() * 3f) * 80f;
795 slimeBalloonGroupSkyEntity.Effects = spriteEffects;
796 slimeBalloonGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(slimeBalloonGroupSkyEntity.Position);
797 slimeBalloonGroupSkyEntity.LifeTime = num4 + random.Next(301);
798 slimeBalloonGroupSkyEntity.SetMagnetization(vector2 * (random.NextFloat() * 0.2f) * 0.05f, targetOffset);
800 }
801 return list;
802 }
803 }
804
806 {
808
810
812
814
816 {
818 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
819 int num = 100;
820 if (Effects == SpriteEffects.FlipHorizontally)
821 {
822 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
823 }
824 else
825 {
826 Position.X = virtualCamera.Position.X - (float)num;
827 }
828 Position.Y = random.NextFloat() * 400f + (float)(Main.UnderworldLayer * 16);
829 Depth = random.NextFloat() * 5f + 3f;
831 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/HellBat" + random.Next(1, 3), (AssetRequestMode)1);
832 Frame = new SpriteFrame(1, 10);
833 LifeTime = random.Next(60, 121) * 60;
836 BrightnessLerper = 0.2f;
838 FramingSpeed = 4;
839 FrameOffset = random.Next(0, Frame.RowCount);
840 int num2 = random.Next(Frame.RowCount);
841 for (int i = 0; i < num2; i++)
842 {
843 NextFrame();
844 }
845 }
846
847 public override void UpdateVelocity(int frameCount)
848 {
852 float x = (3f + Math.Abs(Main.WindForVisuals) * 0.8f) * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1));
853 Velocity = new Vector2(x, 0f) + _velocityVsMagnet;
854 }
855
856 public override void Update(int frameCount)
857 {
858 base.Update(frameCount);
859 }
860
866
871
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 }
906
908 {
910 {
911 return 1f;
912 }
913 return 0f;
914 }
915 }
916
918 {
920
922
924
926
927 public BatsGroupSkyEntity(Player player, FastRandom random)
928 {
930 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
931 int num = 100;
932 if (Effects == SpriteEffects.FlipHorizontally)
933 {
934 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
935 }
936 else
937 {
938 Position.X = virtualCamera.Position.X - (float)num;
939 }
940 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
941 Depth = random.NextFloat() * 3f + 3f;
943 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Bat" + random.Next(1, 4), (AssetRequestMode)1);
944 Frame = new SpriteFrame(1, 10);
945 LifeTime = random.Next(60, 121) * 60;
948 BrightnessLerper = 0.2f;
950 FramingSpeed = 4;
951 FrameOffset = random.Next(0, Frame.RowCount);
952 int num2 = random.Next(Frame.RowCount);
953 for (int i = 0; i < num2; i++)
954 {
955 NextFrame();
956 }
957 }
958
959 public override void UpdateVelocity(int frameCount)
960 {
964 float x = (3f + Math.Abs(Main.WindForVisuals) * 0.8f) * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1));
965 Velocity = new Vector2(x, 0f) + _velocityVsMagnet;
966 }
967
968 public override void Update(int frameCount)
969 {
970 base.Update(frameCount);
972 {
974 }
975 }
976
982
987
989 {
991 int num = 100;
992 int num2 = random.Next(20, 40);
994 SpriteEffects spriteEffects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
995 Vector2 vector = default(Vector2);
996 if (spriteEffects == SpriteEffects.FlipHorizontally)
997 {
998 vector.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
999 }
1000 else
1001 {
1002 vector.X = virtualCamera.Position.X - (float)num;
1003 }
1004 vector.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
1005 float num3 = random.NextFloat() * 3f + 3f;
1006 int num4 = random.Next(30, 61) * 60;
1007 Vector2 vector2 = new Vector2(random.NextFloat() * 0.5f + 0.5f, random.NextFloat() * 0.5f + 0.5f);
1008 Vector2 targetOffset = new Vector2(random.NextFloat() * 2f - 1f, random.NextFloat() * 2f - 1f) * 100f;
1009 for (int i = 0; i < num2; i++)
1010 {
1012 batsGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f;
1013 batsGroupSkyEntity.Position = vector + new Vector2(random.NextFloat() * 20f - 10f, random.NextFloat() * 3f) * 50f;
1014 batsGroupSkyEntity.Effects = spriteEffects;
1015 batsGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(batsGroupSkyEntity.Position);
1016 batsGroupSkyEntity.LifeTime = num4 + random.Next(301);
1017 batsGroupSkyEntity.SetMagnetization(vector2 * (random.NextFloat() * 0.3f + 0.85f) * 0.05f, targetOffset);
1019 }
1020 return list;
1021 }
1022 }
1023
1025 {
1026 public WyvernSkyEntity(Player player, FastRandom random)
1027 {
1029 Effects = ((!(Main.WindForVisuals > 0f)) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
1030 int num = 100;
1031 if (Effects == SpriteEffects.FlipHorizontally)
1032 {
1033 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
1034 }
1035 else
1036 {
1037 Position.X = virtualCamera.Position.X - (float)num;
1038 }
1039 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
1040 Depth = random.NextFloat() * 3f + 3f;
1042 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Wyvern", (AssetRequestMode)1);
1043 Frame = new SpriteFrame(1, 5);
1044 LifeTime = random.Next(40, 71) * 60;
1047 BrightnessLerper = 0.2f;
1049 FramingSpeed = 4;
1050 }
1051
1052 public override void UpdateVelocity(int frameCount)
1053 {
1054 float num = 3f + Math.Abs(Main.WindForVisuals) * 0.8f;
1055 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
1056 }
1057 }
1058
1060 {
1062 {
1063 return Color.Lerp(backgroundColor, Color.White, 0.3f);
1064 }
1065
1066 public override Vector2 GetDrawPosition()
1067 {
1068 return Position;
1069 }
1070
1071 public override void Update(int frameCount)
1072 {
1073 }
1074 }
1075
1079
1081 {
1082 public AirshipSkyEntity(Player player, FastRandom random)
1083 {
1085 Effects = ((random.Next(2) != 0) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
1086 int num = 100;
1087 if (Effects == SpriteEffects.FlipHorizontally)
1088 {
1089 Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float)num;
1090 }
1091 else
1092 {
1093 Position.X = virtualCamera.Position.X - (float)num;
1094 }
1095 Position.Y = random.NextFloat() * ((float)Main.worldSurface * 16f - 1600f - 2400f) + 2400f;
1096 Depth = random.NextFloat() * 3f + 3f;
1098 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/FlyingShip", (AssetRequestMode)1);
1099 Frame = new SpriteFrame(1, 4);
1100 LifeTime = random.Next(40, 71) * 60;
1103 BrightnessLerper = 0.2f;
1105 FramingSpeed = 4;
1106 }
1107
1108 public override void UpdateVelocity(int frameCount)
1109 {
1110 float num = 6f + Math.Abs(Main.WindForVisuals) * 1.6f;
1111 Velocity = new Vector2(num * (float)((Effects != SpriteEffects.FlipHorizontally) ? 1 : (-1)), 0f);
1112 }
1113
1114 public override void Update(int frameCount)
1115 {
1116 base.Update(frameCount);
1118 {
1120 }
1121 }
1122 }
1123
1125 {
1126 private const int RANDOM_TILE_SPAWN_RANGE = 100;
1127
1129 {
1130 new VirtualCamera(player);
1131 int x = player.Center.ToTileCoordinates().X;
1132 Effects = ((random.Next(2) != 0) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
1133 Position.X = ((float)x + 100f * (random.NextFloat() * 2f - 1f)) * 16f;
1134 Position.Y = (float)Main.worldSurface * 16f - (float)random.Next(50, 81) * 16f;
1135 Depth = random.NextFloat() * 3f + 3f;
1136 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/AirBalloons_" + ((random.Next(2) == 0) ? "Large" : "Small"), (AssetRequestMode)1);
1137 Frame = new SpriteFrame(1, 5);
1138 Frame.CurrentRow = (byte)random.Next(5);
1139 LifeTime = random.Next(20, 51) * 60;
1142 BrightnessLerper = 0.2f;
1144 FramingSpeed = int.MaxValue;
1145 }
1146
1147 public override void UpdateVelocity(int frameCount)
1148 {
1149 float x = Main.WindForVisuals * 4f;
1150 float num = 3f + Math.Abs(Main.WindForVisuals) * 1f;
1151 if ((double)Position.Y < Main.worldSurface * 12.0)
1152 {
1153 num *= 0.5f;
1154 }
1155 if ((double)Position.Y < Main.worldSurface * 8.0)
1156 {
1157 num *= 0.5f;
1158 }
1159 if ((double)Position.Y < Main.worldSurface * 4.0)
1160 {
1161 num *= 0.5f;
1162 }
1163 Velocity = new Vector2(x, 0f - num);
1164 }
1165
1166 public override void Update(int frameCount)
1167 {
1168 base.Update(frameCount);
1170 {
1172 }
1173 }
1174 }
1175
1177 {
1178 public CrimeraSkyEntity(Player player, FastRandom random)
1179 : base(player, random)
1180 {
1181 int num = 3;
1182 if (Depth <= 6f)
1183 {
1184 num = 2;
1185 }
1186 if (Depth <= 5f)
1187 {
1188 num = 1;
1189 }
1190 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Crimera" + num, (AssetRequestMode)1);
1191 Frame = new SpriteFrame(1, 3);
1192 }
1193
1195 {
1196 return base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[8];
1197 }
1198 }
1199
1201 {
1202 public EOSSkyEntity(Player player, FastRandom random)
1203 : base(player, random)
1204 {
1205 int num = 3;
1206 if (Depth <= 6f)
1207 {
1208 num = 2;
1209 }
1210 if (Depth <= 5f)
1211 {
1212 num = 1;
1213 }
1214 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/EOS" + num, (AssetRequestMode)1);
1215 Frame = new SpriteFrame(1, 4);
1216 }
1217
1219 {
1220 return base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[1];
1221 }
1222 }
1223
1225 {
1226 private const int STATE_ZIGZAG = 1;
1227
1228 private const int STATE_GOOVERPLAYER = 2;
1229
1230 private int _state;
1231
1232 private int _direction;
1233
1234 private float _waviness;
1235
1236 public EOCSkyEntity(Player player, FastRandom random)
1237 {
1238 VirtualCamera camera = new VirtualCamera(player);
1239 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/EOC", (AssetRequestMode)1);
1240 Frame = new SpriteFrame(1, 3);
1241 Depth = random.NextFloat() * 3f + 4.5f;
1242 if (random.Next(4) != 0)
1243 {
1244 BeginZigZag(ref random, camera, (random.Next(2) == 1) ? 1 : (-1));
1245 }
1246 else
1247 {
1248 BeginChasingPlayer(ref random, camera);
1249 }
1253 BrightnessLerper = 0.2f;
1255 FramingSpeed = 5;
1256 }
1257
1258 private void BeginZigZag(ref FastRandom random, VirtualCamera camera, int direction)
1259 {
1260 _state = 1;
1261 LifeTime = random.Next(18, 31) * 60;
1262 _direction = direction;
1263 _waviness = random.NextFloat() * 1f + 1f;
1264 Position.Y = camera.Position.Y;
1265 int num = 100;
1266 if (_direction == 1)
1267 {
1268 Position.X = camera.Position.X - (float)num;
1269 }
1270 else
1271 {
1272 Position.X = camera.Position.X + camera.Size.X + (float)num;
1273 }
1274 }
1275
1277 {
1278 _state = 2;
1279 LifeTime = random.Next(18, 31) * 60;
1280 Position = camera.Position + camera.Size * new Vector2(random.NextFloat(), random.NextFloat());
1281 }
1282
1283 public override void UpdateVelocity(int frameCount)
1284 {
1285 switch (_state)
1286 {
1287 case 1:
1289 break;
1290 case 2:
1292 break;
1293 }
1294 Rotation = Velocity.ToRotation();
1295 }
1296
1297 private void ZigzagMove(int frameCount)
1298 {
1299 Velocity = new Vector2(_direction * 3, (float)Math.Cos((float)frameCount / 1200f * ((float)Math.PI * 2f)) * _waviness);
1300 }
1301
1302 private void ChasePlayerTop(int frameCount)
1303 {
1304 Vector2 vector = Main.LocalPlayer.Center + new Vector2(0f, -500f) - Position;
1305 if (vector.Length() >= 100f)
1306 {
1307 Velocity.X += 0.1f * (float)Math.Sign(vector.X);
1308 Velocity.Y += 0.1f * (float)Math.Sign(vector.Y);
1309 Velocity = Vector2.Clamp(Velocity, new Vector2(-18f), new Vector2(18f));
1310 }
1311 }
1312 }
1313
1315 {
1316 public MeteorSkyEntity(Player player, FastRandom random)
1317 {
1318 new VirtualCamera(player);
1319 Effects = ((random.Next(2) != 0) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
1320 Depth = random.NextFloat() * 3f + 3f;
1321 Texture = Main.Assets.Request<Texture2D>("Images/Backgrounds/Ambience/Meteor", (AssetRequestMode)1);
1322 Frame = new SpriteFrame(1, 4);
1323 Vector2 vector = ((float)Math.PI / 4f + random.NextFloat() * ((float)Math.PI / 2f)).ToRotationVector2();
1324 float num = (float)(Main.worldSurface * 16.0 - 0.0) / vector.Y;
1325 float num2 = 1200f;
1326 float num3 = num / num2;
1327 Vector2 velocity = vector * num3;
1328 Velocity = velocity;
1329 int num4 = 100;
1330 Vector2 position = player.Center + new Vector2(random.Next(-num4, num4 + 1), random.Next(-num4, num4 + 1)) - Velocity * num2 * 0.5f;
1331 Position = position;
1332 LifeTime = (int)num2;
1335 BrightnessLerper = 0.5f;
1337 FramingSpeed = 5;
1338 Rotation = Velocity.ToRotation() + (float)Math.PI / 2f;
1339 }
1340 }
1341
1343
1344 private bool _isActive;
1345
1347
1348 private int _frameCounter;
1349
1350 public override void Activate(Vector2 position, params object[] args)
1351 {
1352 _isActive = true;
1353 }
1354
1355 public override void Deactivate(params object[] args)
1356 {
1357 _isActive = false;
1358 }
1359
1361 {
1362 if (!SkyManager.Instance["MonolithMoonLord"].IsActive())
1363 {
1364 return SkyManager.Instance["MoonLord"].IsActive();
1365 }
1366 return true;
1367 }
1368
1369 public override void Update(GameTime gameTime)
1370 {
1371 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
1372 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
1373 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
1374 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
1375 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
1376 if (Main.gamePaused)
1377 {
1378 return;
1379 }
1380 _frameCounter++;
1381 if (Main.netMode != 2 && AnActiveSkyConflictsWithAmbience() && SkyManager.Instance["Ambience"].IsActive())
1382 {
1383 SkyManager.Instance.Deactivate("Ambience");
1384 }
1386 {
1387 SkyEntity value = item.Value;
1389 if (!value.IsActive)
1390 {
1391 _entities.Remove(item.Id);
1392 if (Main.netMode != 2 && _entities.Count == 0 && SkyManager.Instance["Ambience"].IsActive())
1393 {
1394 SkyManager.Instance.Deactivate("Ambience");
1395 }
1396 }
1397 }
1398 }
1399
1400 public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
1401 {
1402 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
1403 if (Main.gameMenu && Main.netMode == 0 && SkyManager.Instance["Ambience"].IsActive())
1404 {
1405 _entities.Clear();
1406 SkyManager.Instance.Deactivate("Ambience");
1407 }
1409 {
1410 item.Value.Draw(spriteBatch, 3f, minDepth, maxDepth);
1411 }
1412 }
1413
1414 public override bool IsActive()
1415 {
1416 return _isActive;
1417 }
1418
1419 public override void Reset()
1420 {
1421 }
1422
1423 public void Spawn(Player player, SkyEntityType type, int seed)
1424 {
1425 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
1426 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
1427 //IL_0084: Unknown result type (might be due to invalid IL or missing references)
1428 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
1429 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
1430 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
1431 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
1432 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
1433 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
1434 //IL_017a: Unknown result type (might be due to invalid IL or missing references)
1435 //IL_0234: Unknown result type (might be due to invalid IL or missing references)
1436 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
1437 //IL_025e: Unknown result type (might be due to invalid IL or missing references)
1438 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
1439 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
1440 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
1441 //IL_020e: Unknown result type (might be due to invalid IL or missing references)
1442 //IL_0283: Unknown result type (might be due to invalid IL or missing references)
1443 FastRandom random = new FastRandom(seed);
1444 switch (type)
1445 {
1446 case SkyEntityType.AirBalloon:
1447 _entities.Add((SkyEntity)new AirBalloonSkyEntity(player, random));
1448 break;
1449 case SkyEntityType.Airship:
1450 _entities.Add((SkyEntity)new AirshipSkyEntity(player, random));
1451 break;
1452 case SkyEntityType.BirdsV:
1453 _entities.Add((SkyEntity)new BirdsPackSkyEntity(player, random));
1454 break;
1455 case SkyEntityType.Eyeball:
1456 _entities.Add((SkyEntity)new EOCSkyEntity(player, random));
1457 break;
1458 case SkyEntityType.Meteor:
1459 _entities.Add((SkyEntity)new MeteorSkyEntity(player, random));
1460 break;
1461 case SkyEntityType.Wyvern:
1462 _entities.Add((SkyEntity)new WyvernSkyEntity(player, random));
1463 break;
1464 case SkyEntityType.Bats:
1465 {
1467 for (int m = 0; m < list5.Count; m++)
1468 {
1470 }
1471 break;
1472 }
1473 case SkyEntityType.Butterflies:
1474 _entities.Add((SkyEntity)new ButterfliesSkyEntity(player, random));
1475 break;
1476 case SkyEntityType.LostKite:
1477 _entities.Add((SkyEntity)new LostKiteSkyEntity(player, random));
1478 break;
1479 case SkyEntityType.Vulture:
1480 _entities.Add((SkyEntity)new VultureSkyEntity(player, random));
1481 break;
1482 case SkyEntityType.PixiePosse:
1483 _entities.Add((SkyEntity)new PixiePosseSkyEntity(player, random));
1484 break;
1485 case SkyEntityType.Seagulls:
1486 {
1488 for (int l = 0; l < list4.Count; l++)
1489 {
1491 }
1492 break;
1493 }
1494 case SkyEntityType.SlimeBalloons:
1495 {
1497 for (int k = 0; k < list3.Count; k++)
1498 {
1500 }
1501 break;
1502 }
1503 case SkyEntityType.Gastropods:
1504 {
1506 for (int j = 0; j < list2.Count; j++)
1507 {
1509 }
1510 break;
1511 }
1512 case SkyEntityType.Pegasus:
1513 _entities.Add((SkyEntity)new PegasusSkyEntity(player, random));
1514 break;
1515 case SkyEntityType.EaterOfSouls:
1516 _entities.Add((SkyEntity)new EOSSkyEntity(player, random));
1517 break;
1518 case SkyEntityType.Crimera:
1519 _entities.Add((SkyEntity)new CrimeraSkyEntity(player, random));
1520 break;
1521 case SkyEntityType.Hellbats:
1522 {
1524 for (int i = 0; i < list.Count; i++)
1525 {
1527 }
1528 break;
1529 }
1530 }
1531 if (Main.netMode != 2 && !AnActiveSkyConflictsWithAmbience() && !SkyManager.Instance["Ambience"].IsActive())
1532 {
1533 SkyManager.Instance.Activate("Ambience", default(Vector2));
1534 }
1535 }
1536}
void Draw(Texture2D texture, Vector2 position, Color color)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static double Cos(double d)
static double Abs(double value)
const double PI
Definition Math.cs:16
static int Sign(decimal value)
Definition Math.cs:1202
static byte Max(byte val1, byte val2)
Definition Math.cs:738
Vector2 Center
Definition Entity.cs:43
AirBalloonSkyEntity(Player player, FastRandom random)
AirshipSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
static List< BatsGroupSkyEntity > CreateGroup(Player player, FastRandom random)
BatsGroupSkyEntity(Player player, FastRandom random)
void SetMagnetization(Vector2 accelerations, Vector2 targetOffset)
BirdsPackSkyEntity(Player player, FastRandom random)
ButterfliesSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
CrimeraSkyEntity(Player player, FastRandom random)
void BeginChasingPlayer(ref FastRandom random, VirtualCamera camera)
void BeginZigZag(ref FastRandom random, VirtualCamera camera, int direction)
EOCSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
EOSSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
static List< GastropodGroupSkyEntity > CreateGroup(Player player, FastRandom random)
GastropodGroupSkyEntity(Player player, FastRandom random)
void SetMagnetization(Vector2 accelerations, Vector2 targetOffset)
HellBatsGoupSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
static List< HellBatsGoupSkyEntity > CreateGroup(Player player, FastRandom random)
void SetMagnetization(Vector2 accelerations, Vector2 targetOffset)
LostKiteSkyEntity(Player player, FastRandom random)
MeteorSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
PegasusSkyEntity(Player player, FastRandom random)
PixiePosseSkyEntity(Player player, FastRandom random)
override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
void SetMagnetization(Vector2 accelerations, Vector2 targetOffset)
SeagullsGroupSkyEntity(Player player, FastRandom random)
override void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
static List< SeagullsGroupSkyEntity > CreateGroup(Player player, FastRandom random)
void CommonDraw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
Definition AmbientSky.cs:59
void SetPositionInWorldBasedOnScreenSpace(Vector2 actualWorldSpace)
Definition AmbientSky.cs:45
virtual void Draw(SpriteBatch spriteBatch, float depthScale, float minDepth, float maxDepth)
Definition AmbientSky.cs:54
static List< SlimeBalloonGroupSkyEntity > CreateGroup(Player player, FastRandom random)
void SetMagnetization(Vector2 accelerations, Vector2 targetOffset)
VultureSkyEntity(Player player, FastRandom random)
override Color GetColor(Color backgroundColor)
WyvernSkyEntity(Player player, FastRandom random)
override void Update(GameTime gameTime)
void Spawn(Player player, SkyEntityType type, int seed)
override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
delegate SkyEntity EntityFactoryMethod(Player player, int seed)
readonly SlotVector< SkyEntity > _entities
override void Activate(Vector2 position, params object[] args)
override void Deactivate(params object[] args)
static readonly Color AmbientNPCGastropodLight
Definition Colors.cs:39
static Microsoft.Xna.Framework.Color ColorOfTheSkies
Definition Main.cs:2577
static bool IsItAHappyWindyDay
Definition Main.cs:2869
static bool IsItRaining
Definition Main.cs:2664
static double worldSurface
Definition Main.cs:1272
static int netMode
Definition Main.cs:2095
static bool dayTime
Definition Main.cs:1282
static bool bloodMoon
Definition Main.cs:1296
static float WindForVisuals
Definition Main.cs:2827
static bool BackgroundEnabled
Definition Main.cs:802
static Camera Camera
Definition Main.cs:289
static float atmo
Definition Main.cs:2571
static float[] bgAlphaFrontLayer
Definition Main.cs:812
static bool eclipse
Definition Main.cs:1312
static int UnderworldLayer
Definition Main.cs:2825
static bool snowMoon
Definition Main.cs:1300
static bool pumpkinMoon
Definition Main.cs:1298
static IAssetRepository Assets
Definition Main.cs:209
static bool gameMenu
Definition Main.cs:1926
static bool gamePaused
Definition Main.cs:1072
static bool IsItStorming
Definition Main.cs:2871
static float GetLerpValue(float from, float to, float t, bool clamped=false)
Definition Utils.cs:203
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
Definition Vector2.cs:201
Rectangle GetSourceRectangle(Texture2D texture)