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


C# Mobile.PlaySound方法代码示例

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


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

示例1: OnHit

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

            ClearCurrentAbility( attacker );

            defender.PlaySound( 0x213 );

            attacker.SendLocalizedMessage( 1074383 ); // Your shot sends forth a wave of psychic energy.
            defender.SendLocalizedMessage( 1074384 ); // Your mind is attacked by psychic force!

            int extraDamage = 10 * (int) ( attacker.Int / defender.Int );

            if ( extraDamage < 10 )
                extraDamage = 10;
            if ( extraDamage > 20 )
                extraDamage = 20;

            AOS.Damage( defender, attacker, extraDamage, 100, 0, 0, 0, 0 ); // 100% Physical Damage

            if ( m_EffectTable.ContainsKey( defender ) )
                m_EffectTable[defender].Stop();

            m_EffectTable[defender] = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( Expire_Callback ), defender );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:26,代码来源:PsychicAttack.cs

示例2: PlayCraftEffect

 public override void PlayCraftEffect(Mobile from)
 {
     from.PlaySound(0x2B); // bellows
     //if ( from.Body.Type == BodyType.Human && !from.Mounted )
     //	from.Animate( 9, 5, 1, true, false, 0 );
     //new InternalTimer( from ).Start();
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:DefGlassblowing.cs

示例3: Target

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

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

                SpellHelper.AddStatCurse(this.Caster, m, StatType.Dex);

                if (m.Spell != null)
                    m.Spell.OnCasterHurt();

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);

                int percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
                TimeSpan length = SpellHelper.GetDuration(this.Caster, m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));

                this.HarmfulSpell(m);
            }

            this.FinishSequence();
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:32,代码来源:Clumsy.cs

示例4: 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

示例5: OnDamage

		public override void OnDamage( int amount, Mobile attacker, bool willKill )
		{
			if ( attacker != null && !willKill && amount > 5 && 50 > Utility.Random( 100 ) )
			{
				if ( this.Hits < (this.HitsMax/3) && this.Sacked )
				{
					attacker.SendMessage("The elemental's body bursts open!");
					AcidPool acid = new AcidPool(attacker);
					acid.Map = attacker.Map;
					acid.Location = attacker.Location;
					attacker.PlaySound( 0x25 );
				}
				else if ( !this.Sacked )
				{
					attacker.SendMessage("Acid spills from the damaged elemental!");
					AcidPool acid = new AcidPool(attacker);
					acid.Map = attacker.Map;
					acid.Location = attacker.Location;
					attacker.PlaySound( 0x25 );
				}
				BurnTimer = new m_Timer( attacker );
				BurnTimer.Start();
			}

			base.OnDamage( amount, attacker, willKill );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:26,代码来源:AcidElemental.cs

示例6: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446); // That is too far away. 
            }
            else
            {
                if (from.Mounted == true)
                {
                    from.SendLocalizedMessage(1042561);
                }
                else
                {
                    if (from.BodyValue == 0x190 || from.BodyValue == 0x191 || from.BodyValue == 0x25D || from.BodyValue == 0x25E)
                    {
                        from.BodyMod = 173; //wolf spider
                        from.HueMod = 1265;

                        from.PlaySound(535);
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 1, 29, 0x47D, 2, 9962, 0);
                        Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z), from.Map, EffectItem.DefaultDuration), 0x37C4, 1, 29, 0x47D, 2, 9502, 0);
                    }
                    else
                    {
                        from.BodyMod = 0x0;
                        from.HueMod = 1265;//make grey.

                        from.PlaySound(586);
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 1, 29, 0x47D, 2, 9962, 0);
                        Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z), from.Map, EffectItem.DefaultDuration), 0x37C4, 1, 29, 0x47D, 2, 9502, 0);
                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:annox,代码行数:35,代码来源:WolfSpiderShiftTalisman.cs

示例7: OnTarget

            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Item)
                {
                    Item item = (Item)target;

                    if (item.IsChildOf(from.Backpack))
                    {
                        if (m_Deed != null && !m_Deed.Deleted)
                        {
                            item.Name = from.Name + "'s " + ((item.Name == null || item.Name == string.Empty || item.Name == "") ? item.ItemData.Name : item.Name);
                            from.SendMessage("You have engraved your name into the item.");
                            Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 1, 29, 0x47D, 2, 9962, 0);
                            Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z - 7), from.Map, EffectItem.DefaultDuration), 0x37C4, 1, 29, 0x47D, 2, 9502, 0);
                            from.PlaySound(0x212);
                            from.PlaySound(0x206);
                            m_Deed.Delete();
                        }
                    }
                    else
                        from.SendLocalizedMessage(1061005); // The item must be in your backpack to enhance it.

                }
                else
                   from.SendMessage("That is not an item.");
            }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:26,代码来源:PersonalisationDeed.cs

示例8: Target

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

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

                double damage = GetDamage( m );

                if ( Core.AOS )
                {
                    m.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
                    m.PlaySound( 0x0FC );
                }
                else
                {
                    m.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
                    m.PlaySound( 0x1F1 );
                }

                SpellHelper.Damage( this, m, damage, 0, 0, 100, 0, 0 );
            }

            FinishSequence();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:30,代码来源:Harm.cs

示例9: OnTarget

        public void OnTarget(Mobile from, object obj)
        {
            if (!from.InRange(GetWorldLocation(), 5) || !from.InLOS(this))
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            else if (obj is Corpse)
            {
                Corpse c = obj as Corpse;

                if (c.Carved)
                    return;

                if (c.Owner is PlayerMobile)
                {
                    ((ICarvable)obj).Carve(from, this);
                    c.PublicOverheadMessage(MessageType.Emote, 33, true, string.Format("*You see {0} steal the soul of {1}*", from.Name, c.Owner.Name));
                    from.PlaySound(0x19c);
                    from.PlaySound(20);
                    from.PlaySound(230);
                    Effects.SendLocationEffect(c.Location, c.Map, 0x37c4, 18, 15, 1);
                }
                else
                    ((ICarvable) obj).Carve(from, this);
            }
            else
                from.SendAsciiMessage("You cannot use this on that");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:DaemonClaws.cs

示例10: OnDoubleClick

      public override void OnDoubleClick( Mobile from ) 
      { 
      
      if ( Parent != from ) 
      if (from.AccessLevel < AccessLevel.GameMaster) 
          from.SendMessage( "When you touch, it vanishes without trace..." ); 
      if (from.AccessLevel < AccessLevel.GameMaster) 
         this.Consume() ; 
      if (from.AccessLevel < AccessLevel.GameMaster)    
         return ; 
      { 
                      
          if ( !from.Hidden == true ) 
            { 
           from.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head ); 
           from.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 ); 
         from.PlaySound( 0x22F ); 
          from.Hidden = true; 
            
            } 
            else 
            { 
           from.Hidden=false; 
           from.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head ); 
           from.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 ); 
         from.PlaySound( 0x22F ); 

                      
            } 
      } 

      
      } 
开发者ID:greeduomacro,项目名称:GoUO,代码行数:33,代码来源:Poisonhide.cs

示例11: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !( IsChildOf( from.Backpack ) ) ) from.SendMessage( "That has to be in your pack to be able to use it" );
            else if ( from.Mounted ) from.SendMessage( "You can not use this while riding" );
            else if ( bodyadjust != from.BodyMod && from.BodyMod != 0 ) from.SendMessage( "You can not use this while all ready morphed" );
            else
            {
                if ( bodyadjust == 0 && (from.BodyValue == 0x190 || from.BodyValue == 0x191 || from.BodyValue == 605 || from.BodyValue == 606 ))
                {
                    from.BodyMod = 157;
                    bodyadjust = from.BodyMod;
                    from.PlaySound( 1105 );
                  	Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                  	Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );

                }
                else if(bodyadjust == from.BodyMod)
                {
                    from.BodyMod = 0;
                    bodyadjust = from.BodyMod;
                    from.PlaySound( 1105 );
                    Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );

                    this.Delete();
                }
                else bodyadjust = 0;
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:29,代码来源:Giant+Black+Widow+Costume+Gem.cs

示例12: OnBeforeDamage

        public override bool OnBeforeDamage(Mobile attacker, Mobile defender)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
                return false;

            ClearCurrentAbility(attacker);

            attacker.SendMessage("You become one with you weapon, allowing it to guide you hand. The effects of this attack are unpredictable, but effective.");
            defender.SendMessage("Your enemy becomes one with their weapon and the effects of his attack are unpredictable");

            attacker.PlaySound(0x20C);
            attacker.PlaySound(0x56);
            attacker.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);

            IEntity from = new Entity(Serial.Zero, new Point3D(attacker.X, attacker.Y, attacker.Z), attacker.Map);
            IEntity to = new Entity(Serial.Zero, new Point3D(attacker.X, attacker.Y, attacker.Z + 50), attacker.Map);
            Effects.SendMovingParticles(from, to, 0xF5F, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

            int damage = 10; 

            damage += Math.Min(5, (int)(Math.Abs(attacker.Skills[SkillName.Anatomy].Value + attacker.Skills[SkillName.ArmsLore].Value) / 8));

            defender.Damage(damage, attacker);

            return true;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:26,代码来源:Bladeweave.cs

示例13: OnDoubleClick

      public override void OnDoubleClick( Mobile from ) 
      	{ 
         	if ( !from.InRange( GetWorldLocation(), 2 ) ) 
        	{ 
            		from.SendLocalizedMessage( 500446 ); // That is too far away. 
         	} 
         	else 
		{
			if ( from.Mounted == true )
			{
				from.SendLocalizedMessage( 1042561 );
			}

			else
         		{ 
           		 	if ( from.BodyValue == 0x190 ) 
           			{ 
              				from.BodyMod = 0x191; 
               				from.HueMod = 0x0; 
               				from.PlaySound( 61 );
					from.PlaySound( 813 );
					this.Delete();
            			} 
           			else 
            			{  
                  			from.BodyMod = 0x190;
					from.HueMod = 0x0; 
                  			from.PlaySound( 61 );
					from.PlaySound( 1087 );
					this.Delete();
				}
  			}
		} 
	} 
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:34,代码来源:FunkyMushroom.cs

示例14: OnMoveOver

        public override bool OnMoveOver( Mobile m )
        {
            if(m_refresh) {
                m.PlaySound( 0x214 );
                m.FixedEffect( 0x376A, 10, 16 );

                m.Resurrect();

                m.Hits = m.HitsMax;
                m.Stam = m.Dex;
                m.Mana = m.Int;
            } else {
                if ( !m.Alive && m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
                {
                    m.PlaySound( 0x214 );
                    m.FixedEffect( 0x376A, 10, 16 );

                    m.CloseGump( typeof( ResurrectGump ) );
                    m.SendGump( new ResurrectGump( m ) );
                }
                else
                {
                    m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
                }
            }

            return false;
        }
开发者ID:guy489,项目名称:runuot2a,代码行数:28,代码来源:ResGate.cs

示例15: Target

		public void Target( Mobile m )
		{
			if ( HasMindRotScalar( m ) )
			{
				Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Attempts to place a curse on the Target that increases the mana cost of any spells they cast,
				 * for a duration based off a comparison between the Caster's Spirit Speak skill and the Target's Resisting Spells skill.
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 50 ) + 20 seconds.
				 */

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.PlaySound( 0x1FB );
				m.PlaySound( 0x258 );
				m.FixedParticles( 0x373A, 1, 17, 9903, 15, 4, EffectLayer.Head );

				TimeSpan duration = TimeSpan.FromSeconds( (((GetDamageSkill( Caster ) - GetResistSkill( m )) / 5.0) + 20.0) * (m.Player ? 1.0 : 2.0 ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				if ( m.Player )
					SetMindRotScalar( Caster, m, 1.25, duration );
				else
					SetMindRotScalar( Caster, m, 2.00, duration );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:35,代码来源:MindRot.cs


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