• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ResistanceMod类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Target

		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
				 * making them more vulnerable to Fire and Poison damage,
				 * but increasing their resistance to Physical and Cold damage.
				 * 
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
				 * 
				 * NOTE: Algorithm above is fixed point, should be:
				 * ((ss-mr)/2.5) + 40
				 * 
				 * NOTE: Resistance is not checked if targeting yourself
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];

				if ( timer != null )
					timer.DoExpire();
				else
					m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
				m.PlaySound( 0x1BB );

				double ss = GetDamageSkill( Caster );
				double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );

				ResistanceMod[] mods = new ResistanceMod[4]
					{
						new ResistanceMod( ResistanceType.Fire, -15 ),
						new ResistanceMod( ResistanceType.Poison, -15 ),
						new ResistanceMod( ResistanceType.Cold, +10 ),
						new ResistanceMod( ResistanceType.Physical, +10 )
					};

				timer = new ExpireTimer( m, mods, duration );
				timer.Start();

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );

				m_Table[m] = timer;

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

				HarmfulSpell( m );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:60,代码来源:CorpseSkin.cs


示例2: OnGaveMeleeAttack

		// TODO: Put this attack shared with Hiryu and Lesser Hiryu in one place
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if( 0.1 > Utility.RandomDouble() )
			{
				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:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:29,代码来源:Swoop.cs


示例3: OnHit

        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.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:m309,项目名称:ForkUO,代码行数:28,代码来源:DefenseMastery.cs


示例4: DoEffect

        public override void DoEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];
       
                int otherMod = 0 + (int)(m.Skills[SkillName.Mysticism].Value / 20);
                int admod = 1 + (int)(m.Skills[SkillName.Focus].Value / 20);
                //int casts = (int)AosAttributes.GetValue(Caster, AosAttribute.CastSpeed - 2);
               

                mods = new ResistanceMod[5]
				{
					new ResistanceMod( ResistanceType.Physical, otherMod + admod  ),
					new ResistanceMod( ResistanceType.Fire,		otherMod + admod  ),
				    new ResistanceMod( ResistanceType.Cold,		otherMod + admod  ),
					new ResistanceMod( ResistanceType.Poison,	otherMod + admod  ),
					new ResistanceMod( ResistanceType.Energy,	otherMod + admod  ),
                   // new ResistanceMod( AosAttribute.CastSpeed, casts )
			       
				};

                m_Table[m] = mods;

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

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                
                m.EndAction(typeof(StoneFormSpell));
                
            }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:32,代码来源:StoneForm.cs


示例5: ExpireTimer

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


示例6: Target

        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                Mobile source = Caster;
                SpellHelper.Turn( source, m );

                SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );

                m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist );

                int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 );
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 );

                m.SendMessage( "Your poison resistance has decreased." );
                ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount );

                m.AddResistanceMod( mod1 );

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

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


示例7: OnCast

        public override void OnCast()
        {
            if (CheckSequence())
            {

                if (contemMagia.ContainsKey(Caster))
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                    return;
                }

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

                //valor da proteção
                int protecao = (int) (Caster.Skills[DamageSkill].Value / 5.0) + Utility.Random(2);

                ResistanceMod[] resistencias = new ResistanceMod[5];

                resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao);
                resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao);
                resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao);
                resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao);
                resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao);

                Caster.AddResistanceMod(resistencias[0]);
                Caster.AddResistanceMod(resistencias[1]);
                Caster.AddResistanceMod(resistencias[2]);
                Caster.AddResistanceMod(resistencias[3]);
                Caster.AddResistanceMod(resistencias[4]);

                //marca que ele contem a magia
                contemMagia.Add(Caster, Caster);

                string args = String.Format("{0}", protecao);

                //adiciona o buff de armadura arcana
                BuffInfo armaduraArcana = new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString());
                BuffInfo.AddBuff(Caster, armaduraArcana);

                //calculo da duracao
                int intDuracao = (int) (Caster.Skills[CastSkill].Value / 10) + Utility.Random(2);
                TimeSpan duracao = TimeSpan.FromMinutes(intDuracao);

                //Tempo para remover
                Timer remover = new InternalTimer(Caster, resistencias, armaduraArcana, duracao);
                remover.Start();
            }
            FinishSequence();
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:50,代码来源:ArmaduraArcanaSpell.cs


