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


C# Mobile.Freeze方法代码示例

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


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

示例1: OnDoubleClick

 public override void OnDoubleClick(Mobile from) //testing to make sure it works.
 {
     if (from.InRange(this, 3) && from is PlayerMobile)
     {
         from.PlaySound(from.Female ? 791 : 1063);
         from.Say("*slipped on " + Name + "*");
         if (!from.Mounted)
         {
             from.Freeze(TimeSpan.FromSeconds(4.0));
             from.Animate(22, 5, 1, true, false, 0);
             from.Freeze(TimeSpan.FromSeconds(4.0));
         }
     }
 }
开发者ID:greeduomacro,项目名称:annox,代码行数:14,代码来源:SlippedOn.cs

示例2: OnMovement

 public override void OnMovement(Mobile from, Point3D oldLocation)
 {
     if (from.InRange(this, 3) && from is PlayerMobile) //chooses the area around the bannana
     {
         from.PlaySound(from.Female ? 791 : 1063); //sound
         from.Say("*slipped on " + Name + "*"); //message
         if (!from.Mounted)  //if not on a horse do the following...
         {
             from.Freeze(TimeSpan.FromSeconds(4.0)); //stops player from running
             from.Animate(22, 5, 1, true, false, 0); //show the player falling
             from.Freeze(TimeSpan.FromSeconds(4.0)); //stops the player just a bit longer.
         }
     }
 }
开发者ID:greeduomacro,项目名称:annox,代码行数:14,代码来源:SlippedOn.cs

