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


C# Mobile.Heal方法代码示例

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


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

示例1: DoHeal

        public void DoHeal( Mobile from )
        {
            int min = Scale( from, MinHeal );
            int max = Scale( from, MaxHeal );

            from.Heal( Utility.RandomMinMax( min, max ) );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:BaseHealPotion.cs

示例2: Target

        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( m.IsDeadBondedPet )
            {
                Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
            }
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4);
                toHeal += Utility.Random( 1, 10 );

                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:35,代码来源:GreaterHeal.cs

示例3: Target

        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4) + Utility.Random( 10 ) + 1;
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:31,代码来源:GreaterHeal.cs

示例4: DoHeal

        public void DoHeal(Mobile from)
        {
            int min = Scale(from, MinHeal);
            int max = Scale(from, MaxHeal);

            from.Heal(Utility.RandomMinMax(min, max) + (IntensifiedStrength ? 5 : 0));
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:7,代码来源:BaseHealPotion.cs

示例5: Target

        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            /* // idea... dont allow lesser heal to heal through poison (but allow it on gheal)
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 ); // You cannot heal that target/yourself in their/your current state.
            }*/
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                int toHeal = 1 + (int)( Utility.Random( 15 ) * Caster.Skills[SkillName.Magery].Value / 100.0 );
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
                m.PlaySound( 0x1F2 );
            }

            FinishSequence();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:34,代码来源:Heal.cs

示例6: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.GetWorldLocation(), 1 ) )
			{
				from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
				return;
			}
			else if ( from != m_Caster )
			{
				// from.SendLocalizedMessage( ); // 
				return;
			}

			BaseWeapon weapon = from.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if ( weapon == null )
				weapon = from.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( weapon != null )
			{
				from.SendLocalizedMessage( 1080116 ); // You must have a free hand to use a Healing Stone.
			}
			else if ( from.BeginAction( typeof( BaseHealPotion ) ) )
			{
				from.Heal( Utility.RandomMinMax( BasePotion.Scale( from, 13 ) , BasePotion.Scale( from, 16 ) ) );
				this.Consume();
				Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( ReleaseHealLock ), from );
			}
			else
				from.SendLocalizedMessage( 1095172 ); // You must wait a few seconds before using another Healing Stone.
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:31,代码来源:HealingStone.cs

示例7: DoHeal

		public void DoHeal( Mobile from )
		{
			int min = Scale( from, MinHeal );
			int max = Scale( from, MaxHeal );

			int toHeal = Utility.RandomMinMax( min, max );

			int healmessage = Math.Min( from.HitsMax - from.Hits, toHeal );

			from.Heal( toHeal );

			if ( healmessage > 0 )
				from.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), from.NetState );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:14,代码来源:BaseHealPotion.cs

示例8: Target

		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m.IsDeadBondedPet )
			{
				Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
			}
			else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
			{
				Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
			}
			else if ( m is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				int toHeal;

				if ( Core.AOS )
				{
					toHeal = Caster.Skills.Magery.Fixed / 120;
					toHeal += Utility.RandomMinMax( 1, 4 );

					if( Core.SE && Caster != m )
						toHeal = (int)(toHeal * 1.5);
				}
				else
				{
					toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
					toHeal += Utility.Random( 1, 5 );
				}

				m.Heal( toHeal );

				m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
				m.PlaySound( 0x1F2 );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:50,代码来源:Heal.cs

示例9: Target

		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				// Algorithm: (10% of magery) + (1-5)

				int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
				toHeal += Utility.Random( 1, 5 );

				int healmessage = Math.Min( m.HitsMax - m.Hits, toHeal );

				m.Heal( toHeal );

				if ( healmessage > 0 )
				{
					m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), m.NetState );
					if ( Caster != m )
						m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), Caster.NetState );
				}

				m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
				m.PlaySound( 0x1F2 );
			}

			FinishSequence();
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:40,代码来源:Heal.cs

