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


C# Mobile.GetStatMod方法代码示例

本文整理汇总了C#中Mobile.GetStatMod方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.GetStatMod方法的具体用法?C# Mobile.GetStatMod怎么用?C# Mobile.GetStatMod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile的用法示例。


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

示例1: Eat

        }// A tasty bite of the enchanted apple lifts all curses from your soul.
        public override bool Eat(Mobile from)
        {
            if (base.Eat(from))
            {
                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = from.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Str Offset");

                mod = from.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Dex Offset");

                mod = from.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Int Offset");

                from.Paralyzed = false;
                from.Asleep = false;

                EvilOmenSpell.TryEndEffect(from);
                StrangleSpell.RemoveCurse(from);
                CorpseSkinSpell.RemoveCurse(from);
                CurseSpell.RemoveEffect(from);

                BuffInfo.RemoveBuff(from, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(from, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);	
				
                return true;
            }
			
            return false;
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:45,代码来源:EnchantedApple.cs

示例2: Target

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

                m.PlaySound( 0xF6 );
                m.PlaySound( 0x1F7 );
                m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

                IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map );
                IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map );
                Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

                StatMod mod;

                mod = m.GetStatMod( "[Magic] Str Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Str Offset" );

                mod = m.GetStatMod( "[Magic] Dex Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Dex Offset" );

                mod = m.GetStatMod( "[Magic] Int Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Int Offset" );

                m.Paralyzed = false;
                m.CurePoison( Caster );

                EvilOmenSpell.CheckEffect( m );
                StrangleSpell.RemoveCurse( m );
                CorpseSkinSpell.RemoveCurse( m );
            }

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

示例3: OnTarget

		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				if ( target.GetStatMod( "MindBlast" ) == null )
				{
					int offset = (int)(target.Skills[SkillName.Magery].Value / 2);
					offset += (int)(target.Skills[SkillName.Necromancy].Value / 2);
					offset += (int)(target.Skills[SkillName.EvalInt].Value / 4);
					offset += (int)(target.Skills[SkillName.SpiritSpeak].Value / 4);

					if ( target is PlayerMobile )
						offset /= 2;

					offset -= ((int)ScaleBySkill( target, SkillName.MagicResist )) -5;

					if ( offset < 15 )
						offset = 15;

					int duration = (int)(Caster.Skills[CastSkill].Value * 2);

					target.AddStatMod( new StatMod( StatType.Int, "MindBlast", -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Meditation, true, -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Focus, true, -offset, TimeSpan.FromSeconds( duration ) ) );

					target.SendMessage("Your mind has been blown!");

					SpellHelper.Damage( this, target, offset * 2, 0, 0, 100, 0, 0 );
				}

				target.FixedParticles( 0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head );
				target.PlaySound( 0x213 );
				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:37,代码来源:MindBlast.cs

示例4: DoRemoveCurses

        public static void DoRemoveCurses( Mobile m )
        {
            StatMod mod;

            mod = m.GetStatMod( "[Magic] Str Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Str Malus" );

            mod = m.GetStatMod( "[Magic] Dex Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Dex Malus" );

            mod = m.GetStatMod( "[Magic] Int Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Int Malus" );

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect( m );
            StrangleSpell.RemoveCurse( m );
            CorpseSkinSpell.RemoveCurse( m );
            CurseSpell.RemoveEffect( m );
            MortalStrike.EndWound( m );
            BloodOathSpell.EndEffect( m );
            SpellPlagueSpell.RemoveEffect( m );

            BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
            BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
            BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
            BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
            BuffInfo.RemoveBuff( m, BuffIcon.Curse );
            BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
            BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );

            // TODO: Should this remove blood oath? Pain spike?
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:36,代码来源:RemoveCurse.cs

示例5: GetStatMod

		public int GetStatMod(Mobile mob, StatType type)
		{
			StatMod mod = mob.GetStatMod(String.Format("[Magic] {0} Offset", type));

			if (mod == null)
			{
				return 0;
			}

			return mod.Offset;
		}
开发者ID:zerodowned,项目名称:justuo-with-ec-support,代码行数:11,代码来源:GuardAI.cs

