Example #1
0
        private static void EndKiAttack(KiAttackInfo info)
        {
            info.m_Timer?.Stop();

            ClearCurrentMove(info.m_Mobile);
            info.m_Mobile.SendLocalizedMessage(1063102); // You failed to complete your Ki Attack in time.

            m_Table.Remove(info.m_Mobile);
        }
Example #2
0
        public override void OnUse(Mobile from)
        {
            if (!this.Validate(from))
                return;

            KiAttackInfo info = new KiAttackInfo(from);
            info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(EndKiAttack), info);

            m_Table[from] = info;
        }
Example #3
0
        public override void OnClearMove(Mobile from)
        {
            KiAttackInfo info = m_Table[from] as KiAttackInfo;

            if (info != null)
            {
                info.m_Timer?.Stop();

                m_Table.Remove(info.m_Mobile);
            }
        }
Example #4
0
        }                                                                                                     // Your Ki Attack must be complete within 2 seconds for the damage bonus!

        public override void OnUse(Mobile from)
        {
            if (!Validate(from))
            {
                return;
            }

            KiAttackInfo info = new KiAttackInfo(from);

            info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(EndKiAttack), info);

            m_Table[from] = info;
        }
Example #5
0
        private static void EndKiAttack(object state)
        {
            KiAttackInfo info = (KiAttackInfo)state;

            if (info.m_Timer != null)
            {
                info.m_Timer.Stop();
            }

            ClearCurrentMove(info.m_Mobile);
            info.m_Mobile.SendLocalizedMessage(1063102);               // You failed to complete your Ki Attack in time.

            m_Table.Remove(info.m_Mobile);
        }
Example #6
0
        public static double GetBonus(Mobile from)
        {
            KiAttackInfo info = m_Table[from] as KiAttackInfo;

            if (info == null)
            {
                return(0.0);
            }

            int xDelta = info.m_Location.X - from.X;
            int yDelta = info.m_Location.Y - from.Y;

            double bonus = Math.Sqrt((xDelta * xDelta) + (yDelta * yDelta));

            return(bonus);
        }