本文整理汇总了C#中Mobile.Animate方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.Animate方法的具体用法?C# Mobile.Animate怎么用?C# Mobile.Animate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.Animate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HideEffects
public override void HideEffects(Mobile from)
{
if (from == null || from.Deleted)
return;
if (playing)
from.SendMessage("You must wait for the animation to finish.");
else if (from.Hidden)
{
playing = true;
tohide = false;
tempHue = from.Hue;
tempBody = from.BodyValue;
from.Hue = 0;
from.BodyValue = 15;
from.Hidden = false;
from.Animate(12, 10, 0, true, false, 0);
from.PlaySound(273);
Timer.DelayCall(TimeSpan.FromMilliseconds(1500.0), new TimerStateCallback(AnimStop_Callback), from);
}
else
{
playing = true;
tohide = true;
from.Animate(17, 4, 1, true, false, 0);
Timer.DelayCall(TimeSpan.FromMilliseconds(750.0), new TimerStateCallback(CastStop_Callback), from);
}
}
示例2: PlayCraftEffect
public override void PlayCraftEffect( Mobile from )
{
// no animation
if ( from.Body.Type == BodyType.Human ) // Vulcan: Added mounted animation
{
if (!from.Mounted)
from.Animate(9, 5, 1, true, false, 0);
else
from.Animate(26, 5, 1, true, false, 0);
}
from.PlaySound( 0x23D );
}
示例3: Eat
public override bool Eat(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("Ceci doit être dans votre sac");
return false;
}
// Fill the Mobile with FillFactor
if (from is PlayerMobile)
{
CanEat = false;
Timer.DelayCall(TimeSpan.FromSeconds(3), ChangeCanEat);
// Play a random "eat" sound
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);
if (from.Hunger < 20)
from.Hunger += Utility.Random(FillFactor);
DoEffect(from);
return true;
}
return false;
}
示例4: PlayCraftEffect
public override void PlayCraftEffect( Mobile from )
{
// no effects
if ( from.Body.Type == BodyType.Human && !from.Mounted )
from.Animate( 9, 5, 1, true, false, 0 );
new InternalTimer( from ).Start();
}
示例5: 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 );
}
示例6: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ( from == null || !from.Alive ) return;
// lumbervalue = 100; will give 100% sucsess in picking
mageValue = from.Skills[SkillName.Magery].Value + 20;
if ( DateTime.Now > lastpicked.AddSeconds(1) ) // 3 seconds between picking changed to 1 sec
{
lastpicked = DateTime.Now;
if ( from.InRange( this.GetWorldLocation(), 1 ) )
{
if ( mageValue > Utility.Random( 100 ) )
{
from.Direction = from.GetDirectionTo( this );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
from.SendMessage("You pull the plant up by the root.");
this.Delete();
from.AddToBackpack( new MandrakeUprooted() );
}
else from.SendMessage("The plant is hard to pull up.");
}
else
{
from.SendMessage( "You are too far away to harvest anything." );
}
}
}
示例7: Eat
public override bool Eat(Mobile from)
{
if (CheckHunger(from))
{
from.PlaySound(Utility.Random(0x3A, 3));
if (from.Body.IsHuman && !from.Mounted)
from.Animate(34, 5, 1, true, false, 0);
if (from is PlayerMobile || !from.IsHallucinated)
{
PlayerMobile junkie = from as PlayerMobile;
junkie.Hallucinating = true;
junkie.IncAddiction(new HallucinogenPotion());
Timer.DelayCall(TimeSpan.FromMinutes(5), HallucinogenPotion.StopHallucinate, junkie);
}
else if (Poison != null)
from.ApplyPoison(Poisoner, Poison);
Consume();
return true;
}
return false;
}
示例8: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ( from == null || !from.Alive ) return;
// lumbervalue = 100; will give 100% sucsess in picking
lumberValue = from.Skills[SkillName.Lumberjacking].Value / 5;
if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
{
lastpicked = DateTime.Now;
if ( from.InRange( this.GetWorldLocation(), 2 ) )
{
if ( lumberValue > Utility.Random( 100 ) )
{
from.Direction = from.GetDirectionTo( this );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
from.SendMessage(AgriTxt.PullRoot);
this.Delete();
from.AddToBackpack( new NightshadeUprooted() );
}
else from.SendMessage(AgriTxt.HardPull);
}
else
{
from.SendMessage(AgriTxt.HardPull);
}
}
}
示例9: Gifle_Callback
/// <summary>
/// Execution de la gifle
/// </summary>
public static void Gifle_Callback(Mobile mJoueur, object objCible)
{
if (objCible is Mobile)
{
Mobile mCible = objCible as Mobile;
// si le joueur s'est ciblé lui même
if (mJoueur == mCible)
mJoueur.Emote("*{0} se gifle*", mJoueur.Name);
// si il reussi a donner la gifle
else if (Utility.Random(10) > 3) // Scriptiz : pas besoin de stocker le booléen
{
mJoueur.Emote("*{0} gifle {1}*", mJoueur.Name, mCible.Name);
mCible.Emote("*{0} se prend une gifle de {1}*", mCible.Name, mJoueur.Name);
}
else // quel looseur il s'est manqué
{
mJoueur.Emote("*{0} gifle {1}, mais ratte*", mJoueur.Name, mCible.Name );
mCible.Emote("*{0} esquive une gifle de {1}*", mCible.Name, mJoueur.Name);
}
// animation
mCible.Animate(20, 1, 1, true, false, 2);
mJoueur.Animate(33, 1, 1, true, false, 2);
// Scriptiz : son
mCible.PlaySound(0x135);
}
}
示例10: PlayCraftEffect
public override void PlayCraftEffect( Mobile from )
{
// no animation
if ( from.Body.Type == BodyType.Human && !from.Mounted )
from.Animate( 33, 5, 1, true, false, 0 );
from.PlaySound( 0x55 );
}
示例11: 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);
}
示例12: 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);
}
示例13: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
from.RevealingAction();
bool releaseLock = true;
int number = -1;
if ( targeted is Mobile )
{
Mobile targ = (Mobile)targeted;
if ( targ.Player ) // We can't beg from players
{
number = 500398; // Perhaps just asking would work better.
}
else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
{
number = 500399; // There is little chance of getting money from that!
}
else if ( !from.InRange( targ, 2 ) )
{
if ( !targ.Female )
number = 500401; // You are too far away to beg from him.
else
number = 500402; // You are too far away to beg from her.
}
else if ( from.Mounted ) // If we're on a mount, who would give us money?
{
number = 500404; // They seem unwilling to give you any money.
}
else
{
releaseLock = false;
// Face eachother
from.Direction = from.GetDirectionTo( targ );
targ.Direction = targ.GetDirectionTo( from );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
new InternalTimer( from, targ ).Start();
m_SetSkillTime = false;
}
}
else // Not a Mobile
{
number = 500399; // There is little chance of getting money from that!
}
if ( number != -1 )
from.SendLocalizedMessage( number );
if (releaseLock && from is PlayerMobile)
((PlayerMobile)from).EndPlayerAction();
}
示例14: BalanceSequence
public void BalanceSequence( Mobile m )
{
m.Frozen = true;
Timer.DelayCall<Mobile>( TimeSpan.FromSeconds( 1.25 ), new TimerStateCallback<Mobile>( EndFall_Callback ), m );
m.SendLocalizedMessage( 1095161 ); //You skillfully manage to maintain your balance.
if ( !m.Mounted )
m.Animate( 17, 1, 1, false, true, 0 );
m.PlaySound( m.Female ? 0x319 : 0x429 );
}
示例15: AnimStop_Callback
private void AnimStop_Callback(Mobile from)
{
from.Hue = tempHue;
from.BodyValue = tempBody;
if (tohide)
from.Hidden = true;
else
from.Animate(17, 4, 1, false, false, 0);
playing = false;
}