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


C# Mobile.EndAction方法代码示例

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


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

示例1: Craft

        public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
        {
            if ( from.Backpack == null )
            {
                from.EndAction( typeof( CraftSystem ) );
                return;
            }

            Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
                delegate
                {
                    if ( from.Backpack.GetAmount( typeof( Bottle ) ) < 1 || from.Backpack.GetAmount( typeof( PlantClippings ) ) < 1 )
                    {
                        from.EndAction( typeof( CraftSystem ) );

                        // You don't have the components needed to make that.
                        from.SendGump( new CraftGump( from, craftSystem, tool, 1044253 ) );
                    }
                    else if ( ShouldChooseHue( from ) )
                    {
                        from.SendLocalizedMessage( 1074794 ); // Target the material to use:
                        from.Target = new ClippingsTarget( craftSystem, typeRes, tool, craftItem );
                    }
                    else
                    {
                        from.EndAction( typeof( CraftSystem ) );
                        DoCraft( from, craftSystem, typeRes, tool, craftItem, from.Backpack.FindItemByType<PlantClippings>() );
                    }
                }
            ) );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:31,代码来源:PlantPigment.cs

示例2: Use

		public override bool Use( Mobile from ) {
			if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.PlaySound( 0x2D6 );

				if ( from.Body.IsHuman ) {
					from.Animate( 34, 5, 1, true, false, 0 );
				}

				from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
				from.PlaySound( 0x1EB );

				StatMod mod = from.GetStatMod( "Concussion" );

				if ( mod != null ) {
					from.RemoveStatMod( "Concussion" );
					from.Mana -= mod.Offset;
				}

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );

				Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
					from.EndAction( typeof( ClarityPotion ) );
				} );

				return true;
			}

			return false;
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:33,代码来源:ClarityPotion.cs

示例3: OnTarget

		protected override void OnTarget( Mobile from, object targeted )
		{
			Item toImbue = targeted as Item;

			if ( Imbuing.Check( from, toImbue ) )
				from.SendGump( new SelectPropGump( toImbue ) );
			else
				from.EndAction( typeof( Imbuing ) );
		}
开发者ID:xrunuo,项目名称:xrunuo,代码行数:9,代码来源:ImbueTarget.cs

