本文整理汇总了C#中Server.Mobile.MovingEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.MovingEffect方法的具体用法?C# Mobile.MovingEffect怎么用?C# Mobile.MovingEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.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 );
}
示例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);
}
示例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);
}
示例4: 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" );
}
}
}
示例5: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !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 )
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, m_Damage, 0, 0, 0, 0, 100 );
if ( m_Target != null )
{
defender.MovingEffect( m_Target, weapon.ItemID, 18, 1, false, false );
Timer.DelayCall( TimeSpan.FromMilliseconds( 333.0 ), new TimerCallback( ThrowAgain ) );
m_Mobile = attacker;
}
ClearCurrentAbility( attacker );
}
示例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 );
if ( m_NextSound < DateTime.Now && message != 500757 )
{
if ( message == 500752 )
Effects.PlaySound( Location, Map, 426 );
else
Effects.PlaySound( Location, Map, 425 );
if ( message < 500756 )
AnimateMongbat();
m_NextSound = DateTime.Now + TimeSpan.FromSeconds( 2 );
}
}
示例7: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( m_Dagger.Deleted )
{
return;
}
else if ( !from.GetEquippedItems().Contains( m_Dagger ) )
{
from.SendMessage( "You must be holding that weapon to use it." );
}
else 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( m.Dex / 100.0 ) * 0.8 ) )
{
from.MovingEffect( m, 0x1BFE, 7, 1, false, false, 0x481, 0 );
AOS.Damage( m, from, Utility.Random( 5, from.Str / 10 ), 100, 0, 0, 0, 0 );
m_Dagger.MoveToWorld( m.Location, m.Map );
}
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;
m_Dagger.MoveToWorld( new Point3D( x, y, m.Z ), m.Map );
from.MovingEffect( m_Dagger, 0x1BFE, 7, 1, false, false, 0x481, 0 );
from.SendMessage( "You miss." );
}
}
}
}
示例8: OnTarget
protected override void OnTarget( Mobile from, object obj )
{
if ( m_NecroCrystal.Deleted )
return;
if ( obj is Mobile )
{
Mobile to = (Mobile)obj;
if ( !m_NecroCrystal.IsChildOf( from.Backpack ) )
{
from.SendMessage( "This must be in your pack" ); // The bola must be in your pack to use it.
}
else if ( from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null )
{
from.SendMessage( "Your hands must be free!" ); // 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 ( !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( NecroCrystal ) ) )
{
}
else if ( to is NecromancerChamp )
{
from.SendMessage( "The Crystal weakens the monster!" );
to.Damage( 50, from );
}
m_NecroCrystal.Consume();
from.Direction = from.GetDirectionTo( to );
//from.Animate( 11, 5, 1, true, false, 0 );
from.MovingEffect( to, 0x1EA7, 10, 0, false, false );
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FinishThrow ), new object[]{ from, to } );
}
else
{
from.SendMessage( "You have to wait a few moments before you can use another Crystal!" ); // You have to wait a few moments before you can use another bola!
}
//else
//{
// from.SendMessage( "You cannot throw a crystal at that!" ); // You cannot throw a bola at that.
//}
}
示例9: Shoot
public void Shoot( Mobile from, Mobile target )
{
if ( from == target )
return;
if ( m_UsesRemaining < 1 )
{
// You have no fukiya darts!
from.SendLocalizedMessage( 1063325 );
}
else if ( m_Using.Contains( from ) )
{
// You are already using that fukiya.
from.SendLocalizedMessage( 1063326 );
}
else if ( !HasFreeHand( from ) )
{
// You must have a free hand to use a fukiya.
from.SendLocalizedMessage( 1063327 );
}
else if ( from.GetDistanceToSqrt( target ) > 5 )
{
// Your target is too far!
from.SendLocalizedMessage( 1063304 );
}
else if ( from.CanBeHarmful( target ) )
{
m_Using.Add( from );
from.Direction = from.GetDirectionTo( target );
from.RevealingAction();
from.PlaySound( 0x223 );
from.MovingEffect( target, 0x2804, 5, 0, false, false );
if ( CheckHitChance( from, target ) )
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( OnDartHit ), new object[] { from, target } );
else
ConsumeUse();
// Shooting a fukiya dart restarts your weapon swing delay
from.NextCombatTime = DateTime.Now + from.Weapon.GetDelay( from );
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), () => m_Using.Remove( from ) );
}
}
示例10: TjnarsScythe_OnTarget
public virtual void TjnarsScythe_OnTarget( Mobile from, object target )
{
if( !from.CanSee( target ) )
{
from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
}
else if( target is Mobile )
{
Mobile targetMobile = (Mobile)target;
if( targetMobile.Body.IsHuman )
{
if( targetMobile.Hits < (targetMobile.HitsMax / 10) )
{
targetMobile.PlaySound( 565 ); //Consecrate Weapon sound
from.PlaySound( 565 );
from.MovingEffect( targetMobile, 0x26C4, 9, 1, false, false ); //Launches a solid scythe
Effects.SendMovingParticles( from, targetMobile, 0x26C4, 1, 0, false, false, 1109, 3, 9501, 1, 0, EffectLayer.Waist, 0x100 ); //Launches a rendered scythe
targetMobile.FixedParticles( 0x3779, 1, 30, 9964, 1109, 3, EffectLayer.Waist ); //Small sparklies on the target
targetMobile.Kill();
Head head = new Head( String.Format( "the head of {0}", targetMobile.Name ) );
from.AddToBackpack( head );
from.BoltEffect( 1 );
this.Delete();
}
else
{
from.PublicOverheadMessage( MessageType.Emote, from.EmoteHue, false, "*the voice of Tjnar rings out across the region:*", false );
from.PublicOverheadMessage( MessageType.Yell, from.SpeechHue, false, "\"You fool! That mere mortal is not prepared to die! Crush the body, and the mind shall be yours!\"", false );
from.SendMessage( "Your target must have less than 10% of his health in order for this spell to work." );
}
}
else
{
from.SendMessage( "This spell will only work on humans." );
}
}
from.Frozen = false;
}
示例11: Shoot
public void Shoot( Mobile from, Mobile target )
{
if ( from == target )
return;
if ( m_UsesRemaining < 1 )
{
// You have no shuriken in your ninja belt!
from.SendLocalizedMessage( 1063297 );
}
else if ( m_Using )
{
// You cannot throw another shuriken yet.
from.SendLocalizedMessage( 1063298 );
}
else if ( !BasePotion.HasFreeHand( from ) )
{
// You must have a free hand to throw shuriken.
from.SendLocalizedMessage( 1063299 );
}
else if ( from.InRange( target, 2 ) )
{
from.SendLocalizedMessage( 1063303 ); // Your target is too close!
}
else if ( from.CanBeHarmful( target ) )
{
m_Using = true;
from.Direction = from.GetDirectionTo( target );
from.RevealingAction();
if ( from.Body.IsHuman )
from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
from.PlaySound( 0x23A );
from.MovingEffect( target, 0x27AC, 1, 0, false, false );
if ( from.CheckSkill( SkillName.Ninjitsu, -10.0, 65.0 ) )
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( OnShurikenHit ), new object[]{ from, target } );
else
ConsumeUse();
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( ResetUsing ) );
}
}
示例12: Shoot
public void Shoot( Mobile from, Mobile target )
{
if ( from == target )
return;
if ( m_UsesRemaining < 1 )
{
// You have no fukiya darts!
from.SendLocalizedMessage( 1063325 );
}
else if ( m_Using )
{
// You are already using that fukiya.
from.SendLocalizedMessage( 1063326 );
}
else if ( !BasePotion.HasFreeHand( from ) )
{
// You must have a free hand to use a fukiya.
from.SendLocalizedMessage( 1063327 );
}
else if ( from.CanBeHarmful( target ) )
{
m_Using = true;
from.Direction = from.GetDirectionTo( target );
from.RevealingAction();
if ( from.Body.IsHuman && !from.Mounted )
from.Animate( 33, 2, 1, true, true, 0 );
from.PlaySound( 0x223 );
from.MovingEffect( target, 0x2804, 5, 0, false, false );
if ( from.CheckSkill( SkillName.Ninjitsu, -10.0, 50.0 ) )
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( OnDartHit ), new object[]{ from, target } );
else
ConsumeUse();
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( ResetUsing ) );
}
}
示例13: Shoot
public void Shoot( Mobile from, Mobile target )
{
if ( from == target )
return;
if ( m_UsesRemaining < 1 )
{
// You have no AzhuranBlowGun darts!
from.SendMessage( "You have no blow gun darts in the weapon." );
}
else if ( m_Using )
{
// You are already using that AzhuranBlowGun.
from.SendMessage( "You are already using that blow gun." );
}
else if ( !BasePotion.HasFreeHand( from ) )
{
// You must have a free hand to use a AzhuranBlowGun.
from.SendMessage( "You must have a free hand to use a blow gun." );
}
else if ( from.CanBeHarmful( target ) )
{
m_Using = true;
from.Direction = from.GetDirectionTo( target );
if ( from.Body.IsHuman && !from.Mounted )
from.Animate( 33, 2, 1, true, true, 0 );
from.PlaySound( 0x223 );
from.MovingEffect( target, 0x2804, 5, 0, false, false );
if ( from.CheckSkill( SkillName.Archery, -10.0, 50.0 ) )
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( OnDartHit ), new object[]{ from, target } );
else
ConsumeUse();
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( ResetUsing ) );
}
}
示例14: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( m_belt.Deleted )
{
return;
}
else if ( targeted is Mobile )
{
if ( !BasePotion.HasFreeHand( from ) && !BasePotion.HasBalancedWeapon( from ) )
{
from.SendLocalizedMessage( 1063299 ); // You must have a free hand to throw shuriken.
return;
}
Mobile m = (Mobile) targeted;
double dist = from.GetDistanceToSqrt( m.Location );
if ( m.Map != from.Map || dist > 11 )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
return;
}
else if ( from.InRange( m, 2 ) )
{
from.SendLocalizedMessage( 1063303 ); // Your target is too close!
return;
}
if ( m != from && from.HarmfulCheck( m ) )
{
Direction to = from.GetDirectionTo( m );
from.Direction = to;
from.RevealingAction();
from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
if ( Fukiya.CheckHitChance( from, m ) )
{
from.MovingEffect( m, 0x27AC, 7, 1, false, false, 0x23A, 0 );
AOS.Damage( m, from, Utility.Random( 3, 5 ), 100, 0, 0, 0, 0 );
if ( m_belt.Poison != null && m_belt.PoisonCharges > 0 )
{
--m_belt.PoisonCharges;
Poison poison = m_belt.Poison;
int maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
if ( poison.Level > maxLevel )
poison = Poison.GetPoison( maxLevel );
m.ApplyPoison( from, poison );
}
}
else
{
from.MovingEffect( new Shuriken(), 0x27AC, 7, 1, false, false, 0x23A, 0 );
from.SendMessage( "You miss." );
}
// Throwing a shuriken restarts you weapon's swing delay
from.NextCombatTime = DateTime.Now + from.Weapon.GetDelay( from );
m_belt.UsesRemaining--;
}
}
}
示例15: 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;
}