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


C# Card.CalculateCombatDamageAmount方法代码示例

本文整理汇总了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);
        }
开发者ID:leloulight,项目名称:magicgrove,代码行数:8,代码来源:EffectBigWithoutEvasions.cs

示例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;
        }
开发者ID:leloulight,项目名称:magicgrove,代码行数:17,代码来源:QuickCombat.cs

示例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;
            }
开发者ID:leloulight,项目名称:magicgrove,代码行数:51,代码来源:BlockStrategy.cs

示例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;
        }
开发者ID:leloulight,项目名称:magicgrove,代码行数:8,代码来源:QuickCombat.cs


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