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


C# Mobile.EndAction方法代码示例

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


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

示例1: OnTargetUntargetable

            protected override void OnTargetUntargetable(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetUntargetable(from, targeted);
            }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:9,代码来源:ItemIdentification.cs

示例2: RemoveEntry

 public static void RemoveEntry( Mobile m )
 {
     if ( _Table.ContainsKey( m ) ) {
         int v = _Table[m];
         _Table.Remove( m );
         m.EndAction( typeof( ArchProtectionSpell ) );
         m.VirtualArmorMod -= v;
         if ( m.VirtualArmorMod < 0 )
             m.VirtualArmorMod = 0;
     }
 }
开发者ID:nathanvy,项目名称:runuo,代码行数:11,代码来源:ArchProtection.cs

示例3: OnBeforeSwing

        public override bool OnBeforeSwing(Mobile attacker, Mobile defender)
        {
            bool valid = this.Validate(attacker) && this.CheckMana(attacker, true);

            if (valid)
            {
                attacker.BeginAction(typeof(Stealth));
                Timer.DelayCall(TimeSpan.FromSeconds(5.0), delegate { attacker.EndAction(typeof(Stealth)); });
            }

            return valid;
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:12,代码来源:SurpriseAttack.cs

示例4: RemoveEffect

		public override void RemoveEffect( Mobile m )
		{
			m.SendLocalizedMessage( 1074771 ); // You are no longer under the effects of Ethereal Voyage.

			TransformationSpellHelper.RemoveContext( m, true );

			Timer.DelayCall( TimeSpan.FromMinutes( 5 ), delegate
			{
				m.EndAction( typeof( EtherealVoyageSpell ) );
			} );

			BuffInfo.RemoveBuff( m, BuffIcon.EtherealVoyage );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:13,代码来源:EtherealVoyage.cs

示例5: RemoveEffect

        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
                return;

            List<ResistanceMod> mods = m_Table[m];

            for (int i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            m_Table.Remove(m);
            m.EndAction(typeof(StoneFormSpell));
            m.PlaySound(0x201);  
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
开发者ID:m309,项目名称:ForkUO,代码行数:18,代码来源:StoneForm.cs

示例6: RemoveEffect

        public override void RemoveEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

            if (mods != null)
            {             
                m_Table.Remove(m);

                m_Table[m] = mods;

                for (int i = 0; i < mods.Length; ++i)
                    m.RemoveResistanceMod(mods[i]);

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                m.EndAction(typeof(StoneFormSpell));
            }
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:19,代码来源:StoneForm.cs

示例7: RemoveEffect

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

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

            m_Table.Remove( m );

            m.EndAction( typeof( ClericAngelicFaithSpell ) );

            m.BodyMod = 0;
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:20,代码来源:AngelicFaithSpell.cs

示例8: RemoveEffect

        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
                return;

            var mods = m_Table[m];

            for (var i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            Enhancement.SetValue(m, AosAttribute.CastSpeed, 2, "Stone Form");
            Enhancement.SetValue(m, AosAttribute.WeaponSpeed, 10, "Stone Form");

            m_Table.Remove(m);
            m.EndAction(typeof (StoneFormSpell));
            m.PlaySound(0x201);
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
开发者ID:rokann,项目名称:JustUO,代码行数:21,代码来源:StoneForm.cs

示例9: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                CraftContext context = m_CraftSystem.GetContext(from);

                if (context != null && targeted is IPlantHue)
                    context.RequiredPlantHue = ((IPlantHue)targeted).PlantHue;
                else if (context != null && targeted is IPigmentHue)
                    context.RequiredPigmentHue = ((IPigmentHue)targeted).PigmentHue;

                from.EndAction(typeof(CraftSystem));
                m_CraftItem.Craft(from, m_CraftSystem, m_TypeRes, m_Tool);
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:12,代码来源:CraftItem.cs

示例10: 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:FreeReign,项目名称:forkuo,代码行数:12,代码来源:Polymorph.cs

示例11: OnTargetCancel

            protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetCancel(from, cancelType);
            }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:9,代码来源:Begging.cs

示例12: Drink

		public override void Drink( Mobile from )
		{
            if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
            {
                from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
                return;
            }

            if (from.BeginAction(typeof(BaseExplosionPotion)))
            {
                from.EndAction(typeof(BaseExplosionPotion)); //Timer should start when targeting

                ThrowTarget targ = from.Target as ThrowTarget;
                Stackable = false;
                // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.

                if (targ != null && targ.Potion == this)
                    return;

                from.RevealingAction();

                if (m_Users == null)
                    m_Users = new ArrayList();

                if (!m_Users.Contains(from))
                    m_Users.Add(from);

                from.Target = new ThrowTarget(this);

                if (m_Timer == null)
                {
                    from.SendLocalizedMessage(500236); // You should throw it now!
                    //if (Core.ML)
                    //    m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 5, new TimerStateCallback(Detonate_OnTick), new object[] {from, 3}); // 3.6 seconds explosion delay
                    //else
                    m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 4, new TimerStateCallback(Detonate_OnTick), new object[] {from, 3}); // 2.6 seconds explosion delay
                }
            }
            else
                from.SendAsciiMessage("You can't use another explosion potion yet!");
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:41,代码来源:BaseExplosionPotion.cs

示例13: OnTargetFinish

            protected override void OnTargetFinish(Mobile from)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                if (m_SetSkillTime)
                    from.NextSkillTime = DateTime.Now;
            }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:10,代码来源:Peacemaking.cs

示例14: Craft

		public void Craft(Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool)
		{
			if (from.BeginAction(typeof(CraftSystem)))
			{
				if (RequiredExpansion == Expansion.None ||
					(from.NetState != null && from.NetState.SupportsExpansion(RequiredExpansion)))
				{
					bool allRequiredSkills = true;
					double chance = GetSuccessChance(from, typeRes, craftSystem, false, ref allRequiredSkills);

					if (allRequiredSkills && chance >= 0.0)
					{
                        if (Recipe == null || !(from is PlayerMobile) || ((PlayerMobile)from).HasRecipe(Recipe))
                        {
                            if (!RequiresBasketWeaving || (from is PlayerMobile && ((PlayerMobile)from).BasketWeaving))
                            {
                                if (!RequiresMechanicalLife || (from is PlayerMobile && ((PlayerMobile)from).MechanicalLife))
                                {
                                    int badCraft = craftSystem.CanCraft(from, tool, m_Type);

                                    if (badCraft <= 0)
                                    {
                                        if (RequiresResTarget && NeedsResTarget(from, craftSystem))
                                        {
                                            from.Target = new ChooseResTarget(from, this, craftSystem, typeRes, tool);
                                            from.SendMessage("Choose the resource you would like to use.");
                                            return;
                                        }

                                        int resHue = 0;
                                        int maxAmount = 0;
                                        object message = null;

                                        if (ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref message))
                                        {
                                            message = null;

                                            if (ConsumeAttributes(from, ref message, false))
                                            {
                                                CraftContext context = craftSystem.GetContext(from);

                                                if (context != null)
                                                {
                                                    context.OnMade(this);
                                                }

                                                int iMin = craftSystem.MinCraftEffect;
                                                int iMax = (craftSystem.MaxCraftEffect - iMin) + 1;
                                                int iRandom = Utility.Random(iMax);
                                                iRandom += iMin + 1;
                                                new InternalTimer(from, craftSystem, this, typeRes, tool, iRandom).Start();
                                                return;
                                            }
                                            else
                                            {
                                                from.EndAction(typeof(CraftSystem));
                                                from.SendGump(new CraftGump(from, craftSystem, tool, message));
                                            }
                                        }
                                        else
                                        {
                                            from.EndAction(typeof(CraftSystem));
                                            from.SendGump(new CraftGump(from, craftSystem, tool, message));
                                        }
                                    }
                                    else
                                    {
                                        from.EndAction(typeof(CraftSystem));
                                        from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
                                    }
                                }
                                else
                                {
                                    from.EndAction(typeof(CraftSystem));
                                    from.SendGump(new CraftGump(from, craftSystem, tool, 1113034)); // You haven't read the Mechanical Life Manual. Talking to Sutek might help!
                                }
                            }
                            else
                            {
                                from.EndAction(typeof(CraftSystem));
                                from.SendGump(new CraftGump(from, craftSystem, tool, 1112253)); // You haven't learned basket weaving. Perhaps studying a book would help!
                            }
                        }
                        else
                        {
                            from.EndAction(typeof(CraftSystem));
                            from.SendGump(new CraftGump(from, craftSystem, tool, 1072847)); // You must learn that recipe from a scroll.
                        }
					}
					else
					{
						from.EndAction(typeof(CraftSystem));
						from.SendGump(new CraftGump(from, craftSystem, tool, 1044153));
						// You don't have the required skills to attempt this item.
					}
				}
				else
				{
					from.EndAction(typeof(CraftSystem));
					from.SendGump(new CraftGump(from, craftSystem, tool, RequiredExpansionMessage(RequiredExpansion)));
//.........这里部分代码省略.........
开发者ID:Crome696,项目名称:ServUO,代码行数:101,代码来源:CraftItem.cs

示例15: ReleaseExplosionLock

		private static void ReleaseExplosionLock(Mobile from)
		{
			from.EndAction(typeof(BaseExplosionPotion));
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:BaseExplosionPotion.cs


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