示例10: LifeforceDrainAttack

        public static void LifeforceDrainAttack( Mobile from, Mobile target )
        {
            int toDrain = 6 + (int) ( ( 120 - target.Skills[SkillName.MagicResist].Value ) / 10 );

            target.FixedParticles( 0x3789, 10, 25, 5032, EffectLayer.Head );
            target.PlaySound( 0x1F8 );

            target.SendLocalizedMessage( 1070848 ); // You feel your life force being stolen away!

            target.Damage( toDrain, from );

            from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
            from.PlaySound( 0x202 );

            from.Heal( toDrain );

            from.DoHarmful( target );

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

示例11: Heal

        public virtual void Heal(Mobile patient)
        {
            if (!Alive || !patient.Alive || !InRange(patient, 2))
            {
            }
            else if (patient.Poisoned)
            {
                double healing = Skills.Healing.Value;
                double anatomy = Skills.Anatomy.Value;
                double chance = (healing - 30.0) / 50.0 - patient.Poison.Level * 0.1;

                if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
                {
                    if (patient.CurePoison(this))
                    {
                        patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.
                        patient.PlaySound(0x57);

                        CheckSkill(SkillName.Healing, 0.0, 100.0);
                        CheckSkill(SkillName.Anatomy, 0.0, 100.0);
                    }
                }
            }
            else if (BleedAttack.IsBleeding(patient))
            {
                patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
                BleedAttack.EndBleed(patient, true);
                patient.PlaySound(0x57);
            }
            else
            {
                double healing = Skills.Healing.Value;
                double anatomy = Skills.Anatomy.Value;
                double chance = (healing + 10.0) / 100.0;

                if (chance > Utility.RandomDouble())
                {
                    double min, max;

                    min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
                    max = (anatomy / 8.0) + (healing / 3.0) + 4.0;

                    if (patient == this)
                        max += 10;

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    toHeal *= HealScalar;

                    patient.Heal((int)toHeal);
                    patient.PlaySound(0x57);

                    CheckSkill(SkillName.Healing, 0.0, 100.0);
                    CheckSkill(SkillName.Anatomy, 0.0, 100.0);
                }
            }

            if (m_HealTimer != null)
                m_HealTimer.Stop();

            m_HealTimer = null;

            m_NextHealTime = DateTime.Now + TimeSpan.FromSeconds(MinHealDelay + (Utility.RandomDouble() * MaxHealDelay));
        }
开发者ID:greeduomacro,项目名称:sosarianlegends,代码行数:64,代码来源:BaseCreature.cs

示例12: Heal

		public static void Heal( int amount, Mobile target, Mobile from, bool message )
		{
			//TODO: All Healing *spells* go through ArcaneEmpowerment
			target.Heal( amount, from, message );
		}
开发者ID:brodock,项目名称:genova-project,代码行数:5,代码来源:SpellHelper.cs

示例13: OnGotMeleeAttack

        public override void OnGotMeleeAttack(Mobile attacker)
        {
            int bonusdmg = (Math.Max((int)attacker.Skills[SkillName.Chivalry].Value,(int)attacker.Skills[SkillName.Blacksmith].Value)/20);
            
            AOS.Damage(this, attacker, bonusdmg, true, 0, 0, 0, 0, 0, 0, 100, false, false, false);

            if(attacker is BaseCreature)
            {
                Say("Meurt, toi qui n'est pas digne de me reconnaitre");
                attacker.Kill();
            }

            if (attacker.FindItemOnLayer(Layer.OneHanded) is BaseWeapon)
            {
                BaseWeapon wpn = (BaseWeapon)attacker.FindItemOnLayer(Layer.OneHanded);
                if (wpn.Resource < CraftResource.MGlowing && Utility.RandomDouble()<.10)
                {
                    Emote("Votre arme perce sa lumière, vous offrant un second souffle");
                    attacker.Heal(Utility.Random(1,15));
                }
            }

            base.OnGotMeleeAttack(attacker);
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:24,代码来源:Celestial.cs

示例14: DoEffect

        public override bool DoEffect(Mobile from, Mobile target)
        {
            if ( target.Alive && from.CanBeBeneficial( target ) && from.CanSee( target ) && from.InLOS( target ) )
            {
                from.DoBeneficial( target );
                SpellHelper.Turn( from, target );

                int toHeal = Utility.RandomMinMax( m_Min, m_Max );
                if ( from != target && from.NetState != null )
                    from.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (target.Hits+toHeal > target.HitsMax ? target.HitsMax - target.Hits : toHeal).ToString(), "" ) );
                target.Heal( toHeal );

                target.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                target.PlaySound( 0x202 );
                return true;
            }

            return false;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:19,代码来源:SpellEffect.cs

示例15: Heal

		public virtual void Heal(Mobile patient)
		{
			if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) )
			{
				StopHeal();
				return;
			}

			bool onSelf = ( patient == this );

			if ( !patient.Alive )
			{
			}
			else if (patient.Poisoned)
			{
				int poisonLevel = patient.Poison.Level;

				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1;

				if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
				{
					if (patient.CurePoison(this))
					{
						patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.

						CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula
						CheckSkill(SkillName.Anatomy, 0.0, 100.0);
					}
				}
			}
			else if (BleedAttack.IsBleeding(patient))
			{
				patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
				BleedAttack.EndBleed( patient, false );
			}
			else
			{
				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = (healing + 10.0) / 100.0;

				if (chance > Utility.RandomDouble())
				{
					double min, max;

					min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
					max = (anatomy / 8.0) + (healing / 3.0) + 4.0;

					if ( onSelf )
						max += 10;

					double toHeal = min + (Utility.RandomDouble() * (max - min));

					toHeal *= HealScalar;

					patient.Heal((int)toHeal);

					CheckSkill( SkillName.Healing, 0.0, 90.0 );
					CheckSkill(SkillName.Anatomy, 0.0, 100.0);
				}
			}

			HealEffect( patient );

			StopHeal();

			if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) )
				HealStart( patient );
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:71,代码来源:BaseCreature.cs


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