public StickerRegister_Finished(Sticker sticker) { InitializeComponent(); StickerNewSticker.StickerFrame.Source = sticker.StickerFrame.Source; StickerNewSticker.StickerImage.Source = sticker.StickerImage.Source; StickerNewSticker.StickerName.Content = sticker.StickerName.Content; SoundPlayer.Instance.Play(SoundTrack.Get("sfx_forge")); }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { GameMaster.Settings.Volume = CheckBoxMuted.IsChecked.Value ? 0 : (float)volume; GameMaster.Settings.AntiAliasing = CheckBoxAA.IsChecked.Value; GameMaster.SaveAll(); ButtonSave.IsEnabled = false; SoundPlayer.StopAll(); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); }
public void Spin() { Spins = 0; var t = 1000; Slot0.Spin(t); Slot1.Spin(t * 2); Slot2.Spin(t * 3); SoundPlayer.Instance.Play(SoundTrack.Get("sfx_slot" + RNG.Next(0, 3))); }
public Homepage() { InitializeComponent(); if (!SoundTrack.Get("st_main").IsPlaying) { SoundPlayer.StopAll("st_blacksmith"); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); } }
private void GiftButton_MouseDown(object sender, MouseButtonEventArgs e) { if (DateTime.Today > GameMaster.Player.LastGift) { ChangeState(ControlState.Compact); GiftButton.Visibility = Visibility.Hidden; GameMaster.Player.LastGift = DateTime.Today; GameMaster.Player.Coins += 10; SoundPlayer.Instance.Play(SoundTrack.Get("sfx_coins")); } }
public Album() { InitializeComponent(); FilterPanel.FilterChanged += InteractionBar_FilterChanged; if (!SoundTrack.Get("st_main").IsPlaying) { SoundPlayer.StopAll("st_blacksmith"); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); } }
public Boolean SetPage(AlbumPage page) { if (page == null) { return(false); } this.CurrentPage = page; this.AlbumArea.Children.Clear(); this.AlbumArea.Children.Add(page); SoundPlayer.Instance.Play(SoundTrack.Get("sfx_pageturn")); return(true); }
public Client() { GameMaster.LoadAll(); Cache.Load(); //Cache.DumpLog(); InitializeComponent(); App.ClientWindow.SetCurrentPage(new Homepage()); this.Background = new ImageBrush(Sprite.Get("bg_oldpaper").Source); if (!SoundTrack.Get("st_main").IsPlaying) { SoundPlayer.StopAll("st_blacksmith"); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); } //TestUtil.RunAllTests(); }
public Configs() { InitializeComponent(); ButtonSave.IsEnabled = false; Console.WriteLine(GameMaster.Settings.Volume); CheckBoxAA.IsChecked = GameMaster.Settings.AntiAliasing; autoContext = true; volume = SliderVolume.Value = GameMaster.Settings.Volume; autoContext = false; CheckBoxMuted.IsChecked = volume == 0; if (!SoundTrack.Get("st_main").IsPlaying) { SoundPlayer.StopAll(); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); } }
public StickerRegister_TypeChoosing() { InitializeComponent(); ComboBoxType.ItemsSource = new Generics.LinkedList <String>() { "Criatura", "Semideus", "Deus", "Titã" }; if (!SoundTrack.Get("st_blacksmith").IsPlaying) { SoundPlayer.StopAll("st_main"); SoundPlayer.Instance.Play(SoundTrack.Get("st_blacksmith"), loop: true); } ComboBoxType.SelectedIndex = 0; }
public SlotMinigame() { InitializeComponent(); Spins = 0; Slot0.FinishedSpin += Slot_FinishedSpin; Slot1.FinishedSpin += Slot_FinishedSpin; Slot2.FinishedSpin += Slot_FinishedSpin; if (!DesignerProperties.GetIsInDesignMode(this)) { this.SpinButton.Source = Sprite.Get("redbutton_released").Source; this.CoinIcon.Source = Sprite.Get("coin").Source; Refresh(); } if (!SoundTrack.Get("st_main").IsPlaying) { SoundPlayer.StopAll("st_blacksmith"); SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true); } }
private void TrashBin_Drop(object sender, DragEventArgs e) { TrashBin.RenderTransform = null; var formats = e.Data.GetFormats(); if (formats.Length > 0) { var data = e.Data.GetData(e.Data.GetFormats()[0]); if (TrashBin.AllowDrop && data is Sticker) { var droppedSticker = data as Sticker; var droppedEntity = droppedSticker.Entity; var player = GameMaster.Player; player.Coins += droppedEntity.GetCoinValue(); DebugUtils.Log($"Entity Trashed => {droppedEntity.ID}"); GameMaster.Player.Inventory.Remove(droppedEntity.ID, 1); droppedSticker.DetachParent(); SoundPlayer.Instance.Play(SoundTrack.Get("sfx_coins")); } } CoinIcon.Visibility = Visibility.Hidden; CoinQuantity.Visibility = Visibility.Hidden; }
private void Self_Drop(object sender, DragEventArgs e) { this.RenderTransform = null; var formats = e.Data.GetFormats(); if (formats.Length > 0) { var data = e.Data.GetData(e.Data.GetFormats()[0]); if (this.AllowDrop && data is Sticker) { var droppedSticker = data as Sticker; var droppedEntity = droppedSticker.Entity; if (this.Entity.ID == droppedEntity.ID && !Entity.IsUnlocked) { DebugUtils.Log($"Valid Entity Dropped => {droppedEntity.ID}"); GameMaster.Player.Inventory.Remove(droppedEntity.ID, 1); GameMaster.Player.Unlock(droppedEntity.ID); this.SetEntity(Entity); droppedSticker.DataDropped.Invoke(droppedSticker, EventArgs.Empty); SoundPlayer.Instance.Play(SoundTrack.Get("sfx_ring")); } } } }
private void Slot_FinishedSpin(object sender, EventArgs e) { Spins++; if (Spins == 3) { Int32 dice; Entity prize = null; var res0 = Slot0.GetResult(); var res1 = Slot1.GetResult(); var res2 = Slot2.GetResult(); dice = RNG.Next(100); if (res0 == res1 && res0 == res2) { if (dice < 65) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.VeryRare).Random(); } else if (dice < 80) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Epic).Random(); } else if (dice <= 95) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Legendary).Random(); } } else if (res0 == res1 || res1 == res2 || res0 == res2) { if (dice < 30) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Uncommon).Random(); } else if (dice < 60) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Rare).Random(); } else if (dice < 90) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.VeryRare).Random(); } else if (dice <= 100) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Epic).Random(); } } else { if (dice < 50) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Common).Random(); } else if (dice < 70) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Uncommon).Random(); } else if (dice < 95) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Rare).Random(); } else if (dice < 99) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.VeryRare).Random(); } else if (dice <= 100) { prize = Entity.GetAll().Where(x => x.Rarity == Rarity.Epic).Random(); } } var prizeSticker = new Sticker(prize, overrideValidation: true); prizeSticker.Width = 150; prizeSticker.Height = 225; LastPrizePanel.Children.Clear(); LastPrizePanel.Children.Add(prizeSticker); GameMaster.Player.Inventory.Add(new SimpleSticker() { ItemID = prize.ID }); DebugUtils.Log($"Minigame prize => <{prize.ID}> => {prize.Rarity}!"); SoundPlayer.Instance.Play(SoundTrack.Get("sfx_coins")); IsSpinning = false; } }
private void UserControl_MouseDown(object sender, MouseButtonEventArgs e) => SoundPlayer.Instance.Play(SoundTrack.Get("sfx_ring"));