示例8: 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:greeduomacro,项目名称:last-wish,代码行数:22,代码来源:LadyJennifyr.cs


示例9: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                var pm = from as PlayerMobile;

                if (m_Tasty.Deleted)
                    return;

                if (targeted is BaseCreature)
                {
                    var creature = (BaseCreature) targeted;

                    if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) &&
                        !(creature.Asleep))
                    {
                        creature.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                        creature.PlaySound(0x1EA);

                        var mod = new ResistanceMod(ResistanceType.Physical, +15);
                        var mod1 = new ResistanceMod(ResistanceType.Fire, +10);
                        var mod2 = new ResistanceMod(ResistanceType.Cold, +10);
                        var mod3 = new ResistanceMod(ResistanceType.Poison, +10);
                        var mod4 = new ResistanceMod(ResistanceType.Energy, +10);
                        creature.AddResistanceMod(mod);
                        creature.AddResistanceMod(mod1);
                        creature.AddResistanceMod(mod2);
                        creature.AddResistanceMod(mod3);
                        creature.AddResistanceMod(mod4);

                        from.SendMessage("You have increased the Damage Absorption of your pet by 10% for 10 Minutes !!");
                        m_Tasty.Used = true;
                        creature.Asleep = true;

                        Timer.DelayCall(TimeSpan.FromMinutes(10.0), delegate
                        {
                            var mod5 = new ResistanceMod(ResistanceType.Physical, -15);
                            var mod6 = new ResistanceMod(ResistanceType.Fire, -10);
                            var mod7 = new ResistanceMod(ResistanceType.Cold, -10);
                            var mod8 = new ResistanceMod(ResistanceType.Poison, -10);
                            var mod9 = new ResistanceMod(ResistanceType.Energy, -10);
                            creature.AddResistanceMod(mod5);
                            creature.AddResistanceMod(mod6);
                            creature.AddResistanceMod(mod7);
                            creature.AddResistanceMod(mod8);
                            creature.AddResistanceMod(mod9);
                            creature.PlaySound(0x1EB);

                            this.m_Tasty.Used = true;
                            creature.Asleep = false;
                            from.SendMessage("The effect of Vial of Armor Essence is finish !");

                            Timer.DelayCall(TimeSpan.FromMinutes(120.0), delegate { this.m_Tasty.Used = false; });
                        });
                    }
                    else if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) &&
                             (creature.Asleep))
                    {
                        from.SendMessage("Pet already under the influence of Vial of Armor Essence !");
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113049);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500329);
                }
            }
开发者ID:rokann,项目名称:JustUO,代码行数:68,代码来源:VialofArmorEssence.cs


示例10: DefenseMasteryInfo

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


示例11: MustardBomb

		public static void MustardBomb( Mobile from, Mobile to )
		{
			if ( !Ability.CanUse( to, from, true ) )
				return;

			Point3D point = to.Location;

			for( int i = -3; i < 4; i++ )
			{
				for( int j = -3; j < 4; j++ )
				{
					point = new Point3D( to.X + i, to.Y + j, to.Z );

					if ( BlueSpell.GetDist( point, to.Location ) < 3.1 )
						Effects.SendLocationEffect( point,to.Map, 0x3728, 13, 1283/*Hue*/, 4 );
				}
			}

			ResistanceMod[] mods = new ResistanceMod[]{ new ResistanceMod( ResistanceType.Fire, -300 ), 
					new ResistanceMod( ResistanceType.Cold, -300 ) };

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

			TimedResistanceMod.AddMod( 
				to, 
				"Mustard Bomb", 
				mods, 
				TimeSpan.FromSeconds( 60 )
			);

			to.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds( 60 ) ) );

			to.SendMessage( "The intense heat scalds your elemental resistance." );
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:35,代码来源:Quina.cs


