Example #1
0
 public void Part2()
 {
     m_levelScreen.UnpauseScreen();
     m_target.UnlockControls();
     if (m_currentActiveLB != null)
     {
         m_currentActiveLB.StopLogicBlock();
     }
     m_target.CurrentSpeed    = 0f;
     m_target.ForceInvincible = true;
     foreach (var current in m_levelScreen.CurrentRoom.TempEnemyList)
     {
         if (!current.IsKilled)
         {
             current.Kill();
         }
     }
     SoundManager.Play3DSound(this, Game.ScreenManager.Player, "Boss_Blob_Death");
     base.Kill();
     if (!IsNeo)
     {
         var list = new List <int>();
         for (var i = 0; i < m_bossCoins; i++)
         {
             list.Add(0);
         }
         for (var j = 0; j < m_bossMoneyBags; j++)
         {
             list.Add(1);
         }
         for (var k = 0; k < m_bossDiamonds; k++)
         {
             list.Add(2);
         }
         CDGMath.Shuffle(list);
         var num = 0f;
         for (var l = 0; l < list.Count; l++)
         {
             var position = Position;
             if (list[l] == 0)
             {
                 Tween.RunFunction(l * num, m_levelScreen.ItemDropManager, "DropItemWide", position, 1, 10);
             }
             else if (list[l] == 1)
             {
                 Tween.RunFunction(l * num, m_levelScreen.ItemDropManager, "DropItemWide", position, 10, 100);
             }
             else
             {
                 Tween.RunFunction(l * num, m_levelScreen.ItemDropManager, "DropItemWide", position, 11, 500);
             }
         }
     }
 }
Example #2
0
        private void ShuffleChests(int goldPaid)
        {
            int[] array =
            {
                1,
                2,
                3
            };
            CDGMath.Shuffle(array);
            var num = 0;

            foreach (var current in GameObjList)
            {
                var chestObj = current as ChestObj;
                if (chestObj != null)
                {
                    chestObj.ForcedItemType = 1;
                    var num2 = array[num];
                    if (num2 == 1)
                    {
                        chestObj.IsEmpty = true;
                    }
                    else if (num2 == 2)
                    {
                        chestObj.IsEmpty = true;
                    }
                    else
                    {
                        chestObj.IsEmpty      = false;
                        chestObj.ForcedAmount = goldPaid * 3f;
                    }
                    num++;
                    m_chestList.Add(chestObj);
                    chestObj.IsLocked     = false;
                    chestObj.TextureColor = Color.White;
                    if (num2 == 3 && Game.PlayerStats.SpecialItem == 8)
                    {
                        chestObj.TextureColor = Color.Gold;
                    }
                }
            }
        }
Example #3
0
 public void RandomizeSentence(bool randomizeNumbers)
 {
     foreach (Match match in Regex.Matches(this.Text, "\\b[\\w']*\\b"))
     {
         string value = match.Value;
         int    num   = 0;
         if (!randomizeNumbers && (randomizeNumbers || int.TryParse(value, out num)) || value.Length <= 3)
         {
             continue;
         }
         List <char> list = value.ToList <char>();
         char        item = list[0];
         char        chr  = list[list.Count - 1];
         list.RemoveAt(list.Count - 1);
         list.RemoveAt(0);
         CDGMath.Shuffle <char>(list);
         string str = new string(list.ToArray());
         str       = string.Concat(item, str, chr);
         this.Text = this.Text.Replace(value, str);
     }
 }
Example #4
0
        private void DropGold()
        {
            var list = new List <int>();

            for (var i = 0; i < m_bossCoins; i++)
            {
                list.Add(0);
            }
            for (var j = 0; j < m_bossMoneyBags; j++)
            {
                list.Add(1);
            }
            for (var k = 0; k < m_bossDiamonds; k++)
            {
                list.Add(2);
            }
            CDGMath.Shuffle(list);
            var num = 0f;

            SoundManager.PlaySound("Boss_Flash");
            for (var l = 0; l < list.Count; l++)
            {
                var position = m_boss.Position;
                if (list[l] == 0)
                {
                    Tween.RunFunction(l * num, Player.AttachedLevel.ItemDropManager, "DropItemWide", position, 1, 10);
                }
                else if (list[l] == 1)
                {
                    Tween.RunFunction(l * num, Player.AttachedLevel.ItemDropManager, "DropItemWide", position, 10, 100);
                }
                else
                {
                    Tween.RunFunction(l * num, Player.AttachedLevel.ItemDropManager, "DropItemWide", position, 11, 500);
                }
            }
        }
