public int getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum cardid, int handsize, int decksize) { //calculates probability \in [0,...,100] int cardsremaining = this.anzCardsInDeck(cardid); if (cardsremaining == 0) { return(0); } double retval = 0.0; //http://de.wikipedia.org/wiki/Hypergeometrische_Verteilung (we calculte 1-p(x=0)) if (cardsremaining == 1) { retval = 1.0 - ((double)(decksize)) / ((double)(decksize + handsize)); } else { retval = 1.0 - ((double)(decksize * (decksize - 1))) / ((double)((decksize + handsize) * (decksize + handsize - 1))); } retval = Math.Min(retval, 1.0); return((int)(100.0 * retval)); }
//[x]<b>Battlecry:</b> Destroy aminion and all copies of it<i>(wherever they are)</i>. //<b>战吼:</b>消灭一个随从及其所有的复制<i>(无论它们在哪)</i>。 public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { CardDB.cardIDEnum id = target.handcard.card.cardIDenum; //场上 if (target != null) { p.minionGetDestroyed(target); } if (own.own) { //手牌中 foreach (Handmanager.Handcard hc in p.owncards) { if (hc.card.cardIDenum == id) { p.removeCard(hc); } } //牌库 //可能无效 foreach (var dc in p.prozis.turnDeck) { if (dc.Key == id) { p.prozis.turnDeck.Remove(dc.Key); } p.ownDeckSize--; } } }
private string getMullRuleKey(CardDB.cardIDEnum cardIDM = CardDB.cardIDEnum.None, HeroEnum ownMHero = HeroEnum.None, HeroEnum enemyMHero = HeroEnum.None, int isExtraRule = 0) { StringBuilder MullRuleKey = new StringBuilder("", 500); MullRuleKey.Append(cardIDM).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(isExtraRule); return(MullRuleKey.ToString()); }
public miniEnch(CardDB.cardIDEnum id, int crtr, int controler, int copydr) { this.CARDID = id; this.creator = crtr; this.controllerOfCreator = controler; this.copyDeathrattle = copydr; }
public void Reset() { this.Id = CardDB.cardIDEnum.None; this.questProgress = 0; this.maxProgress = 1000; this.mobsTurn.Clear(); }
public static SimTemplate GetCardSimulation(CardDB.cardIDEnum tempCardIdEnum) { SimTemplate result = new SimTemplate(); var className = string.Format("Sim_{0}", tempCardIdEnum); var list = GetTypeByName(className); if (list.Count != 1) { if (list.Count >= 2) { var content = string.Join(",", list.Select(x => x.FullName)); throw new Exception(string.Format("Find multiple card simulation class for {0} : {1}", tempCardIdEnum, content)); } } else { var type = list[0]; var simTemplateInstance = Activator.CreateInstance(type); if (simTemplateInstance.GetType().IsSubclassOf(typeof(SimTemplate))) { result = simTemplateInstance as SimTemplate; } else { throw new Exception(string.Format("class {0} should inherit from {1}", className, typeof(SimTemplate))); } } return(result); }
public QuestItem(string s) { String[] q = s.Split(' '); this.Id = CardDB.Instance.cardIdstringToEnum(q[0]); this.questProgress = Convert.ToInt32(q[1]); this.maxProgress = Convert.ToInt32(q[2]); }
public discoveryitem(string line) { this.cardid = CardDB.Instance.cardIdstringToEnum(line.Split(',')[0]); this.bonus = Convert.ToInt32(line.Split(';')[0].Split(',')[1]); this.ownclass = line.Split(';')[1]; this.enemyclass = line.Split(';')[2]; }
public Deck(Playfield p, CardDB.cardIDEnum cardId, int number, bool own) { Deck newDeck = new Deck(); newDeck.deckChanged = true; if (this.deckChanged) { newDeck.deckSize += this.deckSize; foreach (KeyValuePair <CardDB.cardIDEnum, int> diff in this.deckDiff) { newDeck.deckDiff.Add(diff.Key, diff.Value); } } if (number > 0) { newDeck.deckSize += number; if (newDeck.deckDiff.ContainsKey(cardId)) { newDeck.deckDiff[cardId] += number; } else { newDeck.deckDiff.Add(cardId, number); } } //if (own) p.ownDeck = newDeck; //else p.enemyDeck = newDeck; }
public static SimTemplate GetCardSimulation(CardDB.cardIDEnum tempCardIdEnum) { SimTemplate result = new SimTemplate(); var className = $"Sim_{tempCardIdEnum}"; var list = GetTypeByName(className); if (list.Count != 1) { if (list.Count >= 2) { var content = string.Join(",", list.Select(x => x.FullName)); throw new Exception($"Find multiple card simulation class for {tempCardIdEnum} : {content}"); } } else { var type = list[0]; var simTemplateInstance = Activator.CreateInstance(type); if (simTemplateInstance is SimTemplate temp) { result = temp; } else { throw new Exception($"class {className} should inherit from {typeof(SimTemplate)}"); } } return(result); }
public miniEnch(CardDB.cardIDEnum id, int crtr, int controler, int copydr) { this.CARDID = id; this.creator = crtr; this.controllerOfCreator = controler; this.copyDeathrattle = copydr; }
private string getMullRuleKey(CardDB.cardIDEnum cardIDM = CardDB.cardIDEnum.None, HeroEnum ownMHero = HeroEnum.None, HeroEnum enemyMHero = HeroEnum.None, bool HoldM = false) { StringBuilder MullRuleKey = new StringBuilder("", 500); MullRuleKey.Append(cardIDM).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(HoldM ? "Hold" : "Discard"); return(MullRuleKey.ToString()); }
public discoveryitem(string line) { this.cardid = CardDB.Instance.cardIdstringToEnum(line.Split(',')[0]); this.bonus = Convert.ToInt32(line.Split(';')[0].Split(',')[1]); this.ownclass = line.Split(';')[1]; this.enemyclass = line.Split(';')[2]; }
public bool isAllowedSecret(CardDB.cardIDEnum cardID) { if (ownCardsOut.ContainsKey(cardID) && ownCardsOut[cardID] >= 2) { return(false); } return(true); }
// Your Hero Power becomes 'Deal 2 damage'. If already in Shadowform: 3 damage. public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { CardDB.cardIDEnum newHeroPower = CardDB.cardIDEnum.EX1_625t; // Mind Spike if ((ownplay ? p.ownHeroAblility.card.cardIDenum : p.enemyHeroAblility.card.cardIDenum) == CardDB.cardIDEnum.EX1_625t) { newHeroPower = CardDB.cardIDEnum.EX1_625t2; // Mind Shatter } p.setNewHeroPower(newHeroPower, ownplay); }
//Battlecry: Replace your starting Hero Power with a better one. public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice) { TAG_CLASS HeroStartClass = (m.own) ? p.ownHeroStartClass : p.enemyHeroStartClass; CardDB.cardIDEnum tmp = CardDB.cardIDEnum.None; switch (HeroStartClass) { case TAG_CLASS.WARRIOR: tmp = CardDB.cardIDEnum.AT_132_WARRIOR; //Tank Up! break; case TAG_CLASS.WARLOCK: tmp = CardDB.cardIDEnum.AT_132_WARLOCK; //Soul Tap break; case TAG_CLASS.ROGUE: tmp = CardDB.cardIDEnum.AT_132_ROGUE; //Poisoned Daggers break; case TAG_CLASS.SHAMAN: tmp = CardDB.cardIDEnum.AT_132_SHAMAN; //Totemic Slam break; case TAG_CLASS.PRIEST: tmp = CardDB.cardIDEnum.AT_132_PRIEST; //Heal break; case TAG_CLASS.PALADIN: tmp = CardDB.cardIDEnum.AT_132_PALADIN; //The Silver Hand break; case TAG_CLASS.MAGE: tmp = CardDB.cardIDEnum.AT_132_MAGE; //Fireblast Rank 2 break; case TAG_CLASS.HUNTER: tmp = CardDB.cardIDEnum.AT_132_HUNTER; //Ballista Shot break; case TAG_CLASS.DRUID: tmp = CardDB.cardIDEnum.AT_132_DRUID; //Dire Shapeshift break; //default: } if (tmp != CardDB.cardIDEnum.None) { if (m.own) { p.ownHeroAblility.card = CardDB.Instance.getCardDataFromID(tmp); } else { p.enemyHeroAblility.card = CardDB.Instance.getCardDataFromID(tmp); } } }
public bool hasCardinGraveyard(CardDB.cardIDEnum cardid) { foreach (GraveYardItem gyi in this.graveyard) { if (gyi.cardid == cardid) { return(true); } } return(false); }
public bool hasEnemyThisCardInDeck(CardDB.cardIDEnum cardid) { if (this.enemyCardsPlayed.ContainsKey(cardid)) { if (this.enemyCardsPlayed[cardid] == 1) { return(true); } return(false); } return(true); }
public CardInfo(String name, CardDB.cardIDEnum cardID) { Name = name; try { Image = new BitmapImage(new Uri("C:\\Code\\AIPJ\\WpfApplication1\\hs-images\\" + cardID + ".png", UriKind.RelativeOrAbsolute)); } catch (FileNotFoundException e) { Image = new BitmapImage(new Uri("C:\\Code\\AIPJ\\WpfApplication1\\hs-images\\GVG_093.png", UriKind.RelativeOrAbsolute)); } }
public int getPlayValue(CardDB.cardIDEnum ce) { if (this.playByValue.Count == 0) { return(0); } if (this.playByValue.ContainsKey(ce)) { return(-this.playByValue[ce]); } return(0); }
//Battlecry: Replace your starting Hero Power with a better one. public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice) { TAG_CLASS HeroStartClass = (m.own) ? p.ownHeroStartClass : p.enemyHeroStartClass; CardDB.cardIDEnum tmp = CardDB.cardIDEnum.None; switch (HeroStartClass) { case TAG_CLASS.WARRIOR: tmp = CardDB.cardIDEnum.HERO_01bp2; //Tank Up! break; case TAG_CLASS.WARLOCK: tmp = CardDB.cardIDEnum.HERO_07bp2; //Soul Tap break; case TAG_CLASS.ROGUE: tmp = CardDB.cardIDEnum.HERO_03bp2; //Poisoned Daggers break; case TAG_CLASS.SHAMAN: tmp = CardDB.cardIDEnum.HERO_02bp2; //Totemic Slam break; case TAG_CLASS.PRIEST: tmp = CardDB.cardIDEnum.HERO_09bp2; //Heal break; case TAG_CLASS.PALADIN: tmp = CardDB.cardIDEnum.HERO_04bp2; //The Silver Hand break; case TAG_CLASS.MAGE: tmp = CardDB.cardIDEnum.HERO_08bp2; //Fireblast Rank 2 break; case TAG_CLASS.HUNTER: tmp = CardDB.cardIDEnum.HERO_05bp2; //Ballista Shot break; case TAG_CLASS.DRUID: tmp = CardDB.cardIDEnum.HERO_06bp2; //Dire Shapeshift break; //default: } if (tmp != CardDB.cardIDEnum.None) { p.setNewHeroPower(tmp, m.own); } }
public static string GetEnglishName(XElement rootElement, CardDB.cardIDEnum cardIdEnum) { if (cardIdEnum == CardDB.cardIDEnum.None) { return(string.Empty); } var cardId = cardIdEnum.ToString(); var elements1 = rootElement.Elements("Entity"); var element1 = elements1.First(x => x.Attribute("CardID").Value == cardId); var element2 = element1.Elements("Tag").First(x => x.Attribute("enumID").Value == "185"); var name = element2.Element("enUS").Value; return(name); }
public void Copy(QuestItem q) { this.Id = q.Id; this.questProgress = q.questProgress; this.maxProgress = q.maxProgress; if (Id == CardDB.cardIDEnum.UNG_067) { this.mobsTurn.Clear(); foreach (var n in q.mobsTurn) { this.mobsTurn.Add(n.Key, n.Value); } } }
public void removeCardFromTurnDeck(CardDB.cardIDEnum crd) { if (turnDeck.ContainsKey(crd)) { if (turnDeck[crd] > 1) { turnDeck[crd]--; } else { turnDeck.Remove(crd); } } }
public void readGraveyards(string owngrave, string enemygrave) { this.ownCardsPlayed.Clear(); this.enemyCardsPlayed.Clear(); string temp = owngrave.Replace("og: ", ""); this.stalaggDead = false; this.feugenDead = false; foreach (string s in temp.Split(';')) { if (s == "" || s == " ") { continue; } string id = s.Split(',')[0]; string anz = s.Split(',')[1]; CardDB.cardIDEnum cdbe = (CardDB.cardIDEnum)Convert.ToInt32(id); this.ownCardsPlayed.Add(cdbe, Convert.ToInt32(anz)); if (cdbe == CardDB.cardIDEnum.FP1_015) { this.feugenDead = true; } if (cdbe == CardDB.cardIDEnum.FP1_014) { this.stalaggDead = true; } } temp = enemygrave.Replace("eg: ", ""); foreach (string s in temp.Split(';')) { if (s == "" || s == " ") { continue; } string id = s.Split(',')[0]; string anz = s.Split(',')[1]; CardDB.cardIDEnum cdbe = (CardDB.cardIDEnum)Convert.ToInt32(id); this.enemyCardsPlayed.Add(cdbe, Convert.ToInt32(anz)); if (cdbe == CardDB.cardIDEnum.FP1_015) { this.feugenDead = true; } if (cdbe == CardDB.cardIDEnum.FP1_014) { this.stalaggDead = true; } } }
public int getBonusValue(CardDB.cardIDEnum cardid, string ownclass, string enemyclass) { int bonus = 0; foreach (discoveryitem di in this.discoverylist) { if (di.cardid == cardid && (di.ownclass == "all" || di.ownclass == ownclass) && (di.enemyclass == "all" || di.enemyclass == enemyclass)) { if (di.bonus > bonus) { bonus = di.bonus; } } } return(bonus); }
public void playedSecret(CardDB.cardIDEnum secretid, int entity) { Console.WriteLine("1111111111111111111111111111111111111111111111111111111111111"); Console.WriteLine("current player " + this.currentplayer + " played secret " + secretid); Console.WriteLine("1111111111111111111111111111111111111111111111111111111111111"); player currentp = this.p2; player currentenemyp = this.p1; if (this.currentplayer) { currentp = this.p1; currentenemyp = this.p2; } SecretItem si = Probabilitymaker.Instance.getNewSecretGuessedItem(entity, currentp.hero); currentenemyp.enemySecrets.Add(si); }
// Deathrattle: Summon a minion from your deck with less Attack than this minion. public override void onDeathrattle(Playfield p, Minion m) { CardDB.cardIDEnum cId = CardDB.cardIDEnum.None; for (int i = m.Attack - 1; i >= 0; i--) { cId = p.prozis.getDeckCardsForCost(i); if (cId != CardDB.cardIDEnum.None) { break; } } if (cId != CardDB.cardIDEnum.None) { CardDB.Card kid = CardDB.Instance.getCardDataFromID(cId); p.CallKid(kid, m.zonepos - 1, m.own); } }
public int anzCardsInDeck(CardDB.cardIDEnum cardid) { int ret = 2; CardDB.Card c = CardDB.Instance.getCardDataFromID(cardid); if (c.rarity == 5) { ret = 1; //you can have only one rare; } if (this.enemyCardsPlayed.ContainsKey(cardid)) { if (this.enemyCardsPlayed[cardid] == 1) { return(1); } return(0); } return(ret); }
public void setTurnDeck(string td) { turnDeck.Clear(); deckCard.Clear(); string temp = td.Replace("td: ", ""); int checkDuplicate = 0; foreach (string s in temp.Split(';')) { string ss = s.Replace(" ", ""); if (ss == "" || ss == " ") { continue; } string[] pair = ss.Split(','); CardDB.cardIDEnum card = CardDB.Instance.cardIdstringToEnum(pair[0]); CardDB.Card dcard = CardDB.Instance.getCardDataFromID(card); Handmanager.Handcard newdcard = new Handmanager.Handcard(dcard); int num = 1; if (pair.Length > 1) { num = Convert.ToInt32(pair[1]); } if (num >= 2) { checkDuplicate++; } turnDeck.Add(card, num); this.deckCard.Add(newdcard); } if (checkDuplicate >= 1) { this.noDuplicates = false; } else { noDuplicates = true; } }
public void AddTurnDeck(CardDB.cardIDEnum card, int num) { //this.TempTurnDeck.Clear(); //Hrtprozis.Instance.setTurnDeck(BoardTester.Instance.td); //this.TempTurnDeck = Hrtprozis.Instance.turnDeck; int originalCount = 0; foreach (KeyValuePair <CardDB.cardIDEnum, int> cid in this.turnDeck) { if (cid.Key == card) { originalCount = cid.Value; //this.turnDeck.Remove(cid.Key); break; } } this.turnDeck.Remove(card); this.turnDeck.Add(card, num + originalCount); }
private void getDecks() { Dictionary <int, HREntity> allEntitys = HRGame.GetEntityMap(); int owncontroler = HRPlayer.GetLocalPlayer().GetControllerId(); int enemycontroler = HRPlayer.GetEnemyPlayer().GetControllerId(); List <CardDB.cardIDEnum> ownCards = new List <CardDB.cardIDEnum>(); List <CardDB.cardIDEnum> enemyCards = new List <CardDB.cardIDEnum>(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetZone() == HRCardZone.SECRET && ent.GetControllerId() == enemycontroler) { continue; // cant know enemy secrets :D } if (ent.GetCardType() == HRCardType.MINION || ent.GetCardType() == HRCardType.WEAPON || ent.GetCardType() == HRCardType.ABILITY) { CardDB.cardIDEnum cardid = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); //string owner = "own"; //if (ent.GetControllerId() == enemycontroler) owner = "enemy"; //if (ent.GetControllerId() == enemycontroler && ent.GetZone() == HRCardZone.HAND) Helpfunctions.Instance.logg("enemy card in hand: " + "cardindeck: " + cardid + " " + ent.GetName()); //if (cardid != CardDB.cardIDEnum.None) Helpfunctions.Instance.logg("cardindeck: " + cardid + " " + ent.GetName() + " " + ent.GetZone() + " " + owner + " " + ent.GetCardType()); if (cardid != CardDB.cardIDEnum.None) { if (ent.GetControllerId() == owncontroler) { ownCards.Add(cardid); } else { enemyCards.Add(cardid); } } } } Probabilitymaker.Instance.setOwnCards(ownCards); Probabilitymaker.Instance.setEnemyCards(enemyCards); }
public Player(Player p) { //this.isOwnTurn = p.isOwnTurn; this.attacked = p.attacked; this.sEnemTurn = p.sEnemTurn; this.ownController = p.ownController; //this.ownHeroEntity = p.ownHeroEntity; //this.enemyHeroEntity = p.enemyHeroEntity; this.evaluatePenality = p.evaluatePenality; this.ownSecretsIDList.AddRange(p.ownSecretsIDList); this.mana = p.mana; this.manaTurnEnd = p.manaTurnEnd; this.ownMaxMana = p.ownMaxMana; addMinionsReal(p.ownMinions, ownMinions); this.ownHero = new Minion(p.ownHero); addCardsReal(p.owncards); this.ownHeroName = p.ownHeroName; this.playactions.AddRange(p.playactions); this.lastTurnActions.AddRange(p.lastTurnActions); this.attackFaceHP = p.attackFaceHP; this.owncarddraw = p.owncarddraw; this.ownWeaponDurability = p.ownWeaponDurability; this.ownWeaponAttack = p.ownWeaponAttack; this.ownWeaponName = p.ownWeaponName; this.lostDamage = p.lostDamage; this.lostWeaponDamage = p.lostWeaponDamage; this.lostHeal = p.lostHeal; this.ownAbilityReady = p.ownAbilityReady; this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility); this.spellpower = 0; this.mobsplayedThisTurn = p.mobsplayedThisTurn; this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn; this.optionsPlayedThisTurn = p.optionsPlayedThisTurn; this.cardsPlayedThisTurn = p.cardsPlayedThisTurn; this.ueberladung = p.ueberladung; this.ownDeckSize = p.ownDeckSize; this.ownHeroFatigue = p.ownHeroFatigue; //need the following for manacost-calculation this.ownHeroHpStarted = p.ownHeroHpStarted; this.ownWeaponAttackStarted = p.ownWeaponAttackStarted; this.ownCardsCountStarted = p.ownCardsCountStarted; this.ownMobsCountStarted = p.ownMobsCountStarted; //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.playedmagierinderkirintor = p.playedmagierinderkirintor; //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; //this.startedWithManagespenst = p.startedWithManagespenst; //this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture; //this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal; //this.startedWithnerubarweblord = p.startedWithnerubarweblord; //this.startedWithDamagedMinions = p.startedWithDamagedMinions; this.nerubarweblord = p.nerubarweblord; this.winzigebeschwoererin = p.winzigebeschwoererin; this.managespenst = p.managespenst; this.soeldnerDerVenture = p.soeldnerDerVenture; //this.loatheb = p.loatheb; this.spellpower = p.spellpower; this.ownLastDiedMinion = p.ownLastDiedMinion; //####buffs############################# this.anzOwnRaidleader = p.anzOwnRaidleader; this.anzOwnMalGanis = p.anzOwnMalGanis; this.anzOwnStormwindChamps = p.anzOwnStormwindChamps; this.anzOwnTundrarhino = p.anzOwnTundrarhino; this.anzOwnTimberWolfs = p.anzOwnTimberWolfs; this.anzMurlocWarleader = p.anzMurlocWarleader; this.anzGrimscaleOracle = p.anzGrimscaleOracle; this.anzOwnAuchenaiSoulpriest = p.anzOwnAuchenaiSoulpriest; this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice; //this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted; this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain; this.anzOwnMechwarper = p.anzOwnMechwarper; //this.anzOwnMechwarperStarted = p.anzOwnMechwarperStarted; this.anzOwnChromaggus = p.anzOwnChromaggus; this.anzOwnDragonConsort = p.anzOwnDragonConsort; //this.anzOwnDragonConsortStarted = p.anzOwnDragonConsortStarted; //implementation of loatheb this.enemyLoatheb = p.enemyLoatheb; this.enemyMillhouse = p.enemyMillhouse; //end this.ownMinionsDiedTurn = p.ownMinionsDiedTurn; //this.feugenDead = p.feugenDead; //this.stalaggDead = p.stalaggDead; this.doublepriest = p.doublepriest; this.ownBaronRivendare = p.ownBaronRivendare; this.weHaveSteamwheedleSniper = p.weHaveSteamwheedleSniper; //######################################### this.tempanzOwnCards = this.owncards.Count; }
public Playfield(Playfield p) { sf = p.sf; this.nextEntity = p.nextEntity; this.isOwnTurn = p.isOwnTurn; this.turnCounter = p.turnCounter; this.attacked = p.attacked; this.sEnemTurn = p.sEnemTurn; this.ownController = p.ownController; //this.ownHeroEntity = p.ownHeroEntity; //this.enemyHeroEntity = p.enemyHeroEntity; this.evaluatePenality = p.evaluatePenality; this.ownSecretsIDList.AddRange(p.ownSecretsIDList); this.enemySecretCount = p.enemySecretCount; this.enemySecretList.Clear(); if (sf.Settings.useSecretsPlayArround) { foreach (SecretItem si in p.enemySecretList) { this.enemySecretList.Add(new SecretItem(si)); } } this.mana = p.mana; this.manaTurnEnd = p.manaTurnEnd; this.ownMaxMana = p.ownMaxMana; this.enemyMaxMana = p.enemyMaxMana; addMinionsReal(p.ownMinions, ownMinions); addMinionsReal(p.enemyMinions, enemyMinions); this.ownHero = new Minion(p.ownHero); this.enemyHero = new Minion(p.enemyHero); addCardsReal(p.owncards); this.ownHeroName = p.ownHeroName; this.enemyHeroName = p.enemyHeroName; this.playactions.AddRange(p.playactions); this.complete = false; this.attackFaceHP = p.attackFaceHP; this.owncarddraw = p.owncarddraw; this.enemyWeaponAttack = p.enemyWeaponAttack; this.enemyWeaponDurability = p.enemyWeaponDurability; this.enemyWeaponName = p.enemyWeaponName; this.enemycarddraw = p.enemycarddraw; this.enemyAnzCards = p.enemyAnzCards; this.ownWeaponDurability = p.ownWeaponDurability; this.ownWeaponAttack = p.ownWeaponAttack; this.ownWeaponName = p.ownWeaponName; this.lostDamage = p.lostDamage; this.lostWeaponDamage = p.lostWeaponDamage; this.lostHeal = p.lostHeal; this.ownAbilityReady = p.ownAbilityReady; this.enemyAbilityReady = p.enemyAbilityReady; this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility); this.enemyHeroAblility = new Handmanager.Handcard(p.enemyHeroAblility); this.spellpower = 0; this.mobsplayedThisTurn = p.mobsplayedThisTurn; this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn; this.optionsPlayedThisTurn = p.optionsPlayedThisTurn; this.cardsPlayedThisTurn = p.cardsPlayedThisTurn; this.ueberladung = p.ueberladung; this.ownDeckSize = p.ownDeckSize; this.enemyDeckSize = p.enemyDeckSize; this.ownHeroFatigue = p.ownHeroFatigue; this.enemyHeroFatigue = p.enemyHeroFatigue; //need the following for manacost-calculation this.ownHeroHpStarted = p.ownHeroHpStarted; this.ownWeaponAttackStarted = p.ownWeaponAttackStarted; this.ownCardsCountStarted = p.ownCardsCountStarted; this.enemyCardsCountStarted = p.enemyCardsCountStarted; this.ownMobsCountStarted = p.ownMobsCountStarted; this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.playedmagierinderkirintor = p.playedmagierinderkirintor; this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.startedWithManagespenst = p.startedWithManagespenst; this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture; this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal; this.startedWithnerubarweblord = p.startedWithnerubarweblord; this.startedWithDamagedMinions = p.startedWithDamagedMinions; this.nerubarweblord = p.nerubarweblord; this.winzigebeschwoererin = p.winzigebeschwoererin; this.managespenst = p.managespenst; this.soeldnerDerVenture = p.soeldnerDerVenture; this.loatheb = p.loatheb; this.spellpower = p.spellpower; this.enemyspellpower = p.enemyspellpower; this.needGraveyard = p.needGraveyard; if (p.needGraveyard) this.diedMinions = new List<GraveYardItem>(p.diedMinions); this.OwnLastDiedMinion = p.OwnLastDiedMinion; //####buffs############################# this.anzOwnRaidleader = p.anzOwnRaidleader; this.anzEnemyRaidleader = p.anzEnemyRaidleader; this.anzOwnMalGanis = p.anzOwnMalGanis; this.anzEnemyMalGanis = p.anzEnemyMalGanis; this.anzOwnStormwindChamps = p.anzOwnStormwindChamps; this.anzEnemyStormwindChamps = p.anzEnemyStormwindChamps; this.anzOwnTundrarhino = p.anzOwnTundrarhino; this.anzEnemyTundrarhino = p.anzEnemyTundrarhino; this.anzOwnTimberWolfs = p.anzOwnTimberWolfs; this.anzEnemyTimberWolfs = p.anzEnemyTimberWolfs; this.anzMurlocWarleader = p.anzMurlocWarleader; this.anzGrimscaleOracle = p.anzGrimscaleOracle; this.anzOwnAuchenaiSoulpriest = p.anzOwnAuchenaiSoulpriest; this.anzEnemyAuchenaiSoulpriest = p.anzEnemyAuchenaiSoulpriest; this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice; this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted; this.anzEnemysorcerersapprentice = p.anzEnemysorcerersapprentice; this.anzEnemysorcerersapprenticeStarted = p.anzEnemysorcerersapprenticeStarted; this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain; this.anzEnemySouthseacaptain = p.anzEnemySouthseacaptain; this.anzOwnMechwarper = p.anzOwnMechwarper; this.anzOwnMechwarperStarted = p.anzOwnMechwarperStarted; this.anzEnemyMechwarper = p.anzEnemyMechwarper; this.anzEnemyMechwarperStarted = p.anzEnemyMechwarperStarted; this.anzOwnChromaggus = p.anzOwnChromaggus; this.anzEnemyChromaggus = p.anzEnemyChromaggus; this.anzOwnDragonConsort = p.anzOwnDragonConsort; this.anzOwnDragonConsortStarted = p.anzOwnDragonConsortStarted; this.anzEnemyTaunt = p.anzEnemyTaunt; this.ownMinionsDiedTurn = p.ownMinionsDiedTurn; this.enemyMinionsDiedTurn = p.enemyMinionsDiedTurn; this.feugenDead = p.feugenDead; this.stalaggDead = p.stalaggDead; this.weHavePlayedMillhouseManastorm = p.weHavePlayedMillhouseManastorm; this.doublepriest = p.doublepriest; this.enemydoublepriest = p.enemydoublepriest; this.ownBaronRivendare = p.ownBaronRivendare; this.enemyBaronRivendare = p.enemyBaronRivendare; this.weHaveSteamwheedleSniper = p.weHaveSteamwheedleSniper; this.enemyHaveSteamwheedleSniper = p.enemyHaveSteamwheedleSniper; //######################################### this.tempanzOwnCards = this.owncards.Count; this.tempanzEnemyCards = this.enemyAnzCards; }
public void updateBoards() { if (!this.tempTrigger.ownMinionsChanged && !this.tempTrigger.enemyMininsChanged) return; List<Minion> deathrattles = new List<Minion>(); bool minionOwnReviving = false; bool minionEnemyReviving = false; if (this.tempTrigger.ownMinionsChanged) { this.tempTrigger.ownMinionsChanged = false; List<Minion> temp = new List<Minion>(); int i = 1; foreach (Minion m in this.ownMinions) { //delete adjacent buffs this.minionGetAdjacentBuff(m, -m.AdjacentAngr, 0); m.cantBeTargetedBySpellsOrHeroPowers = false; if ((m.name == CardDB.cardName.faeriedragon || m.name == CardDB.cardName.spectralknight || m.name == CardDB.cardName.laughingsister || m.name == CardDB.cardName.arcanenullifierx21) && !m.silenced) { m.cantBeTargetedBySpellsOrHeroPowers = true; } //kill it! if (m.Hp <= 0) { if (this.revivingOwnMinion == CardDB.cardIDEnum.None) { this.revivingOwnMinion = m.handcard.card.cardIDenum; minionOwnReviving = true; } if ((!m.silenced && m.handcard.card.deathrattle) || m.ancestralspirit >= 1 || m.souloftheforest >= 1) { deathrattles.Add(m); } // end aura of minion m m.handcard.card.sim_card.onAuraEnds(this, m); /*if (m.handcard.card.name == CardDB.cardName.cairnebloodhoof || m.handcard.card.name == CardDB.cardName.harvestgolem || m.ancestralspirit>=1) { this.evaluatePenality -= Ai.Instance.botBase.getEnemyMinionValue(m, this) - 1; }*/ } else { m.zonepos = i; temp.Add(m); i++; } } this.ownMinions = temp; this.updateAdjacentBuffs(true); } if (this.tempTrigger.enemyMininsChanged) { this.tempTrigger.enemyMininsChanged = false; List<Minion> temp = new List<Minion>(); int i = 1; foreach (Minion m in this.enemyMinions) { //delete adjacent buffs this.minionGetAdjacentBuff(m, -m.AdjacentAngr, 0); m.cantBeTargetedBySpellsOrHeroPowers = false; if ((m.name == CardDB.cardName.faeriedragon || m.name == CardDB.cardName.spectralknight || m.name == CardDB.cardName.laughingsister || m.name == CardDB.cardName.arcanenullifierx21) && !m.silenced) { m.cantBeTargetedBySpellsOrHeroPowers = true; } //kill it! if (m.Hp <= 0) { if (this.revivingEnemyMinion == CardDB.cardIDEnum.None) { this.revivingEnemyMinion = m.handcard.card.cardIDenum; minionEnemyReviving = true; } if ((!m.silenced && m.handcard.card.deathrattle) || m.ancestralspirit >= 1 || m.souloftheforest >= 1) { deathrattles.Add(m); } m.handcard.card.sim_card.onAuraEnds(this, m); if ((!m.silenced && (m.handcard.card.name == CardDB.cardName.cairnebloodhoof || m.handcard.card.name == CardDB.cardName.harvestgolem)) || m.ancestralspirit >= 1) { this.evaluatePenality -= Ai.Instance.botBase.getEnemyMinionValue(m, this) - 1; } } else { m.zonepos = i; temp.Add(m); i++; } } this.enemyMinions = temp; this.updateAdjacentBuffs(false); } if (deathrattles.Count >= 1) this.doDeathrattles(deathrattles); if (minionOwnReviving) { this.secretTrigger_MinionDied(true); this.revivingOwnMinion = CardDB.cardIDEnum.None; } if (minionEnemyReviving) { this.secretTrigger_MinionDied(false); this.revivingEnemyMinion = CardDB.cardIDEnum.None; } //update buffs }
public CardIDEntity(string id_string, int entt) { this.id = CardDB.Instance.cardIdstringToEnum(id_string); this.entity = entt; }
public GraveYardItem(CardDB.cardIDEnum id, int entity, bool own) { this.own = own; this.cardid = id; this.entity = entity; }