示例12: Target

        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) ) {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            if ( sobreEfeito( m ) ){
                Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia Proteção Frio." );
            }
            else if ( CheckBSequence( m, false ) ) {
                SpellHelper.Turn( Caster, m );

                //proteção
                double valorSkill = Caster.Skills[DamageSkill].Value;

                int bonus = (int)(valorSkill / 10);
                int protecao = Utility.RandomMinMax(Math.Max(1, bonus - 3), bonus + Utility.Random(5));

                //duracao
                TimeSpan duracao = TimeSpan.FromMinutes(Caster.Skills[CastSkill].Value / 10 + Utility.Random(2));

                //adicona a resistencia
                ResistanceMod[] resistencias = new ResistanceMod[1];

                resistencias[0] = new ResistanceMod(ResistanceType.Cold, protecao);

                foreach (ResistanceMod resis in resistencias) {
                    Caster.AddResistanceMod(resis);
                }

                //efeito
                m.PlaySound( 0x202 );
                m.FixedParticles( 0x373A, 10, 15, 5012, 0x450, 3, EffectLayer.Waist );
                m.SendMessage( "Você esta sobre o efeito da magia Proteção Frio" );

                adicionarEfeito(m);

                Timer t = new InternalTimer(m, resistencias, duracao);
                t.Start();
            }

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


示例13: InternalTimer

            public InternalTimer(Mobile m, ResistanceMod[] resistencias, TimeSpan delay )
                : base(delay)
            {
                alvo = m;
                this.resistencias = resistencias;

                bf = new BuffInfo( BuffIcon.Bless, 1075843, new TextDefinition("Proteção Frio"));
                BuffInfo.AddBuff( m,  bf);
            }
开发者ID:evildude807,项目名称:kaltar,代码行数:9,代码来源:ProtecaoFrioSpell.cs


示例14: OnGaveMeleeAttack

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

            if (!this.IsFanned(defender) && 0.05 > Utility.RandomDouble())
            {
                /* Fanning Fire
                * Graphic: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x3709" ItemIdName: "fire column" FromLocation: "(994 325, 16)" ToLocation: "(994 325, 16)" Speed: "10" Duration: "30" FixedDirection: "True" Explode: "False" Hue: "0x0" RenderMode: "0x0" Effect: "0x34" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x57D4F5B" Layer: "5" Unknown: "0x0"
                * Sound: 0x208
                * Start cliloc: 1070833
                * Effect: Fire res -10% for 10 seconds
                * Damage: 35-45, 100% fire
                * End cliloc: 1070834
                * Effect does not stack
                */
                defender.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks.

                int effect = -(defender.FireResistance / 10);

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

                defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot);
                defender.PlaySound(0x208);

                // This should be done in place of the normal attack damage.
                //AOS.Damage( defender, this, Utility.RandomMinMax( 35, 45 ), 0, 100, 0, 0, 0 );

                defender.AddResistanceMod(mod);
		
                ExpireTimer timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:34,代码来源:FanDancer.cs


示例15: ExpireTimer

 public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay)
     : base(delay)
 {
     this.m_Mobile = m;
     this.m_Mod = mod;
     this.Priority = TimerPriority.TwoFiftyMS;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Hiryu.cs


示例16: OnGaveMeleeAttack

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

            if (0.1 > Utility.RandomDouble())
            {
                /* Flurry of Twigs
                * Start cliloc: 1070850
                * Effect: Physical resistance -15% for 5 seconds
                * End cliloc: 1070852
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070851); // The creature lands another blow in your weakened state.
                }
                else
                    defender.SendLocalizedMessage(1070850); // The creature's flurry of twigs 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, m_FlurryOfTwigsTable, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_FlurryOfTwigsTable[defender] = timer;
            }
            else if (0.05 > Utility.RandomDouble())
            {
                /* Chlorophyl Blast
                * Start cliloc: 1070827
                * Effect: Energy resistance -50% for 10 seconds
                * End cliloc: 1070829
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070828); // The creature continues to hinder your energy resistance!
                }
                else
                    defender.SendLocalizedMessage(1070827); // The creature's attack has made you more susceptible to energy attacks!

                int effect = -(defender.EnergyResistance / 2);

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

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

                timer = new ExpireTimer(defender, mod, m_ChlorophylBlastTable, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_ChlorophylBlastTable[defender] = timer;
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:63,代码来源:KazeKemono.cs


示例17: OnCast

        public override void OnCast()
        {
            /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
             * 15 + (Inscription/20) Physcial bonus
             * -5 Elemental
             * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
             * (+20 physical -5 elemental at 100 Inscription)
             */

            if ( CheckSequence() )
            {
                Mobile targ = Caster;

                ResistanceMod[] mods = (ResistanceMod[]) m_Table[targ];

                if ( mods == null )
                {
                    targ.PlaySound( 0x1E9 );
                    targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );

                    int physmod = 15 + (int) ( targ.Skills[SkillName.Inscribe].Value / 20 );

                    mods = new ResistanceMod[5]
                        {
                            new ResistanceMod( ResistanceType.Physical, physmod ),
                            new ResistanceMod( ResistanceType.Fire, -5 ),
                            new ResistanceMod( ResistanceType.Cold, -5 ),
                            new ResistanceMod( ResistanceType.Poison, -5 ),
                            new ResistanceMod( ResistanceType.Energy, -5 )
                        };

                    string buffFormat = String.Format( "{0}\t{1}\t{1}\t{1}\t{1}", physmod, 5 );

                    BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.ReactiveArmor, 1075812, buffFormat, true ) );

                    m_Table[targ] = mods;

                    for ( int i = 0; i < mods.Length; ++i )
                        targ.AddResistanceMod( mods[i] );
                }
                else
                {
                    targ.PlaySound( 0x1ED );
                    targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );

                    BuffInfo.RemoveBuff( targ, BuffIcon.ReactiveArmor );

                    m_Table.Remove( targ );

                    for ( int i = 0; i < mods.Length; ++i )
                        targ.RemoveResistanceMod( mods[i] );
                }
            }

            FinishSequence();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:57,代码来源:ReactiveArmor.cs


