示例#1
0
        private void ExitTransition()
        {
            SoundManager.PlaySound("DialogMenuClose");
            var num  = 0;
            var num2 = 0f;

            foreach (var current in m_diaryList)
            {
                if (current.Visible)
                {
                    current.Opacity = 1f;
                    if (num >= 5)
                    {
                        num   = 0;
                        num2 += 0.05f;
                    }
                    num++;
                    Tween.To(current, 0.25f, Tween.EaseNone, "delay", num2.ToString(), "Opacity", "0");
                    Tween.By(current, 0.25f, Quad.EaseOut, "delay", num2.ToString(), "Y", "-50");
                }
            }
            m_titleText.Opacity = 1f;
            Tween.To(m_titleText, 0.25f, Tween.EaseNone, "Opacity", "0");
            m_inputDelay = 1f;
            Tween.To(this, 0.5f, Tween.EaseNone, "BackBufferOpacity", "0");
            Tween.AddEndHandlerToLastTween(ScreenManager, "HideCurrentScreen");
        }
示例#2
0
 public void PlayChestGame()
 {
     if (Game.PlayerStats.Gold >= 4)
     {
         m_paid = true;
         float num;
         if (ID == 1)
         {
             num = 0.25f;
         }
         else if (ID == 2)
         {
             num = 0.5f;
         }
         else
         {
             num = 0.75f;
         }
         var num2 = (int)(Game.PlayerStats.Gold * num);
         Game.PlayerStats.Gold -= num2;
         ShuffleChests(num2);
         Player.AttachedLevel.TextManager.DisplayNumberStringText(-num2, "gold", Color.Yellow,
                                                                  new Vector2(Player.X, Player.Bounds.Top));
         Tween.By(m_gate, 1f, Quad.EaseInOut, "Y", (-m_gate.Height).ToString());
         return;
     }
     (Player.AttachedLevel.ScreenManager as RCScreenManager).DialogueScreen.SetDialogue("ChestBonusRoom1-NoMoney");
     Tween.To(this, 0f, Linear.EaseNone);
     Tween.AddEndHandlerToLastTween(Player.AttachedLevel.ScreenManager, "DisplayScreen", 13, true,
                                    typeof(List <object>));
 }
示例#3
0
        public override void OnEnter()
        {
            m_cutsceneRunning = true;
            SoundManager.StopMusic(0.5f);
            m_boss.ChangeSprite("EnemyEyeballBossFire_Character");
            m_boss.ChangeToBossPupil();
            var scale = m_boss.Scale;

            m_boss.Scale = new Vector2(0.3f, 0.3f);
            Player.AttachedLevel.Camera.X = (int)(Bounds.Left + Player.AttachedLevel.Camera.Width * 0.5f);
            Player.AttachedLevel.Camera.Y = Player.Y;
            var arg_CA_0 = Player.AttachedLevel.Camera.Position;

            m_boss.AnimationDelay = 0.1f;
            Player.LockControls();
            Player.AttachedLevel.RunCinematicBorders(8f);
            Player.AttachedLevel.CameraLockedToPlayer = false;
            Player.AttachedLevel.Camera.Y             = Player.Y;
            Tween.To(Player.AttachedLevel.Camera, 1f, Quad.EaseInOut, "Y", m_boss.Y.ToString());
            Tween.RunFunction(1.1f, m_boss, "PlayAnimation", true);
            Tween.To(m_boss, 0.5f, Linear.EaseNone, "delay", "2.5", "AnimationDelay", 0.0166666675f.ToString());
            Tween.To(m_boss, 3f, Quad.EaseInOut, "delay", "1", "Rotation", "1800");
            Tween.AddEndHandlerToLastTween(m_boss, "ChangeSprite", "EnemyEyeballBossEye_Character");
            Tween.To(m_boss, 2f, Bounce.EaseOut, "delay", "2", "ScaleX", scale.X.ToString(), "ScaleY",
                     scale.Y.ToString());
            Tween.RunFunction(3.2f, this, "DisplayBossTitle", "The Gatekeeper", m_boss.Name, "Intro2");
            Tween.RunFunction(0.8f, typeof(SoundManager), "PlaySound", "Boss_Eyeball_Build");
            base.OnEnter();
        }
示例#4
0
 public void Intro5()
 {
     Tween.To(Player.AttachedLevel.Camera, 0.5f, Quad.EaseInOut, "delay", "0.3", "X",
              (Player.X + GlobalEV.Camera_XOffset).ToString(), "Y",
              (Bounds.Bottom - (Player.AttachedLevel.Camera.Bounds.Bottom - Player.AttachedLevel.Camera.Y)).ToString());
     Tween.AddEndHandlerToLastTween(this, "BeginFight");
 }
