private void ShowOptions(ShootSelected e)
        {
            var visuals  = new List <IVisual>();
            var automata = new List <IAutomaton>();

            e.AvailableTargets.ForEach(x =>
            {
                visuals.Add(new ColoredRectangle
                {
                    Transform = x.Character.CurrentTile.Transform,
                    Color     = UiColors.AvailableTargetsView_Rectanges
                });
                var anim = new TileRotatingEdgesAnim(x.Character.CurrentTile.Position, UiColors.AvailableTargetsView_TileRotatingEdgesAnim);
                anim.Init();
                visuals.Add(anim);
                automata.Add(anim);
            });
            _visuals  = visuals;
            _automata = automata;
        }
 private void ShowOptions(ShootSelected e)
 {
     e.AvailableTargets.ForEach(x =>
     {
         _targetVisuals[x.Character.CurrentTile.Position] = new List <IVisual>();
         x.CoverToThem.Covers.SelectMany(c => c.Providers).GroupBy(p => p.Position).ForEach(g =>
         {
             _targetVisuals[x.Character.CurrentTile.Position].Add(new UiImage {
                 Tint = 100.Alpha(), Image = "UI/shield-placeholder-" + g.Count(), Transform = g.First().Transform
             });
             _targetVisuals[x.Character.CurrentTile.Position].Add(new Label {
                 TextColor = UiColors.AvailableTargetsUI_CoverPercentText, Transform = g.First().Transform
             });
         });
         _targetVisuals[x.Character.CurrentTile.Position].Add(new Label {
             Text = $"{new HitChanceCalculation(GameWorld.CurrentCharacter.Accuracy, x.CoverToThem.BlockChance, x.Character.Stats.Agility, x.Character.State.IsHiding).Get()}%", Transform = x.Character.CurrentTile.Transform
         });
         _targetVisuals[x.Character.CurrentTile.Position].Add(new Label {
             Text = $"{new HitChanceCalculation(x.Character.Accuracy, x.CoverFromThem.BlockChance, GameWorld.CurrentCharacter.Stats.Agility, GameWorld.CurrentCharacter.State.IsHiding).Get()}% ", Transform = GameWorld.CurrentCharacter.CurrentTile.Transform
         });
     });
 }
예제 #3
0
 private void SelectTarget(ShootSelected e)
 {
     IfAITurn(() => Shoot(e.AvailableTargets
                          .OrderBy(x => new ShotCalculation(Char.CurrentTile, x.Character.CurrentTile).GetBestShot().BlockChance)
                          .ThenByDescending(x => x.Character.Stats.Guts).First()));
 }