示例6: GetStatMod

		public int GetStatMod(Mobile mob, StatType type)
		{
			int offset = 0;
			StatMod buff = mob.GetStatMod(String.Format("[Magic] {0} Buff", type));
			StatMod curse = mob.GetStatMod(String.Format("[Magic] {0} Curse", type));

			if (buff != null)
				offset += buff.Offset;
			if (curse != null)
				offset += buff.Offset;

			return offset;
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:GuardAI.cs

示例7: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
            }
            else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
            {
                from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.
            }
            else
            {
                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));

                this.Consume();
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:18,代码来源:RoseOfTrinsic.cs

示例8: OnHit

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

			if ( (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
			{
				StatMod mod = defender.GetStatMod( "Concussion" );

				if ( mod == null )
				{
					defender.SendMessage( "You receive a concussion blow!" );
					defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( 30.0 ) ) );

					attacker.SendMessage( "You deliver a concussion blow!" );
					attacker.PlaySound( 0x11C );
				}
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:18,代码来源:BasePoleArm.cs

示例9: AddStatBonus

        public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
        {
            int offset = bonus;
            string name = String.Format( "[Magic] {0} Offset", type );

            StatMod mod = target.GetStatMod( name );

            //one is negative and the other is positive, so adding up
            if( mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)) )
            {
                target.RemoveStatMod( name );
                target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
                return true;
            }
            //nothing to replace, just adding
            else if( mod == null )
            {
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }
            //replacing the current mod with a larger one
            else if( mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)) )
            {
                target.RemoveStatMod( name );
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }

            return false;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:30,代码来源:SpellHelper.cs