示例#5
0
        public void DisplayStringNumberText(string text, int amount, Color color, Vector2 position)
        {
            var textObj = m_resourcePool.CheckOut();

            textObj.Font     = Game.JunicodeFont;
            textObj.FontSize = 14f;
            textObj.Text     = text + " " + amount;
            var width = textObj.Width;

            m_resourcePool.CheckIn(textObj);
            var textObj2 = m_resourcePool.CheckOut();

            textObj2.Font         = Game.JunicodeFont;
            textObj2.Text         = text + " ";
            textObj2.FontSize     = 14f;
            textObj2.TextureColor = color;
            textObj2.Position     = new Vector2(position.X - width / 2f, position.Y - textObj2.Height / 2f);
            textObj2.Visible      = true;
            var textObj3 = m_resourcePool.CheckOut();

            textObj3.Font         = Game.HerzogFont;
            textObj3.Text         = amount.ToString();
            textObj3.FontSize     = 18f;
            textObj3.TextureColor = color;
            textObj3.Position     = new Vector2(textObj2.X + textObj2.Width, textObj2.Y + 5f);
            textObj3.Visible      = true;
            Tween.By(textObj3, 0.3f, Quad.EaseOut, "Y", "-60");
            Tween.To(textObj3, 0.2f, Linear.EaseNone, "delay", "0.5", "Opacity", "0");
            Tween.AddEndHandlerToLastTween(this, "DestroyText", textObj3);
            Tween.By(textObj2, 0.3f, Quad.EaseOut, "Y", "-60");
            Tween.To(textObj2, 0.2f, Linear.EaseNone, "delay", "0.5", "Opacity", "0");
            Tween.AddEndHandlerToLastTween(this, "DestroyText", textObj2);
        }
示例#6
0
        public void Intro2()
        {
            object arg_96_0 = Player.AttachedLevel.Camera;
            var    arg_96_1 = 1f;
            Easing arg_96_2 = Quad.EaseInOut;
            var    array    = new string[8];

            array[0] = "delay";
            array[1] = "0.5";
            array[2] = "X";
            var arg_5D_0 = array;
            var arg_5D_1 = 3;
            var x        = Bounds.Center.X;

            arg_5D_0[arg_5D_1] = x.ToString();
            array[4]           = "Y";
            var arg_84_0 = array;
            var arg_84_1 = 5;
            var y        = Bounds.Center.Y;

            arg_84_0[arg_84_1] = y.ToString();
            array[6]           = "Zoom";
            array[7]           = "0.5";
            Tween.To(arg_96_0, arg_96_1, arg_96_2, array);
            Tween.AddEndHandlerToLastTween(this, "EndCutscene");
        }
示例#7
0
 public override void OnEnter()
 {
     m_cameraPos = new Vector2(Camera.X, Camera.Y);
     if (m_player == null)
     {
         m_player = (ScreenManager as RCScreenManager).Player;
     }
     m_titlePlate.Scale   = Vector2.Zero;
     m_title.Scale        = Vector2.Zero;
     m_title.Opacity      = 1f;
     m_titlePlate.Opacity = 1f;
     m_storedMusicVolume  = SoundManager.GlobalMusicVolume;
     m_songName           = SoundManager.GetCurrentMusicName();
     Tween.To(typeof(SoundManager), 1f, Tween.EaseNone, "GlobalMusicVolume",
              (m_storedMusicVolume * 0.1f).ToString());
     SoundManager.PlaySound("Player_Death_FadeToBlack");
     m_player.Visible    = true;
     m_player.Opacity    = 1f;
     m_spotlight.Opacity = 0f;
     Tween.To(this, 0.5f, Linear.EaseNone, "BackBufferOpacity", "1");
     Tween.To(m_spotlight, 0.1f, Linear.EaseNone, "delay", "1", "Opacity", "1");
     Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", "Player_Death_Spotlight");
     Tween.To(Camera, 1f, Quad.EaseInOut, "X", m_player.AbsX.ToString(), "Y",
              (m_player.Bounds.Bottom - 10).ToString(), "Zoom", "1");
     Tween.RunFunction(2f, this, "PlayerLevelUpAnimation");
     base.OnEnter();
 }
