當前位置: 首頁>>代碼示例>>C#>>正文


C# Server.Poison類代碼示例

本文整理匯總了C#中Server.Poison的典型用法代碼示例。如果您正苦於以下問題:C# Poison類的具體用法?C# Poison怎麽用?C# Poison使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Poison類屬於Server命名空間,在下文中一共展示了Poison類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetTemporaryResistChance

        public static double GetTemporaryResistChance( Mobile m, Poison poison )
        {
            if ( !m_Table.ContainsKey( m ) )
                return 0.0;

            int resistLevel = GetTemporaryResistLevel( m );
            double factor = 15.0 / ( poison.Level + 1 );

            double chance = factor * resistLevel / 100.0;

            return chance / 100.0;
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:12,代碼來源:PoisonResistance.cs

示例2: Register

		public static void Register( Poison reg )
		{
			string regName = reg.Name.ToLower();

			for ( int i = 0; i < m_Poisons.Count; i++ )
			{
				if ( reg.Level == m_Poisons[i].Level )
					throw new Exception( "A poison with that level already exists." );
				else if ( regName == m_Poisons[i].Name.ToLower() )
					throw new Exception( "A poison with that name already exists." );
			}

			m_Poisons.Add( reg );
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:14,代碼來源:Poison.cs

示例3: GetNaturalResistChance

        public static double GetNaturalResistChance( Mobile m, Poison poison )
        {
            double poisoning = m.Skills.Poisoning.Value;

            Resilience song = Spellsong.GetEffectSpellsong<Resilience>( m );

            if ( song != null )
                poisoning += song.CurseReduction; // Guessing here.

            double factor = 80.0 / ( poison.Level + 1 );

            double chance = factor * poisoning / 100.0;

            return chance / 100.0;
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:15,代碼來源:PoisonResistance.cs

示例4: ConsumeUse

        public void ConsumeUse()
        {
            if ( m_UsesRemaining < 1 )
                return;

            --m_UsesRemaining;

            if ( m_PoisonCharges > 0 )
            {
                --m_PoisonCharges;

                if ( m_PoisonCharges == 0 )
                    m_Poison = null;
            }

            InvalidateProperties();
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:17,代碼來源:Fukiya.cs

示例5: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_UsesRemaining = reader.ReadInt();

                    m_Poison = Poison.Deserialize( reader );
                    m_PoisonCharges = reader.ReadInt();

                    break;
                }
            }
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:19,代碼來源:FukiyaDarts.cs

示例6: Aura

 // No Effects
 public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range,
     Poison poison, string text, bool scales, bool allownull)
 {
     Aura(location, map, from, min, max, type, range, poison, text, scales, allownull, false, 0, 0);
 }
開發者ID:rokann,項目名稱:JustUO,代碼行數:6,代碼來源:Abilities.cs

示例7: OnCured

 /// <summary>
 /// Overridable. Virtual event invoked when a call to <see cref="CurePoison" /> succeeded.
 /// <seealso cref="CurePoison" />
 /// <seealso cref="CheckCure" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnCured( Mobile from, Poison oldPoison )
 {
 }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:9,代碼來源:Mobile.cs

示例8: Serialize

		public static void Serialize( Poison p, GenericWriter writer )
		{
			if ( p == null )
				writer.Write( (byte)0 );
			else
			{
				writer.Write( (byte)1 );
				writer.Write( (byte)p.Level );
			}
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:10,代碼來源:Poison.cs

示例9: Reload

		public void Reload( Mobile from, Shuriken shuriken )
		{
			int need = ( MaxUses - m_UsesRemaining );

			if ( need <= 0 )
			{
				// You cannot add any more shuriken.
				from.SendLocalizedMessage( 1063302 );
			}
			else if ( shuriken.UsesRemaining > 0 )
			{
				if ( need > shuriken.UsesRemaining )
					need = shuriken.UsesRemaining;

				if ( shuriken.Poison != null && shuriken.PoisonCharges > 0 )
				{
					if ( m_PoisonCharges <= 0 || m_Poison == shuriken.Poison )
					{
						if ( m_Poison != null && m_Poison.Level < shuriken.Poison.Level )
							Unload( from );

						if ( need > shuriken.PoisonCharges )
							need = shuriken.PoisonCharges;

						if ( m_Poison == null || m_PoisonCharges <= 0 )
							m_PoisonCharges = need;
						else
							m_PoisonCharges += need;

						m_Poison = shuriken.Poison;

						shuriken.PoisonCharges -= need;

						if ( shuriken.PoisonCharges <= 0 )
							shuriken.Poison = null;

						m_UsesRemaining += need;
						shuriken.UsesRemaining -= need;
					}
					else
					{
						from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first
					}
				}
				else
				{
					m_UsesRemaining += need;
					shuriken.UsesRemaining -= need;
				}

				if ( shuriken.UsesRemaining <= 0 )
					shuriken.Delete();

				InvalidateProperties();
			}
		}
開發者ID:ITLongwell,項目名稱:aedilis2server,代碼行數:56,代碼來源:LeatherNinjaBelt.cs

示例10: CheckPoisonImmunity

        public override bool CheckPoisonImmunity( Mobile from, Poison poison )
        {
            if ( base.CheckPoisonImmunity( from, poison ) )
                return true;

            Poison p = this.PoisonImmune;

            return ( p != null && p.Level >= poison.Level );
        }
開發者ID:cynricthehun,項目名稱:UOLegends,代碼行數:9,代碼來源:BaseCreature.cs

示例11: IncreaseLevel

		public static Poison IncreaseLevel(Poison oldPoison)
		{
			Poison newPoison = oldPoison == null ? null : GetPoison(oldPoison.Level + 1);

			return newPoison ?? oldPoison;
		}
開發者ID:rokann,項目名稱:JustUO,代碼行數:6,代碼來源:Poison.cs

示例12: PoisonPlayers

        public virtual void PoisonPlayers( Poison poison )
        {
            List<Mobile> list = GetPoisonableMobiles( null );

            foreach ( Mobile m in list )
            {
                if ( ( m.Poison == null || m.Poison.Level < poison.Level ) )
                    m.ApplyPoison( null, poison );
            }
        }
開發者ID:evildude807,項目名稱:kaltar,代碼行數:10,代碼來源:PoisonRoom.cs

示例13: OnPoison

 public virtual void OnPoison( Poison poison, int tick )
 {
 }
開發者ID:evildude807,項目名稱:kaltar,代碼行數:3,代碼來源:PoisonRoom.cs

示例14: OnPoisonImmunity

 /// <summary>
 /// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> failed because <see cref="CheckPoisonImmunity" /> returned false: the Mobile was resistant to the poison. By default, this broadcasts an overhead message: * The poison seems to have no effect. *
 /// <seealso cref="CheckPoisonImmunity" />
 /// <seealso cref="ApplyPoison" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnPoisonImmunity( Mobile from, Poison poison )
 {
     this.PublicOverheadMessage( MessageType.Emote, 0x3B2, 1005534 ); // * The poison seems to have no effect. *
 }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:10,代碼來源:Mobile.cs

示例15: OnPoisoned

 /// <summary>
 /// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> succeeded. By default, this broadcasts an overhead message varying by the level of the poison. Example: * Zippy begins to spasm uncontrollably. *
 /// <seealso cref="ApplyPoison" />
 /// <seealso cref="Poison" />
 /// </summary>
 public virtual void OnPoisoned( Mobile from, Poison poison, Poison oldPoison )
 {
     if (poison != null && poison.Level >= 0 && poison.Level <= 4)
     {
         this.LocalOverheadMessage( MessageType.Regular, 0x22, 1042857 + (poison.Level * 2) );
         this.NonlocalOverheadMessage( MessageType.Regular, 0x22, 1042858 + (poison.Level * 2), Name );
     }
 }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:13,代碼來源:Mobile.cs


注:本文中的Server.Poison類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。