本文整理汇总了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";
}
示例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." );
}
示例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;
}
示例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 );
}
示例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 ) );
}
}
}
示例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 );
}
示例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." );
}
}
示例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.
}
}
示例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;
}
示例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;
}
示例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);
}
示例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 });
}
示例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);
}
示例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" );
}
}
}
示例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 );
}
}
}