本文整理汇总了C#中Card.Has方法的典型用法代码示例。如果您正苦于以下问题:C# Card.Has方法的具体用法?C# Card.Has怎么用?C# Card.Has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.Has方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateGainAttackerWouldGetIfPowerAndThoughnessWouldIncrease
public static int CalculateGainAttackerWouldGetIfPowerAndThoughnessWouldIncrease(Card attacker,
IEnumerable<Card> blockers, int powerIncrease, int toughnessIncrease)
{
if ((blockers.None() || attacker.Has().Trample) && powerIncrease > 0)
{
return CalculateDefendingPlayerLifeloss(attacker, blockers) > 0 ? 2 : 0;
}
if (toughnessIncrease < 1 && !attacker.Has().FirstStrike)
return 0;
var p = new AttackerEvaluationParameters(attacker, blockers);
var canBeDealtLeathalDamageWithoutBoost = CanAttackerBeDealtLeathalDamage(p);
if (canBeDealtLeathalDamageWithoutBoost == false)
return 0;
p.AttackerPowerIncrease = powerIncrease;
p.AttackerToughnessIncrease = toughnessIncrease;
var canBeDealtLeathalDamageWithBoost = CanAttackerBeDealtLeathalDamage(p);
return canBeDealtLeathalDamageWithBoost ? 0 : attacker.Score;
}
示例2: CalculateDefendingPlayerLifeloss
public static int CalculateDefendingPlayerLifeloss(Card attacker, IEnumerable<Card> blockers)
{
var total = 0;
if (blockers.None())
{
total = attacker.CalculateCombatDamageAmount(singleDamageStep: false);
}
else if (attacker.Has().Trample)
{
total = CalculateTrampleDamage(attacker, blockers);
}
var prevented = attacker.Controller.Opponent.CalculatePreventedReceivedDamageAmount(total, attacker,
isCombat: true);
return total - prevented;
}
示例3: CalculatePermanentScoreFromManaCost
private static int CalculatePermanentScoreFromManaCost(Card permanent)
{
var converted = Math.Min(7, permanent.ManaCost.Converted);
if (permanent.Has().Haste)
{
converted--;
}
return permanent.Has().Echo
? Scores.ManaCostToScoreEcho[converted]
: Scores.ManaCostToScore[converted];
}