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


C# Mobile.SayTo方法代码示例

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


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

示例1: Validate

        public virtual bool Validate( Mobile from )
        {
            if( Parent == null )
            {
                from.SayTo( from, 1010095 ); // This must be on your person to use.
                return false;
            }
            else if( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
            {
                // CheckIsUsableBy sends the message
                return false;
            }
            else if( !BaseMount.CheckMountAllowed( from, true ) )
            {
                // CheckMountAllowed sends the message
                return false;
            }
            else if( from.Mounted )
            {
                from.SendLocalizedMessage( 1005583 ); // Please dismount first.
                return false;
            }
            else if( from.IsBodyMod && !from.Body.IsHuman )
            {
                from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
                return false;
            }
            else if( from.HasTrade )
            {
                from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
                return false;
            }
            else if( ( from.Followers + FollowerSlots ) > from.FollowersMax )
            {
                from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount.
                return false;
            }
            else if( !Multis.DesignContext.Check( from ) )
            {
                // Check sends the message
                return false;
            }

            return true;
        }
开发者ID:AlcesAlces,项目名称:UOsmart,代码行数:45,代码来源:Ethereals.cs

示例2: CheckItemUse

        public override bool CheckItemUse( Mobile from, Item item )
        {
            if ( !base.CheckItemUse( from, item ) )
                return false;

            if ( item != this && from.AccessLevel < AccessLevel.GameMaster && m_Locked )
            {
                //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                int OldHue = from.SpeechHue;
                from.SpeechHue = 0;
                from.SayTo(from, true, "I can't reach that.");
                from.SpeechHue = OldHue;
                return false;
            }

            return true;
        }
开发者ID:Godkong,项目名称:Origins,代码行数:17,代码来源:LockableContainer.cs

示例3: OnDoubleClick

 public override void OnDoubleClick( Mobile from )
 {
     if (from.AccessLevel == AccessLevel.Player && (/*!from.InLOS( this ) || */!from.InRange(GetWorldLocation(), 2)))
     {
         //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
         int OldHue = from.SpeechHue;
         from.SpeechHue = 0;
         from.SayTo(from, true, "I can't reach that.");
         from.SpeechHue = OldHue;
     }
     else
         Use(from);
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:13,代码来源:BaseDoor.cs

示例4: Use

        public virtual void Use( Mobile from )
        {
            if ( m_Locked && !m_Open && UseLocks() )
            {
                if ( from.AccessLevel >= AccessLevel.GameMaster )
                {
                    //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502502 ); // That is locked, but you open it with your godly powers.
                    //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
                    int OldHue = from.SpeechHue;
                    from.SpeechHue = 0;
                    from.SayTo(from, true, "That is locked, but you open it with your godly powers.");
                    from.SpeechHue = OldHue;
                }
                else if ( Key.ContainsKey( from.Backpack, this.KeyValue ) )
                {
                    //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501282 ); // You quickly unlock, open, and relock the door
                    int OldHue = from.SpeechHue;
                    from.SpeechHue = 0;
                    from.SayTo(from, true, "You quickly unlock, open, and relock the door.");
                    from.SpeechHue = OldHue;
                }
                else if ( IsInside( from ) )
                {
                    //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside.
                    int OldHue = from.SpeechHue;
                    from.SpeechHue = 0;
                    from.SayTo(from, true, "That is locked, but is usable from the inside.");
                    from.SpeechHue = OldHue;
                }
                else
                {
                    if (Hue == 0x44E && Map == Map.Malas) // doom door into healer room in doom
                        this.SendLocalizedMessageTo(from, 1060014); // Only the dead may pass.
                    else
                    {
                        //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502503); // That is locked.
                        int OldHue = from.SpeechHue;
                        from.SpeechHue = 0;
                        from.SayTo(from, true, "That is locked.");
                        from.SpeechHue = OldHue;
                    }

                    return;
                }
            }

            if ( m_Open && !IsFreeToClose() )
                return;

            if ( m_Open )
                OnClosed( from );
            else
                OnOpened( from );

            if ( UseChainedFunctionality )
            {
                bool open = !m_Open;

                List<BaseDoor> list = GetChain();

                for ( int i = 0; i < list.Count; ++i )
                    list[i].Open = open;
            }
            else
            {
                Open = !m_Open;

                BaseDoor link = this.Link;

                if ( m_Open && link != null && !link.Open )
                    link.Open = true;
            }
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:73,代码来源:BaseDoor.cs

示例5: OnTarget

            protected override void OnTarget(Mobile from, object target)
            {
                from.RevealingAction();

                if (target is Mobile)
                {
                    Mobile targ = (Mobile)target;

                    if (targ is BaseCreature && ((BaseCreature)targ).BardImmune)
                    {
                        from.SendAsciiMessage("You cannot entice that!");
                    }
                    else if (targ == from)
                    {
                        from.SendAsciiMessage("You cannot entice yourself!");
                    }
                    else
                    {
                        if (!BaseInstrument.CheckMusicianship(from))
                        {
                            from.SayTo(from, 500612); // You play poorly, and there is no effect.
                            m_Instrument.PlayInstrumentBadly(from);
                            m_Instrument.ConsumeUse(from);
                        }
                        else if (from.CheckTargetSkill(SkillName.Discordance, target, 0, 100))
                        {
                            m_Instrument.PlayInstrumentWell(from);
                            m_Instrument.ConsumeUse(from);

                            if (targ.Player)
                            {
                                targ.SayTo(targ, "You hear lovely music, and are drawn towards it...");
                                targ.SayTo(from, "You might have better luck with sweet words.");
                                return;
                            }

                            if (targ.Body.IsHuman)
                                targ.Say("What am I hearing?");

                            if (targ is BaseGuard || targ is BaseVendor || targ is WanderingHealer || targ is Banker || targ is TownCrier || targ is BaseShieldGuard)
                            {
                                targ.Say("Oh, but I cannot wander too far from my work!");
                                targ.SayTo(from, true, "They look too dedicated to their job to be lured away.");
                            }
                            else
                            {
                                from.SayTo(from, true, "You play your hypnotic music, luring them near.");
                                if (targ is BaseCreature)
                                    ((BaseCreature)targ).TargetLocation = new Point2D(from.Location);
                            }
                        }
                        else
                        {
                            targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it...");
                            targ.SayTo(from, true, "Your music fails to attract them.");
                            m_Instrument.PlayInstrumentBadly(from);
                            m_Instrument.ConsumeUse(from);
                        }
                    }
                }
                else
                {
                    m_Instrument.PlayInstrumentBadly(from);
                }
            }
开发者ID:greeduomacro,项目名称:divinity,代码行数:65,代码来源:Discordance.cs

示例6: CheckHold

        /*public override bool IsAccessibleTo( Mobile m )
        {
            if ( !BaseHouse.CheckAccessible( m, this ) )
                return false;

            return base.IsAccessibleTo( m );
        }

        public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems )
        {
            if ( !BaseHouse.CheckHold( m, this, item, message, checkItems ) )
                return false;

            return base.CheckHold( m, item, message, checkItems );
        }

        public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
        {
            base.GetContextMenuEntries( from, list );
            SetSecureLevelEntry.AddTo( from, this, list );
        }*/
        public override void OnDoubleClick(Mobile from)
        {
            if ( !from.InLOS( GetWorldLocation() ) )
                from.SayTo( from, true, "I cannot see that." );
            else
                base.OnDoubleClick(from);
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:28,代码来源:Container.cs

示例7: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            int xLong = 0, yLat = 0;
            int xMins = 0, yMins = 0;
            bool xEast = false, ySouth = false;

            if ( Sextant.Format( from.Location, from.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
            {
                string location = String.Format( "{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
                //from.LocalOverheadMessage( MessageType.Regular, from.SpeechHue, false, location );
                from.SayTo(from, true, location);
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:13,代码来源:Sextant.cs

示例8: SAYTO

			public static void SAYTO(TriggerObject trigObject, Mobile from, Mobile to, object said)
			{
				if (from == null || to == null)
				{
					return;
				}

				if (said == null)
				{
					said = "null";
				}

				from.SayTo(to, said.ToString());
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:14,代码来源:UberScriptFunctions.cs

示例9: OnDoubleClick

 public override void OnDoubleClick( Mobile from )
 {
     if (from.AccessLevel > AccessLevel.Player || (from.InRange(this.GetWorldLocation(), 2) && from.InLOS(this)) || this.RootParent is PlayerVendor)
         Open(from);
     else
     {
         //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
         int OldHue = from.SpeechHue;
         from.SpeechHue = 0;
         from.SayTo(from, true, "I can't reach that.");
         from.SpeechHue = OldHue;
     }
 }
开发者ID:WarriorWithin,项目名称:RunUO,代码行数:13,代码来源:Container.cs

示例10: Validate

		public virtual bool Validate( Mobile from )
		{
			if( Parent == null )
			{
				from.SayTo( from,1010095 ); // This must be on your person to use.
				return false;
			}
            else if (Parent != from.Backpack)
            {
                from.SendMessage("You cannot mount it unless it is in your main backpack!");
                return false;
            }
            else if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
            {
            }
            else if (!BaseMount.CheckMountAllowed(from, true))
            {
            }
            else if (from.IsT2A)
            {
                from.SendMessage(61, "You cannot use this item in a T2A zone.");
            }
            else if (from.Mounted)
                from.SendLocalizedMessage(1005583); // Please dismount first.
            else if (from.IsBodyMod && !from.Body.IsHuman)
                from.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
            else if (from.HasTrade)
                from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time
            else if ((from.Followers + FollowerSlots) > from.FollowersMax)
                from.SendLocalizedMessage(1049679); // You have too many followers to summon your mount.
            else if (!Multis.DesignContext.Check(from))
            {
            }
            else
                return true;

			return false;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:38,代码来源:Ethereals.cs

示例11: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted == from)
                    from.SayTo(from, true, "You cannot entice yourself!");
                //from.SendAsciiMessage("You cannot entice yourself!");
                else if (!m_Instrument.IsChildOf(from.Backpack))
                    from.SendAsciiMessage("The instrument you are trying to play is no longer in your backpack!"); // The instrument you are trying to play is no longer in your backpack!
                else if (targeted is Mobile)
                {
                    Mobile targ = targeted as Mobile;
                    m_SetSkillTime = false;
                    from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);

                    if (!BaseInstrument.CheckMusicianship(from))
                    {
                        targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it.");
                        targ.SayTo(from, true, "Your music fails to attract them.");
                        //targ.LocalOverheadMessage(MessageType.Regular, targ.SpeechHue, true, String.Format("You hear lovely music, and for a moment are drawn towards it."));
                        //targ.NonlocalOverheadMessage(MessageType.Regular, targ.SpeechHue, true, String.Format("You hear lovely music, and for a moment are drawn towards it."));
                        m_Instrument.PlayInstrumentBadly(from);
                        m_Instrument.ConsumeUse(from);
                    }
                    else if (!from.CheckSkill(SkillName.Discordance, 0.0, 100.0))
                    {
                        targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it.");
                        targ.SayTo(from, true, "Your music fails to attract them.");
                        m_Instrument.PlayInstrumentBadly(from);
                        m_Instrument.ConsumeUse(from);
                    }
                    else
                    {
                        m_Instrument.PlayInstrumentWell(from);
                        m_Instrument.ConsumeUse(from);
                        targ.SayTo(targ, true, "You hear lovely music, and are drawn towards it...");
                        from.SayTo(from, true, "You play your hypnotic music, luring them near.");

                        if (targ is PlayerMobile)
                        {
                            targ.SayTo(from, true, "What am I hearing?");
                            targ.SayTo(from, true, "You might have better luck with sweet words.");
                        }
                        else if (targ is BaseVendor)
                        {
                            targ.SayTo(from, true, "What am I hearing?");
                            targ.SayTo(from, true, "Oh, but I cannot wander too far from my shop!");
                        }
                        else if (targ is BaseCreature)
                        {
                            ((BaseCreature)targ).TargetLocation = new Point2D((IPoint2D)from.Location);
                        }
                    }
                }
                else
                    from.SendAsciiMessage("You cannot entice that!");
            }
开发者ID:Godkong,项目名称:RunUO,代码行数:57,代码来源:Discordance.cs


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