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


C# Mobile.MovingEffect方法代码示例

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


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

示例1: Throw

		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:32,代码来源:DartBoard.cs

示例2: AttackAnimation

		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman)
			{
				from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
			}

			from.PlaySound(0x23A);
			from.MovingEffect(to, 0x27AC, 1, 0, false, false);
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:10,代码来源:LeatherNinjaBelt.cs

示例3: AttackAnimation

		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman && !from.Mounted)
			{
				from.Animate(33, 2, 1, true, true, 0);
			}

			from.PlaySound(0x223);
			from.MovingEffect(to, 0x2804, 5, 0, false, false);
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:10,代码来源:Fukiya.cs

示例4: OnFired

		public virtual bool OnFired( Mobile attacker, Mobile defender ) {
			Container pack = attacker.Backpack;

			if( attacker.Player && (pack == null || !pack.ConsumeTotal( AmmoType, 1 )) )
				return false;

			attacker.MovingEffect( defender, EffectID, 18, 1, false, false );

			return true;
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:10,代码来源:BaseThrowingWeap.cs

示例5: OnHit

        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.CheckMana(attacker, true) && defender != null)
                return;

            BaseThrown weapon = attacker.Weapon as BaseThrown;

            if (weapon == null)
                return;

            List<Mobile> targets = new List<Mobile>();

            foreach (Mobile m in attacker.GetMobilesInRange(weapon.MaxRange))
            {
                if (m == defender)
                    continue;

                if (m.Combatant != attacker)
                    continue;

                targets.Add(m);
            }

            if (targets.Count > 0)
                this.m_Target = targets[Utility.Random(targets.Count)];

            /*
            Mobile m = null;

            foreach( DamageEntry de in attacker.DamageEntries )
            {
            m = Mobile.GetDamagerFrom( de );

            if ( m != null )
            {
            if ( defender != m && defender.InRange( m, 3 ) )
            {
            m_Target = m;
            break;
            }
            }
            }
            */

            AOS.Damage(defender, attacker, this.m_Damage, 0, 0, 0, 0, 100);

            if (this.m_Target != null)
            {
                defender.MovingEffect(this.m_Target, weapon.ItemID, 18, 1, false, false);
                Timer.DelayCall(TimeSpan.FromMilliseconds(333.0), new TimerCallback(ThrowAgain));
                this.m_Mobile = attacker;
            }

            ClearCurrentAbility(attacker);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:55,代码来源:MysticArc.cs

示例6: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Mobile )
				{
					Mobile m = (Mobile)targeted;
			
					if ( m != from && from.HarmfulCheck( m ) )
					{
						Direction to = from.GetDirectionTo( m );

						from.Direction = to;

						from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );

						if ( Utility.RandomDouble() <= (Math.Sqrt( from.Dex / 100.0 ) * 1.0) )
						{
							from.MovingEffect( m, 0x10E5, 7, 1, false, false, 0x481, 0 );
							AOS.Damage( m, from, Utility.Random( 5, from.Str / 10 ), 100, 0, 0, 0, 0 );
							m.Paralyze( TimeSpan.FromSeconds( 10 ) );
							Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( ReleasecastLock ), from );
							
						}
						else
						{
							int x = 0, y = 0;

							switch ( to & Direction.Mask )
							{
								case Direction.North: --y; break;
								case Direction.South: ++y; break;
								case Direction.West: --x; break;
								case Direction.East: ++x; break;
								case Direction.Up: --x; --y; break;
								case Direction.Down: ++x; ++y; break;
								case Direction.Left: --x; ++y; break;
								case Direction.Right: ++x; --y; break;
							}

							x += Utility.Random( -1, 3 );
							y += Utility.Random( -1, 3 );

							x += m.X;
							y += m.Y;

							from.MovingEffect( m_MBoomerang, 0x10E5, 7, 1, false, false, 0x481, 0 );

							from.SendMessage( "You miss." );
							Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( ReleasecastLock ), from );
						}
				
					}
				}
			}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:53,代码来源:Boomerang.cs

