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


C# BaseCreature.FixedEffect方法代码示例

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


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

示例1: OnTick

        public void OnTick(BaseCreature lizard, Mobile owner)
        {
            if (lizard != null && lizard.Controlled)
            {
                lizard.Frozen = false;

                m_Timer.Stop();
                m_Timer = null;
            }
            else
                lizard.FixedEffect(0x376A, 1, 32);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:12,代码来源:ScaleCollar.cs

示例2: OnUsed

        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( pet.GetStatMod( "[Tasty Treat] Str" ) != null )
            {
                from.SendLocalizedMessage( 1113051 ); // Your pet is still enjoying the last tasty treat!
                return false;
            }
            else if ( DateTime.Now < pet.NextTastyTreat )
            {
                from.SendLocalizedMessage( 1113049 ); // Your pet is still recovering from the last tasty treat.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                AddEffect( pet );

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if ( this.Amount > 1 )
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem( this );
                }
                else
                {
                    Delete();
                }

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

示例3: OnUsed

        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( m_UnderEffect.Contains( pet ) )
            {
                from.SendLocalizedMessage( 1113075 ); // Your pet is still under the effect of armor essence.
                return false;
            }
            else if ( DateTime.Now < pet.NextArmorEssence )
            {
                from.SendLocalizedMessage( 1113076 ); // Your pet is still recovering from the last armor essence it consumed.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                List<ResistanceMod> mods = new List<ResistanceMod>();

                mods.Add( new ResistanceMod( ResistanceType.Physical, 15 ) );
                mods.Add( new ResistanceMod( ResistanceType.Fire, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Cold, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Poison, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Energy, 10 ) );

                for ( int i = 0; i < mods.Count; i++ )
                    pet.AddResistanceMod( mods[i] );

                m_UnderEffect.Add( pet );

                Timer.DelayCall( Duration, new TimerCallback(
                    delegate
                    {
                        for ( int i = 0; i < mods.Count; i++ )
                            pet.RemoveResistanceMod( mods[i] );

                        m_UnderEffect.Remove( pet );
                    } ) );

                pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;

                Delete();

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


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