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


C# BaseCreature.UseSkill方法代码示例

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


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

示例1: UseProvo

        public static void UseProvo(BaseCreature from, bool randomly)
        {
            if (from.Combatant == null && randomly || !CheckBarding(from))
                return;

            if (!CanUse(from))
                return;

            if (!from.UseSkill(SkillName.Provocation))
                return;

            var targetone = FindRandomTarget(from, randomly);

            if (targetone == null)
                return;

            if (from.Target != null)
                from.Target.Invoke(from, targetone);

            var targettwo = randomly ? FindRandomTarget(from, randomly) : from.Combatant;

            if (targettwo == null)
                return;

            if (from.Target != null)
                from.Target.Invoke(from, targettwo);
        }
开发者ID:rokann,项目名称:JustUO,代码行数:27,代码来源:Abilities.cs

示例2: UseDiscord

        public static void UseDiscord(BaseCreature from)
        {
            if (from.Combatant == null || !CanUse(from) || !CheckBarding(from))
                return;

            //int effect = 0.0;

            //if ( SkillHandlers.Discordance.GetEffect( from.Combatant, ref effect ) )
            //return;

            if (!from.UseSkill(SkillName.Discordance))
                return;

            if (from.Combatant is BaseCreature)
                if (from.Target != null)
                    from.Target.Invoke(from, from.Combatant);
                else
                {
                    var effect = -(from.Skills[SkillName.Discordance].Value/5.0);
                    var duration = TimeSpan.FromSeconds(from.Skills[SkillName.Discordance].Value*2);

                    ResistanceMod[] mods =
                    {
                        new ResistanceMod(ResistanceType.Physical, (int) (effect*0.01)),
                        new ResistanceMod(ResistanceType.Fire, (int) (effect*0.01)),
                        new ResistanceMod(ResistanceType.Cold, (int) (effect*0.01)),
                        new ResistanceMod(ResistanceType.Poison, (int) (effect*0.01)),
                        new ResistanceMod(ResistanceType.Energy, (int) (effect*0.01))
                    };

                    TimedResistanceMod.AddMod(from.Combatant, "Discordance", mods, duration);
                    from.Combatant.AddStatMod(new StatMod(StatType.Str, "DiscordanceStr",
                        (int) (from.Combatant.RawStr*effect), duration));
                    from.Combatant.AddStatMod(new StatMod(StatType.Int, "DiscordanceInt",
                        (int) (from.Combatant.RawInt*effect), duration));
                    from.Combatant.AddStatMod(new StatMod(StatType.Dex, "DiscordanceDex",
                        (int) (from.Combatant.RawDex*effect), duration));
                }
        }
开发者ID:rokann,项目名称:JustUO,代码行数:39,代码来源:Abilities.cs

示例3: UsePeace

        public static void UsePeace(BaseCreature from)
        {
            if (from.Combatant == null || !CanUse(from) || !CheckBarding(from))
                return;

            if (!from.UseSkill(SkillName.Peacemaking))
                return;

            if (from.Combatant is PlayerMobile)
            {
#if ML
                                PlayerMobile pm = (PlayerMobile)from.Combatant;
                                if ( pm.PeacedUntil <= DateTime.UtcNow )
                                {
                                        pm.PeacedUntil = DateTime.UtcNow + TimeSpan.FromSeconds( (int)(from.Skills[SkillName.Peacemaking].Value / 5) );
                                        pm.SendLocalizedMessage( 500616 ); // You hear lovely music, and forget to continue battling!                                   
                                }
                #endif
            }
            else if (from.Target != null)
                from.Target.Invoke(from, from.Combatant);
        }
开发者ID:rokann,项目名称:JustUO,代码行数:22,代码来源:Abilities.cs

示例4: UseDiscord

        public static bool UseDiscord(BaseCreature from, Mobile target)
        {
            if (target == null || !target.InLOS(from) || CheckBarding(from) == null)
                return false;

            if (from.Spell != null)
                from.Spell = null;

            if (!from.UseSkill(SkillName.Discordance))
                return false;

            if (from.Target is Discordance.DiscordanceTarget)
            {
                from.Target.Invoke(from, target);
                return true;
            }
            return false;
        }
开发者ID:g4idrijs,项目名称:ServUO,代码行数:18,代码来源:DespiseCreature.cs


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