示例18: OnCast

		public override void OnCast()
		{
			if ( Core.AOS )
			{
				/* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
				 * Physical decrease = 25 - (Inscription/20).
				 * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
				 * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
				 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. 
				 */

				if ( CheckSequence() )
				{
					Mobile targ = Caster;

					ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];

					if ( mods == null )
					{
						targ.PlaySound( 0x1E9 );
						targ.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );

						int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
						int otherMod = 10;

						mods = new ResistanceMod[5]
							{
								new ResistanceMod( ResistanceType.Physical, physiMod ),
								new ResistanceMod( ResistanceType.Fire,		otherMod ),
								new ResistanceMod( ResistanceType.Cold,		otherMod ),
								new ResistanceMod( ResistanceType.Poison,	otherMod ),
								new ResistanceMod( ResistanceType.Energy,	otherMod )
							};

						m_Table[targ] = mods;

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

						string buffFormat = String.Format( "{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod );

						BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.MagicReflection, 1075817, buffFormat, true ) );
					}
					else
					{
						targ.PlaySound( 0x1ED );
						targ.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );

						m_Table.Remove( targ );

						for ( int i = 0; i < mods.Length; ++i )
							targ.RemoveResistanceMod( mods[i] );

						BuffInfo.RemoveBuff( targ, BuffIcon.MagicReflection );
					}
				}

				FinishSequence();
			}
			else
			{
				if ( Caster.MagicDamageAbsorb > 0 )
				{
					Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
				}
				else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
				{
					Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
				}
				else if ( CheckSequence() )
				{
					if ( Caster.BeginAction( typeof( DefensiveSpell ) ) )
					{
						int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value);
						value = (int)(8 + (value/200)*7.0);//absorb from 8 to 15 "circles"

						Caster.MagicDamageAbsorb = value;

						Caster.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );
						Caster.PlaySound( 0x1E9 );
					}
					else
					{
						Caster.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
					}
				}

				FinishSequence();
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:90,代码来源:MagicReflect.cs