示例4: Remove

        public static void Remove(Mobile m)
        {
            if (m_Table.ContainsKey(m))
            {
                m.RemoveSkillMod(m_Table[m]);
                m_Table.Remove(m);
            }

            m.EndAction(typeof(RogueShadowSpell));
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:10,代码来源:Shadow.cs

示例5: OnTarget

        protected override void OnTarget( Mobile from, object targeted )
        {
            Item item = targeted as Item;
            IImbuable toUnravel = targeted as IImbuable;

            from.EndAction( typeof( Imbuing ) );

            if ( !Soulforge.CheckProximity( from, 2 ) )
                from.SendLocalizedMessage( 1080433 ); // You must be near a soulforge to magically unravel an item.
            else if ( !Soulforge.CheckQueen( from ) )
                from.SendLocalizedMessage( 1113736 ); // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
            else if ( item == null || !item.IsChildOf( from.Backpack ) )
                from.SendLocalizedMessage( 1080424 ); // The item must be in your backpack to magically unravel it.
            else
                Unraveling.TryUnravel( from, item, true );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:16,代码来源:UnravelTarget.cs

示例6: Drink

public override void Drink( Mobile from )
{
	if ( from.BeginAction( typeof( LightCycle ) ) )
	{

// ** EDIT ** Time System

		//new LightCycle.NightSightTimer( from ).Start();
		//from.LightLevel = LightCycle.DungeonLevel / 2;

		from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
		from.PlaySound( 0x1E3 );

		BasePotion.PlayDrinkEffect( from );

		this.Consume();

		int oldLevel = LightCycle.DungeonLevel / 2;

		int level = TimeSystem.EffectsEngine.GetNightSightLevel(from, oldLevel);

		if (level > -1)
		{
			from.LightLevel = level;

			TimeSystem.EffectsEngine.SetNightSightOn(from, oldLevel);
		}
		else
		{
			from.EndAction(typeof(LightCycle));

			from.SendMessage("The potion seems to have no effect.");
		}

// ** END *** Time System

	}
	else
	{
		from.SendMessage( "You already have nightsight." );
	}
}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:42,代码来源:NightSight.cs

示例7: Craft

        public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
        {
            if ( !( from is PlayerMobile ) || !( (PlayerMobile) from ).BasketWeaving )
            {
                from.EndAction( typeof( CraftSystem ) );

                // You haven't learned basket weaving. Perhaps studying a book would help!
                from.SendGump( new CraftGump( from, craftSystem, tool, 1112253 ) );
            }
            else
            {
                Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
                    delegate
                    {
                        from.SendLocalizedMessage( 1074794 ); // Target the material to use:
                        from.Target = new ReedsTarget( craftSystem, typeRes, tool, craftItem );
                    }
                ) );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:20,代码来源:WeavableBasket.cs

示例8: RemoveEffect

        public static void RemoveEffect(Mobile m)
        {
            if (m_Table.ContainsKey(m))
            {
                object[] mods = m_Table[m];

                if (mods != null)
                {
                    m.RemoveStatMod(((StatMod)mods[0]).Name);
                    m.RemoveSkillMod((SkillMod)mods[1]);
                    m.RemoveSkillMod((SkillMod)mods[2]);
                }

                m_Table.Remove(m);

                m.BodyMod = 0;

                m.EndAction(typeof(RogueSlyFoxSpell));
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:20,代码来源:SlyFox.cs

示例9: RemoveEffect

        public static void RemoveEffect(Mobile m)
        {
            if (m_Table.ContainsKey(m))
            {
                object[] mods = (object[])m_Table[m];

                if (mods != null)
                {
                    m.RemoveStatMod(((StatMod)mods[0]).Name);
                    m.RemoveStatMod(((StatMod)mods[1]).Name);
                    m.RemoveSkillMod((SkillMod)mods[2]);
                    m.RemoveSkillMod((SkillMod)mods[3]);
                    m.RemoveSkillMod((SkillMod)mods[4]);
                    m.RemoveSkillMod((SkillMod)mods[5]);
                    m.RemoveSkillMod((SkillMod)mods[6]);
                }

                m_Table.Remove(m);

                m.EndAction(typeof(RogueIntimidationSpell));
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:22,代码来源:Intimidation.cs

示例10: DismountAttack

        public static void DismountAttack( Mobile from, Mobile target )
        {
            target.Damage( 1, from );

            IMount mt = target.Mount;

            if ( mt != null )
            {
                mt.Rider = null;
            }

            if ( target.IsPlayer )
            {
                target.BeginAction( typeof( BaseMount ) );

                target.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!

                target.EndAction( typeof( BaseMount ) );
            }

            from.DoHarmful( target );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:22,代码来源:BaseAttackHelperSE.cs

示例11: ApplyEffect

        public override void ApplyEffect(Mobile to, Mobile source, int intensity, Item itemSource)
        {
            if (to.BeginAction(typeof(LightCycle)))
            {
                int oldLevel = to.LightLevel;

                int level = TimeSystem.EffectsEngine.GetNightSightLevel(to, oldLevel);

                if (level > -1)
                {
                    to.LightLevel = level;

                    TimeSystem.EffectsEngine.SetNightSightOn(to, oldLevel);
                }
                else
                {
                    to.EndAction(typeof(LightCycle));

                    to.SendMessage("The potion seems to have no effect.");
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:22,代码来源:ImprovedVisionEffect.cs

示例12: OnTarget

        protected override void OnTarget( Mobile from, object targeted )
        {
            Container cont = targeted as Container;

            from.EndAction( typeof( Imbuing ) );

            if ( !Soulforge.CheckProximity( from, 2 ) )
                from.SendLocalizedMessage( 1080433 ); // You must be near a soulforge to magically unravel an item.
            else if ( !Soulforge.CheckQueen( from ) )
                from.SendLocalizedMessage( 1113736 ); // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
            else if ( cont == null )
                from.SendLocalizedMessage( 1111814, "0\t0" ); // Unraveled: ~1_COUNT~/~2_NUM~ items
            else if ( !cont.IsChildOf( from.Backpack ) )
                from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
            else if ( HasSpecialMaterialItem( cont ) )
            {
                from.BeginAction( typeof( Imbuing ) );
                from.SendGump( new ConfirmUnravelContainerGump( cont ) );
            }
            else
            {
                Unraveling.UnravelContainer( from, cont );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:24,代码来源:UnravelContainerTarget.cs

示例13: OnDoubleClick

		public override void OnDoubleClick(Mobile m)
		{
			if (m == null || m.Deleted)
			{
				return;
			}

			if (FuseLit)
			{
				m.SendMessage("The fuse is already burning.");
				return;
			}

			if (!this.CheckDoubleClick(m, true, false, 10))
			{
				return;
			}

			if (!m.BeginAction(UseLock))
			{
				m.SendMessage("You must wait before you can light another {0}.", this.ResolveName(m));
				return;
			}

			MoveToWorld(m.Location, m.Map);

			Timer.DelayCall(UseDelay, () => m.EndAction(UseLock));

			IgniteFuse(m);

			InvalidateProperties();
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:32,代码来源:BaseFirework.cs

示例14: EndLock

		private void EndLock( Mobile m )
		{
			m.EndAction( this );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:4,代码来源:SirHelper.cs

示例15: EndPolymorph

        private static void EndPolymorph( Mobile m )
        {
            if( !m.CanBeginAction( typeof( PolymorphSpell ) ) )
            {
                m.BodyMod = 0;
                m.HueMod = -1;
                m.EndAction( typeof( PolymorphSpell ) );

                BaseArmor.ValidateMobile( m );
                BaseClothing.ValidateMobile( m );
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:12,代码来源:Polymorph.cs


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