示例3: OnGaveMeleeAttack

		public override void OnGaveMeleeAttack(Mobile defender)
		{
            base.OnGaveMeleeAttack(defender);
            if (defender.Frozen == false)
			{
				defender.Freeze( TimeSpan.FromSeconds( 6.0 ) );
				defender.SendMessage( "You are stuck to the spot!" );
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:9,代码来源:Puddle.cs

示例4: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			if (defender.Player && defender.Region.Name == "The Paintball Field" )
			{
				Item paintrobe = defender.FindItemOnLayer(Layer.OuterTorso );
				defender.SendMessage( "You feel wet paint on you" );
				if ( paintrobe == null)
				{
					defender.SendMessage( "Cheating is not allowed!!!" );
					defender.SendMessage( "You are Eliminated" );
					defender.X = 6094;
					defender.Y = 1216;
					defender.Z = 0;
					defender.Map = Map.Felucca;
				}
				else if ( paintrobe.Hue == 6) paintrobe.Hue = 11;
				else if ( paintrobe.Hue == 11) paintrobe.Hue = 21;
				else if ( paintrobe.Hue == 21) paintrobe.Hue = 31;
				else if ( paintrobe.Hue == 31) paintrobe.Hue = 38;
				else if ( paintrobe.Hue == 38)
				{
					paintrobe.Hue = 6;
					defender.X = 6094;
					defender.Y = 1216;
					defender.Z = 0;
					defender.Map = Map.Felucca;
					defender.SendMessage( "You were Eliminated" );
					this.Name = this.Name + "/";
				}
				else
				{
					paintrobe.Hue = 6;
					defender.X = 6094;
					defender.Y = 1216;
					defender.Z = 0;
					defender.Map = Map.Felucca;
					defender.SendMessage( "You were Eliminated for an improper robe" );
				}

			}
			else if ( defender.Region.Name == "The Paintball Field" )
			{
				attacker.SendMessage( "You stunned the bot for a moment" );
				defender.Freeze( TimeSpan.FromSeconds( 10.0 ) );
			}

			damageBonus = -10;

			base.OnHit( attacker, defender, damageBonus );
		}
开发者ID:FreeReign,项目名称:realmofdarkness,代码行数:50,代码来源:PaintBallGunBase.cs

示例5: OnTrigger

		public override void OnTrigger( Mobile from )
		{
			if ( from.AccessLevel > AccessLevel.Player )
				return;

			Effects.SendLocationEffect( this.Location, this.Map, 14186, 32, 20, 300, 0 );

			Effects.PlaySound( Location, Map, 0x204 );

			if ( from.Alive && CheckRange( from.Location, 0 ) && from.CanBeDamaged() )
			{
				from.Freeze( TimeSpan.FromSeconds( m_Duration ) );
				from.SendMessage( "You have been paralyzed!" );
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:15,代码来源:ParalyzeTrap.cs

示例6: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
			defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!

			defender.Freeze( defender.Player ? PlayerFreezeDuration : NPCFreezeDuration );

			defender.FixedEffect( 0x376A, 9, 32 );
			defender.PlaySound( 0x204 );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:15,代码来源:ParalyzingBlow.cs

示例7: ExplodeHorn

        private void ExplodeHorn( Mobile target )
        {
            target.SendMessage("One of the eryon's horns seems to glow, erupting violently in a flash!");

            this.FixedEffect(0x36B0, 10, 1);
            target.BoltEffect(0);
            target.BoltEffect(0);

            target.Freeze(TimeSpan.FromSeconds(5));

            this.Direction = this.GetDirectionTo(target.Location);
            this.DoHarmful(target, true);
            target.Damage(Utility.RandomMinMax(15, 45), this);

            Item hornShard = new Item(0x9D1); //grape bunch itemID
            hornShard.Hue = 1109;
            hornShard.Name = "a piece of eryon horn";
            hornShard.MoveToWorld(target.Location, target.Map);
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:19,代码来源:Eryon.cs

示例8: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender);

			if ( cantpara )
			{
				attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
				defender.SendLocalizedMessage(1070813); // You resist paralysis.
			}
			else
			{
				attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
				defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
			}

			attacker.PlaySound(0x204);
			defender.FixedEffect(0x376A, 9, 32);
			defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);

			if ( Core.ML )
			{
				AOS.Damage( defender, attacker, (int)( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.Random( 10 ) ), true, 100, 0, 0, 0, 0 );	//0-25

				if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
				{
					defender.Paralyze( TimeSpan.FromSeconds( 2.0 ) );
					Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );				
				}
			}
			else if( !cantpara )
			{
				AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0 ); //10-25
				defender.Freeze(TimeSpan.FromSeconds(2.0));
				Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:41,代码来源:NerveStrike.cs

示例9: OnHit

        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (!Core.AOS && this.Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Paralyzing Blow", false))
            {
                defender.SendMessage("You receive a paralyzing blow!"); // Is this not localized?
                defender.Freeze(TimeSpan.FromSeconds(2.0));

                attacker.SendMessage("You deliver a paralyzing blow!"); // Is this not localized?
                attacker.PlaySound(0x11C);
            }

            if (!Core.AOS && this.Poison != null && this.PoisonCharges > 0)
            {
                --this.PoisonCharges;

                if (Utility.RandomDouble() >= 0.5) // 50% chance to poison
                    defender.ApplyPoison(attacker, this.Poison);
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:21,代码来源:BaseSpear.cs

示例10: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
			{
				defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
				defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
				attacker.PlaySound( 0x11C );
			}

			if ( Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:21,代码来源:BaseSpear.cs

示例11: Entangle

		public void Entangle( Mobile m )
		{
			Point3D p = Location;

			if ( SpellHelper.FindValidSpawnLocation( Map, ref p, true ) )
			{
				TimeSpan delay = TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 10 ) );
				m.MoveToWorld( p, Map );
				m.Freeze( delay );
				m.SendLocalizedMessage( 1042555 ); // You become entangled in the spider web.

				SpidersWeb web = new SpidersWeb( m, delay );
				p.Z += 2;
				web.MoveToWorld( p, Map );

				Combatant = m;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:18,代码来源:SpiderQueen.cs

示例12: Damage

        private void Damage( Mobile to )
        {
            if ( to != null )
            {
                // send the effects
                Effects.SendPacket( to, to.Map, new GraphicalEffect( EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, to.Location, to.Location, 20, 10, true, false ) );
                to.PlaySound( 0x307 );

                // deal the damage
                SpellHelper.Damage( this, to, GetNewAosDamage( 40, 1, 5, to ), 100, 0, 0, 0, 0 );

                // stun the target
                double stunChance = ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 2000.0;
                stunChance -= GetResistSkill( to ) / 1000.0;

                if ( Utility.RandomDouble() < stunChance && !ParalyzingBlow.IsInmune( to ) )
                {
                    to.Freeze( TimeSpan.FromSeconds( 2.0 ) );
                    ParalyzingBlow.BeginInmunity( to, TimeSpan.FromSeconds( 10.0 ) );
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:22,代码来源:BombardSpell.cs

示例13: OnSwing

		public override TimeSpan OnSwing( Mobile attacker, Mobile defender )
		{
			if ( attacker.StunReady )
			{
				if ( attacker.CanBeginAction( typeof( Fists ) ) )
				{
					if ( attacker.Skills[SkillName.Anatomy].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0 )
					{
						if ( attacker.Stam >= 15 )
						{
							attacker.Stam -= 15;

							if ( CheckMove( attacker, SkillName.Anatomy ) )
							{
								StartMoveDelay( attacker );

								attacker.StunReady = false;

								attacker.SendLocalizedMessage( 1004013 ); // You successfully stun your opponent!
								defender.SendLocalizedMessage( 1004014 ); // You have been stunned!

								defender.Freeze( TimeSpan.FromSeconds( 4.0 ) );
							}
							else
							{
								attacker.SendLocalizedMessage( 1004010 ); // You failed in your attempt to stun.
								defender.SendLocalizedMessage( 1004011 ); // Your opponent tried to stun you and failed.
							}
						}
						else
						{
							attacker.SendLocalizedMessage( 1004009 ); // You are too fatigued to attempt anything.
						}
					}
					else
					{
						attacker.SendLocalizedMessage( 1004008 ); // You are not skilled enough to stun your opponent.
						attacker.StunReady = false;
					}
				}
			}
			else if ( attacker.DisarmReady )
			{
				if ( attacker.CanBeginAction( typeof( Fists ) ) )
				{
					if ( defender.Player || defender.Body.IsHuman )
					{
						if ( attacker.Skills[SkillName.ArmsLore].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0 )
						{
							if ( attacker.Stam >= 15 )
							{
								Item toDisarm = defender.FindItemOnLayer( Layer.OneHanded );

								if ( toDisarm == null || !toDisarm.Movable )
									toDisarm = defender.FindItemOnLayer( Layer.TwoHanded );

								Container pack = defender.Backpack;

								if ( pack == null || toDisarm == null || !toDisarm.Movable )
								{
									attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent.
								}
								else if ( CheckMove( attacker, SkillName.ArmsLore ) )
								{
									StartMoveDelay( attacker );

									attacker.Stam -= 15;
									attacker.DisarmReady = false;

									attacker.SendLocalizedMessage( 1004006 ); // You successfully disarm your opponent!
									defender.SendLocalizedMessage( 1004007 ); // You have been disarmed!

									pack.DropItem( toDisarm );
								}
								else
								{
									attacker.Stam -= 15;

									attacker.SendLocalizedMessage( 1004004 ); // You failed in your attempt to disarm.
									defender.SendLocalizedMessage( 1004005 ); // Your opponent tried to disarm you but failed.
								}
							}
							else
							{
								attacker.SendLocalizedMessage( 1004003 ); // You are too fatigued to attempt anything.
							}
						}
						else
						{
							attacker.SendLocalizedMessage( 1004002 ); // You are not skilled enough to disarm your opponent.
							attacker.DisarmReady = false;
						}
					}
					else
					{
						attacker.SendLocalizedMessage( 1004001 ); // You cannot disarm your opponent.
					}
				}
			}

//.........这里部分代码省略.........
开发者ID:romeov007,项目名称:imagine-uo,代码行数:101,代码来源:Fists.cs

示例14: DoComboDefense

        //

        // carry out the combo defenses
        //
        // If you add a new combo, you must add the code here to define what it actually does when it is activated
        //
        public void DoComboDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboDefense combo)
        {
            if (attacker == null || defender == null || weapon == null || combo == null)
                return;

            defender.SendMessage("You unleash the combo defense {0}!", combo.Name);

            // apply the combo defense
            switch(combo.DefenseID)
            {
                case ComboDefenses.ColdWind:
                    {
                        // 5 sec paralyze
                        attacker.FixedEffect(0x376A, 9, 32);
                        attacker.PlaySound(0x204);
                        attacker.Freeze(TimeSpan.FromSeconds(5));
                        // 7x stam drain
                        attacker.Stam -= weapon.MaxDamage * 7;
                        break;
                    }
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:28,代码来源:XmlCustomDefenses.cs

示例15: DoSpecialDefense

        //
        // carry out the special defenses
        //
        // If you add a new defense, you must add the code here to define what it actually does when it hits
        // can optionally return a value that will be used to reduce damage
        //
        public int DoSpecialDefense(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialDefense special)
        {
            if (attacker == null || defender == null || weapon == null || special == null)
                return 0;

            defender.SendMessage("you defend with {0}!", special.Name);

            // apply the special defense
            switch(special.DefenseID)
            {
                case SpecialDefenses.MindDrain:
                    {
                        attacker.Mana -= damageGiven;
                        defender.FixedEffect(0x375A, 10, 15);
                        // absorb all of the damage you would have taken
                        return damageGiven;
                    }
                case SpecialDefenses.StamDrain:
                    {
                        attacker.Stam -= damageGiven;
                        defender.FixedEffect(0x374A, 10, 15);
                        // absorb all of the damage you would have taken
                        return damageGiven;
                    }
                case SpecialDefenses.SpikeShield:
                    {
                        // return the damage to attacker
                        attacker.Damage(damageGiven, defender);
                        defender.SendMessage("{0} damage reflected!", damageGiven);
                        // absorb all of the damage you would have taken
                        return damageGiven;
                    }
                case SpecialDefenses.PuffOfSmoke:
                    {
                        defender.Hidden = true;
                        break;
                    }
                case SpecialDefenses.GiftOfHealth:
                    {
                        defender.FixedEffect(0x376A, 9, 32);
                        defender.PlaySound(0x202);
                        defender.Hits += damageGiven;
                        defender.SendMessage("healed {0}!", damageGiven);
                        // absorb all of the damage you would have taken
                        return damageGiven;
                    }
                case SpecialDefenses.ParalyzingFear:
                    {
                        // lose target focus
                        attacker.Combatant = null;
                        // flee
                        if (attacker is BaseCreature)
                        {
                            ((BaseCreature)attacker).BeginFlee(TimeSpan.FromSeconds(6));
                        }
                        // and become paralyzed
                        attacker.Freeze(TimeSpan.FromSeconds(damageGiven / 10));
                        attacker.FixedEffect(0x376A, 9, 32);
                        attacker.PlaySound(0x204);
                        break;
                    }
                default:
                    defender.SendMessage("no effect");
                    break;
            }
            return 0;
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:73,代码来源:XmlCustomDefenses.cs


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