本文整理汇总了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;
}
示例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);
}
}
示例3: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if(board.WeaponFriend == null && board.HasWeaponInHand() && board.TurnCount < 2)
return false;
return true;
}