示例#8
0
 public void CloseGate(bool animate)
 {
     if (animate)
     {
         Player.Y     = 381f;
         Player.X    += 10f;
         Player.State = 1;
         var logicSet = new LogicSet(Player);
         logicSet.AddAction(new RunFunctionLogicAction(Player, "LockControls"));
         logicSet.AddAction(new MoveDirectionLogicAction(new Vector2(1f, 0f)));
         logicSet.AddAction(new ChangeSpriteLogicAction("PlayerWalking_Character"));
         logicSet.AddAction(new PlayAnimationLogicAction());
         logicSet.AddAction(new ChangePropertyLogicAction(Player, "CurrentSpeed", 200));
         logicSet.AddAction(new DelayLogicAction(0.2f));
         logicSet.AddAction(new ChangePropertyLogicAction(Player, "CurrentSpeed", 0));
         Player.RunExternalLogicSet(logicSet);
         Tween.By(m_castleGate, 1.5f, Quad.EaseOut, "Y", m_castleGate.Height.ToString());
         Tween.AddEndHandlerToLastTween(Player, "UnlockControls");
         Player.AttachedLevel.RunCinematicBorders(1.5f);
     }
     else
     {
         m_castleGate.Y += m_castleGate.Height;
     }
     m_gateClosed = true;
 }
示例#9
0
 public void MovePlayerTo(GameObj target)
 {
     m_controlsLocked = true;
     if (Player.X != target.X - 150f)
     {
         if (Player.X > target.Position.X - 150f)
         {
             Player.Flip = SpriteEffects.FlipHorizontally;
         }
         var num = CDGMath.DistanceBetweenPts(Player.Position, new Vector2(target.X - 150f, target.Y)) /
                   Player.Speed;
         Player.UpdateCollisionBoxes();
         Player.State         = 1;
         Player.IsWeighted    = false;
         Player.AccelerationY = 0f;
         Player.AccelerationX = 0f;
         Player.IsCollidable  = false;
         Player.CurrentSpeed  = 0f;
         Player.LockControls();
         Player.ChangeSprite("PlayerWalking_Character");
         Player.PlayAnimation();
         var logicSet = new LogicSet(Player);
         logicSet.AddAction(new DelayLogicAction(num));
         Player.RunExternalLogicSet(logicSet);
         Tween.To(Player, num, Tween.EaseNone, "X", (target.Position.X - 150f).ToString());
         Tween.AddEndHandlerToLastTween(this, "MovePlayerComplete", target);
         return;
     }
     MovePlayerComplete(target);
 }
示例#10
0
        private void ExitTransition()
        {
            SoundManager.PlaySound("DialogMenuClose");
            m_transitioning = true;
            Tween.To(m_confirmText, 0.2f, Tween.EaseNone, "Opacity", "0");
            Tween.To(m_cancelText, 0.2f, Tween.EaseNone, "Opacity", "0");
            Tween.To(m_navigationText, 0.2f, Tween.EaseNone, "Opacity", "0");
            Tween.To(this, 0.2f, Tween.EaseNone, "BackBufferOpacity", "0");
            Tween.To(m_optionsBar, 0.2f, Tween.EaseNone, "Opacity", "0");
            m_bgSprite.Position = new Vector2(660f, 360f);
            m_bgSprite.Opacity  = 1f;
            Tween.To(m_bgSprite, 0.5f, Quad.EaseOut, "Y", "0");
            Tween.To(m_bgSprite, 0.2f, Tween.EaseNone, "Opacity", "0");
            var num = 0;

            foreach (var current in m_optionsArray)
            {
                current.Y       = 160 + num * 30;
                current.Opacity = 1f;
                Tween.By(current, 0.5f, Quad.EaseOut, "Y", (-360f).ToString());
                Tween.To(current, 0.2f, Tween.EaseNone, "Opacity", "0");
                num++;
            }
            Tween.AddEndHandlerToLastTween(ScreenManager, "HideCurrentScreen");
        }
示例#11
0
 public void AnimateJukebox()
 {
     Tween.To(m_jukeBox, 0.2f, Tween.EaseNone, "ScaleY", "2.9", "ScaleX", "3.1", "Rotation", "0");
     Tween.AddEndHandlerToLastTween(this, "AnimateJukebox2");
     Player.AttachedLevel.ImpactEffectPool.DisplayMusicNote(
         new Vector2(m_jukeBox.Bounds.Center.X + CDGMath.RandomInt(-20, 20),
                     m_jukeBox.Bounds.Top + CDGMath.RandomInt(0, 20)));
 }
示例#12
0
 public static void StopFadeOut(ProjectileObj proj, bool hitPlayer)
 {
     proj.IsCollidable  = false;
     proj.AccelerationX = 0f;
     proj.AccelerationY = 0f;
     Tween.To(proj, 0.3f, Tween.EaseNone, "Opacity", "0");
     Tween.AddEndHandlerToLastTween(proj, "KillProjectile");
 }
示例#13
0
 public static void FadeOutOffset(ProjectileObj proj, bool hitPlayer)
 {
     Tween.StopAllContaining(proj, false);
     proj.IsCollidable = false;
     Tween.By(proj, 0.3f, Linear.EaseNone, "X", CDGMath.RandomInt(-50, 50).ToString(), "Y", CDGMath.RandomInt(-100, 100).ToString());
     Tween.To(proj, 0.3f, Linear.EaseNone, "Opacity", "0");
     Tween.AddEndHandlerToLastTween(proj, "KillProjectile");
 }
