Example #1
0
 public override void PreUpdate()
 {
     if (DreamBattleWorld.IsActive <DreamBattleWorld>())
     {
         enWhite = 0;
         if (Timer1 < 60)
         {
             enWhite = (float)(60 - Timer1) / 60;
         }
         if (Timer1 < 180)
         {
             Timer1++;
         }
         if (Timer1 == 180)
         {
             Timer1++;
             Vector2 Pos = Main.LocalPlayer.Center - new Vector2(0, 400);
             NPC.NewNPC((int)Pos.X, (int)Pos.Y, ModContent.NPCType <Marx>());
             ExistBoss = true;
         }
         if (ExistBoss && !NPC.AnyNPCs(ModContent.NPCType <Marx>()))
         {
             ExistBoss = false;
             Timer2    = 180;
         }
         if (Timer2 > 0)
         {
             Timer2--;
         }
         if (Timer2 < 60 && Timer2 >= 0)
         {
             enWhite = (float)(60 - Timer2) / 60;
         }
         if (Timer2 == 0)
         {
             Timer2--;
             Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/DreamEnter").WithVolume(2f).WithPitchVariance(.5f), Main.LocalPlayer.Center);
             DreamBattleWorld.Exit();
             Timer1    = 0;
             Timer2    = -1;
             ExistBoss = false;
         }
     }
     else
     {
         enWhite   = 0;
         Timer1    = 0;
         Timer2    = -1;
         ExistBoss = false;
     }
 }
Example #2
0
        public override bool UseItem(Player player)
        {
            if (player.itemAnimation > 0 && player.itemTime == 0)
            {
                if (player.altFunctionUse == 2)
                {
                    DreamModWorld.Difficulty = (DreamModWorld.Difficulty + 1) % 3;
                    string mode  = "";
                    Color  color = Color.White;
                    switch (DreamModWorld.Difficulty)
                    {
                    case 0:
                        mode  = Language.GetTextValue("Mods.HKBoss.Mode1");
                        color = Color.DarkOrange;
                        break;

                    case 1:
                        mode  = Language.GetTextValue("Mods.HKBoss.Mode2");
                        color = Color.Silver;
                        break;

                    case 2:
                        mode  = Language.GetTextValue("Mods.HKBoss.Mode3");
                        color = Color.Goldenrod;
                        break;

                    default:
                        break;
                    }
                    Main.NewText(mode, color);
                }
                else
                {
                    if (!DreamBattleWorld.IsActive <DreamBattleWorld>())
                    {
                        Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/DreamEnter").WithVolume(2f).WithPitchVariance(.5f), player.Center);
                        DreamBattleWorld.Enter <DreamBattleWorld>();
                    }
                }
            }
            return(true);
        }