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


C# Mobile.Animate方法代码示例

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


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

示例1: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( Hue != 1150 )
			{
				base.OnDoubleClick( from );
				return;
			}

			Container pack = from.Backpack;

			if ( !(pack != null && Parent == pack) )
			{
				from.SendLocalizedMessage( 1080058 ); // This must be in your backpack to use it.
				return;
			}

			from.Animate( 34, 5, 1, true, false, 0 );
			from.PlaySound( Utility.Random( 0x3A, 3 ) );

			if ( BlueMageControl.IsBlueMage( from ) )
				BlueMageControl.CheckKnown( from, typeof( AngelsSnackSpell ), true );

			Hue = Utility.RandomList( 0, 0x66D, 0x53D, 0x8A5, 0x21, 0x5, 0x38, 0xD, 0x59B, 0x46F, 0x10, 0x42, 0x2B );
			Name = "grasses";
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:25,代码来源:AngelSnack.cs

示例2: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( from.InRange( this.Location, 1 ) )
            {
                if ( !from.Mounted )
                {
                    Flower flower = Activator.CreateInstance( Ingredient ) as Flower;
                    if ( flower != null )
                    {
                        Server.Spells.SpellHelper.Turn( from, this );
                        from.Animate( 32, 5, 1, true, false, 0 );
                        from.PlaySound( 79 );

                        from.SendMessage( "You have picked the flower." );
                        flower.Hue = this.Hue;
                        from.AddToBackpack( flower );
                        ((PlayerMobile)from).Crafting = true;
                        Misc.LevelSystem.AwardMinimumXP( (PlayerMobile)from, 1 );
                        ((PlayerMobile)from).Crafting = false;
                        Delete();
                    }
                }
                else
                    from.SendMessage( "You can't do that while mounted." );
            }
            else
                from.SendMessage( "You are too far away." );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:28,代码来源:BaseFlowerPlant.cs