示例#14
0
 public void Intro2()
 {
     m_boss1.PlayAnimation();
     Tween.To(Player.AttachedLevel.Camera, 0.5f, Quad.EaseInOut, "delay", "0.5", "X",
              (Player.X + GlobalEV.Camera_XOffset).ToString(), "Y",
              (Bounds.Bottom - (Player.AttachedLevel.Camera.Bounds.Bottom - Player.AttachedLevel.Camera.Y)).ToString());
     Tween.AddEndHandlerToLastTween(this, "BeginBattle");
 }
示例#15
0
        public void ItemSpinAnimation3()
        {
            var scale = m_itemSprite.Scale;

            m_itemSprite.Scale = Vector2.One;
            var num = 130f / m_itemSprite.Height;

            m_itemSprite.Scale = scale;
            Tween.To(m_itemSprite, 0.2f, Tween.EaseNone, "ScaleX", num.ToString(), "ScaleY", num.ToString());
            Tween.To(m_itemSprite, 0.2f, Tween.EaseNone, "X", 660.ToString(), "Y", 390.ToString());
            Tween.To(m_itemFoundText, 0.3f, Back.EaseOut, "ScaleX", "1", "ScaleY", "1");
            Tween.To(m_continueText, 0.3f, Linear.EaseNone, "Opacity", "1");
            scale             = m_tripStat1.Scale;
            m_tripStat1.Scale = Vector2.One;
            num = 130f / m_tripStat1.Height;
            m_tripStat1.Scale = scale;
            Tween.To(m_tripStat1, 0.2f, Tween.EaseNone, "ScaleX", num.ToString(), "ScaleY", num.ToString());
            Tween.To(m_tripStat1, 0.2f, Tween.EaseNone, "X", 830.ToString(), "Y", 390.ToString());
            scale             = m_tripStat2.Scale;
            m_tripStat2.Scale = Vector2.One;
            num = 130f / m_tripStat2.Height;
            m_tripStat2.Scale = scale;
            Tween.To(m_tripStat2, 0.2f, Tween.EaseNone, "ScaleX", num.ToString(), "ScaleY", num.ToString());
            Tween.To(m_tripStat2, 0.2f, Tween.EaseNone, "X", 490.ToString(), "Y", 390.ToString());
            Tween.To(m_tripStat1FoundText, 0.3f, Back.EaseOut, "ScaleX", "1", "ScaleY", "1");
            Tween.To(m_tripStat2FoundText, 0.3f, Back.EaseOut, "ScaleX", "1", "ScaleY", "1");
            for (var i = 0; i < m_levelUpParticles.Length; i++)
            {
                m_levelUpParticles[i].AnimationDelay = 0f;
                m_levelUpParticles[i].Visible        = true;
                m_levelUpParticles[i].Scale          = new Vector2(0.1f, 0.1f);
                m_levelUpParticles[i].Opacity        = 0f;
                m_levelUpParticles[i].Position       = new Vector2(660f, 360f);
                m_levelUpParticles[i].Position      += new Vector2(CDGMath.RandomInt(-100, 100), CDGMath.RandomInt(-50, 50));
                var duration = CDGMath.RandomFloat(0f, 0.5f);
                Tween.To(m_levelUpParticles[i], 0.2f, Linear.EaseNone, "delay", duration.ToString(), "Opacity", "1");
                Tween.To(m_levelUpParticles[i], 0.5f, Linear.EaseNone, "delay", duration.ToString(), "ScaleX", "2",
                         "ScaleY", "2");
                Tween.To(m_levelUpParticles[i], duration, Linear.EaseNone);
                Tween.AddEndHandlerToLastTween(m_levelUpParticles[i], "PlayAnimation", false);
            }
            m_itemFoundSprite.Position = new Vector2(660f, 190f);
            m_itemFoundSprite.Scale    = Vector2.Zero;
            m_itemFoundSprite.Visible  = true;
            Tween.To(m_itemFoundSprite, 0.5f, Back.EaseOut, "delay", "0.05", "ScaleX", "1", "ScaleY", "1");
            m_levelUpBGImage.Position = m_itemFoundSprite.Position;
            m_levelUpBGImage.Y       += 30f;
            m_levelUpBGImage.Scale    = Vector2.Zero;
            m_levelUpBGImage.Visible  = true;
            Tween.To(m_levelUpBGImage, 0.5f, Back.EaseOut, "ScaleX", "1", "ScaleY", "1");
            Tween.To(this, 0.5f, Linear.EaseNone, "BackBufferOpacity", "0.5");
            if (m_itemSpinning)
            {
                m_itemSprite.Rotation = -25f;
            }
            m_itemSpinning = false;
            Tween.RunFunction(0.5f, this, "UnlockControls");
        }
