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


C# BaseCreature.AddResistanceMod方法代码示例

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


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

示例1: OnSummon

        /**
         * Evento invocado quando uma criatura é invocada por um jogador.
         */
        public void OnSummon(Jogador caster, BaseCreature creature, ref Point3D p, ref TimeSpan duration)
        {
            SistemaTalento st = caster.getSistemaTalento();

            //Aumenta o duração
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoExtendida))
            {
                caster.SendMessage("Duracao normal: {0}", duration);

                double totalDuracaoSegundos = duration.TotalSeconds * 1.5;
                duration = TimeSpan.FromSeconds(totalDuracaoSegundos);

                caster.SendMessage("Duracao alterada: {0}", duration);
            }

            //Aumenta a resistencia das conjurações
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
            {
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Cold, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Energy, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Fire, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Physical, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Poison, 5));

                caster.SendMessage("Bonus resistencia");
            }

            //Aumenta os atributos da conjuração
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
            {
                HabilidadeNode node = st.getHabilidades()[IdHabilidadeTalento.conjuracaoResistente];

                StatMod statusBonus = new StatMod(StatType.All, "TalentoConjuracaoForte", node.Nivel * 10, TimeSpan.FromDays(99));
                creature.AddStatMod(statusBonus);

                caster.SendMessage("Bonus Status");
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:41,代码来源:SummonUtil.cs

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