示例3: Eat

		public override sealed bool Eat(Mobile from)
		{
			if (from == null || from.Deleted)
			{
				return false;
			}

			if (CheckHunger(from))
			{
				from.PlaySound(Utility.Random(0x3A, 3));

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

				if (Poison != null)
				{
					from.ApplyPoison(Poisoner, Poison);
				}

				OnEaten(from);
				Consume();
				return true;
			}

			return false;
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:28,代码来源:MagicalFood.cs

示例4: Target

		public static void Target( Mobile from, object target, ACreedJinBori jinbori )
		{
			if ( from == null || jinbori.Parent != from )
				return;

			Mobile to = target as Mobile;

			if ( to == null )
				return;

			int delay = 11;
			delay -= (from.Dex / 30);

			if ( delay < 6 )
				delay = 6;

			jinbori.ThrowDelay = DateTime.Now + TimeSpan.FromSeconds( delay );
			--jinbori.m_Ammo;

			from.Direction = from.GetDirectionTo( to );
			from.Animate( 31, 5, 1, true, false, 0 );
			// SendMovingEffect( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes )
			Effects.SendMovingEffect( from, to, 0xF51, 10, 1, false, false );

			Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( jinbori.ACreedDaggerDamage_CallBack ), to );
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:26,代码来源:ACreedJinBori.cs

示例5: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:28,代码来源:SpellScrolls.cs

示例6: 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:romeov007,项目名称:imagine-uo,代码行数:32,代码来源:DartBoard.cs

示例7: OnChop

		public virtual void OnChop( Mobile from )
		{
			double chance = (from.Skills[SkillName.Lumberjacking].Value * 0.20);

			if( !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( Sower != null && from != Sower )
			{
				from.SendMessage( "You cannot chop down this tree." );
			}
			else if( chance > Utility.RandomDouble() )
			{
				from.Animate( 13, 7, 1, true, false, 0 );
				from.PlaySound( 0x13E );
				from.SendMessage( "You manage to cut down the tree." );

				new Weeds().MoveToWorld( this.Location, this.Map );
				new Server.Items.TimedItem( 60.0, 0x1038 ).MoveToWorld( this.Location, this.Map );

				from.AddToBackpack( new Log( 10 ) );

				this.Delete();
			}
			else
			{
				from.SendMessage( "You find yourself unable to cut down this tree right now." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:30,代码来源:HarvestableTree.cs

示例8: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !ValidateUse( from ) )
				{
					SendLocalizedMessageTo( from, 500309 ); // Nothing Happens.
				}
				else if ( m_PlayTimer != null )
				{
					SendLocalizedMessageTo( from, 1042144 ); // This is currently in use.
				}
				else if ( Charges > 0 )
				{
					from.Animate( 34, 7, 1, true, false, 0 );
					from.PlaySound( 0xFF );
					from.SendLocalizedMessage( 1049115 ); // You play the horn and a sense of peace overcomes you...

					--Charges;

					m_PlayTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( PlayTimer_Callback ), from );
				}
				else
				{
					SendLocalizedMessageTo( from, 1042544 ); // This item is out of charges.
				}
			}
			else
			{
				SendLocalizedMessageTo( from, 1042001 ); // That must be in your pack for you to use it.
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:32,代码来源:HornOfRetreat.cs

示例9: Eat

        public override bool Eat( Mobile from )
        {
            if ( !CheckCooldown( from ) )
                return false;

            // The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
            from.SendLocalizedMessage( 1074847 );

            m_InfluenceList.Add( from );
            m_CooldownTable.Add( from, DateTime.Now + Cooldown );

            Timer.DelayCall( Duration, new TimerStateCallback( delegate { m_InfluenceList.Remove( from ); } ), from );

            // Play a random "eat" sound
            from.PlaySound( Utility.Random( 0x3A, 3 ) );

            from.Animate( 6 );

            if ( Poison != null )
                from.ApplyPoison( Poisoner, Poison );

            Consume();

            return true;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:25,代码来源:GrapesOfWrath.cs

示例10: 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

示例11: 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:jsrn,项目名称:MidnightWatchServer,代码行数:10,代码来源:Fukiya.cs

示例12: OnMine

        public void OnMine(Mobile from, Item tool)
        {
            if (tool is IUsesRemaining && ((IUsesRemaining)tool).UsesRemaining < 1)
                return;

            from.Direction = from.GetDirectionTo(this.Location);
            from.Animate(11, 5, 1, true, false, 0);

            Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(DoMine), new object[] { from, tool });
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:10,代码来源:Niter.cs

示例13: 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:romeov007,项目名称:imagine-uo,代码行数:10,代码来源:LeatherNinjaBelt.cs

示例14: OnTarget

			protected override void OnTarget( Mobile from, object obj )
			{
				if ( m_BaseThrowingItem.Deleted || m_BaseThrowingItem.Map == Map.Internal)
					return;

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

					if ( !from.CanBeHarmful( to ) )
					{
					}
					else
					{	from.Direction = from.GetDirectionTo( to );
						from.Animate( 11, 5, 1, true, false, 0 );
						from.MovingEffect( to, m_BaseThrowingItem.ItemID, 10, 0, false, false );

						Timer.DelayCall<ThrowInfo>( TimeSpan.FromSeconds( 0.5 ), new TimerStateCallback<ThrowInfo>( FinishThrow ), new ThrowInfo( from, to, m_DamageMin, m_DamageMax, m_Break, m_BaseThrowingItem ) );

						if ( m_DeleteOnThrow || m_Break )
							m_BaseThrowingItem.Delete();
					}
				}
				else
				{
					IPoint3D p = obj as IPoint3D;

					if ( p == null )
						return;

					Map map = from.Map;

					if ( map == null )
						return;

					IEntity to;

					to = new Entity( Serial.Zero, new Point3D( p ), map );

					from.Direction = from.GetDirectionTo( to );
					Effects.SendMovingEffect( from, to, m_BaseThrowingItem.ItemID & 0x3FFF, 7, 0, false, false, m_BaseThrowingItem.Hue, 0 );
					from.Animate( 11, 5, 1, true, false, 0 );

					if ( m_DeleteOnThrow )
					{
						m_BaseThrowingItem.Delete();
						from.SendMessage( "You miss the target and the {0} is wasted", m_BaseThrowingItem.Name );
					}
					else
					{
						Timer.DelayCall<object[]>( TimeSpan.FromSeconds( 0.5 ), new TimerStateCallback<object[]>( FinishMiss ), new object[]{ to, map, m_BaseThrowingItem } );
						from.SendMessage( "You miss the target" );
					}
				}
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:55,代码来源:BaseThrowingItem.cs

示例15: OnDoubleClick

		public virtual void OnDoubleClick( Mobile from, bool createWeedsAndDelete )
		{
			if( !from.CanSee( this ) )
			{
				from.SendMessage( "You cannot see that." );
			}
			else if( !(this is HarvestableTree) && !from.InRange( this, 1 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( this is HarvestableTree && !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( (Sower != null && from != m_Sower) && !(this is HarvestableTree) )
			{
				from.SendMessage( "You cannot harvest any of this crop." );
			}
			else if( from.Mounted )
			{
				from.SendMessage( "You cannot do this while riding a mount." );
			}
			else
			{
				int calcYield = CalculateYield( from );
				Item crop = null;

				try { crop = CreateCrop( calcYield ); }
				catch( Exception e ) { Server.Utilities.ExceptionManager.LogException( "BaseGrownCrop.cs", e ); }

				if( crop == null )
				{
					from.SendMessage( "You are unable to harvest any of this crop!" );
				}
				else
				{
					from.AddToBackpack( crop );

					from.Direction = from.GetDirectionTo( this );
					from.Animate( AnimationFrame, 5, 1, true, false, 0 );
					from.PlaySound( 0x133 );
					from.SendMessage( "You successfully harvest the crop!" );
				}

				if( createWeedsAndDelete )
				{
					new Weeds().MoveToWorld( this.Location, this.Map );
					this.Delete();
				}
				else
				{
					OnHarvest( from );
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:55,代码来源:BaseGrownCrop.cs


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