本文整理汇总了C#中Card.CalculateCombatDamageAmount方法的典型用法代码示例。如果您正苦于以下问题:C# Card.CalculateCombatDamageAmount方法的具体用法?C# Card.CalculateCombatDamageAmount怎么用?C# Card.CalculateCombatDamageAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.CalculateCombatDamageAmount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateScore
private int CalculateScore(Card creature)
{
if (!creature.CanAttack)
return -1;
return Combat.CouldBeBlockedByAny(creature) ? 1 :
creature.CalculateCombatDamageAmount(singleDamageStep: false);
}
示例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: AssignInitialBlockers
private void AssignInitialBlockers(Card attacker, IEnumerable<Card> blockers, int defendersLife)
{
_canAllInitialBlockersBeKilled = true;
var attackerAbilities = attacker.GetCombatAbilities();
var attackerEvaluationParameters = new AttackerEvaluationParameters(attacker,
attackerAbilities.PowerIncrease, attackerAbilities.ToughnessIncrease);
foreach (var blocker in blockers)
{
var blockerAbilities = blocker.GetCombatAbilities();
_blockers.Add(blocker);
attackerEvaluationParameters.AddBlocker(blocker, blockerAbilities.PowerIncrease,
blockerAbilities.ToughnessIncrease);
var canBlockerBeDealtLeathalCombatDamage =
QuickCombat.CanBlockerBeDealtLeathalCombatDamage(new BlockerEvaluationParameters
{
Attacker = attacker,
Blocker = blocker,
BlockerPowerIncrease = blockerAbilities.PowerIncrease,
BlockerToughnessIncrease = blockerAbilities.ToughnessIncrease,
AttackerPowerIncrease = attackerAbilities.PowerIncrease,
AttackerToughnessIncrease = attackerAbilities.ToughnessIncrease
});
var blockerScore = canBlockerBeDealtLeathalCombatDamage && !blockerAbilities.CanRegenerate
? blocker.Score
: 0;
var lifelossScore = ScoreCalculator.CalculateLifelossScore(
defendersLife,
attacker.CalculateCombatDamageAmount(singleDamageStep: false));
var trampleScore = ScoreCalculator.CalculateLifelossScore(
defendersLife, QuickCombat.CalculateTrampleDamage(Attacker, blocker));
Gain = lifelossScore - blockerScore - trampleScore;
_canAllInitialBlockersBeKilled = _canAllInitialBlockersBeKilled && canBlockerBeDealtLeathalCombatDamage;
}
IsAttackerKilled = QuickCombat.CanAttackerBeDealtLeathalDamage(attackerEvaluationParameters);
var attackerScore = IsAttackerKilled && !attackerAbilities.CanRegenerate
? attacker.Score
: 0;
Gain += attackerScore;
}
示例4: GetAmountOfDamageCreature1WillDealToCreature2
public static int GetAmountOfDamageCreature1WillDealToCreature2(Card creature1, Card creature2,
int powerIncrease = 0)
{
var amountDealt = creature1.CalculateCombatDamageAmount(powerIncrease: powerIncrease);
var preventedReceived = creature2.CalculatePreventedDamageAmount(amountDealt, creature1, isCombat: true);
return amountDealt - preventedReceived;
}