public override void Execute(IImpactChangeMana data)
        {
            //if (_battle.State.Data == null)
            //{
            //    throw new Exception("ImpactManaExecutor Битва не запущена");
            //}
            var manaId = _scorers.ManaId;
            var value  = (int)_logic.Calculate(data.Value);

            if (!_explorer.State.IsRun)
            {
                Logger.Error("Attempting to record mana for stage outside of explorer", this);
                return;
            }
            var stage = _explorer.GetStage(_explorer.CurrentStage);

            stage.Values.TryGetValue(manaId, out var scorer);

            if (data.Oversize)
            {
                value = (int)scorer + value;
            }
            else
            {
                value = Mathf.Min((int)scorer + value, _settings.Settings.PlayerSettings.ManaMax);
                value = Mathf.Max(value, 0);
            }
            stage.Values[manaId] = value;
        }
 public override void Execute(IUnitImpactLeave data)
 {
     if (_context.BattleMode)
     {
         var targetId = _context.ContextImpact.CurrentTarget;
         var member   = _battle.GetMember(targetId);
         if (member == null)
         {
             Logger.Error($"No member in battle CurrentTarget = {targetId} ", this);
             return;
         }
         member.Status    = UnitBattleStatus.Leave;
         member.CurrentHp = 0;
         member.Status    = UnitBattleStatus.DeadInTernNoDropped;
     }
     else
     {
         Logger.Error($"No leave unit in no battle", this);
     }
 }
        public override void Execute(IUnitImpactHp data)
        {
            var targetId = _context.ContextImpact.CurrentTarget;
            var value    = (float)_logic.Calculate(data.Value);

            if (_context.BattleMode)
            {
                var member = _battle.GetMember(targetId);
                if (member == null)
                {
                    Logger.Error($"No member in battle CurrentTarget = {targetId} ", this);
                    return;
                }
                var oldHp = member.CurrentHp;

                if (value < 0)
                {
                    value            = Mathf.Min(value, member.CurrentHp);
                    member.CurrentHp = member.CurrentHp + value;
                    if (member.CurrentHp <= 0)
                    {
                        member.Status = UnitBattleStatus.DeadInTernNoDropped;
                        if (member.MemberType == BattleMemberType.Unit)
                        {
                            _units.SetUnitReserve(member.StaticId, true);
                        }
                    }
                }
                else
                {
                    value            = Mathf.Min(value, (float)member.HpMax.Value - member.CurrentHp);
                    member.CurrentHp = member.CurrentHp + value;
                }
                if (_units.Static.Abilities.TryGetValue(_context.CurrentAbility, out var ability))
                {
                    if (member.CurrentHp < oldHp)
                    {
                        if (ability.Influence.Values.Contains(InfluenceType.Attack))
                        {
                            member.TurnInfluence.Add(InfluenceTargetType.Attack);
                        }
                        if (ability.Influence.Values.Contains(InfluenceType.AttackDistance))
                        {
                            member.TurnInfluence.Add(InfluenceTargetType.AttackDistance);
                        }
                    }
                    if (member.CurrentHp > oldHp)
                    {
                        if (ability.Influence.Values.Contains(InfluenceType.Attack))
                        {
                            member.TurnInfluence.Add(InfluenceTargetType.Heal);
                        }
                    }
                }
            }
            else
            {
                var(member, unit) = _units.GetUnit(targetId);
                var max = _units.CalculateMaxHp(member, _logic);
                if (value < 0)
                {
                    value            = Mathf.Min(value, member.CurrentHp);
                    member.CurrentHp = member.CurrentHp + value;
                    if (member.CurrentHp <= 0)
                    {
                        _units.SetUnitReserve(targetId, true);
                    }
                }
                else
                {
                    member.CurrentHp = Mathf.Min(member.CurrentHp + value, (float)max.Value);
                }
            }
        }