当前位置: 首页>>代码示例>>C#>>正文


C# Server.ResistanceMod类代码示例

本文整理汇总了C#中Server.ResistanceMod的典型用法代码示例。如果您正苦于以下问题:C# ResistanceMod类的具体用法?C# ResistanceMod怎么用?C# ResistanceMod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResistanceMod类属于Server命名空间,在下文中一共展示了ResistanceMod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResistanceModTimer

 public ResistanceModTimer(Mobile m, string name, ResistanceMod[] mods, TimeSpan duration)
     : base(duration)
 {
     this.m_Mobile = m;
     this.m_Name = name;
     this.m_Mods = mods;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:TimedResistanceMod.cs

示例2: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			attacker.SendLocalizedMessage( 1063353 ); // You perform a masterful defense!

			attacker.FixedParticles( 0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist );

			int modifier = (int)(30.0 * ((Math.Max( attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value ) - 50.0) / 70.0));

			DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

			if( info != null )
				EndDefense( (object)info );

			ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, 50 + modifier );
			attacker.AddResistanceMod( mod );

			info = new DefenseMasteryInfo( attacker, 80 - modifier, mod );
			info.m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( EndDefense ), info );

			m_Table[attacker] = info;

			attacker.Delta( MobileDelta.WeaponDamage );
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:28,代码来源:DefenseMastery.cs

示例3: ExpireTimer

			public ExpireTimer( Mobile m, ResistanceMod mod )
				: base( TimeSpan.FromSeconds( 10 ) )
			{
				m_Mobile = m;
				m_Mod = mod;
				Priority = TimerPriority.TwoFiftyMS;
			}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:7,代码来源:LadyJennifyr.cs

示例4: OnCast

        public override void OnCast()
        {
            if( CheckSequence() )
            {
                ArrayList targets = new ArrayList();

                foreach ( Mobile m in Caster.GetMobilesInRange( 3 ) )
                {
                    if ( Caster.CanBeBeneficial( m, false, true ) && !(m is Golem) )
                        targets.Add( m );
                }

                for ( int i = 0; i < targets.Count; ++i )
                {
                    Mobile m = (Mobile)targets[i];

                    TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Value * 0.2 );
                    int amount = (int)( Caster.Skills[SkillName.Musicianship].Value * .125 );

                    m.SendMessage( "Your fire resistance has increased." );
                    ResistanceMod mod1 = new ResistanceMod( ResistanceType.Fire, + amount );

                    m.AddResistanceMod( mod1 );

                    m.FixedParticles( 0x373A, 10, 15, 5012, 0x21, 3, EffectLayer.Waist );

                    new ExpireTimer( m, mod1, duration ).Start();
                }
            }

            FinishSequence();
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:32,代码来源:FireCarolSpell.cs

示例5: ExpireTimer

		public ExpireTimer( Mobile m, ResistanceMod[] mod, TimeSpan delay, Hashtable hashtbl ) : base( delay )
		{
			m_Mobile = m;

			m_Mod = mod;

			m_Hashtbl = hashtbl;
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:8,代码来源:BaseTimersSE.cs

示例6: AddMod

		public static void AddMod( Mobile m, string name, ResistanceMod[] mods, TimeSpan duration )
		{
			string fullname = name + ":" + m.Serial.ToString();

			if ( m_Table.ContainsKey( fullname ) )
			{
				ResistanceModTimer timer = m_Table[fullname];
				timer.Stop();
				m_Table.Remove( fullname );
			}

			ResistanceModTimer timertostart = new ResistanceModTimer( m, name, mods, duration );
			timertostart.Start();
			m_Table.Add( fullname, timertostart );
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:15,代码来源:TimedResistanceMod.cs

示例7: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );
			
			if ( m_Table == null )
				m_Table = new Hashtable();
		
			if ( Combatant != null && m_Table[ Combatant ] == null )
			{
				ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 );
				Combatant.AddResistanceMod( mod );
				m_Table[ Combatant ] = mod;
				Timer.DelayCall( TimeSpan.FromSeconds( 30 ), new TimerStateCallback( EndMod_Callback ), Combatant );
			}
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:15,代码来源:LadyJennifyr.cs

示例8: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( attacker != null && defender != null )
			{
				ResistanceMod[] mods = new ResistanceMod[]{ new ResistanceMod( ResistanceType.Fire, -15 ) };

				for ( int i = 0; i < mods.Length; ++i )
					attacker.AddResistanceMod( mods[i] );

				TimedResistanceMod.AddMod( 
					defender, 
					"BistroFork", 
					mods, 
					TimeSpan.FromSeconds( 10 )
				);
			}
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:19,代码来源:BistroFork.cs

示例9: CorruptArmorAttack

        public static void CorruptArmorAttack( Mobile from, ref ExpireTimer timer, Mobile target )
        {
            ResistanceMod[] mod = new ResistanceMod[5]
            {
                new ResistanceMod( ResistanceType.Fire, -target.FireResistance / 2 ),
                new ResistanceMod( ResistanceType.Poison, -target.PoisonResistance / 2 ),
                new ResistanceMod( ResistanceType.Cold, -target.ColdResistance / 2 ),
                new ResistanceMod( ResistanceType.Energy, -target.EnergyResistance / 2 ),
                new ResistanceMod( ResistanceType.Physical, -target.PhysicalResistance / 2 )
            };

            target.SendLocalizedMessage( 1070846 ); // The creature magically corrupts your armor!

            TimeSpan duration = TimeSpan.FromSeconds( 2 + Utility.Random( 3 ) );

            LowerResistanceAttack( from, ref timer, duration, target, mod, m_RuneBeetleRMT );

            return;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:19,代码来源:BaseAttackHelperSE.cs

示例10: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( Utility.RandomDouble() < 0.1 )
			{
				ExpireTimer timer;

				if ( m_Table.TryGetValue( defender, out timer ) )
					timer.DoExpire();

				defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
				defender.PlaySound( 0x208 );
				defender.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks.

				ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 );
				defender.AddResistanceMod( mod );

				m_Table[defender] = timer = new ExpireTimer( defender, mod );
				timer.Start();
			}
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:22,代码来源:LadyJennifyr.cs

