private async void XpEvent(object sender, object e) { xp_gain_textblock.Visibility = Visibility.Visible; Xp_Gain_story_anim.From = _game.GetPlayer().getLocation().y; Xp_Gain_story_anim.To = _game.GetPlayer().getLocation().y - 50; Canvas.SetTop(xp_gain_textblock, _game.GetPlayer().getLocation().y); Canvas.SetLeft(xp_gain_textblock, _game.GetPlayer().getLocation().x); Xp_Gain_story.Begin(); await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(1)); xp_gain_textblock.Visibility = Visibility.Collapsed; var source = currentSource; if (source != null) { _game.GetPlayer().ChangeSkill(currentLocation); xp_gain_textblock.Text = _game.GetPlayer().Act(source.Experience, source.resource).ToString() + "xp"; } Dictionary <string, dynamic> stats = _game.GetPlayer().GetStats(); woodcuttinglevel.Text = "lvl: " + stats["woodcuttinglvl"].ToString(); woodcuttingxp.Text = "xp: " + stats["woodcuttingxp"].ToString(); mininglevel.Text = "lvl: " + stats["mininglvl"].ToString(); miningxp.Text = "xp: " + stats["miningxp"].ToString(); fishinglevel.Text = "lvl: " + stats["fishinglvl"].ToString(); fishingxp.Text = "xp: " + stats["fishingxp"].ToString(); goldearned.Text = "Total earned: " + stats["totalearned"] + " gold"; totalxp.Text = "Total xp: " + (stats["woodcuttingxp"] + stats["fishingxp"] + stats["miningxp"]); mostplayed.Text = "Most played: " + stats["mostplayedskill"]; }
private async void XpEvent(object sender, object e) { xp_gain_textblock.Visibility = Visibility.Visible; Xp_Gain_story_anim.From = _game.GetPlayer().getLocation().y; Xp_Gain_story_anim.To = _game.GetPlayer().getLocation().y - 50; Canvas.SetTop(xp_gain_textblock, _game.GetPlayer().getLocation().y); Canvas.SetLeft(xp_gain_textblock, _game.GetPlayer().getLocation().x); Xp_Gain_story.Begin(); await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(1)); xp_gain_textblock.Visibility = Visibility.Collapsed; Dictionary <string, Source> sources = _game.getSources(); foreach (var source in sources) { if (source.Key == currentLocation) { _game.GetPlayer().Act(source.Value.Experience, currentLocation); break; } } }