示例7: OnFired

		public override bool OnFired( Mobile attacker, Mobile defender )
		{
			m_Thrower = attacker;

			if ( !attacker.InRange( defender, 1 ) )
			{
				//Internalize();
				Visible = false;
				attacker.MovingEffect( defender, EffectID, 18, 1, false, false );
			}

			return true;
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:13,代码来源:BaseThrown.cs

示例8: OnFired

		public override bool OnFired( Mobile attacker, Mobile defender )
		{
			if( !m_PBGI.Active )
			{
				attacker.SendMessage( "The game has not started yet!" );
				return false;
			}

			if( defender.ChestArmor != null && defender.ChestArmor is PBArmor )
			{
				if( defender.FindItemOnLayer( Layer.Cloak ) != null && defender.FindItemOnLayer( Layer.Cloak ).Hue == Hue )
				{
					attacker.SendMessage( "Do not attack your own team!" );
					return false;
				}
			}
			else
			{
				attacker.SendMessage( "You cannot attack someone that is not playing!" );
				defender.SendMessage( "You are not playing Paintball, please leave the area." );
				return false;
			}

			Container pack = attacker.Backpack;

			if( attacker.Player && (pack == null || !pack.ConsumeTotal( AmmoType, 1 ) ) )
			{
				attacker.SendMessage( "You are out of paintballs!" );
				return false;
			}

			attacker.MovingEffect( defender, EffectID, 18, 1, false, false, Hue, 3 );
			return true;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:34,代码来源:PBEquipment.cs

示例9: ProduceEffect

        public virtual void ProduceEffect( Mobile from, bool first )
        {
            if( first && EffectSound > 0 )
                Caster.PlaySound( EffectSound );

            if( EffectID > 0 )
                from.MovingEffect( TargetMobile, EffectID, 5, 0, false, true, EffectHue, 0 );

            DamageDelay = 0.1 * from.GetDistanceToSqrt( TargetMobile.Location );
            new MageChainEffectTimer( this ).Start();
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:11,代码来源:CustomMageSpell.cs

示例10: OnTarget

            protected override void OnTarget(Mobile from, object obj)
            {
                if (this.m_Bola.Deleted)
                    return;

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!this.m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
                    }
                    else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
                    {
                        from.SendLocalizedMessage(1040015); // Your hands must be free to use this
                    }
                    else if (from.Mounted)
                    {
                        from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
                    }
                    else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
                    {
                        from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
                    }
                    else if (!to.Mounted)
                    {
                        from.SendLocalizedMessage(1049628); // You have no reason to throw a bola at that.
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        if (Core.AOS)
                        {
                            Item one = from.FindItemOnLayer(Layer.OneHanded);
                            Item two = from.FindItemOnLayer(Layer.TwoHanded);

                            if (one != null)
                                from.AddToBackpack(one);

                            if (two != null)
                                from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        if (Core.AOS)
                            BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(3.0));

                        this.m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to });
                    }
                    else
                    {
                        from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1049629); // You cannot throw a bola at that.
                }
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:71,代码来源:Bola.cs

示例11: OnFired

        public virtual bool OnFired( Mobile attacker, Mobile defender )
        {
            Container pack = attacker.Backpack;
            Quiver quiver = attacker.FindItemOnLayer(Layer.Cloak) as Quiver;

            if( quiver != null && quiver.ConsumeTotal(AmmoType, 1) )
            {
                quiver.UpdateTotals();
                quiver.InvalidateProperties();

                attacker.MovingEffect(defender, EffectID, 18, 1, false, false);
                return true;
            }
            else if( pack != null && pack.ConsumeTotal(AmmoType, 1) )
            {
                attacker.MovingEffect(defender, EffectID, 18, 1, false, false);
                return true;
            }

            return false;
        }
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:21,代码来源:BaseRanged.cs

示例12: OnFired

		public virtual bool OnFired(Mobile attacker, Mobile defender)
		{
			var pm = attacker as PlayerMobile;
			var battle = AutoPvP.FindBattleI<IUOFBattle>(pm);

			if ((attacker.Player && battle == null) || (battle != null && !battle.NoConsume) ||
				(attacker is BaseCreature && ((BaseCreature)attacker).Pseu_ConsumeReagents))
			{
				var quiver = attacker.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
				Container pack = attacker.Backpack;

				if (quiver != null && (quiver.LowerAmmoCost < Utility.Random(100) || quiver.ConsumeTotal(AmmoType, 1)))
				{
					quiver.InvalidateWeight();
				}
				else if (pack == null || !pack.ConsumeTotal(AmmoType, 1))
				{
					return false;
				}
			}

			if (defender != null)
			{
				attacker.MovingEffect(defender, EffectID, 18, 1, false, false);
			}

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

示例13: OnFired

		public virtual bool OnFired( Mobile attacker, Mobile defender )
		{
			attacker.MovingEffect( defender, EffectID, 18, 1, false, false );

			return true;
		}
开发者ID:greeduomacro,项目名称:matts-uo-server,代码行数:6,代码来源:Trainingbow.cs

示例14: OnFired

        public override bool OnFired( Mobile attacker, Mobile defender )
        {
            attacker.MovingEffect( defender, EffectID, 9, 1, false, false );
            defender.MovingEffect( attacker, EffectID, 9, 1, false, false );

            return true;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:7,代码来源:AzhuranBoomerang.cs

示例15: OnFired

		public virtual bool OnFired(Mobile attacker, Mobile defender)
		{
			if (attacker.Player)
			{
                BaseQuiver quiver = attacker.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
                Container pack = attacker.Backpack;

                if (quiver == null || Utility.Random(100) >= quiver.LowerAmmoCost)
                {
                    // consume ammo
                    if (quiver != null && quiver.ConsumeTotal(AmmoType, 1))
                    {
                        quiver.InvalidateWeight();
                    }
                    else if (pack == null || !pack.ConsumeTotal(AmmoType, 1))
                    {
                        return false;
                    }
                }
                else if (quiver.FindItemByType(AmmoType) == null && (pack == null || pack.FindItemByType(AmmoType) == null))
                {
                    // lower ammo cost should not work when we have no ammo at all
                    return false;
                }
            }

			attacker.MovingEffect(defender, EffectID, 18, 1, false, false);

			return true;
		}
开发者ID:Jascen,项目名称:UOSmart,代码行数:30,代码来源:BaseRanged.cs


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