当前位置: 首页>>代码示例>>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;未经允许,请勿转载。