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


C# Bandage.Consume方法代码示例

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


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

示例1: EndHeal


//.........这里部分代码省略.........

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059; // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
			else if( BleedAttack.IsBleeding( m_Patient ) )
				BleedAttack.EndBleed( m_Patient, false );
			else if( MortalStrike.IsWounded( m_Patient ) )
				healerNumber = ( m_Healer == m_Patient ? 1005000 : 1010398 );
			else if( m_Patient.Hits == m_Patient.HitsMax )
				healerNumber = 500967; // You heal what little damage your patient had.
			else
			{
			    checkSkills = true;
			    patientNumber = -1;
				Bandage bandage = null;

				if( origin.Parent == null && !origin.Deleted )
					origin.Consume( 1 );
				else if( ( bandage = m_Healer.Backpack.FindItemByType( typeof( Bandage ), true ) as Bandage ) == null )
				{
					m_Healer.SendAsciiMessage( "You don't have any bandages." );
					return;
				}
				else
					bandage.Consume( 1 );
                
				double healing = m_Healer.Skills[primarySkill].Base;
				double anatomy = m_Healer.Skills[secondarySkill].Base;

                //Loki edit: Dexterity improves healing chance
                double chance = (healing/100.0) * (0.91 + (((double)m_Healer.RawDex - 80.0) / 1000.0));

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

					min = 0.04 * ( ( anatomy / 4.0 ) + ( healing / 4.0 ) );
					max = ( ( anatomy / 4.0 ) + ( healing / 4.0 ) ) - 4;

                    //Loki edit: Bonus from dexterity
                    double dexbonus = ((double)m_Healer.RawDex - 80.0) / 10.0;
                    min += dexbonus;
                    max += dexbonus / 2;

					if( max < 2 )
						max = 2;

					double toHeal = Utility.RandomMinMax( (int)min, (int)max );
                    
					if( toHeal < 1 )
开发者ID:FreeReign,项目名称:imaginenation,代码行数:67,代码来源:Bandage.cs

示例2: tryToHeal

			public static bool tryToHeal(Mobile healer, Mobile patient, Bandage bandage){
				if(patient.Alive && (patient.Hits < patient.HitsMax || patient.Poisoned) ){
					if ( healer == patient)
						patient.SendLocalizedMessage( 1008078, false, healer.Name ); //  : Attempting to heal you.
					
					healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
					
					double finalDelay = new Random().NextDouble()*(Bandage.delayMax-Bandage.delayMin)+Bandage.delayMin;
					contextTable[healer] = new HealingContext(healer, patient, finalDelay);
					
					bandage.Consume();
					return true;
				}
				
				return false;
			}
开发者ID:greeduomacro,项目名称:uotitan,代码行数:16,代码来源:Bandage.cs

示例3: BandageContext

		public BandageContext( Mobile healer, Mobile patient, TimeSpan delay, Bandage origin )
		{
			m_Healer = healer;
			m_Patient = patient;

			if( m_Patient != null && !m_Patient.Alive )
			{
				if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 || m_Healer.Skills[SkillName.Healing].Base < 100.0 )
				{
					if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 && m_Healer.Skills[SkillName.Healing].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM healing and anatomy to resurrect your target." );
						return;
					}
					else if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM anatomy to resurrect your target." );
						return;
					}
					else if( m_Healer.Skills[SkillName.Healing].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM healing to resurrect your target." );
						return;
					}
				}

				if( m_Healer.Hits <= 50 )
				{
					m_Healer.SendAsciiMessage( "You need to have more than 50 hp to resurrect your target" );
					return;
				}

				if( m_Patient.Region is HouseRegion )
				{
					m_Healer.SendAsciiMessage( "You can't resurrect people in house regions." );

					//Server.Multis.BaseHouse patientHouse = (m_Patient.Region as HouseRegion).House;

					////The owner can resurrect who ever he wants.
					//if (patientHouse.IsOwner(m_Healer) || patientHouse.IsCoOwner(m_Healer))
					//{
					//    m_Patient.Resurrect();
					//    m_Patient.Hits = 10;
					//    m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*");
					//    m_Healer.Hits -= 50;
					//}
					////The patient can be ressed by anoyone as long as he is an owner, co owner or friend
					//else if (patientHouse.IsOwner(m_Patient) || patientHouse.IsCoOwner(m_Patient) || patientHouse.IsFriend(m_Patient))
					//{
					//    m_Patient.Resurrect();
					//    m_Patient.Hits = 10;
					//    m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*");
					//    m_Healer.Hits -= 50;
					//}
					//else
					//{
					//    m_Patient.SendAsciiMessage("You cannot be resurrected in this region!");
					//    m_Healer.SendAsciiMessage("You cannot resurrect in this region!");
					//}
				}
				else
				{
					m_Patient.PlaySound( 0x214 );
					m_Patient.Resurrect();
					m_Patient.Hits = 10;
					m_Healer.PublicOverheadMessage( MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*" );
					m_Healer.Hits -= 50;
                    origin.Consume(1);
				}
			}
			else
			{
				m_Timer = new InternalTimer( this, delay, origin );
				m_Timer.Start();
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:76,代码来源:Bandage.cs


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