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


C# Board.HasWeaponInHand方法代码示例

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


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

示例1: ShouldAttackTargetWithWeapon

        public override bool ShouldAttackTargetWithWeapon(Board board,Card weapon,Card target)
        {
            if(target.Type == Card.CType.HERO && !board.HasWeaponInHand() && target.CurrentHealth + target.CurrentArmor > 15)
                    return false;

                if(target.Type == Card.CType.HERO && (board.WeaponFriend.template.Id == "EX1_411") && target.CurrentHealth + target.CurrentArmor > board.WeaponFriend.CurrentAtk)
                    return false;

            return true;
        }
开发者ID:MahirZukic,项目名称:smartcustomclass,代码行数:10,代码来源:bProfileBehavior.cs

示例2: OnAttack

        public override void OnAttack(Board board, Card attacker, Card target)
        {
            bool IsAttackingWithHero = (attacker.Id == board.HeroFriend.Id);
            bool IsAttackingWithWeapon = (board.WeaponFriend != null && attacker.Id == board.WeaponFriend.Id);

            if ((IsAttackingWithHero || IsAttackingWithWeapon) && board.WeaponFriend != null)//If we attack with weapon equipped
            {
                switch (board.WeaponFriend.Template.Id)
                {
                    case Card.Cards.EX1_536://Eaglehorn Bow

                        if (board.Secret.Count > 0 && board.WeaponFriend.CurrentDurability <= 1 && !board.HasWeaponInHand())
                            WeaponAttackGlobalCost += 20;
                        else if (board.Hand.Any(x => x.Template.IsSecret)  && board.WeaponFriend.CurrentDurability <= 1 && !board.HasWeaponInHand())
                            WeaponAttackGlobalCost += 20;
                        else
                            WeaponAttackGlobalCost += 8;

                        break;
                    case Card.Cards.GVG_043://Glaivezooka
                        WeaponAttackGlobalCost += 3;
                        break;
                }
            }

            if(!IsAttackingWithHero && !IsAttackingWithWeapon)
            {
                if(target != null && target.CurrentAtk >= attacker.CurrentHealth && !attacker.IsDivineShield)
                    OnMinionDeath(board,attacker);
            }
        }
开发者ID:jdizify,项目名称:SmartBotProfiles,代码行数:31,代码来源:Face.cs

示例3: ShouldBePlayed

		public override bool ShouldBePlayed(Board board)
        {
			if(board.WeaponFriend == null && board.HasWeaponInHand() && board.TurnCount < 2)
				return false;
            return true;
        }
开发者ID:MahirZukic,项目名称:smartcustomclass,代码行数:6,代码来源:NEW1_018.cs


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