Exemple #1
0
            protected override void OnTick()
            {
                int damage = Utility.RandomMinMax(10, 15 + (int)(m_from.PlayerLevel / 4));

                m_from.MovingParticles(m_targ, 0x36E4, 5, 0, false, false, 3006, 4006, 0);
                m_from.PlaySound(0x1E5);
                SpellHelper.Damage(TimeSpan.Zero, m_targ, m_from, damage, d_ph, d_fi, d_co, d_po, d_en);

                if (!m_from.CanSee(m_targ) || !m_from.InLOS(m_targ))
                {
                    RunCount = MaxCount;
                }

                if (!m_targ.Alive)
                {
                    RunCount = MaxCount;
                }

                if (RunCount == MaxCount)
                {
                    if (m_targ is TeiravonMobile)
                    {
                        TeiravonMobile pctarg = (TeiravonMobile)m_targ;
                        pctarg.ShadowShotReady = false;
                    }
                }
                if (RunCount < MaxCount && m_from.Alive)
                {
                    RunCount++;
                    Timer m_EffectTimer = new EffectTimer(m_from, m_targ, d_ph, d_fi, d_en, d_co, d_po, RunCount, MaxCount, DateTime.Now + TimeSpan.FromSeconds(0.25));
                    m_EffectTimer.Start();
                }
            }
Exemple #2
0
        protected override void OnTarget(Mobile from, object targ)
        {
            TeiravonMobile m_player = (TeiravonMobile)from;

            if (targ is Mobile)
            {
                if (!(targ is TeiravonMobile))
                {
                    Mobile m_targ        = (Mobile)targ;
                    Timer  m_EffectTimer = new EffectTimer(m_player, m_targ, phys, fire, nrgy, cold, pois, 0, 1 + (int)(m_player.PlayerLevel / 3), DateTime.Now + TimeSpan.FromSeconds(0.25));
                    m_EffectTimer.Start();
                    m_player.Mana -= 5 + (5 * (int)(m_player.PlayerLevel / 3));
                }
                else
                {
                    TeiravonMobile pctarg = (TeiravonMobile)targ;

                    if (pctarg.ShadowShotReady)
                    {
                        m_player.SendMessage("This spell is already active on that target!");
                    }
                    else
                    {
                        Timer m_EffectTimer = new EffectTimer(m_player, pctarg, phys, fire, nrgy, cold, pois, 0, 1 + (int)(m_player.PlayerLevel / 3), DateTime.Now + TimeSpan.FromSeconds(0.25));
                        m_EffectTimer.Start();
                        m_player.Mana         -= 5 + (5 * (int)(m_player.PlayerLevel / 3));
                        pctarg.ShadowShotReady = true;                         //using shadowshotready to show spell active on target
                    }
                }
            }
            else
            {
                from.SendMessage("Only Mobiles may be targeted");
            }
        }
Exemple #3
0
            protected override void OnTick()
            {
                foreach (NetState state in m_Player.GetClientsInRange(15))
                {
                    if (m_Count % 2 != 0)
                    {
                        state.Mobile.PlaySound(287);
                    }
                    else
                    {
                        state.Mobile.PlaySound(288);
                    }
                }

                m_Count++;

                if (m_Count == 2)
                {
                    EffectTimer et = new EffectTimer(m_Player);
                    et.Start();
                }

                if (m_Count > 4)
                {
                    Stop();
                    return;
                }
            }
Exemple #4
0
		public BRBomb( BRGame game ) : base( 0x103C ) // 0x103C = bread, 0x1042 = pie, 0x1364 = rock, 0x13a8 = pillow, 0x2256 = bagball
		{
			Name = "da bomb";
			Movable = false;
			Hue = 0x35;

			m_Game = game;
			
			m_Helpers = new ArrayList();

			m_Timer = new EffectTimer( this );
			m_Timer.Start();
		}
Exemple #5
0
            protected override void OnTick()
            {
                m_Summoner.FixedParticles(0x3779, 10, 100, 9502, 67, 7, EffectLayer.Head);
                m_Summoner.PlaySound(0x24A);
                m_Summoner.RevealingAction();

                if (!(m_Summoner.Mounted) && (m_Summoner.Body.IsHuman))
                {
                    m_Summoner.Animate(266, 7, 1, true, false, 0);
                }

                if (RunCount < MaxCount)
                {
                    RunCount++;
                    Timer m_EffectTimer = new EffectTimer(m_Summoner, RunCount, MaxCount, DateTime.Now + TimeSpan.FromSeconds(3.0));
                    m_EffectTimer.Start();
                }
            }
Exemple #6
0
        // 0x103C = bread, 0x1042 = pie, 0x1364 = rock, 0x13a8 = pillow, 0x2256 = bagball
        public BRBomb( BRGame game )
            : base(0x103C)
        {
            Name = "da bomb";
            Movable = false;
            Hue = 0x35;

            m_Game = game;

            m_Helpers = new ArrayList();

            m_Timer = new EffectTimer( this );
            m_Timer.Start();
        }
Exemple #7
0
            protected override void OnTick()
            {
                Mobile from = (Mobile)parent;

                #region Magic Clothing
                if (m_Item.Charges <= 0)
                {
                    from.SendAsciiMessage("This item is out of charges.");   // This item is out of charges.

                    switch (m_Item.Effect)
                    {
                    case JewelEffect.Strength:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "Str");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Agility:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "Dex");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Cunning:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "Int");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Bless:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "BlessStr");
                        from.RemoveStatMod(m_Item.Serial.ToString() + "BlessDex");
                        from.RemoveStatMod(m_Item.Serial.ToString() + "BlessInt");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Weaken:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "LowerStr");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Clumsy:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "LowerDex");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Feeblemind:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "LowerInt");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.Curse:
                        from.RemoveStatMod(m_Item.Serial.ToString() + "CurseStr");
                        from.RemoveStatMod(m_Item.Serial.ToString() + "CurseDex");
                        from.RemoveStatMod(m_Item.Serial.ToString() + "CurseInt");
                        from.CheckStatTimers();
                        break;

                    case JewelEffect.NightSight:
                        from.EndAction(typeof(LightCycle));
                        from.LightLevel = 0;
                        break;

                    case JewelEffect.Invisibility:
                        from.Hidden = false;
                        break;

                    case JewelEffect.MagicReflection:
                        break;

                    case JewelEffect.Protection:
                        if (from.VirtualArmorMod >= 10)
                        {
                            from.VirtualArmorMod -= 10;
                        }
                        else
                        {
                            from.VirtualArmorMod = 0;
                        }
                        break;
                    }
                    Stop();
                }
                else
                {
                    if (m_Item.Effect == JewelEffect.Invisibility && parent.Hidden == false)
                    {
                        Stop();
                    }
                    else
                    {
                        m_Item.ConsumeCharge(from, m_Item);
                        m_st = new EffectTimer(from, m_Item);
                        m_st.Start();
                    }
                }
                #endregion
            }
Exemple #8
0
        private void Activate(object parent)
        {
            if (Effect == JewelEffect.None || Charges <= 0)
            {
                return;
            }

            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                string modName = this.Serial.ToString();

                switch (Effect)
                {
                case JewelEffect.Strength:
                    from.AddStatMod(new StatMod(StatType.Str, modName + "Str", 10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x375a, 10, 15, 5017, EffectLayer.Waist);
                    from.PlaySound(0x1ee);
                    break;

                case JewelEffect.Agility:
                    from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x375a, 10, 15, 5010, EffectLayer.Waist);
                    from.PlaySound(0x28e);
                    break;

                case JewelEffect.Cunning:
                    from.AddStatMod(new StatMod(StatType.Int, modName + "Int", 10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x375a, 10, 15, 5011, EffectLayer.Head);
                    from.PlaySound(0x1eb);
                    break;

                case JewelEffect.Bless:
                    from.AddStatMod(new StatMod(StatType.Str, modName + "BlessStr", 10, TimeSpan.Zero));
                    from.AddStatMod(new StatMod(StatType.Dex, modName + "BlessDex", 10, TimeSpan.Zero));
                    from.AddStatMod(new StatMod(StatType.Int, modName + "BlessInt", 10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x373a, 10, 15, 5018, EffectLayer.Waist);
                    from.PlaySound(0x1ea);
                    break;

                case JewelEffect.Weaken:
                    from.AddStatMod(new StatMod(StatType.Str, modName + "LowerStr", -10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                    from.PlaySound(0x1e6);
                    break;

                case JewelEffect.Clumsy:
                    from.AddStatMod(new StatMod(StatType.Dex, modName + "LowerDex", -10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                    from.PlaySound(0x1df);
                    break;

                case JewelEffect.Feeblemind:
                    from.AddStatMod(new StatMod(StatType.Int, modName + "LowerInt", -10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                    from.PlaySound(0x1e4);
                    break;

                case JewelEffect.Curse:
                    from.AddStatMod(new StatMod(StatType.Str, modName + "CurseStr", -10, TimeSpan.Zero));
                    from.AddStatMod(new StatMod(StatType.Dex, modName + "CurseDex", -10, TimeSpan.Zero));
                    from.AddStatMod(new StatMod(StatType.Int, modName + "CurseInt", -10, TimeSpan.Zero));
                    from.CheckStatTimers();
                    from.FixedParticles(0x374a, 10, 15, 5028, EffectLayer.Waist);
                    from.PlaySound(0x1ea);
                    break;

                case JewelEffect.NightSight:
                    from.EndAction(typeof(LightCycle));
                    from.BeginAction(typeof(LightCycle));
                    from.LightLevel = (int)LightCycle.DungeonLevel;
                    from.FixedParticles(0x376a, 9, 32, 5007, EffectLayer.Waist);
                    from.PlaySound(0x1e3);
                    break;

                case JewelEffect.Invisibility:
                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z + 16), from.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
                    from.PlaySound(0x203);
                    from.Hidden = true;
                    break;

                case JewelEffect.MagicReflection:
                    from.MagicDamageAbsorb = 15;
                    from.FixedParticles(0x375a, 10, 15, 5037, EffectLayer.Waist);
                    from.PlaySound(0x1e9);
                    break;

                case JewelEffect.Protection:
                    from.VirtualArmorMod += 10;
                    from.FixedParticles(0x375a, 9, 20, 5016, EffectLayer.Waist);
                    from.PlaySound(0x1ed);
                    break;
                }

                ConsumeCharge(from, this);

                if (m_st != null)
                {
                    m_st.Stop();
                }

                m_st = new EffectTimer(from, this);
                m_st.Start();
            }
        }
Exemple #9
0
            protected override void OnTick()
            {
                Mobile from = (Mobile)parent;

                #region Magic Clothing
                if (m_Item.Charges <= 0)
                {
                    from.SendAsciiMessage("This item is out of charges."); // This item is out of charges.

                    switch (m_Item.Effect)
                    {
                        case ClothEffect.Strength:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "Str");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Agility:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "Dex");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Cunning:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "Int");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Bless:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "BlessStr");
                            from.RemoveStatMod(m_Item.Serial.ToString() + "BlessDex");
                            from.RemoveStatMod(m_Item.Serial.ToString() + "BlessInt");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Weaken:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "LowerStr");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Clumsy:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "LowerDex");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Feeblemind:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "LowerInt");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.Curse:
                            from.RemoveStatMod(m_Item.Serial.ToString() + "CurseStr");
                            from.RemoveStatMod(m_Item.Serial.ToString() + "CurseDex");
                            from.RemoveStatMod(m_Item.Serial.ToString() + "CurseInt");
                            from.CheckStatTimers();
                            break;
                        case ClothEffect.NightSight:
                            from.EndAction(typeof(LightCycle));
                            from.LightLevel = 0;
                            break;
                        case ClothEffect.Invisibility:
                            from.Hidden = false;
                            break;
                        case ClothEffect.MagicReflection:
                            break;
                        case ClothEffect.Protection:
                            if (from.VirtualArmorMod >= 10)
                                from.VirtualArmorMod -= 10;
                            else
                                from.VirtualArmorMod = 0;
                            break;
                    }
                    Stop();

                }
                else
                {
                    if (m_Item.Effect == ClothEffect.Invisibility && parent.Hidden == false)
                        Stop();
                    else
                    {
                        m_Item.ConsumeCharge(from, m_Item);
                        m_st = new EffectTimer(from, m_Item);
                        m_st.Start();
                    }
                }
                #endregion
            }
Exemple #10
0
        private void Activate(object parent)
        {
            if (Effect == ClothEffect.None || Charges <= 0)
                return;

            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                string modName = this.Serial.ToString();

                switch (Effect)
                {
                    case ClothEffect.Strength:
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", 10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x375a, 10, 15, 5017, EffectLayer.Waist);
                        from.PlaySound(0x1ee);
                        break;
                    case ClothEffect.Agility:
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x375a, 10, 15, 5010, EffectLayer.Waist);
                        from.PlaySound(0x28e);
                        break;
                    case ClothEffect.Cunning:
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", 10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x375a, 10, 15, 5011, EffectLayer.Head);
                        from.PlaySound(0x1eb);
                        break;
                    case ClothEffect.Bless:
                        from.AddStatMod(new StatMod(StatType.Str, modName + "BlessStr", 10, TimeSpan.Zero));
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "BlessDex", 10, TimeSpan.Zero));
                        from.AddStatMod(new StatMod(StatType.Int, modName + "BlessInt", 10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x373a, 10, 15, 5018, EffectLayer.Waist);
                        from.PlaySound(0x1ea);
                        break;
                    case ClothEffect.Weaken:
                        from.AddStatMod(new StatMod(StatType.Str, modName + "LowerStr", -10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                        from.PlaySound(0x1e6);
                        break;
                    case ClothEffect.Clumsy:
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "LowerDex", -10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                        from.PlaySound(0x1df);
                        break;
                    case ClothEffect.Feeblemind:
                        from.AddStatMod(new StatMod(StatType.Int, modName + "LowerInt", -10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                        from.PlaySound(0x1e4);
                        break;
                    case ClothEffect.Curse:
                        from.AddStatMod(new StatMod(StatType.Str, modName + "CurseStr", -10, TimeSpan.Zero));
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "CurseDex", -10, TimeSpan.Zero));
                        from.AddStatMod(new StatMod(StatType.Int, modName + "CurseInt", -10, TimeSpan.Zero));
                        from.CheckStatTimers();
                        from.FixedParticles(0x374a, 10, 15, 5028, EffectLayer.Waist);
                        from.PlaySound(0x1ea);
                        break;
                    case ClothEffect.NightSight:
                        from.EndAction(typeof(LightCycle));
                        from.BeginAction(typeof(LightCycle));
                        from.LightLevel = (int)LightCycle.DungeonLevel;
                        from.FixedParticles(0x376a, 9, 32, 5007, EffectLayer.Waist);
                        from.PlaySound(0x1e3);
                        break;
                    case ClothEffect.Invisibility:
                        Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z + 16), from.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
                        from.PlaySound(0x3C4);
                        from.Hidden = true;
                        break;
                    case ClothEffect.MagicReflection:
                        from.MagicDamageAbsorb = 15;
                        from.FixedParticles(0x375a, 10, 15, 5037, EffectLayer.Waist);
                        from.PlaySound(0x1e9);
                        break;
                    case ClothEffect.Protection:
                        from.VirtualArmorMod += 10;
                        from.FixedParticles(0x375a, 9, 20, 5016, EffectLayer.Waist);
                        from.PlaySound(0x1ed);
                        break;
                }

                ConsumeCharge(from, this);

                if (m_st != null)
                    m_st.Stop();

                m_st = new EffectTimer(from, this);
                m_st.Start();
            }
        }
Exemple #11
0
        public void Summonicate(TeiravonMobile necromancer, Type necrosummon, string name, int stat, int level, int damage, int res)
        {
            necromancer.BeginAction(typeof(NecroSummonGump));
            BaseCreature summon = (BaseCreature)Activator.CreateInstance(necrosummon);

            summon.Name         = name;
            summon.Level        = 0;
            summon.NoKillAwards = true;
            m_Player.BeginAction(typeof(NecroSummonGump));
            double variation   = (level / 2);
            int    bonus       = (int)(1.0 + (double)(level / 3.0)) * (necromancer.PlayerLevel);
            int    necrobonus  = (int)(necromancer.Skills[SkillName.Necromancy].Value / 4);
            double damageboost = 1.0 + ((bonus) / 100) + (necrobonus / 200);

            if (damageboost < 1.0)
            {
                damageboost = 1.0;
            }


            summon.SetStr(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus);
            summon.SetDex(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus);
            summon.SetInt(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus);
            summon.SetHits(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + (int)(bonus / 2) + necrobonus);
            summon.SetStam(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + (int)(bonus / 2) + necrobonus);
            summon.SetMana(0);

            summon.SetDamage((int)(damageboost * (Utility.RandomMinMax(damage - (int)(damage / 2), damage))), (int)(damageboost * (Utility.RandomMinMax(damage, damage + (int)(damage / 4)))));
            summon.SetDamageType(ResistanceType.Physical, 100 - ((level - 1) * 10));
            summon.SetDamageType(ResistanceType.Fire, (level - 1) * 2);
            summon.SetDamageType(ResistanceType.Poison, ((level - 1) * 2) + ((level - 1) * 2));
            summon.SetDamageType(ResistanceType.Cold, (level - 1) * 2);
            summon.SetDamageType(ResistanceType.Energy, (level - 1) * 2);

            summon.Karma = necromancer.Karma;

            summon.Skills.MagicResist = necromancer.Skills.MagicResist;
            summon.SetSkill(SkillName.Wrestling, 55 + (level * 5), 75 + (level * 5));
            summon.SetSkill(SkillName.Tactics, 65 + (level * 5), 75 + (level * 5));

            summon.SetResistance(ResistanceType.Physical, (int)(res * 0.75), res);
            summon.SetResistance(ResistanceType.Fire, (int)(res * 0.75), res);
            summon.SetResistance(ResistanceType.Cold, (int)(res * 0.75), res);
            summon.SetResistance(ResistanceType.Poison, (int)(res * 0.75), res);
            summon.SetResistance(ResistanceType.Energy, (int)(res * 0.75), res);

            if (summon.Backpack != null)
            {
                summon.Backpack.Delete();
            }

            summon.ControlSlots  = 4;
            summon.Controled     = true;
            summon.ControlMaster = m_Player;

            Item pentagram = new BloodPentagram();

            Point3D p = new Point3D(m_Player.X - 2, m_Player.Y - 3, m_Player.Z);

            pentagram.MoveToWorld(p, m_Player.Map);

            m_Player.SendMessage("You begin summoning a {0} from the netherworld!", name);
            m_Player.Emote("*You see {0} begin summoning*", m_Player.Name);
            m_Player.RevealingAction();

            m_Player.FixedParticles(0x3779, 10, 100, 9502, 67, 7, EffectLayer.Head);
            m_Player.Freeze(TimeSpan.FromSeconds(4.0 * level));
            m_Player.PlaySound(0x24A);

            if (!(m_Player.Mounted) && (m_Player.Body.IsHuman))
            {
                m_Player.Animate(266, 7, 1, true, false, 0);
            }

            Timer m_EffectTimer = new EffectTimer(m_Player, 1, level - 1, DateTime.Now + TimeSpan.FromSeconds(3.0));

            m_EffectTimer.Start();

            DateTime SummonTime = DateTime.Now + TimeSpan.FromSeconds(4.0 * level);
            Timer    m_Timer    = new NecromancerSummonTimer(m_Player, summon, pentagram, SummonTime, m_EffectTimer);

            m_Timer.Start();
        }
Exemple #12
0
        /// <summary>
        /// Изменение координат мыши и действия при нахождении бонусов и сыра
        /// </summary>
        private void MovementOfMouse()
        {
            int    x        = Mouse.mice[current_mouse].position.Left - Server.shift_of_map_Left; // Координата X текущей мыши
            int    y        = Mouse.mice[current_mouse].position.Top - Server.shift_of_map_Top;   // Координата Y текущей мыши
            int    step     = Convert.ToInt32(Mouse.mice[current_mouse].speed);                   // Шаг
            double double_x = (Convert.ToDouble(x)) / Server.size_of_cell;                        // Позиция X внутри ячейки
            double double_y = (Convert.ToDouble(y)) / Server.size_of_cell;                        // Позиция Y внутри ячейки

            // Нажата клавиша влево
            if (key_left_pressed)
            {
                // Проверка на преграды и прочее
                if (CheckingOfMovement(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top, "left", current_mouse))
                {
                    Mouse.mice[current_mouse].position.Location = new Point(Mouse.mice[current_mouse].position.Left - step, Mouse.mice[current_mouse].position.Top);
                }
            }
            // Нажата клавиша вправо
            if (key_right_pressed)
            {
                // Проверка на преграды и прочее
                if (CheckingOfMovement(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top, "right", current_mouse))
                {
                    Mouse.mice[current_mouse].position.Location = new Point(Mouse.mice[current_mouse].position.Left + step, Mouse.mice[current_mouse].position.Top);
                }
            }
            // Нажата клавиша вверх
            if (key_up_pressed)
            {
                // Проверка на преграды и прочее
                if (CheckingOfMovement(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top, "up", current_mouse))
                {
                    Mouse.mice[current_mouse].position.Location = new Point(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top - step);
                }
            }
            // Нажата клавиша вниз
            if (key_down_pressed)
            {
                // Проверка на преграды и прочее
                if (CheckingOfMovement(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top, "down", current_mouse))
                {
                    Mouse.mice[current_mouse].position.Location = new Point(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top + step);
                }
            }
            // Если никакая клавиша не нажата
            if (!key_left_pressed && !key_right_pressed && !key_up_pressed && !key_down_pressed)
            {
                int result = AutoAligment(Mouse.mice[current_mouse].position.Left, Mouse.mice[current_mouse].position.Top);
                // Проверка на автоцентровку (выравнивание по правому краю)
                if (result == 1)
                {
                    int coordinate_X_of_right_cell = Convert.ToInt32(Math.Ceiling(double_x) * Server.size_of_cell + Server.shift_of_map_Left);
                    Mouse.mice[current_mouse].position.Location = new Point(coordinate_X_of_right_cell, y + Server.shift_of_map_Left);
                }
                // Проверка на автоцентровку (выравнивание по левому краю)
                if (result == 2)
                {
                    int coordinate_X_of_left_cell = Convert.ToInt32(Math.Floor(double_x) * Server.size_of_cell + Server.shift_of_map_Left);
                    Mouse.mice[current_mouse].position.Location = new Point(coordinate_X_of_left_cell, y + Server.shift_of_map_Left);
                }
                // Проверка на автоцентровку (выравнивание по нижнему краю)
                if (result == 3)
                {
                    int coordinate_Y_of_down_cell = Convert.ToInt32(Math.Ceiling(double_y) * Server.size_of_cell + Server.shift_of_map_Top);
                    Mouse.mice[current_mouse].position.Location = new Point(x + Server.shift_of_map_Left, coordinate_Y_of_down_cell);
                }
                // Проверка на автоцентровку (выравнивание по верхнему краю)
                if (result == 4)
                {
                    int coordinate_Y_of_up_cell = Convert.ToInt32(Math.Floor(double_y) * Server.size_of_cell + Server.shift_of_map_Top);
                    Mouse.mice[current_mouse].position.Location = new Point(x + Server.shift_of_map_Left, coordinate_Y_of_up_cell);
                }
            }
            // Если подобрали бонус
            if (bonus)
            {
                bonus = false;
                Mouse.mice[current_mouse].speed = 3;
                EffectTimer.Stop();  // Останавливаем таймер, если он запущен
                time_of_effect = 10;
                EffectTimer.Start(); // Запускаем таймер эффекта бонуса
                Server.bonus_sound.Play();
            }
            // Если подобрали сыр
            if (cheese)
            {
                cheese = false;
                Mouse.mice[current_mouse].number_of_cheeses++;
                Server.cheese_sound.Play();
            }
            // Если наткнулись на мышеловку
            if (trap)
            {
                trap = false;
                Mouse.mice[current_mouse].speed = 1;
                EffectTimer.Stop();  // Останавливаем таймер, если он запущен
                time_of_effect = 10;
                EffectTimer.Start(); // Запускаем таймер эффекта бонуса
                Server.cheese_sound.Play();
            }
        }