示例11: LowerResistanceAttack

		public static void LowerResistanceAttack( Mobile from, ref ExpireTimer timer, TimeSpan duration, Mobile target, ResistanceMod[] mod, Hashtable hashtbl )
		{
			target.PlaySound( 0x1E9 );
			target.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );

			timer = new ExpireTimer( target, mod, duration, hashtbl );
			timer.Start();

			hashtbl[target] = timer;

			for (int i=0;i<mod.Length;i++)
				target.AddResistanceMod( mod[i] );		

			if ( hashtbl == m_RuneBeetleRMT )
				target.SendLocalizedMessage( 1070845 ); // The creature continues to corrupt your armor!

			if ( hashtbl == m_FanDancerRMT )
				target.SendLocalizedMessage( 1070835 ); // The creature surrounds you with fire, reducing your resistance to fire attacks.

			from.DoHarmful( target );

			return;
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:23,代码来源:BaseAttackHelperSE.cs

示例12: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if( 0.1 > Utility.RandomDouble() )
			{
				/* Grasping Claw
				 * Start cliloc: 1070836
				 * Effect: Physical resistance -15% for 5 seconds
				 * End cliloc: 1070838
				 * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False"
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[defender];

				if( timer != null )
				{
					timer.DoExpire();
					defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
				}
				else
					defender.SendLocalizedMessage( 1070836 ); // The blow from the creature's claws has made you more susceptible to physical attacks.

				int effect = -(defender.PhysicalResistance * 15 / 100);

				ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, effect );

				defender.FixedEffect( 0x37B9, 10, 5 );
				defender.AddResistanceMod( mod );

				timer = new ExpireTimer( defender, mod, TimeSpan.FromSeconds( 5.0 ) );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
开发者ID:nathanvy,项目名称:runuo,代码行数:35,代码来源:Hiryu.cs

示例13: DefenseMasteryInfo

			public DefenseMasteryInfo( Mobile from, int damageMalus, ResistanceMod mod )
			{
				m_From = from;
				m_DamageMalus = damageMalus;
				m_Mod = mod;
			}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:6,代码来源:DefenseMastery.cs

示例14: FinalEffect

        public static void FinalEffect( Mobile target, int protection, int duration )
        {
            if( target == null || target.Deleted || !(target is IKhaerosMobile) )
                return;

            if( target.ResistanceMods != null )
                target.ResistanceMods.Clear();

            if( ((IKhaerosMobile)target).AuraOfProtection != null )
                ((IKhaerosMobile)target).AuraOfProtection.Stop();

            target.PlaySound( 0x1E9 );
            target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

            ResistanceMod blunt = new ResistanceMod( ResistanceType.Blunt, protection );
            ResistanceMod slash = new ResistanceMod( ResistanceType.Slashing, protection );
            ResistanceMod pierce = new ResistanceMod( ResistanceType.Piercing, protection );
            target.AddResistanceMod( blunt );
            target.AddResistanceMod( slash );
            target.AddResistanceMod( pierce );

            ((IKhaerosMobile)target).AuraOfProtection = new AuraOfProtectionTimer( target, duration );
            ((IKhaerosMobile)target).AuraOfProtection.Start();

            if( target is PlayerMobile && ((PlayerMobile)target).HasGump( typeof( CharInfoGump ) ) )
                ((PlayerMobile)target).SendGump( new CharInfoGump( (PlayerMobile)target ) );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:27,代码来源:AuraOfProtection.cs

示例15: OnTick

            protected override void OnTick()
            {
                if( m_target == null )
                    return;

                if( m_animsleft > 0 )
                {
                    m_animsleft--;
                    m_target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );
                    ( (IKhaerosMobile)m_target ).AuraOfProtection = new AuraOfProtectionTimer( m_target, m_animsleft );
                    ( (IKhaerosMobile)m_target ).AuraOfProtection.Start();
                }

                else
                {
                    if( m_target.ResistanceMods != null )
                        m_target.ResistanceMods.Clear();

                    ResistanceMod blunt = new ResistanceMod( ResistanceType.Blunt, 0 );
                    ResistanceMod slash = new ResistanceMod( ResistanceType.Slashing, 0 );
                    ResistanceMod pierce = new ResistanceMod( ResistanceType.Piercing, 0 );
                    m_target.AddResistanceMod( blunt );
                    m_target.AddResistanceMod( slash );
                    m_target.AddResistanceMod( pierce );

                    if( m_target is PlayerMobile && ( (PlayerMobile)m_target ).HasGump( typeof( CharInfoGump ) ) && ( (PlayerMobile)m_target ).m_CharInfoTimer == null )
                    {
                        ( (PlayerMobile)m_target ).m_CharInfoTimer = new CharInfoGump.CharInfoTimer( ( (PlayerMobile)m_target ) );
                        ( (PlayerMobile)m_target ).m_CharInfoTimer.Start();
                    }

                    if( ( (IKhaerosMobile)m_target ).AuraOfProtection != null )
                    {
                        ( (IKhaerosMobile)m_target ).AuraOfProtection.Stop();
                        ( (IKhaerosMobile)m_target ).AuraOfProtection = null;
                    }
                }
            }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:38,代码来源:AuraOfProtection.cs


注:本文中的Server.ResistanceMod类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。