예제 #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (((Mobile)targeted).Frozen)
                        {
                            if (FireAidsContext.BeginHeal(from, (Mobile)targeted) != null)
                            {
                                m_Bandage.Consume();
                            }
                        }
                        else
                        {
                            from.SendMessage("That is not frozen");
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
예제 #2
0
        public static FireAidsContext GetContext(Mobile healer)
        {
            FireAidsContext bc = null;

            m_Table.TryGetValue(healer, out bc);
            return(bc);
        }
예제 #3
0
        public static FireAidsContext BeginHeal(Mobile healer, Mobile patient)
        {
            if (patient == null || healer == null || healer == patient || healer.Frozen || !healer.Alive || !patient.Alive || !patient.Frozen)
            {
                return(null);
            }

            FireAidsContext context = GetContext(healer);

            if (context != null)
            {
                context.StopHeal();
            }

            context = new FireAidsContext(healer, patient, TimeSpan.FromSeconds(5.0));

            m_Table[healer] = context;

            patient.SendLocalizedMessage(1008078, false, healer.Name);               //  : Attempting to heal you.

            healer.SendMessage("You begin thawing them");
            return(context);
        }
예제 #4
0
 public InternalTimer(FireAidsContext context, int ticks) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1))
 {
     m_Context  = context;
     Priority   = TimerPriority.FiftyMS;
     this.ticks = ticks;
 }
예제 #5
0
파일: FireAids.cs 프로젝트: guy489/runuot2a
 public InternalTimer( FireAidsContext context, int ticks )
     : base(TimeSpan.Zero, TimeSpan.FromSeconds(1))
 {
     m_Context = context;
     Priority = TimerPriority.FiftyMS;
     this.ticks = ticks;
 }
예제 #6
0
파일: FireAids.cs 프로젝트: guy489/runuot2a
        public static FireAidsContext BeginHeal( Mobile healer, Mobile patient )
        {
            if(patient == null || healer == null || healer == patient || healer.Frozen || !healer.Alive || !patient.Alive || !patient.Frozen)
                return null;

            FireAidsContext context = GetContext( healer );

            if ( context != null )
                context.StopHeal();

            context = new FireAidsContext( healer, patient, TimeSpan.FromSeconds( 5.0 ) );

            m_Table[healer] = context;

            patient.SendLocalizedMessage( 1008078, false, healer.Name ); //  : Attempting to heal you.

            healer.SendMessage( "You begin thawing them" );
            return context;
        }