示例10: OnHit

        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus )
        {
            PlayHurtAnimation( defender );

            attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
            defender.PlaySound( GetHitDefendSound( attacker, defender ) );

            int damage = ComputeDamage( attacker, defender );

            if (Effect != WeaponEffect.None && Charges > 0)
            {
                #region Magic Weapon Effects
                if (Effect == WeaponEffect.Clumsy)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Dex);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < -10)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                    defender.PlaySound(0x1DF);
                }
                else if (Effect == WeaponEffect.Feeblemind)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Int, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                    defender.PlaySound(0x1E4);
                }
                else if (Effect == WeaponEffect.MagicArrow)
                {
                    DoMagicArrow(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
                    attacker.PlaySound(0x1E5);*/
                }
                else if (Effect == WeaponEffect.Weakness)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Str);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Str, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                    defender.PlaySound(0x1E6);
                }
                else if (Effect == WeaponEffect.Harm)
                {
                    DoHarm(attacker, defender);
                    Charges--;
                    /*defender.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
                    defender.PlaySound(0x1F1);*/
                }
                else if (Effect == WeaponEffect.Paralyze)
                {
                    defender.Paralyze(TimeSpan.FromSeconds(7));
                    Charges--;
                    defender.PlaySound(0x204);
                    defender.FixedEffect(0x376A, 6, 1);
                }
                else if (Effect == WeaponEffect.Fireball)
                {
                    DoFireball(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    attacker.PlaySound(0x15E);*/
                }
                else if (Effect == WeaponEffect.Curse)
                {
                    string nameS = String.Format("[Magic] {0} Offset", StatType.Str);
                    string nameD = String.Format("[Magic] {0} Offset", StatType.Dex);
                    string nameI = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod strmod = defender.GetStatMod(nameS);
                    StatMod dexmod = defender.GetStatMod(nameD);
                    StatMod intmod = defender.GetStatMod(nameI);

                    if (strmod != null && strmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, strmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (strmod == null || strmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, -10, TimeSpan.FromSeconds(60.0)));

                    if (dexmod != null && dexmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, dexmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (dexmod == null || dexmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, -10, TimeSpan.FromSeconds(60.0)));
//.........这里部分代码省略.........
开发者ID:Godkong,项目名称:RunUO,代码行数:101,代码来源:BaseWeapon.cs

示例11: AddStatCurse

        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            int offset = curse;
            string name = String.Format("[Magic] {0} Curse", type);

            StatMod mod = target.GetStatMod(name);
			if (mod != null)
				offset = Math.Max(mod.Offset, offset);
			offset *= -1;

            target.AddStatMod(new StatMod(type, name, offset, duration));
			Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
			return true;
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:14,代码来源:SpellHelper.cs

示例12: HasStatEffect

        public static bool HasStatEffect(Mobile target, StatType type)
        {
            if (type == StatType.All)
            {
                return HasStatEffect(target, StatType.Dex) && HasStatEffect(target, StatType.Int) && HasStatEffect(target, StatType.Str);
            }
            else
            {
                StatMod mod = target.GetStatMod(String.Format("[Magic] {0} Offset", type));

                return mod != null;
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:13,代码来源:SpellHelper.cs

示例13: FixMobile

		private void FixMobile(Mobile m)
		{
			if (!m.Alive)
				m.Resurrect();

			HandleCorpse(m);

			m.Aggressed.Clear();
			m.Aggressors.Clear();
			m.Hits = m.HitsMax;
			m.Stam = m.StamMax;
			m.Mana = m.ManaMax;
			m.DamageEntries.Clear();
			m.Combatant = null;
			m.InvalidateProperties();

            m.Criminal = false;

			StatMod mod;

			mod = m.GetStatMod("[Magic] Str Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Str Offset");

			mod = m.GetStatMod("[Magic] Dex Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Dex Offset");

			mod = m.GetStatMod("[Magic] Int Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Int Offset");

			m.Paralyzed = false;
			m.CurePoison(m);

			// EvilOmenSpell.CheckEffect(m);
			StrangleSpell.RemoveCurse(m);
			CorpseSkinSpell.RemoveCurse(m);

			#region Buff Icons
			if (m is PlayerMobile)
			{
				PlayerMobile pm = (PlayerMobile)m;
				pm.RemoveBuff(BuffIcon.Clumsy);
				pm.RemoveBuff(BuffIcon.CorpseSkin);
				pm.RemoveBuff(BuffIcon.EvilOmen);
				pm.RemoveBuff(BuffIcon.Curse);
				pm.RemoveBuff(BuffIcon.FeebleMind);
				pm.RemoveBuff(BuffIcon.MassCurse);
				pm.RemoveBuff(BuffIcon.Paralyze);
				pm.RemoveBuff(BuffIcon.Poison);
				pm.RemoveBuff(BuffIcon.Strangle);
				pm.RemoveBuff(BuffIcon.Weaken);
			}
			#endregion

			m.SendMessage("The duel has ended.");
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:58,代码来源:Duel.cs

示例14: Target

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

				/* Attempts to remove all Curse effects from Target.
				 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
				 * as well as all Necromancer curses.
				 * Chance of removing curse is affected by Caster's Karma.
				 */

				int chance = 0;

				if ( Caster.Karma < -5000 )
					chance = 0;
				else if ( Caster.Karma < 0 )
					chance = (int) Math.Sqrt( 20000 + Caster.Karma ) - 122;
				else if ( Caster.Karma < 5625 )
					chance = (int) Math.Sqrt( Caster.Karma ) + 25;
				else
					chance = 100;

				if ( chance > Utility.Random( 100 ) )
				{
					m.PlaySound( 0xF6 );
					m.PlaySound( 0x1F7 );
					m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

					IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map );
					IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map );
					Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

					StatMod mod;

					mod = m.GetStatMod( "[Magic] Str Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Str Offset" );

					mod = m.GetStatMod( "[Magic] Dex Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Dex Offset" );

					mod = m.GetStatMod( "[Magic] Int Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Int Offset" );

					m.Paralyzed = false;

					EvilOmenSpell.TryEndEffect( m );
					StrangleSpell.RemoveCurse( m );
					CorpseSkinSpell.RemoveCurse( m );
					CurseSpell.RemoveEffect( m );
					MortalStrike.EndWound( m );
					if (Core.ML) { BloodOathSpell.RemoveCurse ( m ); }
					MindRotSpell.ClearMindRotScalar ( m );

					BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
					BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
					BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
					BuffInfo.RemoveBuff ( m, BuffIcon.Curse );
					BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
					BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
					BuffInfo.RemoveBuff ( m, BuffIcon.Mindrot );

					// TODO: Should this remove blood oath? Pain spike?
				}
				else
				{
					m.PlaySound( 0x1DF );
				}
			}

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

示例15: OnHit

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

            if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && this.Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendMessage("You receive a concussion blow!");
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendMessage("You deliver a concussion blow!");
                    attacker.PlaySound(0x308);
                }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:18,代码来源:BaseAxe.cs


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