public Handcard(Handcard hc) { this.position = hc.position; this.entity = hc.entity; this.manacost = hc.manacost; this.card = hc.card; }
public Handcard(CardDB.Card c) { this.position = 0; this.entity = -1; this.card = c; this.addattack = 0; this.addHp = 0; }
public Handcard(Handcard hc) { this.position = hc.position; this.entity = hc.entity; this.manacost = hc.manacost; this.card = hc.card; this.addattack = hc.addattack; this.addHp = hc.addHp; }
public Handcard(HRSim.Handmanager.Handcard hc) { this.position = hc.position; this.entity = hc.entity; this.manacost = hc.manacost; this.card = new CardDB.Card(hc.card); this.addattack = hc.addattack; this.addHp = hc.addHp; }
public void loadPreparedHeros(int bfield) { if (bfield == 0) { currentMana = 5; ownMaxMana = 7; heroHp = 22; enemyHp = 25; heroAtk = 0; enemyAtk = 0; heroDefence = 0; enemyDefence = 0; ownheroisread = false; ownAbilityisReady = true; heroname = "mage"; enemyHeroname = "druid"; this.heroAbility = this.cdb.getCardDataFromID("CS2_034"); anzEnemys = 0; anzOwn = 0; herofrozen = false; enemyfrozen = false; numMinionsPlayedThisTurn = 0; cardsPlayedThisTurn = 0; ueberladung = 0; ownMaxMana = 10; enemyMaxMana = 10; enemyWeaponDurability = 0; enemyWeaponAttack = 0; enemyHeroWeapon = ""; heroWeaponDurability = 0; heroWeaponAttack = 0; ownHeroWeapon = ""; heroImmuneToDamageWhileAttacking = false; ownPlayerController = 1; } }
public void clearAll() { ownHeroEntity = -1; enemyHeroEntitiy = -1; tempwounded = false; currentMana = 0; heroHp = 30; enemyHp = 30; heroAtk = 0; enemyAtk = 0; heroDefence = 0; enemyDefence = 0; ownheroisread = false; ownAbilityisReady = false; ownHeroNumAttacksThisTurn = 0; ownHeroWindfury = false; ownSecretList.Clear(); enemySecretCount = 0; heroname = "druid"; enemyHeroname = "druid"; heroAbility = new CardDB.Card(); anzEnemys = 0; anzOwn = 0; herofrozen = false; enemyfrozen = false; numMinionsPlayedThisTurn = 0; cardsPlayedThisTurn = 0; ueberladung = 0; ownMaxMana = 0; enemyMaxMana = 0; enemyWeaponDurability = 0; enemyWeaponAttack = 0; enemyHeroWeapon = ""; heroWeaponDurability = 0; heroWeaponAttack = 0; ownHeroWeapon = ""; heroImmuneToDamageWhileAttacking = false; ownMinions.Clear(); enemyMinions.Clear(); }
private void playCardWithoutTarget(CardDB.Card c, int choice) { //todo faehrtenlesen! //play card without target if (c.name == "diemuenze") { this.mana++; } //hunter######################################################################### if (c.name == "mehrfachschuss" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(3); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//damage the strongest temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "tierbegleiter") { CardDB.Card c2 = CardDB.Instance.getCardData("misha"); int placeoffather = this.ownMinions.Count - 1; callKid(c2, placeoffather, true); } if (c.name == "leuchtfeuer") { foreach (Minion m in this.ownMinions) { m.stealth = false; } foreach (Minion m in this.enemyMinions) { m.stealth = false; } this.owncarddraw++; this.drawACard(""); this.enemySecretCount = 0; } if (c.name == "lasstdiehundelos") { int anz = this.enemyMinions.Count; int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardData("jagdhund"); for (int i = 0; i < anz; i++) { callKid(kid, posi, true); } } if (c.name == "toedlicherschuss" && this.enemyMinions.Count >= 1) { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp)); temp.AddRange(Helpfunctions.TakeList(temp2, 1)); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } } //warrior######################################################################### if (c.name == "befehlsruf") { List<Minion> temp = new List<Minion>(this.ownMinions); Enchantment e1 = CardDB.getEnchantmentFromCardID("NEW1_036e"); e1.creator = c.entityID; e1.controllerOfCreator = this.ownController; Enchantment e2 = CardDB.getEnchantmentFromCardID("NEW1_036e2"); e2.creator = c.entityID; e2.controllerOfCreator = this.ownController; foreach (Minion mnn in temp) {//cantLowerHPbelowONE addEffectToMinionNoDoubles(mnn, e1, true); addEffectToMinionNoDoubles(mnn, e2, true); mnn.cantLowerHPbelowONE = true; } } if (c.name == "kampfeswut") { foreach (Minion mnn in this.ownMinions) { if (mnn.wounded) { this.owncarddraw++; this.drawACard(""); } } } if (c.name == "scharmuetzel") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion mnn in temp) { minionGetDestroyed(mnn, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion mnn in temp) { minionGetDestroyed(mnn,false); } } if (c.name == "spalten" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(2); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "aufwertung" ) { if (this.ownWeaponName != "") { this.ownWeaponAttack++; this.ownheroAngr++; this.ownWeaponDurability++; } else { CardDB.Card wcard = CardDB.Instance.getCardData("schwereaxt"); this.equipWeapon(wcard); } } if (c.name == "wirbelwind") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } temp.Clear(); temp = new List<Minion>(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, true); } } if (c.name == "heldenhafterstoss") { this.ownheroAngr = this.ownheroAngr + 4; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "schildblock") { this.ownHeroDefence = this.ownHeroDefence + 5; this.owncarddraw++; drawACard("unknown"); } //mage######################################################################################### if (c.name == "blizzard") { int damage = getSpellDamageDamage(2); List<Minion> temp = new List<Minion>(this.enemyMinions); int maxHp = 0; foreach (Minion enemy in temp) { enemy.frozen = true; if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false, true); } this.lostDamage += Math.Max(0, damage - maxHp); } if (c.name == "arkanegeschosse") { List<Minion> temp = new List<Minion>(this.enemyMinions); temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); int damage = 1; int ammount = getSpellDamageDamage(3); int i = 0; int hp = 0; foreach (Minion enemy in temp) { if (enemy.Hp >= 2) { minionGetDamagedOrHealed(enemy, damage, 0, false); i++; hp += enemy.Hp; if (i == ammount) break; } } if (i < ammount) attackOrHealHero(ammount - i, false); } if (c.name == "arkaneintelligenz") { this.owncarddraw++; this.drawACard(""); this.drawACard(""); } if (c.name == "spiegelbild") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardData("spiegelbildminion"); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "arkaneexplosion") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "frostnova") { List<Minion> temp = new List<Minion>(this.enemyMinions); foreach (Minion enemy in temp) { enemy.frozen = true; } } if (c.name == "flammenstoss") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(4); int maxHp = 0; foreach (Minion enemy in temp) { if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false, true); } this.lostDamage += Math.Max(0, damage - maxHp); } //pala################################################################# if (c.name == "weihe") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } attackOrHealHero(damage, false); } if (c.name == "gleichheit") { foreach (Minion m in this.ownMinions) { m.Hp = 1; m.maxHp = 1; } foreach (Minion m in this.enemyMinions) { m.Hp = 1; m.maxHp = 1; } } if (c.name == "goettlichegunst") { int enemcardsanz = this.enemyAnzCards + this.enemycarddraw; int diff = enemcardsanz - this.owncards.Count; if (diff >= 1) { for (int i = 0; i < diff; i++) { this.owncarddraw++; this.drawACard(""); } } } if (c.name == "zornigevergeltung") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = 1; int i = 0; if (temp.Count >= 1) { foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); i++; if (i == 8) break; } } else { damage = getSpellDamageDamage(8); attackOrHealHero(damage, false); } } //priest #################################################### if (c.name == "kreisderheilung") { List<Minion> temp = new List<Minion>(this.enemyMinions); int heal = getSpellHeal(4); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal, true); } } if (c.name == "gedankenraub") { this.owncarddraw++; this.drawACard("enemycard"); this.owncarddraw++; this.drawACard("enemycard"); } if (c.name == "gedankensicht") { if (this.enemyAnzCards >= 1) { this.owncarddraw++; this.drawACard("enemycard"); } } if (c.name == "schattengestalt") { if (this.ownHeroAblility.CardID == "CS1h_001") // lesser heal becomes mind spike { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_625t"); } else { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_625t2"); // mindspike becomes mind shatter } } if (c.name == "gedankenspiele") { CardDB.Card copymin = CardDB.Instance.getCardDataFromID("CS2_152"); //we draw a knappe :D (worst case) callKid(copymin, this.ownMinions.Count - 1, true); } if (c.name == "massenbannung") { foreach (Minion m in this.enemyMinions) { minionGetSilenced(m, false); } } if (c.name == "gedankenschlag") { int damage = getSpellDamageDamage(5); attackOrHealHero(damage, false); } if (c.name == "kreisderheilung") { List<Minion> temp = new List<Minion>(this.ownMinions); int heal = getSpellHeal(2); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal, false); } attackOrHealHero(-heal, true); temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, true); } attackOrHealHero(damage, true); } //rogue ################################################# if (c.name == "vorbereitung") { this.playedPreparation = true; } if (c.name == "klingenwirbel") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = this.ownWeaponAttack; foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } attackOrHealHero(damage, false); //destroy own weapon this.lowerWeaponDurability(1000, true); } if (c.name == "schaedelbruch") { int damage = getSpellDamageDamage(2); attackOrHealHero(damage, false); if (this.cardsPlayedThisTurn >= 1) this.owncarddraw++; // DONT DRAW A CARD WITH (drawAcard()) because we get this NEXT turn } if (c.name == "finstererstoss") { int damage = getSpellDamageDamage(3); attackOrHealHero(damage, false); } if (c.name == "toedlichesgift") { if (this.ownWeaponName != "") { this.ownWeaponAttack += 2; this.ownheroAngr += 2; } } if (c.name == "dolchfaecher") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "sprinten") { for (int i = 0; i < 4; i++) { this.owncarddraw++; this.drawACard(""); } } if (c.name == "verschwinden") { List<Minion> temp = new List<Minion>(this.enemyMinions); int heal = getSpellHeal(4); foreach (Minion enemy in temp) { minionReturnToHand(enemy, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionReturnToHand(enemy, true); } } //shaman ################################################# if (c.name == "gabelblitzschlag" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(2); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "fernsicht") { this.owncarddraw++; this.drawACard(""); } if (c.name == "gewittersturm") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); int maxHp = 0; foreach (Minion enemy in temp) { if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false, true); } this.lostDamage += Math.Max(0, damage - maxHp); } if (c.name == "wildgeist") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardData("geisterwolf"); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "machtdertotems") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.card.race == 21) // if minion is a totem, buff it { minionGetBuffed(m, 0, 2, true); } } } if (c.name == "kampfrausch") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { Enchantment e = CardDB.getEnchantmentFromCardID("CS2_046e"); e.creator = this.ownController; e.controllerOfCreator = this.ownController; addEffectToMinionNoDoubles(m, e, true); } } //hexenmeister ################################################# if (c.name == "daemonenwahrnehmen") { this.owncarddraw += 2; this.drawACard(""); this.drawACard(""); } if (c.name == "wirbelndernether") { List<Minion> temp = new List<Minion>(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, true); } } if (c.name == "hoellenfeuer") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(3); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } attackOrHealHero(damage, true); attackOrHealHero(damage, false); } //druid ################################################# if (c.name == "seeledeswaldes") { List<Minion> temp = new List<Minion>(this.ownMinions); Enchantment e = CardDB.getEnchantmentFromCardID("EX1_158e"); e.creator = c.entityID; e.controllerOfCreator = this.ownController; foreach (Minion enemy in temp) { addEffectToMinionNoDoubles(enemy, e, true); } } if (c.name == "anregen") { this.mana = Math.Min(this.mana + 2 ,10); } if (c.name == "biss") { this.ownheroAngr += 4; this.ownHeroDefence += 4; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "klaue") { this.ownheroAngr += 2; this.ownHeroDefence += 2; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "naturgewalt") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_tk9");//Treant callKid(kid, posi, true); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "machtderwildnis")// macht der wildnis with summoning { if (choice == 1) { foreach (Minion m in this.ownMinions) { minionGetBuffed(m, 1, 1, true); } } if (choice == 2) { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_160t");//panther callKid(kid, posi, true); } } if (c.name == "sternenregen") { if (choice == 2) { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } } if (c.name == "pflege") { if (choice == 1) { if (this.ownMaxMana == 10) { this.owncarddraw++; this.drawACard("ueberschuessigesmana"); } else { this.ownMaxMana++; this.mana++; } if (this.ownMaxMana == 10) { this.owncarddraw++; this.drawACard("ueberschuessigesmana"); } else { this.ownMaxMana++; this.mana++; } } if (choice == 2) { this.owncarddraw+=3; this.drawACard(""); this.drawACard(""); this.drawACard(""); } } //special cards####################### if (c.CardID == "PRO_001a")// i am murloc { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("PRO_001at");//panther callKid(kid, posi, true); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.CardID == "PRO_001c")// i am murloc { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_021");//scharfseher callKid(kid, posi, true); } if (c.name == "wildwuchs") { if (this.ownMaxMana == 10) { this.owncarddraw++; this.drawACard("ueberschuessigesmana"); } else { this.ownMaxMana++; } } if (c.name == "ueberschuessigesmana") { this.owncarddraw++; this.drawACard(""); } if (c.name == "yseraerwacht") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(5); foreach (Minion enemy in temp) { if (enemy.name != "ysera")// dont attack ysera { minionGetDamagedOrHealed(enemy, damage, 0, false); } } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { if (enemy.name != "ysera")//dont attack ysera { minionGetDamagedOrHealed(enemy, damage, 0, false); } } attackOrHealHero(damage, true); attackOrHealHero(damage, false); } if (c.name == "stampfen" ) { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } }
private void playCardWithoutTarget(Handmanager.Handcard hc, int choice) { CardDB.Card c = hc.card; //todo faehrtenlesen! //play card without target if (c.name == "thecoin") { this.mana++; } //hunter######################################################################### if (c.name == "multi-shot" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(3); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//damage the strongest temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "animalcompanion") { CardDB.Card c2 = CardDB.Instance.getCardData("misha"); int placeoffather = this.ownMinions.Count - 1; callKid(c2, placeoffather, true); } if (c.name == "flare") { foreach (Minion m in this.ownMinions) { m.stealth = false; } foreach (Minion m in this.enemyMinions) { m.stealth = false; } //this.owncarddraw++; drawACard("", true); this.enemySecretCount = 0; } if (c.name == "unleashthehounds") { int anz = this.enemyMinions.Count; int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardData("hound"); for (int i = 0; i < anz; i++) { callKid(kid, posi, true); } } if (c.name == "deadlyshot" && this.enemyMinions.Count >= 1) { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Angr.CompareTo(b.Angr)); temp.AddRange(Helpfunctions.TakeList(temp2, 1)); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } } //warrior######################################################################### if (c.name == "commandingshout") { List<Minion> temp = new List<Minion>(this.ownMinions); Enchantment e1 = CardDB.getEnchantmentFromCardID("NEW1_036e"); e1.creator = hc.entity; e1.controllerOfCreator = this.ownController; Enchantment e2 = CardDB.getEnchantmentFromCardID("NEW1_036e2"); e2.creator = hc.entity; e2.controllerOfCreator = this.ownController; foreach (Minion mnn in temp) {//cantLowerHPbelowONE addEffectToMinionNoDoubles(mnn, e1, true); addEffectToMinionNoDoubles(mnn, e2, true); mnn.cantLowerHPbelowONE = true; } } if (c.name == "battlerage") { foreach (Minion mnn in this.ownMinions) { if (mnn.wounded) { //this.owncarddraw++; drawACard("", true); } } } if (c.name == "brawl") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion mnn in temp) { minionGetDestroyed(mnn, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion mnn in temp) { minionGetDestroyed(mnn,false); } } if (c.name == "cleave" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(2); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "upgrade") { if (this.ownWeaponName != "") { this.ownWeaponAttack++; this.ownheroAngr++; this.ownWeaponDurability++; } else { CardDB.Card wcard = CardDB.Instance.getCardData("heavyaxe"); this.equipWeapon(wcard); } } if (c.name == "whirlwind") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } temp.Clear(); temp = new List<Minion>(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, true); } } if (c.name == "heroicstrike") { this.ownheroAngr = this.ownheroAngr + 4; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "shieldblock") { this.ownHeroDefence = this.ownHeroDefence + 5; //this.owncarddraw++; drawACard("", true); } //mage######################################################################################### if (c.name == "blizzard") { int damage = getSpellDamageDamage(2); List<Minion> temp = new List<Minion>(this.enemyMinions); int maxHp = 0; foreach (Minion enemy in temp) { enemy.frozen = true; if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false, true); } this.lostDamage += Math.Max(0, damage - maxHp); } if (c.name == "arcanemissiles") { /*List<Minion> temp = new List<Minion>(this.enemyMinions); temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); int damage = 1; int ammount = getSpellDamageDamage(3); int i = 0; int hp = 0; foreach (Minion enemy in temp) { if (enemy.Hp >= 2) { minionGetDamagedOrHealed(enemy, damage, 0, false); i++; hp += enemy.Hp; if (i == ammount) break; } } if (i < ammount) attackOrHealHero(ammount - i, false);*/ int damage = 1; int i = 0; List<Minion> temp = new List<Minion>(this.enemyMinions); int times = this.getSpellDamageDamage(3); while (i < times) { if (temp.Count >= 1) { temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); if (temp[0].Hp == 1 && this.enemyHeroHp >= 2) { attackOrHealHero(damage, false); } else { minionGetDamagedOrHealed(temp[0], damage, 0, false); } } else { attackOrHealHero(damage, false); } i++; } } if (c.name == "arcaneintellect") { //this.owncarddraw++; drawACard("", true); drawACard("", true); } if (c.name == "mirrorimage") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("CS2_mirror"); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "arcaneexplosion") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "frostnova") { List<Minion> temp = new List<Minion>(this.enemyMinions); foreach (Minion enemy in temp) { enemy.frozen = true; } } if (c.name == "flamestrike") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(4); int maxHp = 0; foreach (Minion enemy in temp) { if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false, true); } this.lostDamage += Math.Max(0, damage - maxHp); } //pala################################################################# if (c.name == "consecration") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } attackOrHealHero(damage, false); } if (c.name == "equality") { foreach (Minion m in this.ownMinions) { m.Hp = 1; m.maxHp = 1; } foreach (Minion m in this.enemyMinions) { m.Hp = 1; m.maxHp = 1; } } if (c.name == "divinefavor") { int enemcardsanz = this.enemyAnzCards + this.enemycarddraw; int diff = enemcardsanz - this.owncards.Count; if (diff >= 1) { for (int i = 0; i < diff; i++) { //this.owncarddraw++; drawACard("", true); } } } if (c.name == "avengingwrath") { int damage = 1; int i = 0; List<Minion> temp = new List<Minion>(this.enemyMinions); int times = this.getSpellDamageDamage(8); while (i < times) { if (temp.Count >= 1) { temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); if (temp[0].Hp == 1 && this.enemyHeroHp >= 2) { attackOrHealHero(damage, false); } else { minionGetDamagedOrHealed(temp[0], damage, 0, false); } } else { attackOrHealHero(damage, false); } i++; } } //priest #################################################### if (c.name == "circleofhealing") { List<Minion> temp = new List<Minion>(this.enemyMinions); int heal = getSpellHeal(4); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal, true); } } if (c.name == "thoughtsteal") { //this.owncarddraw++; this.drawACard("enemycard",true); //this.owncarddraw++; this.drawACard("enemycard",true); } if (c.name == "mindvision") { if (this.enemyAnzCards+this.enemycarddraw >= 1) { //this.owncarddraw++; this.drawACard("enemycard",true); } } if (c.name == "shadowform") { if (this.ownHeroAblility.CardID == "CS1h_001") // lesser heal becomes mind spike { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_625t"); this.ownAbilityReady = true; } else { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_625t2"); // mindspike becomes mind shatter this.ownAbilityReady = true; } } if (c.name == "mindgames") { CardDB.Card copymin = CardDB.Instance.getCardDataFromID("CS2_152"); //we draw a knappe :D (worst case) callKid(copymin, this.ownMinions.Count - 1, true); } if (c.name == "massdispel") { foreach (Minion m in this.enemyMinions) { minionGetSilenced(m, false); } } if (c.name == "mindblast") { int damage = getSpellDamageDamage(5); attackOrHealHero(damage, false); } if (c.name == "holynova") { List<Minion> temp = new List<Minion>(this.ownMinions); int heal = getSpellHeal(2); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, 0, heal,true,true); } attackOrHealHero(-heal, true); temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false,true); } attackOrHealHero(damage, false); } //rogue ################################################# if (c.name == "preparation") { this.playedPreparation = true; } if (c.name == "bladeflurry") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = this.getSpellDamageDamage(this.ownWeaponAttack); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } attackOrHealHero(damage, false); //destroy own weapon this.lowerWeaponDurability(1000, true); } if (c.name == "headcrack") { int damage = getSpellDamageDamage(2); attackOrHealHero(damage, false); if (this.cardsPlayedThisTurn >= 1) this.owncarddraw++; // DONT DRAW A CARD WITH (drawAcard()) because we get this NEXT turn } if (c.name == "sinisterstrike") { int damage = getSpellDamageDamage(3); attackOrHealHero(damage, false); } if (c.name == "deadlypoison") { if (this.ownWeaponName != "") { this.ownWeaponAttack += 2; this.ownheroAngr += 2; } } if (c.name == "fanofknives") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(1); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } drawACard("", true); } if (c.name == "sprint") { for (int i = 0; i < 4; i++) { //this.owncarddraw++; drawACard("", true); } } if (c.name == "vanish") { List<Minion> temp = new List<Minion>(this.enemyMinions); int heal = getSpellHeal(4); foreach (Minion enemy in temp) { minionReturnToHand(enemy, false, 0); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionReturnToHand(enemy, true, 0); } } //shaman ################################################# if (c.name == "forkedlightning" && this.enemyMinions.Count >= 2) { List<Minion> temp = new List<Minion>(); int damage = getSpellDamageDamage(2); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => -a.Hp.CompareTo(b.Hp)); temp.AddRange(Helpfunctions.TakeList(temp2, 2)); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } if (c.name == "farsight") { //this.owncarddraw++; drawACard("", true); } if (c.name == "lightningstorm") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); int maxHp = 0; foreach (Minion enemy in temp) { if (maxHp < enemy.Hp) maxHp = enemy.Hp; minionGetDamagedOrHealed(enemy, damage, 0, false,true); } this.lostDamage += Math.Max(0, damage - maxHp); } if (c.name == "feralspirit") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardData("spiritwolf"); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "totemicmight") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.handcard.card.race == 21) // if minion is a totem, buff it { minionGetBuffed(m, 0, 2, true); } } } if (c.name == "bloodlust") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { Enchantment e = CardDB.getEnchantmentFromCardID("CS2_046e"); e.creator = this.ownController; e.controllerOfCreator = this.ownController; addEffectToMinionNoDoubles(m, e, true); } } //hexenmeister ################################################# if (c.name == "sensedemons") { //this.owncarddraw += 2; this.drawACard("", true); this.drawACard("", true); } if (c.name == "twistingnether") { List<Minion> temp = new List<Minion>(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, true); } } if (c.name == "hellfire") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(3); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, true); } attackOrHealHero(damage, true); attackOrHealHero(damage, false); } //druid ################################################# if (c.name == "souloftheforest") { List<Minion> temp = new List<Minion>(this.ownMinions); Enchantment e = CardDB.getEnchantmentFromCardID("EX1_158e"); e.creator = hc.entity; e.controllerOfCreator = this.ownController; foreach (Minion enemy in temp) { addEffectToMinionNoDoubles(enemy, e, true); } } if (c.name == "innervate") { this.mana = Math.Min(this.mana + 2 ,10); } if (c.name == "bite") { this.ownheroAngr += 4; this.ownHeroDefence += 4; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "claw") { this.ownheroAngr += 2; this.ownHeroDefence += 2; if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen) { this.ownHeroReady = true; } } if (c.name == "forceofnature") { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_tk9");//Treant callKid(kid, posi, true); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.name == "powerofthewild")// macht der wildnis with summoning { if (choice == 1) { foreach (Minion m in this.ownMinions) { minionGetBuffed(m, 1, 1, true); } } if (choice == 2) { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_160t");//panther callKid(kid, posi, true); } } if (c.name == "starfall") { if (choice == 2) { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } } if (c.name == "nourish") { if (choice == 1) { if (this.ownMaxMana == 10) { //this.owncarddraw++; this.drawACard("excessmana",true); } else { this.ownMaxMana++; this.mana++; } if (this.ownMaxMana == 10) { //this.owncarddraw++; this.drawACard("excessmana",true); } else { this.ownMaxMana++; this.mana++; } } if (choice == 2) { //this.owncarddraw+=3; this.drawACard("", true); this.drawACard("", true); this.drawACard("", true); } } if (c.name == "savageroar") { List<Minion> temp = new List<Minion>(this.ownMinions); Enchantment e = CardDB.getEnchantmentFromCardID("CS2_011o"); e.creator = hc.entity; e.controllerOfCreator = this.ownController; foreach (Minion m in temp) { addEffectToMinionNoDoubles(m, e, true); } this.ownheroAngr += 2; } //special cards####################### if (c.CardID == "PRO_001a")// i am murloc { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("PRO_001at");//panther callKid(kid, posi, true); callKid(kid, posi, true); callKid(kid, posi, true); } if (c.CardID == "PRO_001c")// i am murloc { int posi = this.ownMinions.Count - 1; CardDB.Card kid = CardDB.Instance.getCardDataFromID("EX1_021");//scharfseher callKid(kid, posi, true); } if (c.name == "wildgrowth") { if (this.ownMaxMana == 10) { //this.owncarddraw++; this.drawACard("excessmana",true); } else { this.ownMaxMana++; } } if (c.name == "excessmana") { //this.owncarddraw++; this.drawACard("", true); } if (c.name == "yseraawakens") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(5); foreach (Minion enemy in temp) { if (enemy.name != "ysera")// dont attack ysera { minionGetDamagedOrHealed(enemy, damage, 0, false); } } temp.Clear(); temp.AddRange(this.ownMinions); foreach (Minion enemy in temp) { if (enemy.name != "ysera")//dont attack ysera { minionGetDamagedOrHealed(enemy, damage, 0, false); } } attackOrHealHero(damage, true); attackOrHealHero(damage, false); } if (c.name == "stomp") { List<Minion> temp = new List<Minion>(this.enemyMinions); int damage = getSpellDamageDamage(2); foreach (Minion enemy in temp) { minionGetDamagedOrHealed(enemy, damage, 0, false); } } //NaxxCards################################################################################### if (c.name == "poisonseeds") { int ownanz= this.ownMinions.Count; int enemanz = this.enemyMinions.Count; foreach (Minion mnn in this.ownMinions) { minionGetDestroyed(mnn, true); } foreach (Minion mnn in this.enemyMinions) { minionGetDestroyed(mnn, false); } for (int i = 0; i < ownanz; i++) { CardDB.Card d = CardDB.Instance.getCardDataFromID("EX1_158t"); callKid(d, 0, true); } for (int i = 0; i < enemanz; i++) { CardDB.Card d = CardDB.Instance.getCardDataFromID("EX1_158t"); callKid(d, 0, false); } } }
public Playfield(Playfield p) { this.sEnemTurn = p.sEnemTurn; this.ownController = p.ownController; this.ownHeroEntity = p.ownHeroEntity; this.enemyHeroEntity = p.enemyHeroEntity; this.evaluatePenality = p.evaluatePenality; foreach(string s in p.ownSecretsIDList) { this.ownSecretsIDList.Add(s); } this.enemySecretCount = p.enemySecretCount; this.mana = p.mana; this.ownMaxMana = p.ownMaxMana; this.enemyMaxMana = p.enemyMaxMana; addMinionsReal(p.ownMinions, ownMinions); addMinionsReal(p.enemyMinions, enemyMinions); addCardsReal(p.owncards); this.enemyHeroHp = p.enemyHeroHp; this.ownHeroName = p.ownHeroName; this.enemyHeroName = p.enemyHeroName; this.ownHeroHp = p.ownHeroHp; this.playactions.AddRange(p.playactions); this.complete = false; this.ownHeroReady = p.ownHeroReady; this.enemyHeroReady = p.enemyHeroReady; this.ownHeroNumAttackThisTurn = p.ownHeroNumAttackThisTurn; this.enemyHeroNumAttackThisTurn = p.enemyHeroNumAttackThisTurn; this.ownHeroWindfury = p.ownHeroWindfury; this.attackFaceHP = p.attackFaceHP; this.heroImmune = p.heroImmune; this.enemyHeroImmune = p.enemyHeroImmune; this.ownheroAngr = p.ownheroAngr; this.enemyheroAngr = p.enemyheroAngr; this.ownHeroFrozen = p.ownHeroFrozen; this.enemyHeroFrozen = p.enemyHeroFrozen; this.heroImmuneWhileAttacking = p.heroImmuneWhileAttacking; this.enemyheroImmuneWhileAttacking = p.enemyheroImmuneWhileAttacking; this.owncarddraw = p.owncarddraw; this.ownHeroDefence = p.ownHeroDefence; this.enemyWeaponAttack = p.enemyWeaponAttack; this.enemyWeaponDurability = p.enemyWeaponDurability; this.enemyWeaponName = p.enemyWeaponName; this.enemycarddraw = p.enemycarddraw; this.enemyAnzCards = p.enemyAnzCards; this.enemyHeroDefence = p.enemyHeroDefence; 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 = p.ownHeroAblility; this.enemyHeroAblility = p.enemyHeroAblility; this.doublepriest = 0; this.spellpower = 0; this.mobsplayedThisTurn = p.mobsplayedThisTurn; this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn; 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.enemyHeroHp = p.enemyHeroHp; this.ownWeaponAttackStarted = p.ownWeaponAttackStarted; this.ownCardsCountStarted = p.ownCardsCountStarted; this.ownMobsCountStarted = p.ownMobsCountStarted; this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.playedmagierinderkirintor = p.playedmagierinderkirintor; this.startedWithZauberlehrling = p.startedWithZauberlehrling; this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.startedWithManagespenst = p.startedWithManagespenst; this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture; this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal; this.ownBaronRivendare = false; this.enemyBaronRivendare = false; this.zauberlehrling = 0; this.winzigebeschwoererin = 0; this.managespenst = 0; this.soeldnerDerVenture = 0; foreach (Minion m in this.ownMinions) { if (m.silenced) continue; if (m.handcard.card.specialMin == CardDB.specialMinions.prophetvelen) this.doublepriest++; spellpower = spellpower + m.handcard.card.spellpowervalue; if (m.handcard.card.specialMin == CardDB.specialMinions.auchenaisoulpriest) this.auchenaiseelenpriesterin = true; if (m.handcard.card.specialMin == CardDB.specialMinions.pintsizedsummoner) this.winzigebeschwoererin++; if (m.handcard.card.specialMin == CardDB.specialMinions.sorcerersapprentice) this.zauberlehrling++; if (m.handcard.card.specialMin == CardDB.specialMinions.manawraith) this.managespenst++; if (m.handcard.card.specialMin == CardDB.specialMinions.venturecomercenary) this.soeldnerDerVenture++; if (m.handcard.card.specialMin == CardDB.specialMinions.summoningportal) this.beschwoerungsportal++; if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare) { this.ownBaronRivendare = true; } } foreach (Minion m in this.enemyMinions) { if (m.silenced) continue; if (m.handcard.card.specialMin == CardDB.specialMinions.manawraith) this.managespenst++; if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare) { this.enemyBaronRivendare = true; } } }
public Playfield() { //this.simulateEnemyTurn = Ai.Instance.simulateEnemyTurn; this.ownController = Hrtprozis.Instance.getOwnController(); this.ownHeroEntity = Hrtprozis.Instance.ownHeroEntity; this.enemyHeroEntity = Hrtprozis.Instance.enemyHeroEntitiy; this.mana = Hrtprozis.Instance.currentMana; this.ownMaxMana = Hrtprozis.Instance.ownMaxMana; this.enemyMaxMana = Hrtprozis.Instance.enemyMaxMana; this.evaluatePenality = 0; this.ownSecretsIDList = Hrtprozis.Instance.ownSecretList; this.enemySecretCount = Hrtprozis.Instance.enemySecretCount; this.heroImmune = Hrtprozis.Instance.heroImmune; this.enemyHeroImmune = Hrtprozis.Instance.enemyHeroImmune; this.attackFaceHP = Hrtprozis.Instance.attackFaceHp; addMinionsReal(Hrtprozis.Instance.ownMinions, ownMinions); addMinionsReal(Hrtprozis.Instance.enemyMinions, enemyMinions); addCardsReal(Handmanager.Instance.handCards); this.enemyHeroHp = Hrtprozis.Instance.enemyHp; this.ownHeroName = Hrtprozis.Instance.heroname; this.enemyHeroName = Hrtprozis.Instance.enemyHeroname; this.ownHeroHp = Hrtprozis.Instance.heroHp; this.complete = false; this.ownHeroReady = Hrtprozis.Instance.ownheroisread; this.ownHeroWindfury = Hrtprozis.Instance.ownHeroWindfury; this.ownHeroNumAttackThisTurn = Hrtprozis.Instance.ownHeroNumAttacksThisTurn; this.ownHeroFrozen = Hrtprozis.Instance.herofrozen; this.enemyHeroFrozen = Hrtprozis.Instance.enemyfrozen; this.ownheroAngr = Hrtprozis.Instance.heroAtk; this.heroImmuneWhileAttacking = Hrtprozis.Instance.heroImmuneToDamageWhileAttacking; this.ownWeaponDurability = Hrtprozis.Instance.heroWeaponDurability; this.ownWeaponAttack = Hrtprozis.Instance.heroWeaponAttack; this.ownWeaponName = Hrtprozis.Instance.ownHeroWeapon; this.owncarddraw = 0; this.ownHeroDefence = Hrtprozis.Instance.heroDefence; this.enemyHeroDefence = Hrtprozis.Instance.enemyDefence; this.enemyWeaponAttack = Hrtprozis.Instance.enemyWeaponAttack;//dont know jet this.enemyWeaponName = Hrtprozis.Instance.enemyHeroWeapon; this.enemyWeaponDurability = Hrtprozis.Instance.enemyWeaponDurability; this.enemycarddraw = 0; this.enemyAnzCards = Handmanager.Instance.enemyAnzCards; this.ownAbilityReady = Hrtprozis.Instance.ownAbilityisReady; this.ownHeroAblility = Hrtprozis.Instance.heroAbility; this.enemyHeroAblility = Hrtprozis.Instance.enemyAbility; this.doublepriest = 0; this.spellpower = 0; this.mobsplayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn; this.startedWithMobsPlayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;// only change mobsplayedthisturm this.cardsPlayedThisTurn = Hrtprozis.Instance.cardsPlayedThisTurn; this.ueberladung = Hrtprozis.Instance.ueberladung; this.ownHeroFatigue = Hrtprozis.Instance.ownHeroFatigue; this.enemyHeroFatigue = Hrtprozis.Instance.enemyHeroFatigue; this.ownDeckSize = Hrtprozis.Instance.ownDeckSize; this.enemyDeckSize = Hrtprozis.Instance.enemyDeckSize; //need the following for manacost-calculation this.ownHeroHpStarted = this.ownHeroHp; this.enemyHeroHpStarted = this.enemyHeroHp; this.ownWeaponAttackStarted = this.ownWeaponAttack; this.ownCardsCountStarted = this.owncards.Count; this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count; this.playedmagierinderkirintor = false; this.playedPreparation = false; this.zauberlehrling = 0; this.winzigebeschwoererin = 0; this.managespenst = 0; this.soeldnerDerVenture = 0; this.beschwoerungsportal = 0; this.startedWithbeschwoerungsportal = 0; this.startedWithManagespenst = 0; this.startedWithWinzigebeschwoererin = 0; this.startedWithZauberlehrling = 0; this.startedWithsoeldnerDerVenture = 0; this.ownBaronRivendare = false; this.enemyBaronRivendare = false; foreach (Minion m in this.ownMinions) { if (m.silenced) continue; if (m.name == "prophetvelen") this.doublepriest++; spellpower = spellpower + m.handcard.card.spellpowervalue; if (m.name == "auchenaisoulpriest") this.auchenaiseelenpriesterin = true; if (m.name == "pint-sizedsummoner") { this.winzigebeschwoererin++; this.startedWithWinzigebeschwoererin++; } if (m.name == "sorcerersapprentice") { this.zauberlehrling++; this.startedWithZauberlehrling++; } if (m.name == "manawraith") { this.managespenst++; this.startedWithManagespenst++; } if (m.name == "venturecomercenary") { this.soeldnerDerVenture++; this.startedWithsoeldnerDerVenture++; } if (m.name == "summoningportal") { this.beschwoerungsportal++; this.startedWithbeschwoerungsportal++; } if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare) { this.ownBaronRivendare = true; } foreach (Enchantment e in m.enchantments)// only at first init needed, after that its copied { if (e.CARDID == "NEW1_036e" || e.CARDID == "NEW1_036e2") m.cantLowerHPbelowONE = true; } } foreach (Minion m in this.enemyMinions) { if (m.silenced) continue; if (m.name == "manawraith") { this.managespenst++; this.startedWithManagespenst++; } if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare) { this.enemyBaronRivendare = true; } } }
private void getHerostuff() { HRPlayer ownPlayer = HRPlayer.GetLocalPlayer(); HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer(); HREntity ownhero = ownPlayer.GetHero(); HREntity enemyhero = enemyPlayer.GetHero(); HREntity ownHeroAbility = ownPlayer.GetHeroPower(); //player stuff######################### //this.currentMana =ownPlayer.GetTag(HRGameTag.RESOURCES) - ownPlayer.GetTag(HRGameTag.RESOURCES_USED) + ownPlayer.GetTag(HRGameTag.TEMP_RESOURCES); this.currentMana = ownPlayer.GetNumAvailableResources(); this.ownMaxMana = ownPlayer.GetTag(HRGameTag.RESOURCES);//ownPlayer.GetRealTimeTempMana(); Helpfunctions.Instance.logg("#######################################################################"); Helpfunctions.Instance.logg("#######################################################################"); Helpfunctions.Instance.logg("start calculations, current time: " + DateTime.Now.ToString("HH:mm:ss") + " V" + this.versionnumber); Helpfunctions.Instance.logg("#######################################################################"); Helpfunctions.Instance.logg("mana " + currentMana + "/" + ownMaxMana); Helpfunctions.Instance.logg("own secretsCount: " + ownPlayer.GetSecretDefinitions().Count); enemySecretCount = HRCard.GetCards(enemyPlayer, HRCardZone.SECRET).Count; enemySecretCount = 0; Helpfunctions.Instance.logg("enemy secretsCount: " + enemySecretCount); this.ownSecretList = ownPlayer.GetSecretDefinitions(); this.numMinionsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_MINIONS_PLAYED_THIS_TURN); this.cardsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_CARDS_PLAYED_THIS_TURN); //if (ownPlayer.HasCombo()) this.cardsPlayedThisTurn = 1; this.ueberladung = ownPlayer.GetTag(HRGameTag.RECALL_OWED); //get weapon stuff this.ownHeroWeapon = ""; this.heroWeaponAttack = 0; this.heroWeaponDurability = 0; this.ownHeroFatigue = ownhero.GetFatigue(); this.enemyHeroFatigue = enemyhero.GetFatigue(); //this.ownDecksize = HRCard.GetCards(ownPlayer, HRCardZone.DECK).Count; //this.enemyDecksize = HRCard.GetCards(enemyPlayer, HRCardZone.DECK).Count; this.heroImmune = ownhero.IsImmune(); this.enemyHeroImmune = enemyhero.IsImmune(); this.enemyHeroWeapon = ""; this.enemyWeaponAttack = 0; this.enemyWeaponDurability = 0; if (enemyPlayer.HasWeapon()) { HREntity weapon = enemyPlayer.GetWeaponCard().GetEntity(); this.enemyHeroWeapon = CardDB.Instance.getCardDataFromID(weapon.GetCardId()).name; this.enemyWeaponAttack = weapon.GetATK(); this.enemyWeaponDurability = weapon.GetDurability(); } //own hero stuff########################### this.heroAtk = ownhero.GetATK(); this.heroHp = ownhero.GetHealth() - ownhero.GetDamage(); this.heroDefence = ownhero.GetArmor(); this.heroname = Hrtprozis.Instance.heroIDtoName(ownhero.GetCardId()); bool exausted = false; exausted = ownhero.IsExhausted(); this.ownheroisread = true; this.heroImmuneToDamageWhileAttacking = (ownhero.IsImmune()) ? true : false; this.herofrozen = ownhero.IsFrozen(); this.heroNumAttacksThisTurn = ownhero.GetNumAttacksThisTurn(); this.heroHasWindfury = ownhero.HasWindfury(); //int numberofattacks = ownhero.GetNumAttacksThisTurn(); //HRLog.Write(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen); if (exausted == true) { this.ownheroisread = false; } if (exausted == false && this.heroAtk == 0) { this.ownheroisread = false; } if (herofrozen) ownheroisread = false; if (ownPlayer.HasWeapon()) { HREntity weapon = ownPlayer.GetWeaponCard().GetEntity(); this.ownHeroWeapon = CardDB.Instance.getCardDataFromID(weapon.GetCardId()).name; this.heroWeaponAttack = weapon.GetATK(); this.heroWeaponDurability = weapon.GetTag(HRGameTag.DURABILITY) - weapon.GetTag(HRGameTag.DAMAGE);//weapon.GetDurability(); this.heroImmuneToDamageWhileAttacking = false; if (this.ownHeroWeapon == "gladiatorslongbow") { this.heroImmuneToDamageWhileAttacking = true; } //HRLog.Write("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability); } //enemy hero stuff############################################################### this.enemyAtk = enemyhero.GetATK(); this.enemyHp = enemyhero.GetHealth() - enemyhero.GetDamage(); this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(enemyhero.GetCardId()); this.enemyDefence = enemyhero.GetArmor(); this.enemyfrozen = enemyhero.IsFrozen(); //own hero ablity stuff########################################################### this.heroAbility = CardDB.Instance.getCardDataFromID(ownHeroAbility.GetCardId()); this.ownAbilityisReady = (ownHeroAbility.IsExhausted()) ? false : true; // if exhausted, ability is NOT ready this.enemyAbility = CardDB.Instance.getCardDataFromID(enemyhero.GetHeroPower().GetCardId()); }
private void drawACard(string ss) { string s = ss; if (s == "") s = "unknown"; if (s == "enemycard") s = "unknown"; // NO PENALITY FOR DRAWING TO MUCH CARDS if (this.owncards.Count >= 10) return; // cant hold more than 10 cards if (s == "unknown") { CardDB.Card plchldr = new CardDB.Card(); plchldr.name = "unknown"; Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = plchldr; hc.position = this.owncards.Count + 1; hc.manacost = 1000; this.owncards.Add(hc); } else { CardDB.Card c = CardDB.Instance.getCardData(s); Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = c; hc.position = this.owncards.Count + 1; hc.manacost = c.calculateManaCost(this); this.owncards.Add(hc); } }
private void getHerostuff() { Dictionary<int, HREntity> allEntitys = HRGame.GetEntityMap(); HRPlayer ownPlayer = HRPlayer.GetLocalPlayer(); HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer(); HREntity ownhero = ownPlayer.GetHero(); HREntity enemyhero = enemyPlayer.GetHero(); HREntity ownHeroAbility = ownPlayer.GetHeroPower(); //player stuff######################### //this.currentMana =ownPlayer.GetTag(HRGameTag.RESOURCES) - ownPlayer.GetTag(HRGameTag.RESOURCES_USED) + ownPlayer.GetTag(HRGameTag.TEMP_RESOURCES); this.currentMana = ownPlayer.GetNumAvailableResources(); this.ownMaxMana = ownPlayer.GetTag(HRGameTag.RESOURCES); this.enemyMaxMana = enemyPlayer.GetTag(HRGameTag.RESOURCES); enemySecretCount = HRCard.GetCards(enemyPlayer, HRCardZone.SECRET).Count; enemySecretCount = 0; //count enemy secrets foreach (HREntity ent in allEntitys.Values) { if (ent.IsSecret() && ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.SECRET) enemySecretCount++; } this.ownSecretList = ownPlayer.GetSecretDefinitions(); this.numMinionsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_MINIONS_PLAYED_THIS_TURN); this.cardsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_CARDS_PLAYED_THIS_TURN); //if (ownPlayer.HasCombo()) this.cardsPlayedThisTurn = 1; this.ueberladung = ownPlayer.GetTag(HRGameTag.RECALL_OWED); //get weapon stuff this.ownHeroWeapon = ""; this.heroWeaponAttack = 0; this.heroWeaponDurability = 0; this.ownHeroFatigue = ownhero.GetFatigue(); this.enemyHeroFatigue = enemyhero.GetFatigue(); this.ownDecksize = 0; this.enemyDecksize = 0; //count decksize foreach (HREntity ent in allEntitys.Values) { if (ent.GetControllerId() == ownPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) ownDecksize++; if (ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) enemyDecksize++; } this.heroImmune = (ownhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; this.enemyHeroImmune = (enemyhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; this.enemyHeroWeapon = ""; this.enemyWeaponAttack = 0; this.enemyWeaponDurability = 0; if (enemyPlayer.HasWeapon()) { HREntity weapon = enemyPlayer.GetWeaponCard().GetEntity(); this.enemyHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.enemyWeaponAttack = weapon.GetATK(); this.enemyWeaponDurability = weapon.GetDurability(); } //own hero stuff########################### this.heroAtk = ownhero.GetATK(); this.heroHp = ownhero.GetHealth() - ownhero.GetDamage(); this.heroDefence = ownhero.GetArmor(); this.heroname = Hrtprozis.Instance.heroIDtoName(ownhero.GetCardId()); bool exausted = false; exausted = ownhero.IsExhausted(); this.ownheroisread = true; this.heroImmuneToDamageWhileAttacking = false; this.herofrozen = ownhero.IsFrozen(); this.heroNumAttacksThisTurn = ownhero.GetNumAttacksThisTurn(); this.heroHasWindfury = ownhero.HasWindfury(); //int numberofattacks = ownhero.GetNumAttacksThisTurn(); //Helpfunctions.Instance.ErrorLog(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen); if (ownPlayer.HasWeapon()) { HREntity weapon = ownPlayer.GetWeaponCard().GetEntity(); this.ownHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.heroWeaponAttack = weapon.GetATK(); this.heroWeaponDurability = weapon.GetTag(HRGameTag.DURABILITY) - weapon.GetTag(HRGameTag.DAMAGE);//weapon.GetDurability(); this.heroImmuneToDamageWhileAttacking = false; if (this.ownHeroWeapon == "gladiatorslongbow") { this.heroImmuneToDamageWhileAttacking = true; } if (this.ownHeroWeapon == "doomhammer") { this.heroHasWindfury = true; } //Helpfunctions.Instance.ErrorLog("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability); } if(exausted) this.ownheroisread = false; if (this.heroNumAttacksThisTurn == 1 && this.heroHasWindfury ) { this.ownheroisread = true; } if (exausted == false && this.heroAtk == 0) { this.ownheroisread = false; } if (herofrozen) ownheroisread = false; //enemy hero stuff############################################################### this.enemyAtk = enemyhero.GetATK(); this.enemyHp = enemyhero.GetHealth() - enemyhero.GetDamage(); this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(enemyhero.GetCardId()); this.enemyDefence = enemyhero.GetArmor(); this.enemyfrozen = enemyhero.IsFrozen(); //own hero ablity stuff########################################################### this.heroAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(ownHeroAbility.GetCardId())); this.ownAbilityisReady = (ownHeroAbility.IsExhausted()) ? false : true; // if exhausted, ability is NOT ready this.enemyAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(enemyhero.GetHeroPower().GetCardId())); }
private void getHerostuff() { List<HSCard> allcards = TritonHs.GetAllCards(); HSCard ownHeroCard = TritonHs.OurHero; HSCard enemHeroCard = TritonHs.EnemyHero; int ownheroentity = TritonHs.OurHero.EntityId; int enemyheroentity = TritonHs.EnemyHero.EntityId; foreach (HSCard ent in allcards) { if (ent.EntityId == enemyheroentity) { enemHeroCard = ent; } if (ent.EntityId == ownheroentity) { ownHeroCard = ent; } } //player stuff######################### //this.currentMana =ownPlayer.GetTag(HRGameTag.RESOURCES) - ownPlayer.GetTag(HRGameTag.RESOURCES_USED) + ownPlayer.GetTag(HRGameTag.TEMP_RESOURCES); this.currentMana = TritonHs.CurrentMana; this.ownMaxMana = TritonHs.Resources; this.enemyMaxMana = ownMaxMana; //count own secrets ownSecretList = new List<string>(); // the CARDIDS of the secrets enemySecretCount = 0; //count enemy secrets: enemySecretList.Clear(); foreach (HSCard ent in allcards) { if (ent.IsSecret && ent.ControllerId != ownPlayerController && ent.GetTag(GAME_TAG.ZONE) == 7) { enemySecretCount++; enemySecretList.Add(ent.GetTag(GAME_TAG.ENTITY_ID)); } if (ent.IsSecret && ent.ControllerId == ownPlayerController && ent.GetTag(GAME_TAG.ZONE) == 7) { ownSecretList.Add(ent.Id); } } int ourSecretsCount = ownSecretList.Count; numMinionsPlayedThisTurn = TritonHs.NumMinionsPlayedThisTurn; cardsPlayedThisTurn = TritonHs.NumCardsPlayedThisTurn; //get weapon stuff this.ownHeroWeapon = ""; this.heroWeaponAttack = 0; this.heroWeaponDurability = 0; this.ownHeroFatigue = ownHeroCard.GetTag(GAME_TAG.FATIGUE); this.enemyHeroFatigue = enemHeroCard.GetTag(GAME_TAG.FATIGUE); this.ownDecksize = 0; this.enemyDecksize = 0; //count decksize foreach (HSCard ent in allcards) { if (ent.ControllerId == ownPlayerController && ent.GetTag(GAME_TAG.ZONE) == 2) ownDecksize++; if (ent.ControllerId != ownPlayerController && ent.GetTag(GAME_TAG.ZONE) == 2) enemyDecksize++; } //own hero stuff########################### int heroAtk = ownHeroCard.GetTag(GAME_TAG.ATK); int heroHp = ownHeroCard.GetTag(GAME_TAG.HEALTH) - ownHeroCard.GetTag(GAME_TAG.DAMAGE); int heroDefence = ownHeroCard.GetTag(GAME_TAG.ARMOR); this.heroname = Hrtprozis.Instance.heroIDtoName(TritonHs.OurHero.Id); bool heroImmuneToDamageWhileAttacking = false; bool herofrozen = (ownHeroCard.GetTag(GAME_TAG.FROZEN) == 0) ? false : true; int heroNumAttacksThisTurn = ownHeroCard.GetTag(GAME_TAG.NUM_ATTACKS_THIS_TURN); bool heroHasWindfury = (ownHeroCard.GetTag(GAME_TAG.WINDFURY) == 0) ? false : true; bool heroImmune = (ownHeroCard.GetTag(GAME_TAG.CANT_BE_DAMAGED) == 0) ? false : true; //Helpfunctions.Instance.ErrorLog(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen); if (TritonHs.DoWeHaveWeapon) { HSCard weapon = TritonHs.OurWeaponCard; ownHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.Id)).name.ToString(); heroWeaponAttack = weapon.GetTag(GAME_TAG.ATK); heroWeaponDurability = weapon.GetTag(GAME_TAG.DURABILITY) - weapon.GetTag(GAME_TAG.DAMAGE); //weapon.GetDurability(); if (ownHeroWeapon == "gladiatorslongbow") { heroImmuneToDamageWhileAttacking = true; } if (this.ownHeroWeapon == "doomhammer") { heroHasWindfury = true; } //Helpfunctions.Instance.ErrorLog("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability); } //enemy hero stuff############################################################### this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(TritonHs.EnemyHero.Id); int enemyAtk = enemHeroCard.GetTag(GAME_TAG.ATK); //lol should be zero :D int enemyHp = enemHeroCard.GetTag(GAME_TAG.HEALTH) - enemHeroCard.GetTag(GAME_TAG.DAMAGE); int enemyDefence = enemHeroCard.GetTag(GAME_TAG.ARMOR); bool enemyfrozen = (enemHeroCard.GetTag(GAME_TAG.FROZEN) == 0) ? false : true; bool enemyHeroImmune = (enemHeroCard.GetTag(GAME_TAG.CANT_BE_DAMAGED) == 0) ? false : true; this.enemyHeroWeapon = ""; this.enemyWeaponAttack = 0; this.enemyWeaponDurability = 0; if (TritonHs.DoesEnemyHasWeapon) { HSCard weapon = TritonHs.EnemyWeaponCard; enemyHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.Id)).name.ToString(); enemyWeaponAttack = weapon.GetTag(GAME_TAG.ATK); enemyWeaponDurability = weapon.GetTag(GAME_TAG.DURABILITY) - weapon.GetTag(GAME_TAG.DAMAGE); } //own hero ablity stuff########################################################### this.heroAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(TritonHs.OurHeroPowerCard.Id)); this.ownAbilityisReady = (TritonHs.OurHeroPowerCard.GetTag(GAME_TAG.EXHAUSTED) == 0) ? true : false; this.enemyAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(TritonHs.OurHeroPowerCard.Id)); int ownHeroAbilityEntity = TritonHs.OurHeroPowerCard.EntityId; //NEW...................................... //its not the ourHeropowerCard... its our player! (entityid = 2 or 3) this.heroPowerUsesThisTurn = TritonHs.OurPlayer.GetTag(GAME_TAG.HEROPOWER_ACTIVATIONS_THIS_TURN); this.ownHeroPowerUsesThisGame = TritonHs.OurPlayer.GetTag(GAME_TAG.NUM_TIMES_HERO_POWER_USED_THIS_GAME); this.enemyHeroPowerUsesThisGame = TritonHs.EnemyPlayer.GetTag(GAME_TAG.NUM_TIMES_HERO_POWER_USED_THIS_GAME); //............................................ foreach (HSCard ent in allcards) { if (ent.EntityId != ownHeroAbilityEntity && ent.GetTag(GAME_TAG.CARDTYPE) == 10) { enemyAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(ent.Id)); break; } } //generate Heros this.ownHero = new Minion(); this.enemyHero = new Minion(); this.ownHero.isHero = true; this.enemyHero.isHero = true; this.ownHero.own = true; this.enemyHero.own = false; this.ownHero.maxHp = ownHeroCard.GetTag(GAME_TAG.HEALTH); this.enemyHero.maxHp = enemHeroCard.GetTag(GAME_TAG.HEALTH); this.ownHero.entitiyID = ownHeroCard.EntityId; this.enemyHero.entitiyID = enemHeroCard.EntityId; this.ownHero.Angr = heroAtk; this.ownHero.Hp = heroHp; this.ownHero.armor = heroDefence; this.ownHero.frozen = herofrozen; this.ownHero.immuneWhileAttacking = heroImmuneToDamageWhileAttacking; this.ownHero.immune = heroImmune; this.ownHero.numAttacksThisTurn = heroNumAttacksThisTurn; this.ownHero.windfury = heroHasWindfury; this.enemyHero.Angr = enemyAtk; this.enemyHero.Hp = enemyHp; this.enemyHero.frozen = enemyfrozen; this.enemyHero.armor = enemyDefence; this.enemyHero.immune = enemyHeroImmune; this.enemyHero.Ready = false; this.ownHero.updateReadyness(); //load enchantments of the heros List<miniEnch> miniEnchlist = new List<miniEnch>(); foreach (HSCard ent in allcards) { if (ent.GetTag(GAME_TAG.ATTACHED) == this.ownHero.entitiyID && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id); int controler = ent.GetTag(GAME_TAG.CONTROLLER); int creator = ent.GetTag(GAME_TAG.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler)); } } this.ownHero.loadEnchantments(miniEnchlist, ownHeroCard.GetTag(GAME_TAG.CONTROLLER)); ueberladung = TritonHs.RecallOwed;//was at the start, but copied it over here :D , its german for overload :D //Reading new values:################################################################################################### //ToDo: this.numberMinionsDiedThisTurn = 0;// GameTag.NUM_MINIONS_KILLED_THIS_TURN; //this should work (hope i didnt oversee a value :D) //THIS IS WRONG CHANGE THIS (should be the ownPLAYER and enemyPLAYER this.ownCurrentOverload = ownHeroCard.GetTag(GAME_TAG.RECALL); this.enemyOverload = enemHeroCard.GetTag(GAME_TAG.RECALL_OWED); //count buffs off !!players!! (players and not heros) (like preparation, kirintor-buff and stuff) // hope this works, dont own these cards to test where its attached int owncontrollerblubb = ownHeroCard.GetTag(GAME_TAG.CONTROLLER)+1; // controller = 1 or 2, but entity with 1 is the board -> +1 int enemycontrollerblubb = enemHeroCard.GetTag(GAME_TAG.CONTROLLER) + 1;// controller = 1 or 2, but entity with 1 is the board -> +1 foreach (HSCard ent in allcards) { if (ent.GetTag(GAME_TAG.ATTACHED) == owncontrollerblubb && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id); if (id == CardDB.cardIDEnum.NEW1_029t) this.enemyMillhouse++;//CHANGED!!!! if (id == CardDB.cardIDEnum.FP1_030e) this.enemyLoathebs++; //CHANGED!!!! if (id == CardDB.cardIDEnum.BRM_018e) this.ownDragonConsort++; if (id == CardDB.cardIDEnum.EX1_612o) this.ownKirintor++; if (id == CardDB.cardIDEnum.EX1_145o) this.ownPrepa++; if (id == CardDB.cardIDEnum.AT_061e) this.lockandload++; if (id == CardDB.cardIDEnum.AT_086e) this.enemysabo++; if (id == CardDB.cardIDEnum.AT_115e) this.ownFenciCoaches++; } if (ent.GetTag(GAME_TAG.ATTACHED) == enemycontrollerblubb && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id); if (id == CardDB.cardIDEnum.NEW1_029t) this.ownMillhouse++; //CHANGED!!!! (enemy has the buff-> we played millhouse) if (id == CardDB.cardIDEnum.FP1_030e) this.ownLoathebs++; //CHANGED!!!! if (id == CardDB.cardIDEnum.BRM_018e) this.enemyDragonConsort++; // not needef for enemy, because its lasting only for his turn //if (id == CardDB.cardIDEnum.EX1_612o) this.enemyKirintor++; //if (id == CardDB.cardIDEnum.EX1_145o) this.enemyPrepa++; if (id == CardDB.cardIDEnum.AT_086e) this.ownsabo++; } } //TODO test Bolvar Fordragon but it will be on his card :D //Reading new values end################################ miniEnchlist.Clear(); foreach (HSCard ent in allcards) { if (ent.GetTag(GAME_TAG.ATTACHED) == this.enemyHero.entitiyID && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id); int controler = ent.GetTag(GAME_TAG.CONTROLLER); int creator = ent.GetTag(GAME_TAG.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler)); } } this.enemyHero.loadEnchantments(miniEnchlist, enemHeroCard.GetTag(GAME_TAG.CONTROLLER)); //fastmode weapon correction: if (this.ownHero.Angr < this.heroWeaponAttack) this.ownHero.Angr = this.heroWeaponAttack; if (this.enemyHero.Angr < this.enemyWeaponAttack) this.enemyHero.Angr = this.enemyWeaponAttack; }
public Handcard(CardDB.Card c ) { this.position = 0; this.entity = -1; this.card = c; }
private void doBattleCryWithoutTargeting(Minion c, int position, bool own, int choice) { //only nontargetable battlecrys! //druid choices //urtum des krieges: if (c.name == "urtumdeskrieges") { if (choice == 1) { minionGetBuffed(c, 5, 0, true); } if (choice == 2) { minionGetBuffed(c, 0, 5, true); c.taunt = true; } } if (c.name == "urtumderlehren") { if (choice == 1) { this.owncarddraw += 2; this.drawACard(""); this.drawACard(""); } } if (c.name == "druidederklaue") { if (choice == 1) { minionGetCharge(c); } if (choice == 2) { minionGetBuffed(c, 0, 2, true); c.taunt = true; } } if (c.name == "cenarius") { if (choice == 1) { foreach (Minion m in this.ownMinions) { minionGetBuffed(m, 2, 2, true); } } //choice 2 = spawn 2 kids } //normal ones if (c.name == "gedankenkontrolleur") { if (this.enemyMinions.Count >= 4) { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Angr.CompareTo(b.Angr));//we take the weekest temp.AddRange(Helpfunctions.TakeList(temp2, 2)); Minion target = new Minion(); target = temp[0]; if (target.taunt && !temp[1].taunt) target = temp[1]; minionGetControlled(target, true, false); } } if (c.name == "teufelswache") { this.ownMaxMana--; } if (c.name == "arkangolem") { this.enemyMaxMana++; } if (c.name == "edwinvancleef" && this.cardsPlayedThisTurn >= 1) { minionGetBuffed(c, this.cardsPlayedThisTurn * 2, this.cardsPlayedThisTurn * 2, own); } if (c.name == "verdammniswache") { this.owncarddraw -= Math.Min(2, this.owncards.Count); this.owncards.RemoveRange(0, Math.Min(2, this.owncards.Count)); } if (c.name == "sukkubus") { this.owncarddraw -= Math.Min(1, this.owncards.Count); this.owncards.RemoveRange(0, Math.Min(1, this.owncards.Count)); } if (c.name == "lordjaraxxus") { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_tk33"); this.ownHeroName = "lordjaraxxus"; this.ownHeroHp = c.Hp; } if (c.name == "flammenwichtel") { attackOrHealHero(3, own); } if (c.name == "grubenlord") { attackOrHealHero(5, own); } if (c.name == "schreckenderleere") { List<Minion> temp = new List<Minion>(); if (own) { temp.AddRange(this.ownMinions); } else { temp.AddRange(this.enemyMinions); } int angr = 0; int hp = 0; foreach (Minion m in temp) { if (m.id == position + 1 || m.id == position - 1) { angr += m.Angr; hp += m.Hp; } } foreach (Minion m in temp) { if (m.id == position + 1 || m.id == position - 1) { minionGetDestroyed(m, own); } } minionGetBuffed(c, angr, hp, own); } if (c.name == "frostwolfkriegsfuerst") { minionGetBuffed(c, this.ownMinions.Count, this.ownMinions.Count, own); } if (c.name == "blutsegelraeuberin") { c.Angr += this.ownWeaponAttack; } if (c.name == "suedmeerdeckmatrose" && this.ownWeaponDurability >= 1) { minionGetCharge(c); } if (c.name == "blutritter") { int shilds = 0; foreach (Minion m in this.ownMinions) { if (m.divineshild) { m.divineshild = false; shilds++; } } foreach (Minion m in this.enemyMinions) { if (m.divineshild) { m.divineshild = false; shilds++; } } minionGetBuffed(c, 3 * shilds, 3 * shilds, own); } if (c.name == "koenigmukla") { this.enemycarddraw += 2; } if (c.name == "tiefenlichtorakel") { this.enemycarddraw += 2; this.owncarddraw += 2; drawACard("unknown"); drawACard("unknown"); } if (c.name == "arathiwaffenschmiedin") { CardDB.Card wcard = CardDB.Instance.getCardData("streitaxt"); this.equipWeapon(wcard); } if (c.name == "blutsegelkorsar") { this.lowerWeaponDurability(1, false); } if (c.name == "saeurehaltigerschlamm") { this.lowerWeaponDurability(1000, false); } if (c.name == "ingenieurslehrling") { this.owncarddraw++; drawACard("unknown"); } if (c.name == "gnomischeerfinderin") { this.owncarddraw++; drawACard("unknown"); } if (c.name == "dunkelschuppenheilerin") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { minionGetDamagedOrHealed(m, 0, 2, true); } attackOrHealHero(-2, true); } if (c.name == "nachtklinge") { attackOrHealHero(3, !own); } if (c.name == "zwielichtdrache") { minionGetBuffed(c, 0, this.owncards.Count, true); } if (c.name == "azurblauerdrache") { this.owncarddraw++; drawACard("unknown"); } if (c.name == "harrisonjones") { this.enemyWeaponAttack = 0; this.owncarddraw += enemyWeaponDurability; for (int i = 0; i < enemyWeaponDurability; i++) { drawACard("unknown"); } this.enemyWeaponDurability = 0; } if (c.name == "waechterderkoenige") { attackOrHealHero(-6, true); } if (c.name == "kapitaengruenhaut") { if (this.ownWeaponName != "") { this.ownheroAngr += 1; this.ownWeaponAttack++; this.ownWeaponDurability++; } } if (c.name == "priesteringvonelune") { attackOrHealHero(-4, true); } if (c.name == "verletzterklingenmeister") { minionGetDamagedOrHealed(c, 4, 0, true); } if (c.name == "schreckenshoellenbestie") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { minionGetDamagedOrHealed(m, 1, 0, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion m in temp) { minionGetDamagedOrHealed(m, 1, 0, false); } attackOrHealHero(1, false); attackOrHealHero(1, true); } if (c.name == "tundranashorn") { minionGetCharge(c); List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.card.race == TAG_RACE.PET) { minionGetCharge(m); } } } if (c.name == "panischerkodo") { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest temp.AddRange(temp2); foreach (Minion enemy in temp) { if (enemy.Angr <= 2) { minionGetDestroyed(enemy, false); break; } } } if (c.name == "sonnenzornbeschuetzerin") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position + 1) { m.taunt = true; } } } if (c.name == "uraltermagier") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position + 1) { m.card.spellpowervalue++; } } } if (c.name == "verteidigervonargus") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position + 1) { Enchantment e = CardDB.getEnchantmentFromCardID("EX1_093e"); e.creator = c.entitiyID; e.controllerOfCreator = this.ownController; addEffectToMinionNoDoubles(m, e, own); } } } if (c.name == "tiefenlichtseher") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.card.race == TAG_RACE.MURLOC) { minionGetBuffed(m, 0, 2, true); } } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.card.race == TAG_RACE.MURLOC) { minionGetBuffed(m, 0, 2, false); } } } if (c.name == "todesschwinge") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } this.owncards.Clear(); } if (c.name == "papageideskapitaens") { this.owncarddraw++; this.drawACard(""); } }
public void updateEnemyHero(string weapon, int watt, int wdur, int heroatt, int herohp, int herodef, string heron, bool frozen, CardDB.Card eab, bool ehisim) { this.enemyHeroWeapon = weapon; this.enemyWeaponAttack = watt; this.enemyWeaponDurability = wdur; this.enemyAtk = heroatt; this.enemyHp = herohp; this.enemyHeroname = this.heroNametoEnum(heron); this.enemyDefence = herodef; this.enemyfrozen = frozen; this.enemyAbility = eab; this.enemyHeroImmune = ehisim; }
public void setMinionTominion(Minion m) { //dont silence---------------------------- this.anzGotDmg = m.anzGotDmg; this.gotDmgRaw = m.gotDmgRaw; this.GotDmgValue = m.GotDmgValue; this.gotInspire = m.gotInspire; this.isHero = m.isHero; this.own = m.own; this.canAttackNormal = m.canAttackNormal; this.name = m.name; this.cardClass = m.cardClass; this.synergy = m.synergy; this.handcard = m.handcard;//new? this.deathrattle2 = m.deathrattle2; //this.entitiyID = m.entitiyID; this.zonepos = m.zonepos; this.allreadyAttacked = m.allreadyAttacked; this.playedThisTurn = m.playedThisTurn; this.numAttacksThisTurn = m.numAttacksThisTurn; this.immuneWhileAttacking = m.immuneWhileAttacking; //--------------------------------------- this.shadowmadnessed = m.shadowmadnessed; this.ancestralspirit = m.ancestralspirit; this.destroyOnOwnTurnStart = m.destroyOnOwnTurnStart; // depends on own! this.destroyOnEnemyTurnStart = m.destroyOnEnemyTurnStart; // depends on own! this.destroyOnOwnTurnEnd = m.destroyOnOwnTurnEnd; // depends on own! this.destroyOnEnemyTurnEnd = m.destroyOnEnemyTurnEnd; // depends on own! this.concedal = m.concedal; this.souloftheforest = m.souloftheforest; this.explorershat = m.explorershat; this.infest = m.infest; this.ownBlessingOfWisdom = m.ownBlessingOfWisdom; this.enemyBlessingOfWisdom = m.enemyBlessingOfWisdom; this.ownPowerWordGlory = m.ownPowerWordGlory; this.enemyPowerWordGlory = m.enemyPowerWordGlory; this.spellpower = m.spellpower; this.Hp = m.Hp; this.maxHp = m.maxHp; this.armor = m.armor; this.Angr = m.Angr; this.AdjacentAngr = m.AdjacentAngr; this.tempAttack = m.tempAttack; this.Ready = m.Ready; this.taunt = m.taunt; this.wounded = m.wounded; this.divineshild = m.divineshild; this.windfury = m.windfury; this.frozen = m.frozen; this.stealth = m.stealth; this.immune = m.immune; this.exhausted = m.exhausted; this.charge = m.charge; this.poisonous = m.poisonous; this.cantLowerHPbelowONE = m.cantLowerHPbelowONE; this.silenced = m.silenced; this.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers; if (m.deathrattles != null) { this.deathrattles = new List<int>(); foreach (int dr in m.deathrattles) { this.deathrattles.Add(dr); } } }
public void updateOwnHero(string weapon, int watt, int wdur, bool heroimunewhileattack, int heroatt, int herohp, int herodef, string heron, bool heroready, bool frozen, CardDB.Card hab, bool habrdy, int numAttacksTTurn, bool windfury, bool hisim) { this.ownHeroWeapon = weapon; this.heroWeaponAttack = watt; this.heroWeaponDurability = wdur; this.heroImmuneToDamageWhileAttacking = heroimunewhileattack; this.heroAtk = heroatt; this.heroHp = herohp; this.heroDefence = herodef; this.heroname = this.heroNametoEnum(heron); this.ownheroisread = heroready; this.herofrozen = frozen; this.heroAbility = hab; this.ownAbilityisReady = habrdy; this.ownHeroWindfury = windfury; this.ownHeroNumAttacksThisTurn = numAttacksTTurn; this.heroImmune = hisim; }
public void becomeSilence(Playfield p) { deathrattle2 = null; p.minionGetOrEraseAllAreaBuffs(this, false); //buffs ancestralspirit = 0; destroyOnOwnTurnStart = false; destroyOnEnemyTurnStart = false; destroyOnOwnTurnEnd = false; destroyOnEnemyTurnEnd = false; concedal = false; souloftheforest = 0; explorershat = 0; infest = 0; ownBlessingOfWisdom = 0; enemyBlessingOfWisdom = 0; ownPowerWordGlory = 0; enemyPowerWordGlory = 0; cantBeTargetedBySpellsOrHeroPowers = false; charge = 0; taunt = false; divineshild = false; windfury = false; frozen = false; stealth = false; immune = false; poisonous = false; cantLowerHPbelowONE = false; if(this.deathrattles!=null) this.deathrattles.Clear(); if (own) { p.spellpower -= spellpower; if (this.taunt) p.anzOwnTaunt--; } else { p.enemyspellpower -= spellpower; if (this.taunt) p.anzEnemyTaunt--; } spellpower = 0; //delete enrage (if minion is silenced the first time) if (wounded && handcard.card.Enrage && !silenced) { handcard.card.sim_card.onEnrageStop(p, this); } //reset attack Angr = handcard.card.Attack; tempAttack = 0;//we dont toutch the adjacent buffs! //reset hp and heal it if (maxHp < handcard.card.Health)//minion has lower maxHp as his card -> heal his hp { Hp += handcard.card.Health - maxHp; //heal minion } maxHp = handcard.card.Health; if (Hp > maxHp) Hp = maxHp; if (!silenced)//minion WAS not silenced, deactivate his aura { handcard.card.sim_card.onAuraEnds(p, this); } silenced = true; this.updateReadyness(); p.minionGetOrEraseAllAreaBuffs(this, true); if (own) { p.tempTrigger.ownMinionsChanged = true; } else { p.tempTrigger.enemyMininsChanged = true; } if (this.shadowmadnessed) { this.shadowmadnessed = false; p.shadowmadnessed--; p.minionGetControlled(this, !own, false); } }
private void getHerostuff() { Dictionary<int, HREntity> allEntitys = HRGame.GetEntityMap(); HRPlayer ownPlayer = HRPlayer.GetLocalPlayer(); HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer(); HREntity ownhero = ownPlayer.GetHero(); HREntity enemyhero = enemyPlayer.GetHero(); HREntity ownHeroAbility = ownPlayer.GetHeroPower(); //player stuff######################### //this.currentMana =ownPlayer.GetTag(HRGameTag.RESOURCES) - ownPlayer.GetTag(HRGameTag.RESOURCES_USED) + ownPlayer.GetTag(HRGameTag.TEMP_RESOURCES); this.currentMana = ownPlayer.GetNumAvailableResources(); this.ownMaxMana = ownPlayer.GetTag(HRGameTag.RESOURCES); this.enemyMaxMana = enemyPlayer.GetTag(HRGameTag.RESOURCES); enemySecretCount = HRCard.GetCards(enemyPlayer, HRCardZone.SECRET).Count; enemySecretCount = 0; //count enemy secrets enemySecretList.Clear(); foreach (HREntity ent in allEntitys.Values) { if (ent.IsSecret() && ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.SECRET) { enemySecretCount++; enemySecretList.Add(ent.GetTag(HRGameTag.ENTITY_ID)); } } this.ownSecretList = ownPlayer.GetSecretDefinitions(); this.numMinionsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_MINIONS_PLAYED_THIS_TURN); this.cardsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_CARDS_PLAYED_THIS_TURN); //if (ownPlayer.HasCombo()) this.cardsPlayedThisTurn = 1; //get weapon stuff this.ownHeroWeapon = ""; this.heroWeaponAttack = 0; this.heroWeaponDurability = 0; this.ownHeroFatigue = ownhero.GetFatigue(); this.enemyHeroFatigue = enemyhero.GetFatigue(); this.ownDecksize = 0; this.enemyDecksize = 0; //count decksize foreach (HREntity ent in allEntitys.Values) { if (ent.GetControllerId() == ownPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) ownDecksize++; if (ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) enemyDecksize++; } //own hero stuff########################### int heroAtk = ownhero.GetATK(); int heroHp = ownhero.GetHealth() - ownhero.GetDamage(); int heroDefence = ownhero.GetArmor(); this.heroname = Hrtprozis.Instance.heroIDtoName(ownhero.GetCardId()); bool heroImmuneToDamageWhileAttacking = false; bool herofrozen = ownhero.IsFrozen(); int heroNumAttacksThisTurn = ownhero.GetNumAttacksThisTurn(); bool heroHasWindfury = ownhero.HasWindfury(); bool heroImmune = (ownhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; //Helpfunctions.Instance.ErrorLog(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen); if (ownPlayer.HasWeapon()) { HREntity weapon = ownPlayer.GetWeaponCard().GetEntity(); this.ownHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.heroWeaponAttack = weapon.GetATK(); this.heroWeaponDurability = weapon.GetTag(HRGameTag.DURABILITY) - weapon.GetTag(HRGameTag.DAMAGE);//weapon.GetDurability(); heroImmuneToDamageWhileAttacking = false; if (this.ownHeroWeapon == "gladiatorslongbow") { heroImmuneToDamageWhileAttacking = true; } if (this.ownHeroWeapon == "doomhammer") { heroHasWindfury = true; } //Helpfunctions.Instance.ErrorLog("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability); } //enemy hero stuff############################################################### this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(enemyhero.GetCardId()); int enemyAtk = enemyhero.GetATK(); int enemyHp = enemyhero.GetHealth() - enemyhero.GetDamage(); int enemyDefence = enemyhero.GetArmor(); bool enemyfrozen = enemyhero.IsFrozen(); bool enemyHeroImmune = (enemyhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; this.enemyHeroWeapon = ""; this.enemyWeaponAttack = 0; this.enemyWeaponDurability = 0; if (enemyPlayer.HasWeapon()) { HREntity weapon = enemyPlayer.GetWeaponCard().GetEntity(); this.enemyHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.enemyWeaponAttack = weapon.GetATK(); this.enemyWeaponDurability = weapon.GetDurability(); } //own hero ablity stuff########################################################### this.heroAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(ownHeroAbility.GetCardId())); this.ownAbilityisReady = (ownHeroAbility.IsExhausted()) ? false : true; // if exhausted, ability is NOT ready this.enemyAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(enemyhero.GetHeroPower().GetCardId())); //generate Heros this.ownHero = new Minion(); this.enemyHero = new Minion(); this.ownHero.isHero = true; this.enemyHero.isHero = true; this.ownHero.own = true; this.enemyHero.own = false; this.ownHero.maxHp = ownhero.GetHealth(); this.enemyHero.maxHp = enemyhero.GetHealth(); this.ownHero.entitiyID = ownhero.GetEntityId(); this.enemyHero.entitiyID = enemyhero.GetEntityId(); this.ownHero.Angr = heroAtk; this.ownHero.Hp = heroHp; this.ownHero.armor = heroDefence; this.ownHero.frozen = herofrozen; this.ownHero.immuneWhileAttacking = heroImmuneToDamageWhileAttacking; this.ownHero.immune = heroImmune; this.ownHero.numAttacksThisTurn = heroNumAttacksThisTurn; this.ownHero.windfury = heroHasWindfury; this.enemyHero.Angr = enemyAtk; this.enemyHero.Hp = enemyHp; this.enemyHero.frozen = enemyfrozen; this.enemyHero.armor = enemyDefence; this.enemyHero.immune = enemyHeroImmune; this.enemyHero.Ready = false; this.ownHero.updateReadyness(); //load enchantments of the heros List<miniEnch> miniEnchlist = new List<miniEnch>(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetTag(HRGameTag.ATTACHED) == this.ownHero.entitiyID && ent.GetZone() == HRCardZone.PLAY) { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); int controler = ent.GetTag(HRGameTag.CONTROLLER); int creator = ent.GetTag(HRGameTag.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler)); } } this.ownHero.loadEnchantments(miniEnchlist, ownhero.GetTag(HRGameTag.CONTROLLER)); ueberladung = ownhero.GetTag(HRGameTag.RECALL_OWED);//was at the start, but copied it over here :D , its german for overload :D //Reading new values:################################################################################################### //ToDo: this.numberMinionsDiedThisTurn = 0;// HRGameTag.NUM_MINIONS_KILLED_THIS_TURN; //this should work (hope i didnt oversee a value :D) this.ownCurrentOverload = ownhero.GetTag(HRGameTag.RECALL); this.enemyOverload = enemyhero.GetTag(HRGameTag.RECALL_OWED); //count buffs off !!players!! (players and not heros) (like preparation, kirintor-buff and stuff) // hope this works, dont own these cards to test where its attached int owncontrollerblubb = ownhero.GetTag(HRGameTag.CONTROLLER) + 1; // controller = 1 or 2, but entity with 1 is the board -> +1 int enemycontrollerblubb = enemyhero.GetTag(HRGameTag.CONTROLLER) + 1;// controller = 1 or 2, but entity with 1 is the board -> +1 foreach (HREntity ent in allEntitys.Values) { if (ent.GetTag(HRGameTag.ATTACHED) == owncontrollerblubb && ent.GetTag(HRGameTag.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); if (id == CardDB.cardIDEnum.NEW1_029t) this.ownMillhouse++; if (id == CardDB.cardIDEnum.FP1_030e) this.ownLoathebs++; if (id == CardDB.cardIDEnum.BRM_018e) this.ownDragonConsort++; if (id == CardDB.cardIDEnum.EX1_612o) this.ownKirintor++; if (id == CardDB.cardIDEnum.EX1_145o) this.ownPrepa++; } if (ent.GetTag(HRGameTag.ATTACHED) == enemycontrollerblubb && ent.GetTag(HRGameTag.ZONE) == 1) //1==play { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); if (id == CardDB.cardIDEnum.NEW1_029t) this.enemyMillhouse++; if (id == CardDB.cardIDEnum.FP1_030e) this.enemyLoathebs++; if (id == CardDB.cardIDEnum.BRM_018e) this.enemyDragonConsort++; // not needef for enemy, because its lasting only for his turn //if (id == CardDB.cardIDEnum.EX1_612o) this.enemyKirintor++; //if (id == CardDB.cardIDEnum.EX1_145o) this.enemyPrepa++; } } //TODO test Bolvar Fordragon but it will be on his card :D //Reading new values end################################ miniEnchlist.Clear(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetTag(HRGameTag.ATTACHED) == this.enemyHero.entitiyID && ent.GetZone() == HRCardZone.PLAY) { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); int controler = ent.GetTag(HRGameTag.CONTROLLER); int creator = ent.GetTag(HRGameTag.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler)); } } this.enemyHero.loadEnchantments(miniEnchlist, enemyhero.GetTag(HRGameTag.CONTROLLER)); //fastmode weapon correction: if (ownHero.Angr < this.heroWeaponAttack) ownHero.Angr = this.heroWeaponAttack; if (enemyHero.Angr < this.enemyWeaponAttack) enemyHero.Angr = this.enemyWeaponAttack; }
public Handcard() { card = CardDB.Instance.unknownCard; }
private void doBattleCryWithoutTargeting(Minion c, int position, bool own, int choice) { //only nontargetable battlecrys! //druid choices //urtum des krieges: if (c.name == "ancientofwar") { if (choice == 1) { minionGetBuffed(c, 5, 0, true); } if (choice == 2) { minionGetBuffed(c, 0, 5, true); c.taunt = true; } } if (c.name == "ancientoflore") { if (choice == 1) { //this.owncarddraw += 2; this.drawACard("", own); this.drawACard("", own); } } if (c.name == "druidoftheclaw") { if (choice == 1) { minionGetCharge(c); } if (choice == 2) { minionGetBuffed(c, 0, 2, true); c.taunt = true; } } if (c.name == "cenarius") { if (choice == 1) { foreach (Minion m in this.ownMinions) { minionGetBuffed(m, 2, 2, true); } } //choice 2 = spawn 2 kids } //normal ones if (c.name == "mindcontroltech") { if (this.enemyMinions.Count >= 4) { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Angr.CompareTo(b.Angr));//we take the weekest temp.AddRange(Helpfunctions.TakeList(temp2, 2)); Minion target = new Minion(); target = temp[0]; if (target.taunt && !temp[1].taunt) target = temp[1]; minionGetControlled(target, true, false); } } if (c.name == "felguard") { this.ownMaxMana--; } if (c.name == "arcanegolem") { this.enemyMaxMana++; } if (c.name == "edwinvancleef" && this.cardsPlayedThisTurn >= 1) { minionGetBuffed(c, this.cardsPlayedThisTurn * 2, this.cardsPlayedThisTurn * 2, own); } if (c.name == "doomguard") { this.owncarddraw -= Math.Min(2, this.owncards.Count); this.owncards.RemoveRange(0, Math.Min(2, this.owncards.Count)); } if (c.name == "succubus") { this.owncarddraw -= Math.Min(1, this.owncards.Count); this.owncards.RemoveRange(0, Math.Min(1, this.owncards.Count)); } if (c.name == "lordjaraxxus") { this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_tk33"); this.ownHeroName = HeroEnum.lordjaraxxus; this.ownHeroHp = c.Hp; } if (c.name == "flameimp") { attackOrHealHero(3, own); } if (c.name == "pitlord") { attackOrHealHero(5, own); } if (c.name == "voidterror") { List<Minion> temp = new List<Minion>(); if (own) { temp.AddRange(this.ownMinions); } else { temp.AddRange(this.enemyMinions); } int angr = 0; int hp = 0; foreach (Minion m in temp) { if (m.id == position || m.id == position - 1) { angr += m.Angr; hp += m.Hp; } } foreach (Minion m in temp) { if (m.id == position || m.id == position - 1) { minionGetDestroyed(m, own); } } minionGetBuffed(c, angr, hp, own); } if (c.name == "frostwolfwarlord") { minionGetBuffed(c, this.ownMinions.Count, this.ownMinions.Count, own); } if (c.name == "bloodsailraider") { c.Angr += this.ownWeaponAttack; } if (c.name == "southseadeckhand" && this.ownWeaponDurability >= 1) { minionGetCharge(c); } if (c.name == "bloodknight") { int shilds = 0; foreach (Minion m in this.ownMinions) { if (m.divineshild) { m.divineshild = false; shilds++; } } foreach (Minion m in this.enemyMinions) { if (m.divineshild) { m.divineshild = false; shilds++; } } minionGetBuffed(c, 3 * shilds, 3 * shilds, own); } if (c.name == "kingmukla") { this.enemycarddraw += 2; } if (c.name == "coldlightoracle") { //this.enemycarddraw += 2; //this.owncarddraw += 2; this.drawACard("", true); this.drawACard("", true); this.drawACard("", false); this.drawACard("", false); } if (c.name == "arathiweaponsmith") { CardDB.Card wcard = CardDB.Instance.getCardData("battleaxe"); this.equipWeapon(wcard); } if (c.name == "bloodsailcorsair") { this.lowerWeaponDurability(1, false); } if (c.name == "acidicswampooze") { this.lowerWeaponDurability(1000, false); } if (c.name == "noviceengineer") { //this.owncarddraw++; drawACard("",true); } if (c.name == "gnomishinventor") { //this.owncarddraw++; drawACard("", true); } if (c.name == "darkscalehealer") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (this.auchenaiseelenpriesterin) { minionGetDamagedOrHealed(m, 2, 0, true); } else { minionGetDamagedOrHealed(m, 0, 2, true); } } if (this.auchenaiseelenpriesterin) { attackOrHealHero(2, true); } else { attackOrHealHero(-2, true); } } if (c.name == "nightblade") { attackOrHealHero(3, !own); } if (c.name == "twilightdrake") { minionGetBuffed(c, 0, this.owncards.Count, true); } if (c.name == "azuredrake") { //this.owncarddraw++; drawACard("", true); } if (c.name == "harrisonjones") { this.enemyWeaponAttack = 0; //this.owncarddraw += enemyWeaponDurability; for (int i = 0; i < enemyWeaponDurability; i++) { drawACard("", true); } this.enemyWeaponDurability = 0; } if (c.name == "guardianofkings") { attackOrHealHero(-6, true); } if (c.name == "captaingreenskin") { if (this.ownWeaponName != "") { this.ownheroAngr += 1; this.ownWeaponAttack++; this.ownWeaponDurability++; } } if (c.name == "priestessofelune") { attackOrHealHero(-4, true); } if (c.name == "injuredblademaster") { minionGetDamagedOrHealed(c, 4, 0, true); } if (c.name == "dreadinfernal") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { minionGetDamagedOrHealed(m, 1, 0, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion m in temp) { minionGetDamagedOrHealed(m, 1, 0, false); } attackOrHealHero(1, false); attackOrHealHero(1, true); } if (c.name == "tundrarhino") { minionGetCharge(c); List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.handcard.card.race == TAG_RACE.PET) { minionGetCharge(m); } } } if (c.name == "stampedingkodo") { List<Minion> temp = new List<Minion>(); List<Minion> temp2 = new List<Minion>(this.enemyMinions); temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest temp.AddRange(temp2); foreach (Minion enemy in temp) { if (enemy.Angr <= 2) { minionGetDestroyed(enemy, false); break; } } } if (c.name == "sunfuryprotector") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position) { m.taunt = true; } } } if (c.name == "ancientmage") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position ) { m.handcard.card.spellpowervalue++; } } } if (c.name == "defenderofargus") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if (m.id == position - 1 || m.id == position)//position and position -1 because its not placed jet { Enchantment e = CardDB.getEnchantmentFromCardID("EX1_093e"); e.creator = c.entitiyID; e.controllerOfCreator = this.ownController; addEffectToMinionNoDoubles(m, e, own); } } } if (c.name == "coldlightseer") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC) { minionGetBuffed(m, 0, 2, true); } } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion m in temp) { if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC) { minionGetBuffed(m, 0, 2, false); } } } if (c.name == "deathwing") { List<Minion> temp = new List<Minion>(this.ownMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, true); } temp.Clear(); temp.AddRange(this.enemyMinions); foreach (Minion enemy in temp) { minionGetDestroyed(enemy, false); } this.owncards.Clear(); this.owncarddraw = 0; this.enemyAnzCards = 0; this.enemycarddraw = 0; } if (c.name == "captainsparrot") { //this.owncarddraw++; drawACard("", true); } }
public void updateOwnHero(string weapon, int watt, int wdur, string heron, CardDB.Card hab, bool habrdy, Minion Hero) { this.ownHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon); this.heroWeaponAttack = watt; this.heroWeaponDurability = wdur; this.heroname = this.heroNametoEnum(heron); this.heroAbility = hab; this.ownAbilityisReady = habrdy; this.ownHero = new Minion(Hero); this.ownHero.updateReadyness(); }
private void drawACard(string ss, bool own) { string s = ss; if (s == "") s = "unknown"; if (s == "enemycard") s = "unknown"; // NO PENALITY FOR DRAWING TO MUCH CARDS // cant hold more than 10 cards if (own) { if (s == "unknown") // draw a card from deck :D { if (ownDeckSize == 0) { this.ownHeroFatigue++; this.attackOrHealHero(this.ownHeroFatigue, true); } else { this.ownDeckSize--; if (this.owncards.Count >= 10) { this.evaluatePenality += 5; return; } this.owncarddraw++; } } else { if (this.owncards.Count >= 10) { this.evaluatePenality += 5; return; } this.owncarddraw++; } } else { if (s == "unknown") // draw a card from deck :D { if (enemyDeckSize == 0) { this.enemyHeroFatigue++; this.attackOrHealHero(this.enemyHeroFatigue, false); } else { this.enemyDeckSize--; if (this.enemyAnzCards + this.enemycarddraw >= 10) { this.evaluatePenality += 5; return; } this.enemycarddraw++; } } else { if (this.enemyAnzCards + this.enemycarddraw >= 10) { this.evaluatePenality += 5; return; } this.enemycarddraw++; } return; } if (s == "unknown") { CardDB.Card plchldr = new CardDB.Card(); plchldr.name = "unknown"; Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = plchldr; hc.position = this.owncards.Count + 1; hc.manacost = 1000; this.owncards.Add(hc); } else { CardDB.Card c = CardDB.Instance.getCardData(s); Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = c; hc.position = this.owncards.Count + 1; hc.manacost = c.calculateManaCost(this); this.owncards.Add(hc); } }
public Handcard() { card = new CardDB.Card(); }
public void clearAll() { ownHeroEntity = -1; enemyHeroEntitiy = -1; currentMana = 0; heroHp = 30; enemyHp = 30; heroAtk = 0; enemyAtk = 0; heroDefence = 0; enemyDefence = 0; ownheroisread = false; ownAbilityisReady = false; ownHeroNumAttacksThisTurn = 0; ownHeroWindfury = false; ownSecretList.Clear(); enemySecretCount = 0; heroname = HeroEnum.druid; enemyHeroname = HeroEnum.druid; heroAbility = new CardDB.Card(); enemyAbility = new CardDB.Card(); herofrozen = false; enemyfrozen = false; numMinionsPlayedThisTurn = 0; cardsPlayedThisTurn = 0; ueberladung = 0; ownMaxMana = 0; enemyMaxMana = 0; enemyWeaponDurability = 0; enemyWeaponAttack = 0; heroWeaponDurability = 0; heroWeaponAttack = 0; heroImmuneToDamageWhileAttacking = false; ownMinions.Clear(); enemyMinions.Clear(); heroImmune = false; enemyHeroImmune = false; this.ownHeroWeapon = CardDB.cardName.unknown; this.enemyHeroWeapon = CardDB.cardName.unknown; }
public Playfield(Playfield p) { this.ownController = p.ownController; this.ownHeroEntity = p.ownHeroEntity; this.enemyHeroEntity = p.enemyHeroEntity; this.evaluatePenality = p.evaluatePenality; foreach(string s in p.ownSecretsIDList) { this.ownSecretsIDList.Add(s); } this.enemySecretCount = p.enemySecretCount; this.mana = p.mana; this.ownMaxMana = p.ownMaxMana; this.enemyMaxMana = p.enemyMaxMana; addMinionsReal(p.ownMinions, ownMinions); addMinionsReal(p.enemyMinions, enemyMinions); addCardsReal(p.owncards); this.enemyHeroHp = p.enemyHeroHp; this.ownHeroName = p.ownHeroName; this.enemyHeroName = p.enemyHeroName; this.ownHeroHp = p.ownHeroHp; this.playactions.AddRange(p.playactions); this.complete = false; this.ownHeroReady = p.ownHeroReady; this.ownHeroNumAttackThisTurn = p.ownHeroNumAttackThisTurn; this.ownHeroWindfury = p.ownHeroWindfury; this.ownheroAngr = p.ownheroAngr; this.ownHeroFrozen = p.ownHeroFrozen; this.enemyHeroFrozen = p.enemyHeroFrozen; this.heroImmuneWhileAttacking = p.heroImmuneWhileAttacking; this.owncarddraw = p.owncarddraw; this.ownHeroDefence = p.ownHeroDefence; this.enemyWeaponAttack = p.enemyWeaponAttack; this.enemycarddraw = p.enemycarddraw; this.enemyAnzCards = p.enemyAnzCards; this.enemyHeroDefence = p.enemyHeroDefence; this.ownWeaponDurability = p.ownWeaponDurability; this.ownWeaponAttack = p.ownWeaponAttack; this.ownWeaponName = p.ownWeaponName; this.lostDamage = p.lostDamage; this.lostWeaponDamage = p.lostWeaponDamage; this.lostHealth = p.lostHealth; this.ownAbilityReady = p.ownAbilityReady; this.ownHeroAblility = p.ownHeroAblility; this.doublepriest = 0; this.spellpower = 0; value = -1000000; this.mobsplayedThisTurn = p.mobsplayedThisTurn; this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn; this.cardsPlayedThisTurn = p.cardsPlayedThisTurn; this.ueberladung = p.ueberladung; //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.startedWithZauberlehrling = p.startedWithZauberlehrling; this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin; this.startedWithManagespenst = p.startedWithManagespenst; this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture; this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal; this.zauberlehrling = 0; this.winzigebeschwoererin = 0; this.managespenst = 0; this.soeldnerDerVenture = 0; foreach (Minion m in this.ownMinions) { if (m.silenced) continue; if (m.name == "prophetvelen") this.doublepriest++; spellpower = spellpower + m.card.spellpowervalue; if (m.name == "auchenaiseelenpriesterin") this.auchenaiseelenpriesterin = true; if (m.name == "winzigebeschwoererin") this.winzigebeschwoererin++; if (m.name == "zauberlehrling") this.zauberlehrling++; if (m.name == "managespenst") this.managespenst++; if (m.name == "soeldnerderventureco") this.soeldnerDerVenture++; if (m.name == "beschwoerungsportal") this.beschwoerungsportal++; } foreach (Minion m in this.enemyMinions) { if (m.silenced) continue; if (m.name == "managespenst") this.managespenst++; } }
public void updateEnemyHero(string weapon, int weaponAttack, int weaponDurability, string heron,int enemMaxMana, CardDB.Card eab, Minion enemyHero) { this.enemyHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon); this.enemyWeaponAttack = weaponAttack; this.enemyWeaponDurability = weaponDurability; this.enemyMaxMana = enemMaxMana; this.enemyHeroname = this.heroNametoEnum(heron); this.enemyAbility = eab; this.enemyHero = new Minion(enemyHero); }
private void getHerostuff() { Dictionary<int, HREntity> allEntitys = HRGame.GetEntityMap(); HRPlayer ownPlayer = HRPlayer.GetLocalPlayer(); HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer(); HREntity ownhero = ownPlayer.GetHero(); HREntity enemyhero = enemyPlayer.GetHero(); HREntity ownHeroAbility = ownPlayer.GetHeroPower(); //player stuff######################### //this.currentMana =ownPlayer.GetTag(HRGameTag.RESOURCES) - ownPlayer.GetTag(HRGameTag.RESOURCES_USED) + ownPlayer.GetTag(HRGameTag.TEMP_RESOURCES); this.currentMana = ownPlayer.GetNumAvailableResources(); this.ownMaxMana = ownPlayer.GetTag(HRGameTag.RESOURCES); this.enemyMaxMana = enemyPlayer.GetTag(HRGameTag.RESOURCES); enemySecretCount = HRCard.GetCards(enemyPlayer, HRCardZone.SECRET).Count; enemySecretCount = 0; //count enemy secrets foreach (HREntity ent in allEntitys.Values) { if (ent.IsSecret() && ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.SECRET) enemySecretCount++; } this.ownSecretList = ownPlayer.GetSecretDefinitions(); this.numMinionsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_MINIONS_PLAYED_THIS_TURN); this.cardsPlayedThisTurn = ownPlayer.GetTag(HRGameTag.NUM_CARDS_PLAYED_THIS_TURN); //if (ownPlayer.HasCombo()) this.cardsPlayedThisTurn = 1; this.ueberladung = ownPlayer.GetTag(HRGameTag.RECALL_OWED); //get weapon stuff this.ownHeroWeapon = ""; this.heroWeaponAttack = 0; this.heroWeaponDurability = 0; this.ownHeroFatigue = ownhero.GetFatigue(); this.enemyHeroFatigue = enemyhero.GetFatigue(); this.ownDecksize = 0; this.enemyDecksize = 0; //count decksize foreach (HREntity ent in allEntitys.Values) { if (ent.GetControllerId() == ownPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) ownDecksize++; if (ent.GetControllerId() == enemyPlayer.GetControllerId() && ent.GetZone() == HRCardZone.DECK) enemyDecksize++; } //own hero stuff########################### int heroAtk = ownhero.GetATK(); int heroHp = ownhero.GetHealth() - ownhero.GetDamage(); int heroDefence = ownhero.GetArmor(); this.heroname = Hrtprozis.Instance.heroIDtoName(ownhero.GetCardId()); bool heroImmuneToDamageWhileAttacking = false; bool herofrozen = ownhero.IsFrozen(); int heroNumAttacksThisTurn = ownhero.GetNumAttacksThisTurn(); bool heroHasWindfury = ownhero.HasWindfury(); bool heroImmune = (ownhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; //Helpfunctions.Instance.ErrorLog(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen); if (ownPlayer.HasWeapon()) { HREntity weapon = ownPlayer.GetWeaponCard().GetEntity(); this.ownHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.heroWeaponAttack = weapon.GetATK(); this.heroWeaponDurability = weapon.GetTag(HRGameTag.DURABILITY) - weapon.GetTag(HRGameTag.DAMAGE);//weapon.GetDurability(); heroImmuneToDamageWhileAttacking = false; if (this.ownHeroWeapon == "gladiatorslongbow") { heroImmuneToDamageWhileAttacking = true; } if (this.ownHeroWeapon == "doomhammer") { heroHasWindfury = true; } //Helpfunctions.Instance.ErrorLog("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability); } //enemy hero stuff############################################################### this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(enemyhero.GetCardId()); int enemyAtk = enemyhero.GetATK(); int enemyHp = enemyhero.GetHealth() - enemyhero.GetDamage(); int enemyDefence = enemyhero.GetArmor(); bool enemyfrozen = enemyhero.IsFrozen(); bool enemyHeroImmune = (enemyhero.GetTag(HRGameTag.CANT_BE_DAMAGED) == 1) ? true : false; this.enemyHeroWeapon = ""; this.enemyWeaponAttack = 0; this.enemyWeaponDurability = 0; if (enemyPlayer.HasWeapon()) { HREntity weapon = enemyPlayer.GetWeaponCard().GetEntity(); this.enemyHeroWeapon = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(weapon.GetCardId())).name.ToString(); this.enemyWeaponAttack = weapon.GetATK(); this.enemyWeaponDurability = weapon.GetDurability(); } //own hero ablity stuff########################################################### this.heroAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(ownHeroAbility.GetCardId())); this.ownAbilityisReady = (ownHeroAbility.IsExhausted()) ? false : true; // if exhausted, ability is NOT ready this.enemyAbility = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(enemyhero.GetHeroPower().GetCardId())); //generate Heros this.ownHero = new Minion(); this.enemyHero = new Minion(); this.ownHero.isHero = true; this.enemyHero.isHero = true; this.ownHero.own = true; this.enemyHero.own = false; this.ownHero.maxHp = ownhero.GetHealth(); this.enemyHero.maxHp = enemyhero.GetHealth(); this.ownHero.entitiyID = ownhero.GetEntityId(); this.enemyHero.entitiyID = enemyhero.GetEntityId(); this.ownHero.Angr = heroAtk; this.ownHero.Hp = heroHp; this.ownHero.armor = heroDefence; this.ownHero.frozen = herofrozen; this.ownHero.immuneWhileAttacking = heroImmuneToDamageWhileAttacking; this.ownHero.immune = heroImmune; this.ownHero.numAttacksThisTurn = heroNumAttacksThisTurn; this.ownHero.windfury = heroHasWindfury; this.enemyHero.Angr = enemyAtk; this.enemyHero.Hp = enemyHp; this.enemyHero.frozen = enemyfrozen; this.enemyHero.armor = enemyDefence; this.enemyHero.immune = enemyHeroImmune; this.enemyHero.Ready = false; this.ownHero.updateReadyness(); //load enchantments of the heros List<miniEnch> miniEnchlist = new List<miniEnch>(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetTag(HRGameTag.ATTACHED) == this.ownHero.entitiyID && ent.GetZone() == HRCardZone.PLAY) { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); int controler = ent.GetTag(HRGameTag.CONTROLLER); int creator = ent.GetTag(HRGameTag.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler )); } } this.ownHero.loadEnchantments(miniEnchlist, ownhero.GetTag(HRGameTag.CONTROLLER)); miniEnchlist.Clear(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetTag(HRGameTag.ATTACHED) == this.enemyHero.entitiyID && ent.GetZone() == HRCardZone.PLAY) { CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId()); int controler = ent.GetTag(HRGameTag.CONTROLLER); int creator = ent.GetTag(HRGameTag.CREATOR); miniEnchlist.Add(new miniEnch(id, creator, controler)); } } this.enemyHero.loadEnchantments(miniEnchlist, enemyhero.GetTag(HRGameTag.CONTROLLER)); //fastmode weapon correction: if (ownHero.Angr < this.heroWeaponAttack) ownHero.Angr = this.heroWeaponAttack; if (enemyHero.Angr < this.enemyWeaponAttack) enemyHero.Angr = this.enemyWeaponAttack; }