• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Ability类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ability的典型用法代码示例。如果您正苦于以下问题:C# Ability类的具体用法?C# Ability怎么用?C# Ability使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Ability类属于命名空间,在下文中一共展示了Ability类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IcePath

        public IcePath(Ability ability)
            : base(ability)
        {
            Modifier = new EvadableModifier(HeroTeam, EvadableModifier.GetHeroType.LowestHealth);

            CounterAbilities.Add(PhaseShift);
            CounterAbilities.Add(BallLightning);
            CounterAbilities.Add(Eul);
            CounterAbilities.AddRange(VsDisable);
            CounterAbilities.Add(SnowBall);
            CounterAbilities.Add(Armlet);
            CounterAbilities.Add(Bloodstone);
            CounterAbilities.Remove("bane_nightmare");
            CounterAbilities.Remove("abaddon_aphotic_shield");

            Modifier.AllyCounterAbilities.AddRange(AllyShields);
            Modifier.AllyCounterAbilities.AddRange(Invul);
            Modifier.AllyCounterAbilities.AddRange(VsMagic);

            AdditionalDelay = ability.AbilitySpecialData.First(x => x.Name == "path_delay").Value;

            for (var i = 0u; i < duration.Length; i++)
            {
                duration[i] = ability.AbilitySpecialData.First(x => x.Name == "duration").GetValue(i);
            }

            talent = AbilityOwner.FindSpell("special_bonus_unique_jakiro");

            if (talent != null)
            {
                bonusDuration = talent.AbilitySpecialData.First(x => x.Name == "value").Value;
            }

            ObstacleStays = true;
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:35,代码来源:IcePath.cs


示例2: Tower

 public Tower(Texture2D texture, Vector2 position, int range, Ability attack)
     : base(texture, position)
 {
     Range = range;
     TowerAbility = attack;
     CanAttack = true;
 }
开发者ID:Grahamcraker,项目名称:Project_Greenhorn,代码行数:7,代码来源:Tower.cs


示例3: AddActive

 public void AddActive(Ability ab, int slot)
 {
     if(!allAbilities.Contains(ab))
         allAbilities.Add(ab);
     if(slot >= 0)
         SetActive(allAbilities.IndexOf(ab),slot);
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:7,代码来源:AbilitiesController.cs


示例4: Mjollnir

        public Mjollnir(Ability ability)
            : base(ability)
        {
            Modifier = new EvadableModifier(EnemyTeam, EvadableModifier.GetHeroType.ModifierSource);

            Modifier.EnemyCounterAbilities.Add(FortunesEnd);
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:7,代码来源:Mjollnir.cs


示例5: DamageAmpValue

 public static float DamageAmpValue(Ability ability)
 {
     var multi = !MultiplierDictionary.ContainsKey(ability.Name)
                     ? 0
                     : Math.Abs(MultiplierDictionary[ability.Name]);
     return multi;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:7,代码来源:DamageAmps.cs


示例6: Projectile

 protected Projectile(Ability ability)
     : base(ability)
 {
     IsDisjointable = true;
     radius = 75;
     DisablePathfinder = true;
 }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:7,代码来源:Projectile.cs


示例7: Torrent

        public Torrent(Ability ability)
            : base(ability)
        {
            Modifier = new EvadableModifier(HeroTeam, EvadableModifier.GetHeroType.LowestHealth);

            CounterAbilities.Add(PhaseShift);
            CounterAbilities.Add(BallLightning);
            CounterAbilities.Add(SleightOfFist);
            CounterAbilities.Add(Manta);
            CounterAbilities.Add(Eul);
            CounterAbilities.AddRange(VsDisable);
            CounterAbilities.AddRange(VsDamage);
            CounterAbilities.AddRange(VsMagic);
            CounterAbilities.AddRange(Invis);
            CounterAbilities.Add(SnowBall);
            CounterAbilities.Add(Armlet);
            CounterAbilities.Add(Bloodstone);

            Modifier.AllyCounterAbilities.AddRange(AllyShields);
            Modifier.AllyCounterAbilities.AddRange(Invul);
            Modifier.AllyCounterAbilities.AddRange(VsMagic);

            AdditionalDelay = Ability.AbilitySpecialData.First(x => x.Name == "delay").Value;

            talent = AbilityOwner.FindSpell("special_bonus_unique_kunkka");

            if (talent != null)
            {
                bonusRadius = talent.AbilitySpecialData.First(x => x.Name == "value").Value;
            }
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:31,代码来源:Torrent.cs


示例8: Check

 public static bool Check(Ability ability)
 {
     return MyAbilities.SoulRing.CanBeCasted() && ability.ManaCost > 0 && Utils.SleepCheck("Ability.SoulRing")
            && Heals.HealsMenuDictionary["item_soul_ring"].Item("item_soul_ringuseBeforeCast").GetValue<bool>()
            && Heals.HealsMenuDictionary["item_soul_ring"].Item("item_soul_ringminHp").GetValue<Slider>().Value
            < AbilityMain.Me.Health;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:7,代码来源:SoulRing.cs


示例9: Create

        public static Menu Create(string name, Ability ability)
        {
            var menu = new Menu(name, name, textureName: name);
            if (name == "rubick_spell_steal")
            {
                return menu;
            }

            menu.AddItem(Togglers.OnSight(name));
            var data = AbilityDatabase.Find(name);
            var defaultValue = ability.AbilityType != AbilityType.Ultimate;
            if (data != null)
            {
                if (data.TrueSight)
                {
                    menu.AddItem(Togglers.OnInvisible(name, defaultValue));
                }

                if (data.IsPurge)
                {
                    menu.AddItem(Togglers.OnPurgable(name, defaultValue));
                }

                if (data.WeakensEnemy)
                {
                    menu.AddItem(Togglers.OnAttack(name, defaultValue));
                }
            }

            menu.AddItem(Sliders.MinManaCheck(name));
            menu.AddItem(Sliders.MinManaCheck(name, true));
            return menu;
        }
开发者ID:Ray0fHope,项目名称:EnsageSharp,代码行数:33,代码来源:SpecialMenu.cs


示例10: AbilityDisplay

        public AbilityDisplay(Ability ability, int exp)
        {
            _ability = ability;
            _exp = exp;

            InitializeComponent();
        }
开发者ID:HaKDMoDz,项目名称:armadillo,代码行数:7,代码来源:AbilityDisplay.cs


示例11: add

 public void add(Ability ability)
 {
     if ( !_abilities.Contains( ability ) )
         _abilities.Add( ability );
     //ability.initData( caster , this );
     Debug.Log( "Added " + ability.name + " to " + caster.name + "'s abilitycontainer" );
 }
开发者ID:Kingsquee,项目名称:Warengine,代码行数:7,代码来源:AbilityContainer.cs


示例12: Execute

        /// <summary>
        /// Execute dirtytricks ability
        /// </summary>
        /// <param name="ab">The used ability</param>
        /// <param name="player">The player that used the ability</param>
        public void Execute(Ability ab, GamePlayer player)
        {
            if (player == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not retrieve player in DirtyTricksAbilityHandler.");
                return;
            }

            if (!player.IsAlive)
            {
                player.Out.SendMessage("You are dead and can't use that ability!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                return;
            }

            if (player.IsMezzed)
            {
                player.Out.SendMessage("You cannot use this while Mezzed!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (player.IsStunned)
            {
                player.Out.SendMessage("You cannot use this while Stunned!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (player.IsSitting)
            {
                player.Out.SendMessage("You must be standing to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            player.DisableSkill(ab, REUSE_TIMER);
            DirtyTricksEffect dt = new DirtyTricksEffect(DURATION * 1000);
            dt.Start(player);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:40,代码来源:DirtyTricksAbilityHandler.cs


示例13: AbilityValueSetsModifier

        public void AbilityValueSetsModifier(int value, int modifier)
        {
            var a = new Ability("TestAbility-BaDumBum");
            a.Value = value;

            Assert.AreEqual(modifier, a.Modifier);
        }
开发者ID:JeffroeBodine,项目名称:PuttingTheDnDInTDD,代码行数:7,代码来源:CharacterTests.cs


示例14: Execute

		public void Execute(Ability ab, GamePlayer player)
		{

			RapidFireEffect rapidFire = player.EffectList.GetOfType<RapidFireEffect>();
			if (rapidFire!=null)
			{
				rapidFire.Cancel(false);
				return;
			}

			if(!player.IsAlive)
			{
				player.Out.SendMessage("You can't switch to rapid fire when dead!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return;
			}

			SureShotEffect sureShot = player.EffectList.GetOfType<SureShotEffect>();
			if (sureShot != null)
				sureShot.Cancel(false);

			TrueshotEffect trueshot = player.EffectList.GetOfType<TrueshotEffect>();
			if (trueshot != null)
				trueshot.Cancel(false);

			new RapidFireEffect().Start(player);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:26,代码来源:RapidFireAbilityHandler.cs


示例15: Execute

        public void Execute(Ability ab, GamePlayer player)
        {
            SureShotEffect sureShot = player.EffectList.GetOfType<SureShotEffect>();
            if (sureShot != null)
            {
                sureShot.Cancel(false);
                return;
            }

            if (!player.IsAlive)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Skill.Ability.SureShot.CannotUseDead"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            RapidFireEffect rapidFire = player.EffectList.GetOfType<RapidFireEffect>();
            if (rapidFire != null)
                rapidFire.Cancel(false);

            TrueshotEffect trueshot = player.EffectList.GetOfType<TrueshotEffect>();
            if (trueshot != null)
                trueshot.Cancel(false);

            new SureShotEffect().Start(player);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:25,代码来源:SureShotAbilityHandler.cs


示例16: Supernova

        public Supernova(Ability ability)
            : base(ability)
        {
            DisablePathfinder = true;

            Modifier = new EvadableModifier(HeroTeam, EvadableModifier.GetHeroType.LowestHealth);

            CounterAbilities.Add(PhaseShift);
            CounterAbilities.Add(BallLightning);
            CounterAbilities.Add(Eul);
            CounterAbilities.Add(Manta);
            CounterAbilities.Add(SleightOfFist);
            CounterAbilities.AddRange(VsDisable);
            CounterAbilities.AddRange(VsDamage);
            CounterAbilities.AddRange(VsMagic);
            CounterAbilities.AddRange(Invis);
            CounterAbilities.Add(Armlet);

            Modifier.AllyCounterAbilities.AddRange(AllyShields);
            Modifier.AllyCounterAbilities.AddRange(Invul);
            Modifier.AllyCounterAbilities.AddRange(VsMagic);

            AdditionalDelay = Ability.AbilitySpecialData.First(x => x.Name == "tooltip_duration").Value;
            radius = Ability.AbilitySpecialData.First(x => x.Name == "aura_radius").Value;
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:25,代码来源:Supernova.cs


示例17: Snowball

        public Snowball(Ability ability)
            : base(ability)
        {
            IsDisjointable = false;

            Modifier = new EvadableModifier(HeroTeam, EvadableModifier.GetHeroType.LowestHealth);

            CounterAbilities.Add(PhaseShift);
            CounterAbilities.Add(BallLightning);
            CounterAbilities.Add(Eul);
            CounterAbilities.AddRange(VsDisable);
            CounterAbilities.AddRange(VsDamage);
            CounterAbilities.AddRange(VsPhys);
            CounterAbilities.AddRange(Invul);
            CounterAbilities.AddRange(Invis);
            CounterAbilities.Add(SnowBall);
            CounterAbilities.Add(Armlet);
            CounterAbilities.Add(Bloodstone);
            CounterAbilities.Add(Lotus);
            CounterAbilities.Remove("abaddon_aphotic_shield");

            Modifier.AllyCounterAbilities.AddRange(AllyShields);
            Modifier.AllyCounterAbilities.AddRange(Invul);

            AdditionalDelay = Ability.AbilitySpecialData.First(x => x.Name == "snowball_windup").Value;
        }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:26,代码来源:Snowball.cs


示例18: Torrent

 public Torrent(Ability ability)
 {
     Ability = ability;
     CastPoint = (float)ability.FindCastPoint();
     AdditionalDelay = AbilityDatabase.Find(ability.Name).AdditionalDelay;
     Radius = ability.GetRadius() + 25;
 }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:7,代码来源:Torrent.cs


示例19: Cast

 public static bool Cast(Ability ability, Unit target, string name)
 {
     if (name == "razor_static_link" && target.Distance2D(AbilityMain.Me) > (ability.GetCastRange(name) * 0.75))
     {
         return false;
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.UnitTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility(target);
         return true;
     }
     if ((ability.IsAbilityBehavior(AbilityBehavior.AreaOfEffect, name)
          || ability.IsAbilityBehavior(AbilityBehavior.Point, name))
         && (Prediction.StraightTime(target) > 1000 || target.MovementSpeed < 200))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         return ability.CastSkillShot(target, name, SoulRing.Check(ability) ? MyAbilities.SoulRing : null);
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility();
         return true;
     }
     return false;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:32,代码来源:Special.cs


示例20: FillMageAbilitys

    private void FillMageAbilitys()
    {
        allMageAbilitys = new Dictionary<int, List<Ability>>();

        //LEVEL 1
        Ability abFrostbolt = new Ability() { Name = "Icebolt", Damage = 15, ManaCost = 20, StaticID = 101, Range = 50, Cooldown = 3 };
        abFrostbolt.Description = string.Format("Simple bolt made of ice that does {0} damage", abFrostbolt.Damage);

        Ability abFirebolt = new Ability() { Name = "Firebolt", Damage = 25, ManaCost = 25, StaticID = 102, Range = 50, Cooldown = 2 };
        abFirebolt.Description = string.Format("Firebolt that does {0} damage", abFirebolt.Damage);

        Ability abMindslash = new Ability() { Name = "Mindeslah", Damage = 20, ManaCost = 35, StaticID = 103, Range = 25, Cooldown = 6 };
        abMindslash.Description = string.Format("Slash the foes mind for {0} damage", abMindslash.Damage);

        Ability abShoot = new Ability() { Name = "Shoot", Damage = 20, ManaCost = 10, StaticID = 104, Range = 75, Cooldown = 10 };
        abShoot.Description = string.Format("Shoot enemy with your wand for {0} damage", abShoot.Damage);

        allMageAbilitys.Add(1, new List<Ability>() { abFrostbolt, abFirebolt, abMindslash, abShoot });

        //LEVEL 2
        Ability abIceSpike = new Ability() { Name = "Ice Spike", Damage = 50, ManaCost = 70, StaticID = 105, Range = 25, Cooldown = 10 };
        abIceSpike.Description = string.Format("Impale enemy for {0} damage", abIceSpike.Damage);

        allMageAbilitys.Add(2, new List<Ability>(){abIceSpike});
    }
开发者ID:SuperJura,项目名称:RPGGame,代码行数:25,代码来源:CodeAbilityDatabase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AbilityType类代码示例发布时间:2022-05-24
下一篇:
C# AVSampleFormat类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap