示例#1
0
文件: Honor.cs 项目: Brrm1/New-One
        public void OnTargetDamaged(Mobile from, int amount)
        {
            if (this.m_FirstHit == FirstHit.NotDelivered)
            {
                this.m_FirstHit = FirstHit.Delivered;
            }

            if (this.m_Poisoned)
            {
                this.m_HonorDamage += amount * 0.8;
                this.m_Poisoned     = false; // Reset the flag

                return;
            }

            this.m_TotalDamage += amount;

            if (from == this.m_Source)
            {
                if (this.m_Target.CanSee(this.m_Source) && this.m_Target.InLOS(this.m_Source) && (this.m_Source.InRange(this.m_Target, 1) ||
                                                                                                  (this.m_Source.Location == this.m_InitialLocation && this.m_Source.Map == this.m_InitialMap)))
                {
                    this.m_HonorDamage += amount;
                }
                else
                {
                    this.m_HonorDamage += amount * 0.8;
                }
            }
            else if (from is BaseCreature && ((BaseCreature)from).GetMaster() == this.m_Source)
            {
                this.m_HonorDamage += amount * 0.8;
            }
        }
示例#2
0
文件: Honor.cs 项目: Brrm1/New-One
        public HonorContext(PlayerMobile source, Mobile target)
        {
            this.m_Source = source;
            this.m_Target = target;

            this.m_FirstHit = FirstHit.NotDelivered;
            this.m_Poisoned = false;

            this.m_InitialLocation = source.Location;
            this.m_InitialMap      = source.Map;

            source.SentHonorContext = this;
            ((IHonorTarget)target).ReceivedHonorContext = this;

            this.m_Timer = new InternalTimer(this);
            this.m_Timer.Start();
            source.m_hontime = (DateTime.UtcNow + TimeSpan.FromMinutes(40));

            Timer.DelayCall(TimeSpan.FromMinutes(40),
                            delegate()
            {
                if (source.m_hontime < DateTime.UtcNow && source.SentHonorContext != null)
                {
                    this.Cancel();
                }
            });
        }
示例#3
0
        public void OnTargetDamaged(Mobile from, int amount)
        {
            if (m_FirstHit == FirstHit.NotDelivered)
            {
                m_FirstHit = FirstHit.Delivered;
            }

            if (m_Poisoned)
            {
                m_HonorDamage += amount * 0.8;
                m_Poisoned     = false; // Reset the flag

                return;
            }

            m_TotalDamage += amount;

            if (from == Source)
            {
                if (Target.CanSee(Source) && Target.InLOS(Source) && (Source.InRange(Target, 1) ||
                                                                      (Source.Location == m_InitialLocation &&
                                                                       Source.Map == m_InitialMap)))
                {
                    m_HonorDamage += amount;
                }
                else
                {
                    m_HonorDamage += amount * 0.8;
                }
            }
            else if (from is BaseCreature creature && creature.GetMaster() == Source)
            {
                m_HonorDamage += amount * 0.8;
            }
        }
示例#4
0
        public HonorContext(PlayerMobile source, Mobile target)
        {
            Source = source;
            Target = target;

            m_FirstHit = FirstHit.NotDelivered;
            m_Poisoned = false;

            m_InitialLocation = source.Location;
            m_InitialMap      = source.Map;

            source.SentHonorContext = this;
            ((IHonorTarget)target).ReceivedHonorContext = this;

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
            source.m_hontime = Core.Now + TimeSpan.FromMinutes(40);

            Timer.StartTimer(
                TimeSpan.FromMinutes(40),
                () =>
            {
                if (source.m_hontime < Core.Now && source.SentHonorContext != null)
                {
                    Cancel();
                }
            }
                );
        }
示例#5
0
文件: Honor.cs 项目: FreeReign/forkuo
        public HonorContext(PlayerMobile source, Mobile target)
        {
            this.m_Source = source;
            this.m_Target = target;

            this.m_FirstHit = FirstHit.NotDelivered;
            this.m_Poisoned = false;

            this.m_InitialLocation = source.Location;
            this.m_InitialMap = source.Map;

            source.SentHonorContext = this;
            ((IHonorTarget)target).ReceivedHonorContext = this;

            this.m_Timer = new InternalTimer(this);
            this.m_Timer.Start();
            source.m_hontime = (DateTime.Now + TimeSpan.FromMinutes(40));

            Timer.DelayCall(TimeSpan.FromMinutes(40),
                delegate()
                {
                    if (source.m_hontime < DateTime.Now && source.SentHonorContext != null)
                    {
                        this.Cancel();
                    }
                });
        }
示例#6
0
文件: Honor.cs 项目: Brrm1/New-One
        public void OnSourceDamaged(Mobile from, int amount)
        {
            if (from != this.m_Target)
            {
                return;
            }

            if (this.m_FirstHit == FirstHit.NotDelivered)
            {
                this.m_FirstHit = FirstHit.Granted;
            }
        }
示例#7
0
        public HonorContext(PlayerMobile source, Mobile target)
        {
            m_Source = source;
            m_Target = target;

            m_FirstHit = FirstHit.NotDelivered;
            m_Poisoned = false;

            m_InitialLocation = source.Location;
            m_InitialMap      = source.Map;

            source.SentHonorContext = this;
            ((IHonorTarget)target).ReceivedHonorContext = this;

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
        }
示例#8
0
        public HonorContext( PlayerMobile source, Mobile target )
        {
            m_Source = source;
            m_Target = target;

            m_FirstHit = FirstHit.NotDelivered;
            m_Poisoned = false;

            m_InitialLocation = source.Location;
            m_InitialMap = source.Map;

            source.SentHonorContext = this;
            ( (IHonorTarget) target ).ReceivedHonorContext = this;

            m_Timer = new InternalTimer( this );
            m_Timer.Start();
        }
示例#9
0
文件: Honor.cs 项目: nathanvy/runuo
		public void OnTargetDamaged( Mobile from, int amount )
		{
			if ( m_FirstHit == FirstHit.NotDelivered )
				m_FirstHit = FirstHit.Delivered;

			if ( m_Poisoned )
			{
				m_HonorDamage += amount * 0.8;
				m_Poisoned = false; // Reset the flag

				return;
			}

			m_TotalDamage += amount;

			if ( from == m_Source )
			{
				if ( m_Target.CanSee( m_Source ) && m_Target.InLOS( m_Source ) && ( m_Source.InRange( m_Target, 1 )
					|| ( m_Source.Location == m_InitialLocation && m_Source.Map == m_InitialMap ) ) )
				{
					m_HonorDamage += amount;
				}
				else
				{
					m_HonorDamage += amount * 0.8;
				}
			}
			else if ( from is BaseCreature && ((BaseCreature)from).GetMaster() == m_Source )
			{
				m_HonorDamage += amount * 0.8;
			}
		}
示例#10
0
文件: Honor.cs 项目: nathanvy/runuo
		public void OnSourceDamaged( Mobile from, int amount )
		{
			if ( from != m_Target )
				return;

			if ( m_FirstHit == FirstHit.NotDelivered )
				m_FirstHit = FirstHit.Granted;
		}