本文整理匯總了C#中Board.HasCardInHand方法的典型用法代碼示例。如果您正苦於以下問題:C# Board.HasCardInHand方法的具體用法?C# Board.HasCardInHand怎麽用?C# Board.HasCardInHand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Board
的用法示例。
在下文中一共展示了Board.HasCardInHand方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if(board.HasCardInHand("NEW1_019"))
{
return false;
}
return true;
}
示例2: GetHandValue
public override int GetHandValue(Board board)
{
if(board.HasMinionOnBoard("CS2_181",true))
return 2;
else if(board.HasCardInHand("EX1_591"))
return 8;
else
return 5;
}
示例3: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
foreach(Card c in board.Hand)
{
if(c.CurrentCost == 4 && c.Type == Card.CType.MINION)
if(board.TurnCount < 2 && !board.HasCardInHand("GAME_005") && board.ManaAvailable == 1)
return false;
}
int dropThreePlayale = board.GetPlayables(Card.CType.MINION, 3,3).Count;
if(!board.HasCardInHand("GAME_005") && dropThreePlayale < 1 && board.TurnCount < 2 && board.ManaAvailable == 1)
return false;
return true;
}
示例4: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if(board.MaxMana > 7 && board.MaxMana < 10)
return false;
if(board.TurnCount == 1 && !board.HasCardInHand("GAME_005"))
return false;
return true;
}
示例5: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if (board.MinionFriend.Count > 5)
return false;
if(board.TurnCount < 3)
return false;
if(board.TurnCount <= 4 && board.HasCardInHand("EX1_258"))
return false;
return true;
}
示例6: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if(board.EnemyClass == Board.Class.ROGUE || board.EnemyClass == Board.Class.MAGE || board.EnemyClass == Board.Class.DRUID)
{
List<Card> playable = board.GetPlayables(Card.CType.MINION, 2,2);
int drop1Playable = board.GetPlayables(Card.CType.MINION, 1,1).Count;
bool has2Hp = false;
foreach(Card c in playable)
{
if(c.CurrentHealth >= 2)
has2Hp = true;
}
if(!has2Hp && drop1Playable < 2 && board.ManaAvailable == 1 && !board.HasCardInHand("EX1_169"))
return false;
}
if(board.TurnCount > 3)
return true;
if(board.GetPlayables(Card.CType.SPELL, 2,2).Count > 0 && board.TurnCount == 1)
return true;
if(board.MinionEnemy.Count > 0 && board.GetPlayables(Card.CType.MINION, 2,2).Count > 0 && board.TurnCount == 1)
return true;
if(board.GetPlayables(Card.CType.MINION, 2,2).Count < 2 && board.TurnCount == 1 && board.GetPlayables(Card.CType.MINION, 1,1).Count == 0 && !board.HasCardInHand("EX1_169"))
return false;
foreach(Card c in board.Hand)
{
if (c.CurrentCost == board.ManaAvailable + 1)
return true;
}
return true;
}
示例7: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
int CountPlayable = 0;
foreach(Card c in board.Hand)
{
if(c.template.Id == "EX1_308")
continue;
if(c.CurrentCost <= board.ManaAvailable && (c.Type == Card.CType.MINION || c.Type == Card.CType.SPELL))
{
if(c.Type == Card.CType.SPELL)
{
foreach(Card cc in board.MinionEnemy)
{
if(c.Behavior.ShouldBePlayedOnTarget(board,cc))
{
CountPlayable++;
}
}
}
else
{
CountPlayable++;
}
}
}
int sum = 0;
foreach(Card c in board.MinionFriend)
{
sum += c.CurrentAtk;
}
if(sum + 4 >= board.HeroEnemy.CurrentHealth + board.HeroEnemy.CurrentArmor)
return true;
if(board.HasCardInHand("EX1_310") && board.Hand.Count < 4)
return false;
if(CountPlayable >= (int)(board.Hand.Count / 2) && board.Hand.Count > 2)
{
return false;
}
return true;
}
示例8: Hasinnervate
private bool Hasinnervate(Board board)
{
return board.HasCardInHand(Cards.Innervate);
}
示例9: HandleTurnOneSpecifics
private void HandleTurnOneSpecifics(Board board, ref ProfileParameters parameters)
{
//We want shade turn one
if (Hasinnervate(board) && board.HasCardInHand(Cards.ShadeofNaxxramas))
{
parameters.MinionsModifiers.AddOrUpdate(Cards.ShadeofNaxxramas, new Modifier(-600));
return;
}
//We want shredder on turn one if possible
if (HasCoin(board) && Hasinnervate(board) && board.HasCardInHand(Cards.PilotedShredder))
{
parameters.MinionsModifiers.AddOrUpdate(Cards.PilotedShredder, new Modifier(-600));
return;
}
//else we wanna keep innervate
parameters.SpellsModifiers.AddOrUpdate(Cards.Innervate, new Modifier(500));
if (HasCoin(board))
{
if (HasDarnassus(board) && !HasWildGrowth(board) && board.MinionEnemy.Count > 0 &&
board.MinionEnemy.Sum(x => x.CurrentAtk) < 3)
parameters.MinionsModifiers.AddOrUpdate(Cards.DarnassusAspirant, new Modifier(-300));
//We choose to coin out darnassus over wild growth
if (HasDarnassus(board) && (HasWildGrowth(board) || board.HasCardInHand(Cards.ShadeofNaxxramas)) &&
board.MinionEnemy.All(x => x.Template.Id != Cards.NorthshireCleric))
parameters.MinionsModifiers.AddOrUpdate(Cards.DarnassusAspirant, new Modifier(-300));
if (HasWildGrowth(board) && !HasDarnassus(board) && board.HasCardInHand(Cards.ShadeofNaxxramas))
parameters.SpellsModifiers.AddOrUpdate(Cards.WildGrowth, new Modifier(-300));
if (board.Hand.Count(x => x.Template.Id == Cards.WildGrowth) == 2)
parameters.SpellsModifiers.AddOrUpdate(Cards.WildGrowth, new Modifier(-100));
}
}
示例10: HasSimpleComboInHand
private bool HasSimpleComboInHand(Board board)
{
return board.HasCardInHand(Cards.ForceofNature) && board.HasCardInHand(Cards.SavageRoar);
}
示例11: GetParameters
public ProfileParameters GetParameters(Board board)
{
//Init profile parameter based on rush profile
var parameters = new ProfileParameters(BaseProfile.Default);
/* ------------------------------------------------------------------------------ */
/* ---------------------------- Global cards modifiers ------------------------- */
/* ------------------------------------------------------------------------------ */
//The coin
parameters.SpellsModifiers.AddOrUpdate(Card.Cards.GAME_005, new Modifier(150));
//Innervate
parameters.SpellsModifiers.AddOrUpdate(Cards.Innervate, new Modifier(180));
//Swipe
parameters.SpellsModifiers.AddOrUpdate(Cards.Swipe, new Modifier(75));
//Silence specifics
parameters.MinionsModifiers.AddOrUpdate(Cards.KeeperoftheGrove, new Modifier(30, Cards.TwilightDrake));
parameters.MinionsModifiers.AddOrUpdate(Cards.KeeperoftheGrove, new Modifier(20, Cards.SludgeBelcher));
parameters.MinionsModifiers.AddOrUpdate(Cards.KeeperoftheGrove, new Modifier(1, Cards.TunnelTrogg));
parameters.MinionsModifiers.AddOrUpdate(Cards.KeeperoftheGrove, new Modifier(1, Cards.KnifeJuggler));
parameters.MinionsModifiers.AddOrUpdate(Cards.KeeperoftheGrove, new Modifier(1, Cards.NorthshireCleric));
//Dr.Boom
parameters.MinionsModifiers.AddOrUpdate(Cards.DrBoom, new Modifier(-100));
//AzureDrake
parameters.MinionsModifiers.AddOrUpdate(Cards.AzureDrake, new Modifier(0));
//Thaurissan
if (HasSimpleComboInHand(board) ||
board.HasCardInHand(Cards.ForceofNature) && board.Hand.Count > 4 &&
board.MinionEnemy.Sum(x => x.CurrentAtk) < 5)
parameters.MinionsModifiers.AddOrUpdate(Cards.EmperorThaurissan, new Modifier(-30));
//Force of nature
parameters.SpellsModifiers.AddOrUpdate(Cards.ForceofNature,
new Modifier(HasDoubleForceOfNature(board) ? 60 : 130));
//Wild growth end game
if (board.MaxMana == 7 && HasSimpleComboInHand(board))
parameters.SpellsModifiers.AddOrUpdate(Cards.WildGrowth, new Modifier(1));
else if (board.MaxMana >= 10)
parameters.SpellsModifiers.AddOrUpdate(Cards.WildGrowth, new Modifier(1));
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
/* --------------------- Aggro modifiers ---------------------------- */
/* ------------------------------------------------------------------------------ */
parameters.GlobalAggroModifier = new Modifier(175);
//If we cant put down enemy's life at topdeck lethal range
if (HasPotentialLethalNextTurn(board))
{
Bot.Log("Detected potential lethal next turn, aggro, aggro, aggro !!!");
//Bot.Log("Detected potential lethal next turn !!!!");
parameters.GlobalAggroModifier = new Modifier(500);
if (board.Hand.Count(x => x.Template.Id == Cards.SavageRoar) == 1)
parameters.SpellsModifiers.AddOrUpdate(Cards.SavageRoar, new Modifier(150));
}
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
/* --------------------- Draw modifiers ---------------------------- */
/* ------------------------------------------------------------------------------ */
if (ShouldDrawCards(board)) //If we need to draw cards
{
parameters.MinionsModifiers.AddOrUpdate(Cards.AncientofLore, new Modifier(40));
parameters.GlobalDrawModifier = new Modifier(110);
}
else
{
parameters.GlobalDrawModifier = new Modifier(50);
}
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
if (board.TurnCount < 5)
{
//Turn specific handlers
switch (board.ManaAvailable)
{
case 1:
HandleTurnOneSpecifics(board, ref parameters);
break;
//.........這裏部分代碼省略.........
示例12: HasWildGrowth
private bool HasWildGrowth(Board board)
{
return board.HasCardInHand(Cards.WildGrowth);
}
示例13: HasAncientOfLoreInHand
private bool HasAncientOfLoreInHand(Board board)
{
return board.HasCardInHand(Cards.AncientofLore);
}
示例14: ShouldBePlayed
public override bool ShouldBePlayed(Board board)
{
if(board.TurnCount == 1 && !board.HasCardInHand("GAME_005") && board.MinionFriend.Count == 0 && (board.EnemyClass == Board.Class.ROGUE || board.EnemyClass == Board.Class.MAGE || board.EnemyClass == Board.Class.DRUID))
return false;
return true;
}
示例15: GetParameters
public ProfileParameters GetParameters(Board board)
{
//Init profile parameter based on rush profile
var parameters = new ProfileParameters(BaseProfile.Rush);
//300% of default "Rush" profile value -> the bot will be more aggressive
if (board.TurnCount <= 4 || board.HeroEnemy.CurrentHealth > 18)
{
parameters.GlobalAggroModifier.Value = 150;
foreach (var card in board.MinionFriend)
{
parameters.BoardFriendlyMinionsModifiers.AddOrUpdate(card.Template.Id, new Modifier(200));
}
}
else
parameters.GlobalAggroModifier.Value = 300;
HandleSpells(ref parameters, board);
HandleMinions(ref parameters, board);
//Lower earthshock modifier on Sludge belcher
//parameters.SpellsModifiers.AddOrUpdate(EarthShock, new Modifier(20, SludgeBelcher));
OverrideSilenceSpellsValueOnTauntMinions(ref parameters); //Lower silences values on taunts
Log("Potential Damages in hand : " + BoardHelper.GetTotalBlastDamagesInHand(board));
Log("Potential Weapon: " + BoardHelper.GetPotentialWeaponDamages(board));
Log("Potential minions: " + board.MinionFriend.Sum(x => x.CurrentAtk));
Log("Lethal next turn : " + BoardHelper.HasPotentialLethalNextTurn(board));
Log("Lethal next turn without spells : " + BoardHelper.HasPotentialLethalNextTurnWithoutSpells(board));
Log("Next turn attackers from hand : " +
string.Join(" - ",
BoardHelper.GetPlayableMinionSequenceAttacker(BoardHelper.GetPlayableMinionSequence(board),
board)));
Log("Next turn attackers from board : " +
string.Join(" - ", BoardHelper.GetPotentialMinionAttacker(board)));
//If we cant put down enemy's life at topdeck lethal range
if (!BoardHelper.HasPotentialLethalNextTurn(board)
||
(BoardHelper.HasPotentialLethalNextTurn(board) &&
BoardHelper.HasPotentialLethalNextTurnWithoutSpells(board)))
{
if (BoardHelper.HasPotentialLethalNextTurnWithoutSpells(board))
parameters.GlobalAggroModifier.Value = 100;
//Set crackle spell modifier to 400% of the base spell value defined in "Rush" profile, the bot will try to keep this spell in hand before turn 6
parameters.SpellsModifiers.AddOrUpdate(Cards.Crackle,
new Modifier(GetOverloadSpellConservativeModifier(board, Cards.Crackle)));
parameters.SpellsModifiers.AddOrUpdate(Cards.Crackle,
new Modifier(GetOverloadSpellConservativeModifier(board, Cards.Crackle), board.HeroEnemy.Id));
//Set lava burst spell modifier to 400% of the base spell value defined in "Rush" profile, the bot will try to keep this spell in hand for lethal
parameters.SpellsModifiers.AddOrUpdate(Cards.LavaBurst,
new Modifier(GetOverloadSpellConservativeModifier(board, Cards.LavaBurst)));
parameters.SpellsModifiers.AddOrUpdate(Cards.LavaBurst,
new Modifier(GetOverloadSpellConservativeModifier(board, Cards.LavaBurst), board.HeroEnemy.Id));
//Set lava burst spell modifier to 400% of the base spell value defined in "Rush" profile, the bot will try to keep this spell in hand for lethal
parameters.MinionsModifiers.AddOrUpdate(Cards.ArcaneGolem, new Modifier(400));
}
if (BoardHelper.HasPotentialLethalNextTurn(board) &&
!BoardHelper.HasPotentialLethalNextTurnWithoutSpells(board))
{
PreventSpellFromBeingPlayedOnMinions(ref parameters, board);
parameters.GlobalAggroModifier.Value = 400;
}
if (BoardHelper.HasDoomhammerOnBoard(board) ||
(board.TurnCount <= 5 && !board.HasCardInHand(Cards.LightningBolt)))
//If we don't have doomhammer this turn
{
//Set rockbiter spell modifier to 400% of the base spell value defined in "Rush" profile, the bot will try to keep this spell in hand until we get doomhammer
parameters.SpellsModifiers.AddOrUpdate(Cards.RockbiterWeapon,
new Modifier(board.TurnCount > 4 ? 200 : 100));
}
else
{
parameters.SpellsModifiers.AddOrUpdate(Cards.RockbiterWeapon, new Modifier(400));
}
if (BoardHelper.ShouldDrawCards(board)) //If we need to draw cards
{
//Set AncestralKnowledge spell modifier to 0% of the base spell value defined in "Rush" profile, the bot will play the spell more easily
parameters.SpellsModifiers.AddOrUpdate(Cards.AncestralKnowledge, new Modifier(0));
parameters.GlobalDrawModifier = new Modifier(150);
}
else
{
parameters.GlobalDrawModifier = new Modifier(50);
}
if (board.TurnCount < 5)
{
//Turn specific handlers
switch (board.ManaAvailable)
{
case 1:
//.........這裏部分代碼省略.........