示例19: OnCast

        public override void OnCast()
        {
            if ( Core.AOS )
            {
                if ( CheckSequence() )
                {
                    Mobile targ = Caster;

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];

                    if ( mods == null )
                    {
                        targ.PlaySound( 0x1E9 );
                        targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );

                        mods = new ResistanceMod[5]
                            {
                                new ResistanceMod( ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20) ),
                                new ResistanceMod( ResistanceType.Fire, -5 ),
                                new ResistanceMod( ResistanceType.Cold, -5 ),
                                new ResistanceMod( ResistanceType.Poison, -5 ),
                                new ResistanceMod( ResistanceType.Energy, -5 )
                            };

                        m_Table[targ] = mods;

                        for ( int i = 0; i < mods.Length; ++i )
                            targ.AddResistanceMod( mods[i] );
                    }
                    else
                    {
                        targ.PlaySound( 0x1ED );
                        targ.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );

                        m_Table.Remove( targ );

                        for ( int i = 0; i < mods.Length; ++i )
                            targ.RemoveResistanceMod( mods[i] );
                    }
                }

                FinishSequence();
            }
            else
            {
                if ( Caster.MeleeDamageAbsorb > 0 )
                {
                    Caster.SendAsciiMessage( "This spell is already in effect." );
                }
                else if ( !Caster.CanBeginAction( typeof( DefensiveSpell ) ) )
                {
                    Caster.SendAsciiMessage( "The spell will not adhere to you at this time." );
                }
                else if ( CheckSequence() )
                {
                    if ( Caster.BeginAction( typeof( DefensiveSpell ) ) )
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value /= 3;

                        if ( value < 0 )
                            value = 1;
                        else if ( value > 75 )
                            value = 75;

                        Caster.MeleeDamageAbsorb = value;

                        Caster.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );
                        Caster.PlaySound( 0x1F2 );
                    }
                    else
                    {
                        Caster.SendAsciiMessage( "The spell will not adhere to you at this time." );
                    }
                }

                FinishSequence();
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:79,代码来源:ReactiveArmor.cs


示例20: AddMods

		public bool AddMods()
		{
			if ( Owner == null )
				return false;

			BonusNumber++;

			if ( BonusNumber > 5 )
				return false;

			// @100.0 Forensics bonus's value is 10.
			double bonus = (BlueSpell.ScaleBySkill( Owner, SkillName.Forensics ) / 2.0);
			StatMod stat = null;
			DefaultSkillMod skill = null;
			ResistanceMod resist = null;
			int intdiff = 0;
			double doublediff = 0.0;

			// Str (+10 @ GM)
			intdiff = (int)( m_StrCap - (Owner.RawStr + bonus) );

			if ( intdiff > 0 )
			{
				stat = new StatMod( StatType.Str, ("DragonForceStr" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) );
				Owner.AddStatMod( stat );
				StatMods.Add( stat );
			}

			// Dex (+10 @ GM)
			intdiff = (int)( m_DexCap - (Owner.RawDex + bonus) );

			if ( intdiff > 0 )
			{
				stat = new StatMod( StatType.Dex, ("DragonForceDex" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) );
				Owner.AddStatMod( stat );
				StatMods.Add( stat );
			}

			// Tactics (+5.0 @ GM)
			doublediff = m_TacticsCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

			if ( doublediff > 0.0 )
			{
				skill = new DefaultSkillMod( SkillName.Tactics, true, (bonus / 2) );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			// Wrestling (+5.0 @ GM)
			doublediff = m_WrestlingCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

			if ( doublediff > 0.0 )
			{
				skill = new DefaultSkillMod( SkillName.Wrestling, true, bonus );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			// Lose all Magic Resist in preparation of negative resistances.
			if ( Owner.Skills[SkillName.MagicResist].Value > 0 )
			{
				skill = new DefaultSkillMod( SkillName.MagicResist, true, -Owner.Skills[SkillName.MagicResist].Value );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			if ( !Status.Enabled )
			{
				// Lower Magery (-30 @ GM)
				if ( Owner.Skills[SkillName.Magery].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Magery, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Necromancy (-30 @ GM)
				if ( Owner.Skills[SkillName.Necromancy].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Necromancy, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Chivalry (-30 @ GM)
				if ( Owner.Skills[SkillName.Chivalry].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Chivalry, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Bushido (-30 @ GM)
				if ( Owner.Skills[SkillName.Bushido].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Bushido, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:101,代码来源:DragonForce.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ResistanceType类代码示例发布时间:2022-05-24
下一篇:
C# ResidualStopCriterium类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap