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


C# Mobile.SendAsciiMessage方法代码示例

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


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

示例1: OnTarget

        protected override void OnTarget(Mobile from, object target) 
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
                return;

            if (target is BaseClothing)
            {
                BaseClothing item = (BaseClothing)target;

                if (item.Hue == 1) 
                {
                    from.SendAsciiMessage("That is already pure black");
                }
                else if (!item.Movable)
                {
                    from.SendAsciiMessage("You cannot dye an item that is locked down");
                }
                else if (item.RootParent != from)
                {
                    from.SendAsciiMessage("You cannot dye that");
                }
                else
                {
                    item.Hue = 1;
                    from.SendAsciiMessage("You dye the item");
                    m_Deed.Delete(); 
                }
            }
            else
            {
                from.SendAsciiMessage("You cannot dye that");
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:BlackClothingDyeDeed.cs

示例2: OnTarget

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

                if ( targeted is BaseCreature && from.CanBeHarmful( (Mobile)targeted, true ) )
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if ( creature.Controled )
                    {
                        from.SendAsciiMessage( "They are too loyal to their master to be provoked." );
                    }
                    else if ( creature.IsParagon )
                    {
                        from.SendAsciiMessage( "You have no chance of provoking those creatures." );
                    }
                    else
                    {
                        from.RevealingAction();
                        m_Instrument.PlayInstrumentWell( from );
                        from.SendAsciiMessage( "You play your music and your target becomes angered.  Whom do you wish them to attack?" );
                        from.Target = new InternalSecondTarget( from, m_Instrument, creature );
                    }
                }
            }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:25,代码来源:Provocation.cs

示例3: Carve

        public void Carve(Mobile from, Item item)
        {
            if (from.BeginAction(typeof(IAction)))
            {
                bool releaseLock;

                if (Summoned)
                {
                    from.SendAsciiMessage("You cannot sheer summoned sheep.");
                    return;
                }

                if (Utility.Random(1000) <= 2)
                    AntiMacro.AntiMacroGump.SendGumpThreaded((PlayerMobile)from);

                if (DateTime.Now < m_NextWoolTime)
                {
                    //This sheep is not yet ready to be shorn.
                    PrivateOverheadMessage(MessageType.Regular, 0x3b2, 500449, from.NetState);
                    releaseLock = true;
                    return;
                }

                from.SendAsciiMessage("You begin sheering the sheep...");
                new InternalTimer(from, this).Start();
                releaseLock = false;

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
            else
                from.SendAsciiMessage("You must wait to perform another action.");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:Sheep.cs

示例4: BeginLaunch

        public void BeginLaunch( Mobile from, bool useCharges )
        {
            Map map = from.Map;

            if ( map == null || map == Map.Internal )
                return;

            if ( useCharges )
            {
                if ( Charges > 0 )
                {
                    --Charges;
                }
                else
                {
                    from.SendAsciiMessage( "There are no charges left on that item." );
                    return;
                }
            }

            from.SendAsciiMessage( "You launch a firework!" );

            Point3D ourLoc = GetWorldLocation();

            Point3D startLoc = new Point3D( ourLoc.X, ourLoc.Y, ourLoc.Z + 10 );
            Point3D endLoc = new Point3D( startLoc.X + Utility.RandomMinMax( -2, 2 ), startLoc.Y + Utility.RandomMinMax( -2, 2 ), startLoc.Z + 32 );

            Effects.SendMovingEffect( new Entity( Serial.Zero, startLoc, map ), new Entity( Serial.Zero, endLoc, map ),
                0x36E4, 5, 0, false, false );

            Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FinishLaunch ), new object[]{ from, endLoc, map } );
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:32,代码来源:FireworksWand.cs

示例5: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:CasinoEntrance.cs

示例6: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendAsciiMessage("You must have the object in your backpack to use it.");
                return;
            }

            if ( m_Uses > 0 )
            {
                from.PlaySound( 0x2D6 );
                from.SendAsciiMessage( "An awful taste fills your mouth." ); // An awful taste fills your mouth.

                if ( from.BAC > 0 )
                {
                    from.BAC = 0;
                    from.SendAsciiMessage( "You are now sober!" ); // You are now sober!
                }

                m_Uses--;
            }
            else
            {
                Delete();
                from.SendAsciiMessage( "There wasn't enough left to have any effect." ); // There wasn't enough left to have any effect.
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:27,代码来源:JaanasHangoverRemedy.cs

示例7: OnTarget

		protected override void OnTarget( Mobile from, object o )
		{
			if ( !BaseCommand.IsAccessible( from, o ) )
			{
				from.SendMessage( "That is not accessible." );
				return;
			}

            if (o is Item)
            {
                from.SendAsciiMessage("Where would you like to move the item?");
                from.Target = new MoveTarget(o);
            }
            else if (o is Mobile)
            {
                Mobile m = (Mobile)o;

                if (string.IsNullOrEmpty(m.Name))
                    from.SendAsciiMessage(string.Format("Where would you like to move {0}?", m.Name));
                else
                    from.SendAsciiMessage(string.Format("Where would you like to move {0}?", m));

                from.Target = new MoveTarget(o);
            }
            else
                from.SendAsciiMessage("You cannot move that.");
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:27,代码来源:PickMoveTarget.cs

示例8: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
                bool releaseLock = true;

                SpellHelper.Turn(from, targeted);

                if (targeted is PlayerMobile)
                {
                    releaseLock = false;
                    new TextTimer(from, targeted).Start();
                }

                else if (targeted is BaseCreature)
                {
                    BaseCreature m = (BaseCreature) targeted;
                    if (m.BodyValue == 0x190 || m.BodyValue == 0x191)
                    {
                        releaseLock = false;

                        if (from.Skills[SkillName.Anatomy].Base < 100.0)
                            new TextTimer(from, targeted).Start();
                        else
                            new GumpTimer(from, targeted).Start();
                    }
                    else
                        from.SendAsciiMessage("You can only use anatomy on humanoids");
                }

                else
                    from.SendAsciiMessage("You can only use anatomy on humanoids");

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Anatomy.cs

示例9: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (from.FindItemOnLayer(Layer.OneHanded) is SmithHammer)
            {
                bool hasForge, hasAnvil;
                DefBlacksmithy.CheckAnvilAndForge(from, 4, out hasAnvil, out hasForge);

                if (hasForge && hasAnvil)
                {
                    CraftSubRes subRes = CustomCraftMenu.GetSubRes(DefBlacksmithy.CraftSystem, GetType(), null);
                    int num = CraftResources.GetIndex(m_Resource);

                    if (subRes == null || !CustomCraftMenu.ResourceInfoList.ContainsKey(subRes))
                    {
                        from.SendAsciiMessage("You can't use that.");
                        return;
                    }

                    if (from.Skills[DefBlacksmithy.CraftSystem.MainSkill].Base < subRes.RequiredSkill)
                    {
                        from.SendAsciiMessage("You cannot work this strange and unusual metal.");
                        return;
                    }

                    from.SendGump(new CraftGump(from, DefBlacksmithy.CraftSystem, (BaseTool)from.FindItemOnLayer(Layer.OneHanded), null, num));
                }
                else
                    from.SendAsciiMessage("You need to be close to a forge and anvil.");
            }
            else
                from.SendAsciiMessage("You need to equip a smith's hammer.");

            base.OnDoubleClick(from);
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Ingots.cs

示例10: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
            if (Mobiles.BaseVendor.ConsumeBackpackAndBankGold(from, m_Price))
            {
                Bag regBag = new Bag();
                regBag.Hue = 1159;

                regBag.DropItem(new Bottle(12));
                regBag.DropItem(new EyesOfNewt(30));
                regBag.DropItem(new BlackPearl(50));
                regBag.DropItem(new Bloodmoss(50));
                regBag.DropItem(new Nightshade(50));
                regBag.DropItem(new Bandage(50));
                regBag.DropItem(new SulfurousAsh(60));
                regBag.DropItem(new Garlic(70));
                regBag.DropItem(new Ginseng(70));
                regBag.DropItem(new SpidersSilk(75));
                regBag.DropItem(new MandrakeRoot(85));

                from.Backpack.DropItem(regBag);
                from.SendAsciiMessage("You've bought a bag of reagents.");
                from.PlaySound(247);
            }
            else
                from.SendAsciiMessage("You do not have enough money!");
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:ReagentStone.cs

示例11: CheckArray

        private static void CheckArray(Mobile from, Container cont, Type[] regs, string[] regsName)
        {
            string sOverLimit = "";
            string sUnderLimit = "";

            for (int i = 0; i < regs.Length; i++)
            {
                int count = cont.GetAmount(regs[i], true);
                string text = string.Format("{0}:{1}", regsName[i], count.ToString());

                if (count > ReagentWarningLimit)
                {
                    if ((sOverLimit.Length != 0) && (i < regs.Length)) sOverLimit += ", ";
                    sOverLimit += text;
                }
                else
                {
                    if ((sUnderLimit.Length != 0) && (i < regs.Length)) sUnderLimit += ", ";
                    sUnderLimit += text;
                }
            }

            if (sOverLimit.Length == 0 && sUnderLimit.Length == 0)
            {
                from.SendAsciiMessage(40, "No regs was found !");
            }
            else
            {
                if (sOverLimit.Length != 0) from.SendAsciiMessage(76, sOverLimit);
                if (sUnderLimit.Length != 0) from.SendAsciiMessage(40, sUnderLimit);
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:32,代码来源:ShowRegs.cs

示例12: Target

		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
                if ((m.Player && m.Dex <= 120) || (!m.Player))
                {
                    if (CurseSpell.UnderEffect(m))
                    {
                        if (m.Dex < m.RawDex)
                            m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex));
                        else
                            m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses");
                    }
                    else
                        SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                }
                else
                {
                    m.SendAsciiMessage(33, "You are too fast to benefit from that!");
                    return;
                }

				m.FixedParticles( 0x373A, 10, 15, 5010, EffectLayer.Waist );
				m.PlaySound( Sound );
			}

			FinishSequence();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:32,代码来源:Agility.cs

示例13: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (Filled)
            {
                if (from.InRange(this, 3) && from.InLOS(this))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else if (IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
            }

            if (!(Filled))
            {
                if (!IsChildOf(from.Backpack))
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                else
                {
                    from.Target = new InternalTarget(this);
                    from.SendAsciiMessage("This tombstone is blank!");
                    from.SendAsciiMessage("Target a players head to bury them.");
                }
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Gravestone.cs

示例14: OnTarget

 protected override void OnTarget( Mobile from, object targeted )
 {
     if ( targeted is BasePoisonPotion )
     {
         from.SendAsciiMessage( "To what do you wish to apply the poison?" ); // To what do you wish to apply the poison?
         from.Target = new InternalTarget( (BasePoisonPotion)targeted );
     }
     else // Not a Poison Potion
     {
         from.SendAsciiMessage( "That is not a poison potion." ); //
     }
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:12,代码来源:Poisoning.cs

示例15: OnDoubleClick

 // Override double click of the deed to call our target
 public override void OnDoubleClick( Mobile from )
 {
     if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
     {
          from.SendAsciiMessage( "That must be in your pack for you to use it." ); // That must be in your pack for you to use it.
     }
     else
     {
         from.SendAsciiMessage( "What would you like to bless? (Clothes Only)" ); // What would you like to bless? (Clothes Only)
         from.Target = new ClothingBlessTarget( this ); // Call our target
      }
 }
开发者ID:Godkong,项目名称:Origins,代码行数:13,代码来源:ClothingBlessDeed.cs


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