本文整理汇总了C#中Card.Is方法的典型用法代码示例。如果您正苦于以下问题:C# Card.Is方法的具体用法?C# Card.Is怎么用?C# Card.Is使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.Is方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateCardInGraveyardScore
public static int CalculateCardInGraveyardScore(Card card)
{
if (card.OverrideScore.Graveyard.HasValue)
return card.OverrideScore.Graveyard.Value;
if (card.Is().BasicLand)
return 1;
if (card.Is().Land)
return 2;
return card.ManaCost.Converted;
}
示例2: CalculateDiscardScore
public static int CalculateDiscardScore(Card card, bool isSearchInProgress)
{
if (isSearchInProgress && card.IsVisibleToSearchingPlayer == false)
{
return 220;
}
// the lower the score, the more likely card will be discarded
var hand = card.Controller.Hand;
var battlefield = card.Controller.Battlefield;
if (card.Is().Land)
{
var landHandCount = hand.Count(x => x.Is().Land);
var landBattlefieldCount = battlefield.Count(x => x.Is().Land);
if ((landHandCount + landBattlefieldCount) < 4)
return int.MaxValue;
if (landHandCount < 2)
return int.MaxValue;
return 0 - 2*landBattlefieldCount;
}
return card.ConvertedCost;
}
示例3: IsUsableNonbasicLand
private bool IsUsableNonbasicLand(Card card, CardColor color1, CardColor? color2 = null)
{
if (!card.Is().Land)
return false;
var landColors = card.ProducableManaColors;
if (landColors.Count == 0)
return true;
if (landColors.Count == 1)
{
if (landColors[0] == (int) CardColor.Colorless)
return true;
if (landColors[0] == (int) color1)
return true;
if (color2.HasValue && landColors[0] == (int) color2.Value)
return true;
return false;
}
if (!color2.HasValue)
return false;
return landColors.Contains((int) color1) &&
landColors.Contains((int) color2.Value);
}
示例4: GetRating
protected double GetRating(Card card)
{
var baseRating = _ratings.GetRating(card.Name);
if (card.Is().Creature && DraftedCards.Count(x => x.Is().Creature) < MinimalCreatures)
baseRating += CreaturesBonus;
return baseRating;
}
示例5: CalculatePermanentScore
public static int CalculatePermanentScore(Card permanent)
{
var score = 0;
if (permanent.OverrideScore.Battlefield.HasValue)
return permanent.OverrideScore.Battlefield.Value;
if (permanent.Level > 0)
score += 10*permanent.Level.Value;
if (permanent.ManaCost != null)
{
score += CalculatePermanentScoreFromManaCost(permanent);
if (permanent.Is().Creature)
{
score += (permanent.Power.Value*10 + permanent.Toughness.Value*3);
if (permanent.HasSummoningSickness)
score -= 1;
}
}
else if (permanent.Is().Creature)
{
score += CalculatePermanentScoreFromPowerToughness(permanent.Power.Value, permanent.Toughness.Value);
}
else if (permanent.Is().Land)
{
score += GetLandOnBattlefieldScore(permanent);
if (!permanent.Is().BasicLand)
score += 10;
}
return score;
}
示例6: CalculateTapPenalty
public static int CalculateTapPenalty(Card card, TurnInfo turnInfo)
{
if (card.Is().Land)
{
if (card.Controller.IsActive)
{
if (turnInfo.Step == Step.Upkeep)
return 10;
return 2;
}
}
return 1;
}
示例7: WasPutIntoGraveyardThisTurnFromBattlefield
private static bool WasPutIntoGraveyardThisTurnFromBattlefield(Card card, Game game)
{
return card.Is().Creature && game.Turn.Events.HasChangedZone(card, @from: Zone.Battlefield, to: Zone.Graveyard);
}
示例8: TargetCreatureRemoval
private bool TargetCreatureRemoval(Card target, TimingRuleParameters p)
{
if (!target.Is().Creature)
return false;
if (IsBeforeYouDeclareAttackers(p.Controller))
{
return target.CanBlock();
}
if (IsBeforeYouDeclareBlockers(p.Controller))
{
return target.IsAttacker;
}
if (_combatOnly)
return false;
if (StackHasInterestingSpells())
{
if (Stack.TopSpell.HasEffectTargets())
{
return Stack.TopSpell.HasEffectTarget(target);
}
// e.g Nantuko Shade gives self a +1/+1 boost
if (Stack.TopSpell.TargetsEffectSource)
{
return target == Stack.TopSpell.Source.OwningCard;
}
}
return false;
}
示例9: TargetAuraRemoval
private bool TargetAuraRemoval(Card target, TimingRuleParameters p)
{
if ((!target.Is().Aura && !target.Is().Equipment) || target.AttachedTo == null)
return false;
if (IsAfterOpponentDeclaresBlockers(p.Controller) && target.AttachedTo.IsBlocker)
{
return true;
}
if (IsAfterOpponentDeclaresAttackers(p.Controller) && target.AttachedTo.IsAttacker)
{
return true;
}
return false;
}