void _battle_BattleFinshed(object sender, BattleFinishedEventArgs e) { Flash.Show(this); LogoBack.IsVisible = true; if (e.Winner == Current) { Sound.WIN(); Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.LOSE_OFFLINE); Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.WIN); var i = 0; Device.StartTimer(TimeSpan.FromMilliseconds(50), () => { BattleComment.Show(BattleCommentAreaForEnemy, Enemy.LoseComment); BattleComment.Show(BattleCommentAreaForCurrent, Current.WinComment); i++; return(i != 10); }); Device.BeginInvokeOnMainThread(() => { AnimationView.Animation = "animation_win.json"; AnimationView.Play(); }); Device.StartTimer(TimeSpan.FromSeconds(3), () => { ShowFourth(); return(false); }); } else { Sound.LOSE(); Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.WIN_OFFLINE); Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.LOSE); var i = 0; Device.StartTimer(TimeSpan.FromMilliseconds(50), () => { BattleComment.Show(BattleCommentAreaForCurrent, Current.LoseComment); BattleComment.Show(BattleCommentAreaForEnemy, Enemy.WinComment); i++; return(i != 10); }); DependencyService.Get <IDeviceService>().PlayVibrate(); Device.BeginInvokeOnMainThread(() => { AnimationView.Animation = "animation_lose.json"; AnimationView.Play(); }); Device.StartTimer(TimeSpan.FromSeconds(3), () => { Back(); return(false); }); } }
void _battle_DamagedEvent(object sender, DamageEventArgs args) { if (args.Target == Current) { if (args.Damage == 0) { Damege.Show(CurrentDamage, "Miss"); return; } Damege.Show(CurrentDamage, args.Damage.ToString()); CurrentImage.Damaged(); if (args.IsCritical) { Flash.Show(this); MagicCircle.Show(this, 500); CutInFace.Show(this, new NameModelViewModel().Hissatsu, Enemy.MainName, false, 2); DependencyService.Get <IDeviceService>().PlayVibrate(); } else if (MyRandom.GetRandom(10) > 3) { BattleComment.Show(BattleCommentAreaForCurrent, Current.GetBattleComment()); } } else { if (args.Damage == 0) { Damege.Show(EnemyDamage, "Miss"); return; } Damege.Show(EnemyDamage, args.Damage.ToString()); EnemyImage.Damaged(); if (args.IsCritical) { Flash.Show(this); MagicCircle.Show(this, 500); CutInFace.Show(this, new NameModelViewModel().Hissatsu, Current.MainName, true, 2); DependencyService.Get <IDeviceService>().PlayVibrate(); } else if (MyRandom.GetRandom(10) > 3) { BattleComment.Show(BattleCommentAreaForEnemy, Enemy.GetBattleComment()); } } }