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


C# Mobile.Send方法代码示例

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


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

示例1: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         }
     }
     else
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " bales of cotton"));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a bale of cotton"));
         }
     }
 }
开发者ID:Godkong,项目名称:Origins,代码行数:25,代码来源:Cotton.cs

示例2: OnSwing

		public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) {
			// Make sure we've been standing still for one second
			if( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( Core.AOS ? 0.5 : 1.0 )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) ) {
				bool canSwing = true;

				if( Core.AOS ) {
					canSwing = (!attacker.Paralyzed && !attacker.Frozen);

					if( canSwing ) {
						Spell sp = attacker.Spell as Spell;

						canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement);
					}
				}

				if( canSwing && attacker.HarmfulCheck( defender ) ) {
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if( OnFired( attacker, defender ) ) {
						if( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				return GetDelay( attacker );
			} else {
				return TimeSpan.FromSeconds( 0.25 );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:32,代码来源:BaseThrowingWeap.cs

示例3: AsciiMessage

        /*public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a ring"));
            }
        }*/
        public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                if (Effect != JewelEffect.None)
                {
                    if (Identified || from.AccessLevel >= AccessLevel.GameMaster)
                    {
                        if (Effect == JewelEffect.Invisibility)
                            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("a ring of invisibility ({0} charges)", Charges)));
                        else if (Effect == JewelEffect.Teleportation)
                            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("a ring of teleportation ({0} charges)", Charges)));
                    }
                    else
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a magic ring"));

                }
                else
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a ring"));
            }
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:36,代码来源:Ring.cs

示例4: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (Utility.RandomBool())
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Ankhs"));
     else
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Serpents"));
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:CommemorativeCoin.cs

示例5: OnSingleClick

        public override void OnSingleClick(Mobile from)
        {
            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a wooden chest"));

            if (this.Locked == false)
            from.Send( new AsciiMessage( Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)" ) );

            if (m_House != null && BaseHouse.DecayEnabled && m_House.DecayPeriod != TimeSpan.Zero)
            {
                string message;
                string full;

                switch (m_House.DecayLevel)
                {
                    case DecayLevel.Ageless: message = "ageless"; break;
                    case DecayLevel.Fairly: message = "fairly worn"; break;
                    case DecayLevel.Greatly: message = "greatly worn"; break;
                    case DecayLevel.LikeNew: message = "like new"; break;
                    case DecayLevel.Slightly: message = "slightly worn"; break;
                    case DecayLevel.Somewhat: message = "somewhat worn"; break;
                    default: message = "in danger of collapsing"; break;
                }
                full = "This tent is " + message + ".";

                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", full));
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:27,代码来源:TentChest.cs

示例6: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         }
     }
     else
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("{0} pieces of cloth ({0} yards of cloth)", Amount)));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a piece of cloth (1 yard of cloth)"));
         }
     }
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:25,代码来源:Cloth.cs

示例7: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     else
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a dungeon wall"));
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:WrongMaze.cs

示例8: OnSingleClick

        public override void OnSingleClick(Mobile from)
        {
            int hue = Notoriety.GetHue(Server.Misc.NotorietyHandlers.CorpseNotoriety(from, this));

            if (this.ItemID == 0x2006) // Corpse form
                from.Send(new MessageLocalized(this.Serial, this.ItemID, MessageType.Label, hue, 3, 1049144, "", this.Name)); // the remains of ~1_NAME~ the apprentice
            else
                from.Send(new MessageLocalized(this.Serial, this.ItemID, MessageType.Label, hue, 3, 1049145, "", "")); // the remains of a wizard's apprentice
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:SchmendrickApprenticeCorpse.cs

示例9: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", (m_Owner == null ? "ribcage" : "ribcage of " + m_Owner)));
     }
 }
开发者ID:Godkong,项目名称:Origins,代码行数:11,代码来源:RibCage.cs

示例10: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "A plate decorated with a beautiful painting of Mondain's defeat as the Gem of Immortality shatters."));
     }
 }
开发者ID:Godkong,项目名称:Origins,代码行数:11,代码来源:CommemorativePlate.cs

示例11: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "In Commemoration of the 300th anniversary of Mondain's defeat"));
     }
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:11,代码来源:CommemorativeCoin.cs

示例12: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a dressform"));
     }
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:11,代码来源:Dressform.cs

示例13: OnSingleClick

 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)"));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a trash chest"));
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)"));
     }
 }
开发者ID:Godkong,项目名称:Origins,代码行数:13,代码来源:TrashChest.cs

示例14: SendTo

		public static void SendTo( this Prompt prompt, Mobile m )
		{
            if (m.NetState != null && m.NetState.Version.Major >= 67)
			{
				m.Send( new PromptGumpStub( prompt, m ).GetPacket() );
			}
			else
			{
				if ( prompt.MessageCliloc != 1042971 || prompt.MessageArgs != String.Empty )
					m.SendLocalizedMessage( prompt.MessageCliloc, prompt.MessageArgs, prompt.MessageHue );

				m.Send( new UnicodePrompt( prompt, m ) );
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:14,代码来源:PromptExtensions.cs

示例15: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            BaseBook book;
            if (Toggle || mate == null) book = this;
            else book = mate;
            if (book.Title == null && book.Author == null && book.Writable == true)
            {
                book.Title = "a book";
                book.Author = from.Name;
            }

            from.Send(new BookHeader(from, book));
            from.Send(new BookPageDetails(book));
            Toggle = !Toggle;
        }
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:15,代码来源:LinkedBooks.cs


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