示例#16
0
        public override void OnEnter()
        {
            m_quickDropText.Visible = false;
            if (InputManager.GamePadIsConnected(PlayerIndex.One))
            {
                m_confirmText.ForcedScale = new Vector2(0.7f, 0.7f);
                m_cancelText.ForcedScale  = new Vector2(0.7f, 0.7f);
                m_navigationText.Text     = "[Button:LeftStick] to navigate options";
            }
            else
            {
                m_confirmText.ForcedScale = new Vector2(1f, 1f);
                m_cancelText.ForcedScale  = new Vector2(1f, 1f);
                m_navigationText.Text     = "Arrow keys to navigate options";
            }
            m_confirmText.Text       = "[Input:" + 0 + "] to select option";
            m_cancelText.Text        = "[Input:" + 2 + "] to exit options";
            m_confirmText.Opacity    = 0f;
            m_cancelText.Opacity     = 0f;
            m_navigationText.Opacity = 0f;
            Tween.To(m_confirmText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.To(m_cancelText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.To(m_navigationText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.RunFunction(0.1f, typeof(SoundManager), "PlaySound", "DialogueMenuOpen");
            if (!m_optionsArray.Contains(m_backToMenuObj))
            {
                m_optionsArray.Insert(m_optionsArray.Count - 1, m_backToMenuObj);
            }
            if (m_titleScreenOptions)
            {
                m_optionsArray.RemoveAt(m_optionsArray.Count - 2);
            }
            m_transitioning = true;
            Tween.To(this, 0.2f, Tween.EaseNone, "BackBufferOpacity", "0.8");
            m_selectedOptionIndex     = 0;
            m_selectedOption          = m_optionsArray[m_selectedOptionIndex];
            m_selectedOption.IsActive = false;
            m_bgSprite.Position       = new Vector2(660f, 0f);
            m_bgSprite.Opacity        = 0f;
            Tween.To(m_bgSprite, 0.5f, Quad.EaseOut, "Y", 360f.ToString());
            Tween.AddEndHandlerToLastTween(this, "EndTransition");
            Tween.To(m_bgSprite, 0.2f, Tween.EaseNone, "Opacity", "1");
            var num = 0;

            foreach (var current in m_optionsArray)
            {
                current.Y       = 160 + num * 30 - 360f;
                current.Opacity = 0f;
                Tween.By(current, 0.5f, Quad.EaseOut, "Y", 360f.ToString());
                Tween.To(current, 0.2f, Tween.EaseNone, "Opacity", "1");
                current.Initialize();
                num++;
            }
            m_optionsBar.Opacity = 0f;
            Tween.To(m_optionsBar, 0.2f, Tween.EaseNone, "Opacity", "1");
            base.OnEnter();
        }
示例#17
0
 public void Intro4()
 {
     m_boss.PlayAnimation();
     m_bossShadow.ChangeSprite("EnemyFairyGhostBossIdle_Character");
     m_bossShadow.PlayAnimation();
     Tween.To(m_boss, 0.5f, Tween.EaseNone, "delay", "0.5", "Opacity", "1");
     Tween.To(m_bossShadow, 0.5f, Tween.EaseNone, "delay", "0.5", "Opacity", "0");
     Tween.AddEndHandlerToLastTween(this, "DisplayBossTitle", "The Forgotten", m_boss.Name, "Intro5");
 }
示例#18
0
 public void ExitTransition()
 {
     Tween.To(typeof(SoundManager), 1f, Tween.EaseNone, "GlobalMusicVolume", m_storedMusicVolume.ToString());
     Tween.To(Camera, 1f, Quad.EaseInOut, "X", m_cameraPos.X.ToString(), "Y", m_cameraPos.Y.ToString());
     Tween.To(m_spotlight, 0.5f, Tween.EaseNone, "Opacity", "0");
     Tween.To(m_titlePlate, 0.5f, Tween.EaseNone, "Opacity", "0");
     Tween.To(m_title, 0.5f, Tween.EaseNone, "Opacity", "0");
     Tween.To(this, 0.2f, Tween.EaseNone, "delay", "1", "BackBufferOpacity", "0");
     Tween.AddEndHandlerToLastTween(ScreenManager, "HideCurrentScreen");
 }
示例#19
0
 private void EndGame()
 {
     Player.LockControls();
     Player.CurrentSpeed = 0f;
     foreach (var current in m_targetList)
     {
         Tween.To(current, 0.5f, Tween.EaseNone, "Opacity", "0");
     }
     Tween.AddEndHandlerToLastTween(this, "EndGame2");
     m_isPlayingGame = false;
 }
示例#20
0
 public override void Draw(Camera2D camera)
 {
     if (State == 0)
     {
         ChestConditionChecker.SetConditionState(this, m_player);
     }
     if (!IsOpen)
     {
         if (Game.ScreenManager.CurrentScreen is ProceduralLevelScreen && m_sparkleCounter > 0f)
         {
             m_sparkleCounter -= (float)camera.GameTime.ElapsedGameTime.TotalSeconds;
             if (m_sparkleCounter <= 0f)
             {
                 m_sparkleCounter = 1f;
                 var num = 0f;
                 for (var i = 0; i < 2; i++)
                 {
                     Tween.To(this, num, Linear.EaseNone);
                     Tween.AddEndHandlerToLastTween(m_player.AttachedLevel.ImpactEffectPool,
                                                    "DisplayChestSparkleEffect", new Vector2(X, Y - Height / 2));
                     num += 0.5f;
                 }
             }
         }
         if (ConditionType == 8 && State == 0)
         {
             if (!m_player.AttachedLevel.IsPaused)
             {
                 Timer -= (float)camera.GameTime.ElapsedGameTime.TotalSeconds;
             }
             m_timerText.Position = new Vector2(Position.X, Y - 50f);
             m_timerText.Text     = ((int)Timer + 1).ToString();
             m_timerText.Draw(camera);
             m_player.AttachedLevel.UpdateObjectiveProgress(
                 (DialogueManager.GetText("Chest_Locked " + ConditionType).Dialogue[0] + (int)(Timer + 1f)));
         }
     }
     if (ConditionType != 10 || IsOpen)
     {
         base.Draw(camera);
         m_lockSprite.Flip = Flip;
         if (Flip == SpriteEffects.None)
         {
             m_lockSprite.Position = new Vector2(X - 10f, Y - Height / 2);
         }
         else
         {
             m_lockSprite.Position = new Vector2(X + 10f, Y - Height / 2);
         }
         m_lockSprite.Draw(camera);
         m_errorSprite.Position = new Vector2(X, Y - Height / 2);
         m_errorSprite.Draw(camera);
     }
 }
示例#21
0
        public void GiveGold(ItemDropManager itemDropManager, int amount = 0)
        {
            int num;

            if (ChestType == 1)
            {
                num = CDGMath.RandomInt((int)BronzeChestGoldRange.X, (int)BronzeChestGoldRange.Y) * 10;
            }
            else if (ChestType == 2 || ChestType == 4)
            {
                num = CDGMath.RandomInt((int)SilverChestGoldRange.X, (int)SilverChestGoldRange.Y) * 10;
            }
            else
            {
                num = CDGMath.RandomInt((int)GoldChestGoldRange.X, (int)GoldChestGoldRange.Y) * 10;
            }
            num += (int)Math.Floor(GoldIncreasePerLevel * Level * 10f);
            if (amount != 0)
            {
                num = amount;
            }
            var num2 = num / 500;

            num -= num2 * 500;
            var num3 = num / 100;

            num -= num3 * 100;
            var num4 = num / 10;
            var num5 = 0f;

            for (var i = 0; i < num2; i++)
            {
                Tween.To(this, num5, Linear.EaseNone);
                Tween.AddEndHandlerToLastTween(itemDropManager, "DropItem",
                                               new Vector2(Position.X, Position.Y - Height / 2), 11, 500);
                num5 += 0.1f;
            }
            num5 = 0f;
            for (var j = 0; j < num3; j++)
            {
                Tween.To(this, num5, Linear.EaseNone);
                Tween.AddEndHandlerToLastTween(itemDropManager, "DropItem",
                                               new Vector2(Position.X, Position.Y - Height / 2), 10, 100);
                num5 += 0.1f;
            }
            num5 = 0f;
            for (var k = 0; k < num4; k++)
            {
                Tween.To(this, num5, Linear.EaseNone);
                Tween.AddEndHandlerToLastTween(itemDropManager, "DropItem",
                                               new Vector2(Position.X, Position.Y - Height / 2), 1, 10);
                num5 += 0.1f;
            }
        }
示例#22
0
        public override void Initialize(ProjectileObj projectile)
        {
            base.Initialize(projectile);

            projectile.Opacity           = 0;
            projectile.CollisionType     = Game.CollisionType.Player;
            projectile.IgnoreBoundsCheck = true;

            Tween.To(projectile, 0.2f, Tween.EaseNone, "ScaleX", "100", "ScaleY", "50");
            Tween.AddEndHandlerToLastTween(projectile, "KillProjectile");
        }
示例#23
0
 private void ExitTransition()
 {
     SoundManager.PlaySound("Upgrade_Splash_Out");
     Tween.To(m_picture, 0.5f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0");
     Tween.To(m_picturePlate, 0.5f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0");
     Tween.To(m_titlePlate, 0.5f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0");
     Tween.To(m_title, 0.5f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0");
     Tween.To(m_plate, 0.5f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0");
     Tween.To(this, 0.2f, Tween.EaseNone, "delay", "0.4", "BackBufferOpacity", "0");
     Tween.AddEndHandlerToLastTween(ScreenManager, "HideCurrentScreen");
 }
示例#24
0
 public override void OnEnter()
 {
     BackBufferOpacity = 0f;
     m_gameCrashed     = false;
     if (Game.PlayerStats.Traits.X == 32f || Game.PlayerStats.Traits.Y == 32f)
     {
         m_loadingText.Text = "Jacking In";
     }
     else if (Game.PlayerStats.Traits.X == 29f || Game.PlayerStats.Traits.Y == 29f)
     {
         m_loadingText.Text = "Reminiscing";
     }
     else if (Game.PlayerStats.Traits.X == 8f || Game.PlayerStats.Traits.Y == 8f)
     {
         m_loadingText.Text = "Balding";
     }
     else
     {
         m_loadingText.Text = "Building";
     }
     if (!m_loadingComplete)
     {
         if (m_screenTypeToLoad == 27)
         {
             Tween.To(this, 0.05f, Tween.EaseNone, "BackBufferOpacity", "1");
             Tween.RunFunction(1f, this, "BeginThreading");
         }
         else
         {
             m_blackTransitionIn.X  = 0f;
             m_blackTransitionIn.X  = 1320 - m_blackTransitionIn.Bounds.Left;
             m_blackScreen.X        = m_blackTransitionIn.X;
             m_blackTransitionOut.X = m_blackScreen.X + m_blackScreen.Width;
             if (!m_wipeTransition)
             {
                 SoundManager.PlaySound("GateDrop");
                 Tween.To(m_gateSprite, 0.5f, Tween.EaseNone, "Y", "0");
                 Tween.RunFunction(0.3f, m_effectPool, "LoadingGateSmokeEffect", 40);
                 Tween.RunFunction(0.3f, typeof(SoundManager), "PlaySound", "GateSlam");
                 Tween.RunFunction(0.55f, this, "ShakeScreen", 4, true, true);
                 Tween.RunFunction(0.65f, this, "StopScreenShake");
                 Tween.RunFunction(1.5f, this, "BeginThreading");
             }
             else
             {
                 Tween.By(m_blackTransitionIn, 0.15f, Quad.EaseIn, "X", (-m_blackTransitionIn.X).ToString());
                 Tween.By(m_blackScreen, 0.15f, Quad.EaseIn, "X", (-m_blackTransitionIn.X).ToString());
                 Tween.By(m_blackTransitionOut, 0.2f, Quad.EaseIn, "X", (-m_blackTransitionIn.X).ToString());
                 Tween.AddEndHandlerToLastTween(this, "BeginThreading");
             }
         }
         base.OnEnter();
     }
 }
示例#25
0
        public override void OnEnter()
        {
            m_levelDataLoaded = false;
            m_fadingOut       = false;
            var thread = new Thread(LoadLevelData);

            thread.Start();
            m_logo.Opacity = 0f;
            Tween.To(m_logo, 1f, Linear.EaseNone, "delay", "0.5", "Opacity", "1");
            Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", "CDGSplashCreak");
            base.OnEnter();
        }
示例#26
0
 public void ExitScreenTransition()
 {
     SoundManager.PlaySound("StatCard_Out");
     Tween.To(m_cancelText, 0.2f, Tween.EaseNone, "Opacity", "0");
     m_frontCard.Y = 30f;
     m_backCard.Y  = 30f;
     Tween.To(this, 0.2f, Tween.EaseNone, "delay", "0.3", "BackBufferOpacity", "0");
     Tween.To(m_frontCard, 0.4f, Back.EaseIn, "Y", "1500");
     Tween.To(m_backCard, 0.4f, Back.EaseIn, "delay", "0.2", "Y", "1500");
     Tween.AddEndHandlerToLastTween(ScreenManager, "HideCurrentScreen");
     OnExit();
 }
示例#27
0
 private void RunSplashAnimation()
 {
     m_splashing = true;
     Rotation    = 0f;
     if (!m_isSnowflake)
     {
         PlayAnimation(2, TotalFrames);
         return;
     }
     Tween.To(this, 0.25f, Tween.EaseNone, "Opacity", "0");
     Tween.AddEndHandlerToLastTween(this, "KillDrop");
 }
示例#28
0
 public void ItemSpinAnimation2()
 {
     Tween.RunFunction(0.2f, typeof(SoundManager), "PlaySound", "GetItemStinger3");
     if (m_buildUpSound != null && m_buildUpSound.IsPlaying)
     {
         m_buildUpSound.Stop(AudioStopOptions.AsAuthored);
     }
     Tween.To(m_itemSprite, 0.2f, Quad.EaseOut, "ScaleX", "0.1", "ScaleY", "0.1");
     Tween.AddEndHandlerToLastTween(this, "ItemSpinAnimation3");
     Tween.To(m_tripStat1, 0.2f, Quad.EaseOut, "ScaleX", "0.1", "ScaleY", "0.1");
     Tween.To(m_tripStat2, 0.2f, Quad.EaseOut, "ScaleX", "0.1", "ScaleY", "0.1");
 }
示例#29
0
 public void Part3()
 {
     SoundManager.PlaySound("Boss_Eyeball_Death");
     m_playDeathLoop = false;
     if (m_deathLoop != null && m_deathLoop.IsPlaying)
     {
         m_deathLoop.Stop(AudioStopOptions.Immediate);
     }
     GoToFrame(1);
     StopAnimation();
     Tween.To(this, 2f, Tween.EaseNone, "Rotation", "-1080");
     Tween.To(this, 2f, Quad.EaseInOut, "ScaleX", "0.1", "ScaleY", "0.1");
     Tween.AddEndHandlerToLastTween(this, "DeathComplete");
 }
示例#30
0
        public void DisplayBossTitle(string bossTitle1, string bossTitle2, string endHandler)
        {
            SoundManager.PlaySound("Boss_Title");
            m_bossTitle1.Text = bossTitle1;
            m_bossTitle2.Text = bossTitle2;
            var camera = Player.AttachedLevel.Camera;

            if (Player.AttachedLevel.CurrentRoom is LastBossRoom)
            {
                m_bossTitle1.Position = new Vector2(camera.X - 550f, camera.Y + 100f);
            }
            else
            {
                m_bossTitle1.Position = new Vector2(camera.X - 550f, camera.Y + 50f);
            }
            m_bossTitle2.X         = m_bossTitle1.X - 0f;
            m_bossTitle2.Y         = m_bossTitle1.Y + 50f;
            m_bossDivider.Position = m_bossTitle1.Position;
            m_bossDivider.Y       += m_bossTitle1.Height - 5;
            m_bossTitle1.X        -= 1000f;
            m_bossTitle2.X        += 1500f;
            Tween.To(m_bossDivider, 0.5f, Tween.EaseNone, "delay", "0.3", "Opacity", "1");
            Tween.To(m_bossDivider, 1f, Quad.EaseInOut, "delay", "0", "ScaleX",
                     ((float)(m_bossTitle2.Width / 5)).ToString());
            Tween.To(m_bossTitle1, 0.5f, Tween.EaseNone, "delay", "0.3", "Opacity", "1");
            Tween.To(m_bossTitle2, 0.5f, Tween.EaseNone, "delay", "0.3", "Opacity", "1");
            Tween.By(m_bossTitle1, 1f, Quad.EaseOut, "X", "1000");
            Tween.By(m_bossTitle2, 1f, Quad.EaseOut, "X", "-1500");
            m_bossTitle1.X += 1000f;
            m_bossTitle2.X -= 1500f;
            Tween.By(m_bossTitle1, 2f, Tween.EaseNone, "delay", "1", "X", "20");
            Tween.By(m_bossTitle2, 2f, Tween.EaseNone, "delay", "1", "X", "-20");
            m_bossTitle1.X -= 1000f;
            m_bossTitle2.X += 1500f;
            Tween.AddEndHandlerToLastTween(this, endHandler);
            Tween.RunFunction(3f, typeof(SoundManager), "PlaySound", "Boss_Title_Exit");
            m_bossTitle1.X      += 1020f;
            m_bossTitle2.X      -= 1520f;
            m_bossTitle1.Opacity = 1f;
            m_bossTitle2.Opacity = 1f;
            Tween.To(m_bossTitle1, 0.5f, Tween.EaseNone, "delay", "3", "Opacity", "0");
            Tween.To(m_bossTitle2, 0.5f, Tween.EaseNone, "delay", "3", "Opacity", "0");
            Tween.By(m_bossTitle1, 0.6f, Quad.EaseIn, "delay", "3", "X", "1500");
            Tween.By(m_bossTitle2, 0.6f, Quad.EaseIn, "delay", "3", "X", "-1000");
            m_bossTitle1.Opacity  = 0f;
            m_bossTitle2.Opacity  = 0f;
            m_bossDivider.Opacity = 1f;
            Tween.To(m_bossDivider, 0.5f, Tween.EaseNone, "delay", "2.8", "Opacity", "0");
            m_bossDivider.Opacity = 0f;
        }