本文整理汇总了C#中HREngine.Bots.CardDB.getManaCost方法的典型用法代码示例。如果您正苦于以下问题:C# CardDB.getManaCost方法的具体用法?C# CardDB.getManaCost怎么用?C# CardDB.getManaCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.CardDB
的用法示例。
在下文中一共展示了CardDB.getManaCost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getSpecialCardComboPenalitys
//.........这里部分代码省略.........
}
}
/*
int numTargets = 2 + p.ownMinions.Count + p.enemyMinions.Count;
int numOwnTargets = 1 + p.ownMinions.Count;
int numEnemyTargets = numTargets-numOwnTargets;
double dmgpertarget = ((double)maxAtk)/((double)numTargets);
foreach (Minion mnn in p.ownMinions)
{
if (mnn.Hp <= dmgpertarget)
{
pen += 10;
}
}
*/
}
if (name == CardDB.cardName.goblinblastmage)
{
bool mechOnField = false;
foreach (Minion mnn in p.ownMinions)
{
if (mnn.handcard.card.race == TAG_RACE.MECHANICAL)
{
mechOnField = true;
break;
}
}
if (! mechOnField)
{
int manacost = card.getManaCost(p, manaCostCard);
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.race == TAG_RACE.MECHANICAL && p.mana >= (hc.getManaCost(p) + manacost)) return 500;//hc.card.race Should work? Nohero please confirm!
if (hc.card.race == TAG_RACE.MECHANICAL && p.mana >= hc.getManaCost(p)) return 50;
}
}
else
{
return 20;
}
}
if (card.name == CardDB.cardName.knifejuggler && p.mobsplayedThisTurn > 1 || (p.ownHeroName == HeroEnum.shaman && p.ownAbilityReady == false))
{
return 20;
}
if (card.name == CardDB.cardName.flametonguetotem && p.ownMinions.Count == 0)
{
return 100;
}
if (card.name == CardDB.cardName.stampedingkodo)
{
bool found = false;
foreach (Minion mi in p.enemyMinions)
{
if (mi.Angr <= 2) found = true;
}
if (!found) return 20;
}
示例2: getSpecialCardComboPenalitys
//.........这里部分代码省略.........
{
if (p.ownWeaponAttack >= 2 || p.ownWeaponDurability >= 2) return 5;
}
if (card.name == CardDB.cardName.upgrade)
{
if (p.ownWeaponDurability == 0)
{
return 16;
}
}
if (card.name == CardDB.cardName.baronrivendare)
{
foreach (Minion mnn in p.ownMinions)
{
if (mnn.name == CardDB.cardName.deathlord || mnn.name == CardDB.cardName.zombiechow || mnn.name == CardDB.cardName.dancingswords) return 30;
}
}
//rule for coin on early game
if (p.ownMaxMana < 3 && card.name == CardDB.cardName.thecoin) //1,2턴
{
bool WGON = false;
int has1manacard = 0;
int has2manacard = 0;
int has3manacard = 0;
bool hasweapon = false;
bool hasPalSecret =false;
foreach (Handmanager.Handcard hcc in p.owncards)
{
if (hcc.card.name == CardDB.cardName.wildgrowth || hcc.card.name == CardDB.cardName.darnassusaspirant ) WGON = true;
if (hcc.manacost == 1 && hcc.card.type == CardDB.cardtype.MOB && hcc.card.name != CardDB.cardName.abusivesergeant) has1manacard++;
if (hcc.card.Secret && hcc.getManaCost(p) == 1) hasPalSecret = true;
if (hcc.manacost == 2 && hcc.card.type != CardDB.cardtype.HEROPWR && hcc.card.name != CardDB.cardName.ironbeakowl) has2manacard++;
if (hcc.manacost == 3 && hcc.card.name != CardDB.cardName.biggamehunter) has3manacard++;
//check 2 mana weapon situation
if (hcc.manacost == 2 && (hcc.card.type == CardDB.cardtype.WEAPON) && p.enemyMinions.Count >=1) hasweapon = true;
}
bool hassecretkepper = false;
foreach (Minion mnn in p.ownMinions)
{
if (mnn.name == CardDB.cardName.secretkeeper) hassecretkepper = true;
}
if (p.ownHeroName == HeroEnum.druid && WGON) return 0;
if (has1manacard >= 2 && p.ownMaxMana == 1) return 0;
if (has2manacard >= 2 && p.ownMaxMana == 1) return 0;
if (has3manacard >= 2 && p.ownMaxMana == 2) return 0;
if (has3manacard == 1 && has1manacard == 1 && has2manacard == 1 && p.ownMaxMana == 2) return 0;
if (hasweapon) return 0;
if (hasPalSecret && hassecretkepper) return 0;
// if (!WGON || (has2manamob <= 1 && p.ownMaxMana == 1) || (has2manamob+has3manamob <= 1 && p.ownMaxMana == 2)) return 500; //몹없고, 무기있고 적몹있는경우 아니거나, 급속성장 없으면 페널티.
return 25;
}
if (card.name == CardDB.cardName.innervate)
{
if (p.mana >= 9) return 100;
}
/* //rule for coin on early game
if (p.ownMaxMana < 3 && card.name == CardDB.cardName.thecoin)
示例3: playCard
public void playCard(CardDB.Card c, int cardpos, int cardEntity, int target, int targetEntity, int choice, int placepos)
{
// lock at frostnova (click) / frostblitz (no click)
this.mana = this.mana - c.getManaCost(this);
if (c.Secret)
{
this.ownSecretsIDList.Add(c.CardID);
this.playedmagierinderkirintor = false;
}
if (c.type == CardDB.cardtype.SPELL) this.playedPreparation = false;
if (logging) help.logg("play crd" + c.name + " " + cardEntity + " " + c.getManaCost(this) + " trgt " + target);
if (c.type == CardDB.cardtype.MOB)
{
Action b = this.placeAmobSomewhere(c, cardpos, target, choice,placepos);
b.druidchoice = choice;
b.owntarget = placepos;
b.enemyEntitiy = targetEntity;
b.cardEntitiy = cardEntity;
this.playactions.Add(b);
this.mobsplayedThisTurn++;
if (c.name == "magierinderkirintor") this.playedmagierinderkirintor = true;
}
else
{
Action a = new Action();
a.cardplay = true;
a.card = c;
a.cardEntitiy = cardEntity;
a.numEnemysBeforePlayed = this.enemyMinions.Count;
a.owntarget = 0;
if (target >= 0)
{
a.owntarget = -1;
}
a.enemytarget = target;
a.enemyEntitiy = targetEntity;
a.druidchoice = choice;
if (target == -1)
{
//card with no target
if (c.type == CardDB.cardtype.WEAPON)
{
equipWeapon(c);
}
playCardWithoutTarget(c, choice);
}
else //before : if(target >=0 && target < 20)
{
if (c.type == CardDB.cardtype.WEAPON)
{
equipWeapon(c);
}
playCardWithTarget(c, target, choice);
}
this.playactions.Add(a);
if (c.type == CardDB.cardtype.SPELL)
{
this.triggerPlayedASpell(c);
}
}
triggerACardGetPlayed(c);
removeCard(cardpos);// remove card
this.ueberladung += c.recallValue;
this.cardsPlayedThisTurn++;
}
示例4: getSpecialCardComboPenalitys
//.........这里部分代码省略.........
if (name == CardDB.cardName.direwolfalpha)
{
int ready = 0;
foreach (Minion min in p.ownMinions)
{
if (min.Ready)
{ ready++; }
}
if (ready == 0)
{ pen = 5; }
}
if (name == CardDB.cardName.abusivesergeant)
{
int ready = 0;
foreach (Minion min in p.ownMinions)
{
if (min.Ready)
{ ready++; }
}
if (ready == 0)
{
pen = 5;
}
}
if (name == CardDB.cardName.madbomber || name == CardDB.cardName.madderbomber)
{
//penalize for any own minions with health equal to potential attack amount
//to lessen risk of losing your own minion
int maxAtk = 3;
if (name == CardDB.cardName.madderbomber) maxAtk = 5;
foreach (Minion mnn in p.ownMinions)
{
if (mnn.Hp <= maxAtk)
{
if (mnn.Ready) pen += mnn.Angr * 20;
}
if (mnn.divineshild) pen += (100 / (p.ownMinions.Count + p.enemyMinions.Count + 2));
}
}
//Should resolve Davidmann's issue, in attempting to play a mech card, onto field first, if possible
if (name == CardDB.cardName.goblinblastmage) //can add other cards that require mechs to be fielded first
{
bool mechOnField = false;
int castCost = card.getManaCost(p, 4);
foreach (Minion mnn in p.ownMinions)
{
if (m.handcard.card.race == TAG_RACE.MECHANICAL) mechOnField = true;
if (mechOnField) break;
}
if (!mechOnField)
{
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.race == TAG_RACE.MECHANICAL && p.mana >= (hc.getManaCost(p) + castCost)) return 500;//hc.card.race Should work? Nohero please confirm!
else if (hc.card.race == TAG_RACE.MECHANICAL && p.mana >= hc.getManaCost(p)) return 50;
}
}
else return 20;
}
if (name == CardDB.cardName.draeneitotemcarver)
{
bool totemOnField = false;
if (p.ownHeroName == HeroEnum.shaman && p.ownAbilityReady == true) return 20;
foreach (Minion mnn in p.ownMinions)
{
if (m.handcard.card.race == TAG_RACE.TOTEM) totemOnField = true;
if (totemOnField) break;
}
if (!totemOnField) return 20;
}
if (returnHandDatabase.ContainsKey(name))
{
if (name == CardDB.cardName.vanish)
{
//dont vanish if we have minons on board wich are ready
bool haveready = false;
foreach (Minion mins in p.ownMinions)
{
if (mins.Ready) haveready = true;
}
if (haveready) pen += 10;
}
if (target.own && !target.isHero)
{
Minion mnn = target;
if (mnn.Ready) pen += 10;
}
}
return pen;
}