예제 #1
0
파일: EventSink.cs 프로젝트: dpisanu/xrunuo
 public static void InvokeBeforeDamage(BeforeDamageEventArgs e)
 {
     if (BeforeDamage != null)
     {
         BeforeDamage(e);
     }
 }
예제 #2
0
파일: Feint.cs 프로젝트: Ravenwolfe/xrunuo
        private static void EventSink_BeforeDamage( BeforeDamageEventArgs e )
        {
            int amount = e.Amount;

            AlterDamage( e.From, e.Mobile, ref amount );

            e.Amount = amount;
        }
예제 #3
0
 private static void EventSink_BeforeDamage( BeforeDamageEventArgs e )
 {
     if ( CheckEffect( e.Mobile ) )
     {
         bool isFromPlayer = ( e.From != null && e.From.IsPlayer );
         e.Amount = (int) ( e.Amount * ( isFromPlayer ? 1.1 : 1.25 ) );
     }
 }
예제 #4
0
        private static void EventSink_BeforeDamage( BeforeDamageEventArgs e )
        {
            Perseverance spellsong = Spellsong.GetEffectSpellsong<Perseverance>( e.Mobile );

            if ( spellsong != null )
                e.Amount = (int) ( e.Amount * ( 100 - spellsong.DamageTaken ) / 100 );
        }
예제 #5
0
파일: Mobile.cs 프로젝트: Ravenwolfe/xrunuo
        public virtual void Damage( int amount, Mobile from, bool informMount )
        {
            if ( !CanBeDamaged() )
                return;

            if ( !Region.OnDamage( this, ref amount ) )
                return;

            BeforeDamageEventArgs args = new BeforeDamageEventArgs( this, from, amount );

            EventSink.Instance.InvokeBeforeDamage( args );

            amount = args.Amount;

            if ( amount > 0 )
            {
                int oldHits = Hits;
                int newHits = oldHits - amount;

                if ( newHits < 0 )
                    amount = oldHits;

                if ( m_Spell != null )
                    m_Spell.OnCasterHurt();

                if ( from != null )
                    RegisterDamage( amount, from );

                DisruptiveAction();

                if ( ( m_Skills[SkillName.Hiding].Value * 0.75 / 100.0 ) < Utility.RandomDouble() )
                    Hidden = false;

                Paralyzed = false;

                InvokeDamaged( new DamagedEventArgs( amount, from ) );

                OnDamage( amount, from, newHits < 0 );

                IMount m = this.Mount;
                if ( m != null && informMount )
                    m.OnRiderDamaged( amount, from, newHits < 0 );

                if ( newHits < 0 )
                {
                    m_LastKiller = from;

                    Hits = 0;

                    if ( oldHits >= 0 )
                        Kill();
                }
                else
                {
                    Hits = newHits;
                }
            }
        }
예제 #6
0
 public void InvokeBeforeDamage( BeforeDamageEventArgs e )
 {
     if ( BeforeDamage != null )
         BeforeDamage( e );
 }
예제 #7
0
        private static void EventSink_BeforeDamage( BeforeDamageEventArgs e )
        {
            if ( e.From == null )
                return;

            Inspire spellsong = Spellsong.GetEffectSpellsong<Inspire>( e.From );

            if ( spellsong != null )
                e.Amount = (int) ( e.Amount * ( 100 + spellsong.DamageModifier ) / 100 );
        }