Ejemplo n.º 1
0
        private void UpdateCamera(FrameEventData evt)
        {
            Vector2 cameraPosition = Main.screenPosition;

            //Vector2 difference = cameraPosition - _CameraTarget;
            //difference = Vector2.Normalize(difference);
            //var dif = difference * (float) TUA.gameTime.ElapsedGameTime.TotalSeconds;
            cameraPosition = Vector2.Lerp(cameraPosition, _CameraTarget, 0.6f);
            //cameraPosition += difference * (float) TUA.gameTime.ElapsedGameTime.TotalSeconds * 0.4f;
            if ((cameraPosition - _CameraTarget).Length() < _speed)
            {
                cameraPosition = _CameraTarget;
            }
            TUAPlayer.LockPlayerCamera(cameraPosition, true);
        }
Ejemplo n.º 2
0
        public override void AI()
        {
            if (npc.localAI[0] != 1f)
            {
                RotateToPlayer();

                if (cutscenePhase != 7)
                {
                    if (cutscenePhase >= 1)
                    {
                        SpawnCircleDust(10 * 16, DustID.Shadowflame);
                    }

                    ExecuteCutscene();
                    return;
                }
                TUAPlayer.LockPlayerCamera(null, false);
                Main.musicVolume = previousMusicVolume;
                if (npc.ai[1] == 0)
                {
                }
            }
        }
Ejemplo n.º 3
0
        private void ExecuteCutscene()
        {
            Vector2 centerPosition = new Vector2(npc.position.X + 300, npc.Center.Y);

            npc.velocity = Vector2.Zero;

            TUAPlayer.LockPlayerCamera(new Vector2(npc.position.X + 300 - Main.screenWidth / 2, npc.Center.Y - Main.screenHeight / 2), true);



            if (CutsceneTimer == 0)
            {
                switch (CutscenePhase)
                {
                case 0:
                    npc.GivenName = "Eye of Cthulhu";
                    TUA.BroadcastMessage("<Eye of Cthulhu> I'm sorry, I failed you master... The terrarian are much more stronger than I thought");
                    CutsceneTimer = 200;
                    CutscenePhase++;
                    break;

                case 1:
                    TUA.BroadcastMessage("<???> You failure of a minion, you can't even do your job properly. I was sealed for 1000 year ago and when I wake up I find that the terrarian are more strong than what they were during the god reign time.");
                    CutsceneTimer = 300;
                    CutscenePhase++;
                    break;

                case 2:
                    TUA.BroadcastMessage("<Eye of Cthulhu> But master, those are not the same from 1000 year ago, those area new race.");
                    CutsceneTimer = 250;
                    CutscenePhase++;
                    break;

                case 3:
                    TUA.BroadcastMessage("<???> I do not care about what they are or what they became, I can still smell the presence of the traveler around the world, the one that made us perish.");
                    TUA.BroadcastMessage("<???> Anyway, enough talking for now, I'll give you one last chance and don't fail on me. Here is a fraction of my power");
                    CutsceneTimer = 400;
                    CutscenePhase++;
                    break;

                case 4:
                    TUA.BroadcastMessage("<Ultra Eye of Cthulhu> Master, I promise I will do this request, the terrarian will be destroyed.");
                    TUA.instance.SetTitle("Ultra Eye of Cthulhu", "Not what you were expecting?", Color.White, Color.DarkRed, Main.fontDeathText, 600, 0.8f, true);
                    TUAPlayer.LockPlayerCamera(null, false);
                    IsCutsceneExecuting = false;
                    CutscenePhase++;
                    npc.GivenName = "Ultra Eye of Cthulhu";
                    break;
                }
            }

            if (CutscenePhase == 4)
            {
                npc.rotation -= 0.5f;
                if (CutsceneDustTimer == 0)
                {
                    Dust.NewDust(npc.Center, 2, 2, DustID.Shadowflame, Main.rand.Next(-4, 4), Main.rand.Next(-4, 4),
                                 0, Color.White, 2f);
                    CutsceneDustTimer = 2;
                }

                CutsceneDustTimer--;
            }
            else
            {
                rotateToPosition(centerPosition);
            }

            CutsceneTimer--;
        }
Ejemplo n.º 4
0
        private void ExecuteCutscene()
        {
            if (previousMusicVolume == -1f)
            {
                previousMusicVolume = Main.musicVolume;
            }

            Main.musicVolume = 0f;
            cutscenetimer--;
            if (cutscenetimer == 0)
            {
                cutscenetimer = 300;
                opacity      += 0.3f;
                npc.Opacity   = opacity;
                switch (cutscenePhase)
                {
                case 0:
                    TUA.instance.SetTitle("Eye of Azathoth", "The god of destruction", Color.Red, Color.Black, Main.fontDeathText, 300, 1, true);
                    TUA.BroadcastMessage("<???> Who hath summoned this to this wretched world? " +
                                         "It will be a pleasure to destroy them, like I did a years ago.", Color.Black);
                    npc.GivenName = "???";
                    break;

                case 1:
                    TUA.BroadcastMessage("<???> Humans sealed me eons ago, but now I'm finally free " +
                                         "and I'll bring this world back to its most glorious stage, the era of destruction!");
                    break;

                case 2:
                    npc.GivenName = "Eye of Azathoth";
                    TUA.BroadcastMessage($"<{npc.GivenName}> I, the Eye of Azathoth, the divine incarnation of destruction, " +
                                         "will bring the world back to the times when humanity was nothing more than a speck on the earth.");
                    break;

                case 3:
                    TUA.BroadcastMessage($"<{npc.GivenName}> Once I reigned supreme over all other gods of this world , " +
                                         "but that despicable man completely defeated me, impossibly, " +
                                         "and somehow me and my brotherhood was rendered powerless and trapped in another dimension.");
                    break;

                case 4:
                    TUA.BroadcastMessage($"<{npc.GivenName}> I'll never forgive that human, never.");
                    break;

                case 5:
                    TUA.BroadcastMessage($"<{npc.GivenName}> But now I am back to seek revenge on the humans, " +
                                         "their worthless spells and so-called \"technology\" won't be able to stop me this time " +
                                         "and everyone will perish under the plagues! I will allow all of humanity to be crushed by " +
                                         "our divine power!");
                    break;

                case 6:
                    TUA.instance.SetTitle("Eye of Azathoth", "The god of destruction", Color.Red, Color.Black, Main.fontDeathText, 300, 1, true);
                    TUA.BroadcastMessage($"<{npc.GivenName}> We are taking our throne back " +
                                         "and we will conquer the world like we did a millenia ago, I hope you're ready to fight Terraria, " +
                                         "otherwise it would be boring for me.");
                    break;
                }
                cutscenePhase++;
            }


            TUAPlayer.LockPlayerCamera(new Vector2(npc.Center.X - Main.screenWidth / 2, npc.Center.Y - Main.screenHeight / 2), true);

            Dust.NewDust(npc.Center, 5, 5, DustID.Electric, Main.rand.Next(-5, 5), Main.rand.Next(-5, 5), 255,
                         Color.White * opacity, 1f);
        }
Ejemplo n.º 5
0
 private void FreeLock(FrameEventData evt)
 {
     TUAPlayer.LockPlayerCamera(null, false);
 }