Example #5
0
 public void Part2()
 {
     m_playDeathLoop = true;
     foreach (var current in m_levelScreen.CurrentRoom.TempEnemyList)
     {
         if (!current.IsKilled)
         {
             current.Kill();
         }
     }
     m_levelScreen.UnpauseScreen();
     m_target.UnlockControls();
     if (m_currentActiveLB != null)
     {
         m_currentActiveLB.StopLogicBlock();
     }
     PauseEnemy(true);
     ChangeSprite("EnemyFairyGhostBossShoot_Character");
     PlayAnimation();
     m_target.CurrentSpeed    = 0f;
     m_target.ForceInvincible = true;
     if (IsNeo)
     {
         m_target.InvincibleToSpikes = true;
     }
     Tween.To(m_levelScreen.Camera, 0.5f, Quad.EaseInOut, "X", X.ToString(), "Y", Y.ToString());
     m_shake      = true;
     m_shakeTimer = m_shakeDuration;
     for (var i = 0; i < 40; i++)
     {
         var vector = new Vector2(CDGMath.RandomInt(Bounds.Left, Bounds.Right),
                                  CDGMath.RandomInt(Bounds.Top, Bounds.Bottom));
         Tween.RunFunction(i * 0.1f, typeof(SoundManager), "Play3DSound", this, m_target, new[]
         {
             "Boss_Explo_01",
             "Boss_Explo_02",
             "Boss_Explo_03"
         });
         Tween.RunFunction(i * 0.1f, m_levelScreen.ImpactEffectPool, "DisplayExplosionEffect", vector);
     }
     Tween.AddEndHandlerToLastTween(this, "Part3");
     if (!IsNeo)
     {
         var list = new List <int>();
         for (var j = 0; j < m_bossCoins; j++)
         {
             list.Add(0);
         }
         for (var k = 0; k < m_bossMoneyBags; k++)
         {
             list.Add(1);
         }
         for (var l = 0; l < m_bossDiamonds; l++)
         {
             list.Add(2);
         }
         CDGMath.Shuffle(list);
         var num = 2.5f / list.Count;
         for (var m = 0; m < list.Count; m++)
         {
             var position = Position;
             if (list[m] == 0)
             {
                 Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", position, 1, 10);
             }
             else if (list[m] == 1)
             {
                 Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", position, 10, 100);
             }
             else
             {
                 Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", position, 11, 500);
             }
         }
     }
 }
Example #6
0
        public void Part2()
        {
            m_levelScreen.UnpauseScreen();
            m_target.UnlockControls();
            if (m_currentActiveLB != null)
            {
                m_currentActiveLB.StopLogicBlock();
            }
            LockEyeball();
            PauseEnemy(true);
            ChangeSprite("EnemyEyeballBossFire_Character");
            PlayAnimation();
            m_target.CurrentSpeed    = 0f;
            m_target.ForceInvincible = true;
            if (IsNeo)
            {
                m_target.InvincibleToSpikes = true;
            }
            object arg_106_0 = m_levelScreen.Camera;
            var    arg_106_1 = 0.5f;
            Easing arg_106_2 = Quad.EaseInOut;
            var    array     = new string[4];

            array[0] = "X";
            var arg_CF_0 = array;
            var arg_CF_1 = 1;
            var x        = m_levelScreen.CurrentRoom.Bounds.Center.X;

            arg_CF_0[arg_CF_1] = x.ToString();
            array[2]           = "Y";
            var arg_103_0 = array;
            var arg_103_1 = 3;
            var y         = m_levelScreen.CurrentRoom.Bounds.Center.Y;

            arg_103_0[arg_103_1] = y.ToString();
            Tween.To(arg_106_0, arg_106_1, arg_106_2, array);
            m_shake         = true;
            m_shakeTimer    = m_shakeDuration;
            m_playDeathLoop = true;
            for (var i = 0; i < 40; i++)
            {
                var vector = new Vector2(CDGMath.RandomInt(Bounds.Left, Bounds.Right),
                                         CDGMath.RandomInt(Bounds.Top, Bounds.Bottom));
                Tween.RunFunction(i * 0.1f, typeof(SoundManager), "Play3DSound", this, m_target, new[]
                {
                    "Boss_Explo_01",
                    "Boss_Explo_02",
                    "Boss_Explo_03"
                });
                Tween.RunFunction(i * 0.1f, m_levelScreen.ImpactEffectPool, "DisplayExplosionEffect", vector);
            }
            Tween.AddEndHandlerToLastTween(this, "Part3");
            if (!IsNeo)
            {
                var list = new List <int>();
                for (var j = 0; j < m_bossCoins; j++)
                {
                    list.Add(0);
                }
                for (var k = 0; k < m_bossMoneyBags; k++)
                {
                    list.Add(1);
                }
                for (var l = 0; l < m_bossDiamonds; l++)
                {
                    list.Add(2);
                }
                CDGMath.Shuffle(list);
                var num = 2.5f / list.Count;
                for (var m = 0; m < list.Count; m++)
                {
                    var vector2 = new Vector2(CDGMath.RandomInt(m_pupil.AbsBounds.Left, m_pupil.AbsBounds.Right),
                                              CDGMath.RandomInt(m_pupil.AbsBounds.Top, m_pupil.AbsBounds.Bottom));
                    if (list[m] == 0)
                    {
                        Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", vector2, 1, 10);
                    }
                    else if (list[m] == 1)
                    {
                        Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", vector2, 10, 100);
                    }
                    else
                    {
                        Tween.RunFunction(m * num, m_levelScreen.ItemDropManager, "DropItem", vector2, 11, 500);
                    }
                }
            }
        }