private void debuff(Minion m, Enchantment e, bool own) { int anz = m.enchantments.RemoveAll(x => x.creator == e.creator && x.CARDID == e.CARDID); if (anz >= 1) { for (int i = 0; i < anz; i++) { if (e.charge && !m.handcard.card.Charge && m.enchantments.FindAll(x => x.charge == true).Count == 0) { m.charge = false; } if (e.taunt && !m.handcard.card.tank && m.enchantments.FindAll(x => x.taunt == true).Count == 0) { m.taunt = false; } if (e.divineshild && m.enchantments.FindAll(x => x.divineshild == true).Count == 0) { m.divineshild = false; } if (e.windfury && !m.handcard.card.windfury && m.enchantments.FindAll(x => x.windfury == true).Count == 0) { m.divineshild = false; } if (e.imune && m.enchantments.FindAll(x => x.imune == true).Count == 0) { m.immune = false; } minionGetBuffed(m, -e.angrbuff, -e.hpbuff,own); } } }
public static Enchantment getEnchantmentFromCardID(string cardID) { Enchantment retval = new Enchantment(); retval.CARDID = cardID; if (cardID == "CS2_188o")//insiriert dieser diener hat +2 angriff in diesem zug. (ruchloser unteroffizier) { retval.angrbuff = 2; } if (cardID == "CS2_059o")//blutpakt (blutwichtel) { retval.hpbuff = 1; } if (cardID == "EX1_019e")//Segen der Klerikerin (blutelfenklerikerin) { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "CS2_045e")//waffedesfelsbeissers { retval.angrbuff = 3; } if (cardID == "EX1_587e")//windfury { retval.windfury = true; } if (cardID == "EX1_355e")//urteildestemplers granted by blessed champion { retval.angrfaktor = 2; } if (cardID == "NEW1_036e")//befehlsruf { retval.cantLowerHPbelowONE = true; } if (cardID == "CS2_046e")// kampfrausch { retval.angrbuff = 3; } if (cardID == "CS2_104e")// toben { retval.angrbuff = 3; retval.hpbuff = 3; } if (cardID == "DREAM_05e")// alptraum { retval.angrbuff = 5; retval.hpbuff = 5; } if (cardID == "CS2_022e")// verwandlung { retval.angrbuff = 3; } if (cardID == "EX1_611e")// gefangen { //icetrap? } if (cardID == "EX1_014te")// banane { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "EX1_178ae")// festgewurzelt { retval.hpbuff = 5; retval.taunt = true; } if (cardID == "CS2_011o")// wildesbruellen { retval.angrbuff = 2; } if (cardID == "EX1_366e")// rechtschaffen { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "CS2_017o")// klauen (ownhero +1angr) { } if (cardID == "EX1_604o")// rasend { retval.angrbuff = 1; } if (cardID == "EX1_084e")// sturmangriff { retval.charge = true; } if (cardID == "CS1_129e")// inneresfeuer // angr = live { retval.angrEqualLife = true; } if (cardID == "EX1_603e")// aufzackgebracht (fieser zuchtmeister) { retval.angrbuff = 2; } if (cardID == "EX1_507e")// mrgglaargl! der murlocanführer verleiht +2/+1. { retval.angrbuff = 2; retval.hpbuff = 1; } if (cardID == "CS2_038e")// geistderahnen : todesröcheln: dieser diener kehrt aufs schlachtfeld zurück. { } if (cardID == "NEW1_024o")// gruenhauts befehl +1/+1. { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "EX1_590e")// schattenvonmuru : angriff und leben durch aufgezehrte gottesschilde erhöht. (blutritter) { retval.angrbuff = 3; retval.hpbuff = 3; } if (cardID == "CS2_074e")// toedlichesgift { } if (cardID == "EX1_258e")// ueberladen von entfesselnder elementar { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "TU4f_004o")// vermaechtnisdeskaisers von cho { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "NEW1_017e")// gefuellterbauch randvoll mit murloc. (hungrigekrabbe) { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "EX1_334e")// dunklerbefehl von dunkler Wahnsin { } if (cardID == "CS2_087e")// segendermacht von segendermacht { retval.angrbuff = 3; } if (cardID == "EX1_613e")// vancleefsrache dieser diener hat erhöhten angriff und erhöhtes leben. { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "EX1_623e")// infusion { retval.hpbuff = 3; } if (cardID == "CS2_073e2")// kaltbluetigkeit +4 { retval.angrbuff = 4; } if (cardID == "EX1_162o")// staerkedesrudels der terrorwolfalpha verleiht diesem diener +1 angriff. { retval.angrbuff = 1; } if (cardID == "EX1_549o")// zorndeswildtiers +2 angriff und immun/ in diesem zug. { retval.angrbuff = 2; retval.imune = true; } if (cardID == "EX1_091o")// kontrollederkabale dieser diener wurde von einer kabaleschattenpriesterin gestohlen. { } if (cardID == "CS2_084e")// maldesjaegers { retval.setHPtoOne = true; } if (cardID == "NEW1_036e2")// befehlsruf2 ? das leben eurer diener kann in diesem zug nicht unter 1 fallen. { retval.cantLowerHPbelowONE = true; } if (cardID == "CS2_122e")// angespornt der schlachtzugsleiter verleiht diesem diener +1 angriff. (schlachtzugsleiter) { retval.angrbuff = 1; } if (cardID == "CS2_103e")// charge { retval.charge = true; } if (cardID == "EX1_080o")// geheimnissebewahren erhöhte werte. { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "CS2_005o")// klaue +2 angriff in diesem zug. { retval.angrbuff = 2; } if (cardID == "EX1_363e2")// segenderweisheit { retval.cardDrawOnAngr = true; } if (cardID == "EX1_178be")// entwurzelt +5 angr { retval.angrbuff = 5; } if (cardID == "CS2_222o")// diemachtsturmwinds +1+1 (von champ of sturmwind) { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "EX1_399e")// amoklauf von gurubashi berserker { retval.angrbuff = 3; } if (cardID == "CS2_041e")// machtderahnen { retval.taunt = true; } if (cardID == "EX1_612o")// machtderkirintor { } if (cardID == "EX1_004e")// elunesanmut erhöhtes leben. von junger priesterin { retval.hpbuff = 1; } if (cardID == "EX1_246e")// verhext dieser diener wurde verwandelt. { } if (cardID == "EX1_244e")// machtdertotems (card that buffs hp of totems) { retval.hpbuff = 2; } if (cardID == "EX1_607e")// innerewut (innere wut) { retval.angrbuff = 2; } if (cardID == "EX1_573ae")// gunstdeshalbgotts (cenarius?) { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "EX1_411e2")// schliffbenoetigt angriff verringert. von waffe blutschrei { retval.angrbuff = -1; } if (cardID == "CS2_063e")// verderbnis wird zu beginn des zuges des verderbenden spielers vernichtet. { } if (cardID == "CS2_181e")// vollekraft +2 angr ka von wem { retval.angrbuff = 2; } if (cardID == "EX1_508o")// mlarggragllabl! dieser murloc hat +1 angriff. (grimmschuppenorakel) { retval.angrbuff = 1; } if (cardID == "CS2_073e")// kaltbluetigkeit +2 angriff. { retval.angrbuff = 2; } if (cardID == "NEW1_018e")// goldrausch von blutsegelraeuberin { } if (cardID == "EX1_059e2")// experimente! der verrückte alchemist hat angriff und leben vertauscht. { } if (cardID == "EX1_570e")// biss (only hero) { retval.angrbuff = 4; } if (cardID == "EX1_360e")// demut angriff wurde auf 1 gesetzt. { retval.setANGRtoOne = true; } if (cardID == "DS1_175o")// wutgeheul durch waldwolf { retval.angrbuff = 1; } if (cardID == "EX1_596e")// daemonenfeuer { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "EX1_158e")// seeledeswaldes todesröcheln: ruft einen treant (2/2) herbei. { } if (cardID == "EX1_316e")// ueberwaeltigendemacht { retval.angrbuff = 4; retval.hpbuff = 4; } if (cardID == "EX1_044e")// stufenaufstieg erhöhter angriff und erhöhtes leben. (rastloser abenteuer) { } if (cardID == "EX1_304e")// verzehren erhöhte werte. (hexer) { } if (cardID == "EX1_363e")// segenderweisheit der segnende spieler zieht eine karte, wenn dieser diener angreift. { } if (cardID == "CS2_105e")// heldenhafterstoss { } if (cardID == "EX1_128e")// verhuellt bleibt bis zu eurem nächsten zug verstohlen. { } if (cardID == "NEW1_033o")// himmelsauge leokk verleiht diesem diener +1 angriff. { retval.angrbuff = 1; } if (cardID == "CS2_004e")// machtwortschild { retval.hpbuff = 2; } if (cardID == "EX1_382e")// waffenniederlegen! angriff auf 1 gesetzt. { retval.setANGRtoOne = true; } if (cardID == "CS2_092e")// segenderkoenige { retval.angrbuff = 4; retval.hpbuff = 4; } if (cardID == "NEW1_012o")// manasaettigung erhöhter angriff. { } if (cardID == "EX1_619e")// gleichheit leben auf 1 gesetzt. { retval.setHPtoOne = true; } if (cardID == "EX1_509e")// blarghghl erhöhter angriff. { retval.angrbuff = 1; } if (cardID == "CS2_009e")// malderwildnis { retval.angrbuff = 2; retval.hpbuff = 2; retval.taunt = true; } if (cardID == "EX1_103e")// mrghlglhal +2 leben. { retval.hpbuff = 2; } if (cardID == "NEW1_038o")// wachstum gruul wächst ... { } if (cardID == "CS1_113e")// gedankenkontrolle { } if (cardID == "CS2_236e")// goettlicherwille dieser diener hat doppeltes leben. { } if (cardID == "CS2_083e")// geschaerft +1 angriff in diesem zug. { retval.angrbuff = 1; } if (cardID == "TU4c_008e")// diemachtmuklas { retval.angrbuff = 8; } if (cardID == "EX1_379e")// busse { retval.setHPtoOne = true; } if (cardID == "EX1_274e")// puremacht! (astraler arkanist) { retval.angrbuff = 2; retval.hpbuff = 2; } if (cardID == "CS2_221e")// vorsicht!scharf! +2 angriff von hasserfüllte schmiedin. { retval.weaponAttack = 2; } if (cardID == "EX1_409e")// aufgewertet +1 angriff und +1 haltbarkeit. { retval.weaponAttack = 1; retval.weapondurability = 1; } if (cardID == "tt_004o")//kannibalismus (fleischfressender ghul) { retval.angrbuff = 1; } if (cardID == "EX1_155ae")// maldernatur { retval.angrbuff = 4; } if (cardID == "NEW1_025e")// verstaerkt (by emboldener 3000) { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "EX1_584e")// lehrenderkirintor zauberschaden+1 (by uralter magier) { retval.zauberschaden = 1; } if (cardID == "EX1_160be")// rudelfuehrer +1/+1. (macht der wildnis) { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "TU4c_006e")// banane { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "NEW1_027e")// yarrr! der südmeerkapitän verleiht +1/+1. { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "DS1_070o")// praesenzdesmeisters +2/+2 und spott/. (hundemeister) { retval.angrbuff = 2; retval.hpbuff = 2; retval.taunt = true; } if (cardID == "EX1_046e")// gehaertet +2 angriff in diesem zug. (dunkeleisenzwerg) { retval.angrbuff = 2; } if (cardID == "EX1_531e")// satt erhöhter angriff und erhöhtes leben. (aasfressende Hyaene) { retval.angrbuff = 2; retval.hpbuff = 1; } if (cardID == "CS2_226e")// bannerderfrostwoelfe erhöhte werte. (frostwolfkriegsfuerst) { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "DS1_178e")// sturmangriff tundranashorn verleiht ansturm. { retval.charge = true; } if (cardID == "CS2_226o")//befehlsgewalt der kriegsfürst der frostwölfe hat erhöhten angriff und erhöhtes leben. { retval.angrbuff = 1; retval.hpbuff = 1; } if (cardID == "Mekka4e")// verwandelt wurde in ein huhn verwandelt! { } if (cardID == "EX1_411e")// blutrausch kein haltbarkeitsverlust. (blutschrei) { } if (cardID == "EX1_145o")// vorbereitung der nächste zauber, den ihr in diesem zug wirkt, kostet (3) weniger. { } if (cardID == "EX1_055o")// gestaerkt die manasüchtige hat erhöhten angriff. { retval.angrbuff = 2; } if (cardID == "CS2_053e")// fernsicht eine eurer karten kostet (3) weniger. { } if (cardID == "CS2_146o")// geschaerft +1 haltbarkeit. { retval.weapondurability = 1; } if (cardID == "EX1_059e")// experimente! der verrückte alchemist hat angriff und leben vertauscht. { } if (cardID == "EX1_565o")// flammenzunge +2 angriff von totem der flammenzunge. { retval.angrbuff = 2; } if (cardID == "EX1_001e")// wachsam erhöhter angriff. (lichtwaechterin) { retval.angrbuff = 2; } if (cardID == "EX1_536e")// aufgewertet erhöhte haltbarkeit. { retval.weaponAttack = 1; retval.weapondurability = 1; } if (cardID == "EX1_155be")// maldernatur dieser diener hat +4 leben und spott/. { retval.hpbuff = 4; retval.taunt = true; } if (cardID == "CS2_103e2")// sturmangriff +2 angriff und ansturm/. { retval.angrbuff = 2; retval.charge = true; } if (cardID == "TU4f_006o")// transzendenz cho kann nicht angegriffen werden, bevor ihr seine diener erledigt habt. { } if (cardID == "EX1_043e")// stundedeszwielichts erhöhtes leben. (zwielichtdrache) { retval.hpbuff = 1; } if (cardID == "NEW1_037e")// bewaffnet erhöhter angriff. meisterschwertschmied { retval.angrbuff = 1; } if (cardID == "EX1_161o")// demoralisierendesgebruell dieser diener hat -3 angriff in diesem zug. { } if (cardID == "EX1_093e")// handvonargus { retval.angrbuff = 1; retval.hpbuff = 1; retval.taunt = true; } return retval; }
private void addEffectToMinionNoDoubles(Minion m, Enchantment e, bool own) { foreach (Enchantment es in m.enchantments) { if ( es.CARDID == e.CARDID && es.creator == e.creator) return; } m.enchantments.Add(e); if (e.angrbuff >= 1 || e.hpbuff >= 1) { minionGetBuffed(m, e.angrbuff, e.hpbuff, own); } if (e.charge) minionGetCharge(m); if (e.divineshild) m.divineshild = true; if (e.taunt) m.taunt = true; if (e.windfury) minionGetWindfurry(m); if (e.imune) m.immune = true; }
public BoardTester() { string[] lines = new string[0] { }; try { string path = Settings.Instance.path; lines = System.IO.File.ReadAllLines(path + "test.txt"); } catch { Helpfunctions.Instance.logg("cant find test.txt"); return; } CardDB.Card heroability = CardDB.Instance.getCardDataFromID("CS2_034"); bool abilityReady = false; int readstate = 0; int counter = 0; Minion tempminion = new Minion(); int j = 0; foreach (string sss in lines) { string s = sss + " "; Helpfunctions.Instance.logg(s); if (s.StartsWith("ailoop")) { break; } if (s.StartsWith("####")) { continue; } if (s.StartsWith("start calculations")) { continue; } if (s.StartsWith("enemy secretsCount:")) { this.enemySecrets = Convert.ToInt32(s.Split(' ')[2]); continue; } if (s.StartsWith("mana ")) { string ss = s.Replace("mana ", ""); mana = Convert.ToInt32(ss.Split('/')[0]); maxmana = Convert.ToInt32(ss.Split('/')[1]); } if (readstate == 42 && counter == 1) // player { this.overdrive = Convert.ToInt32(s.Split(' ')[2]); this.numMinionsPlayedThisTurn = Convert.ToInt32(s.Split(' ')[0]); this.cardsPlayedThisTurn = Convert.ToInt32(s.Split(' ')[1]); this.ownPlayer = Convert.ToInt32(s.Split(' ')[3]); } if (readstate == 1 && counter == 1) // class + hp + defence + immune { ownheroname = s.Split(' ')[0]; ownherohp = Convert.ToInt32(s.Split(' ')[1]); ownherodefence = Convert.ToInt32(s.Split(' ')[2]); string boolim = s.Split(' ')[4]; this.ownHeroimmunewhileattacking = (boolim == "True") ? true : false; } if (readstate == 1 && counter == 2) // ready, num attacks this turn, frozen { string readystate = s.Split(' ')[1]; this.ownheroready = (readystate == "True") ? true : false; this.ownheroattacksThisRound = Convert.ToInt32(s.Split(' ')[3]); this.ownHeroFrozen = (s.Split(' ')[5] == "True")? true:false; ownHeroAttack = Convert.ToInt32(s.Split(' ')[7]); ownHeroWeaponAttack = Convert.ToInt32(s.Split(' ')[8]); this.ownHeroWeaponDurability = Convert.ToInt32(s.Split(' ')[9]); if (ownHeroWeaponAttack == 0) { ownHeroWeapon = ""; //:D } else { ownHeroWeapon = s.Split(' ')[10]; } } if (readstate == 1 && counter == 3) // ability + abilityready { abilityReady = (s.Split(' ')[1] == "True") ? true : false; heroability = CardDB.Instance.getCardDataFromID(s.Split(' ')[2]); } if (readstate == 1 && counter >= 5) // secrets { if (!s.StartsWith("enemyhero:")) { ownsecretlist.Add(s.Replace(" ", "")); } } if (readstate == 2 && counter == 1) // class + hp + defence + frozen { enemyheroname = s.Split(' ')[0]; enemyherohp = Convert.ToInt32(s.Split(' ')[1]); enemyherodefence = Convert.ToInt32(s.Split(' ')[2]); enemyFrozen = (s.Split(' ')[3] == "True") ? true : false; } if (readstate == 2 && counter == 2) // wepon + stuff { this.enemyWeaponAttack = Convert.ToInt32(s.Split(' ')[0]); this.enemyWeaponDur = Convert.ToInt32(s.Split(' ')[1]); if (enemyWeaponDur == 0) { this.enemyWeapon = ""; } else { this.enemyWeapon = s.Split(' ')[2]; } } if (readstate == 3) // minion or enchantment { if (s.Contains(" id:")) { if (counter >= 2) { this.ownminions.Add(tempminion); } string minionname = s.Split(' ')[0]; int attack = Convert.ToInt32(s.Split(new string[] { " A:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int hp = Convert.ToInt32(s.Split(new string[] { " H:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int maxhp = Convert.ToInt32(s.Split(new string[] { " mH:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); bool ready = s.Split(new string[] { " rdy:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; bool taunt = s.Split(new string[] { " tnt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; bool silenced = false; if (s.Contains(" silenced:")) { silenced = s.Split(new string[] { " silenced:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool divshield = false; if (s.Contains(" divshield:")) { divshield = s.Split(new string[] { " divshield:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool ptt = false;//played this turn if (s.Contains(" ptt:")) { ptt = s.Split(new string[] { " ptt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool wndfry = false;//windfurry if (s.Contains(" wndfr:")) { wndfry = s.Split(new string[] { " wndfr:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } int natt = 0; if (s.Contains(" natt:")) { natt = Convert.ToInt32(s.Split(new string[] { " natt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } int ent = 1000 + j; if (s.Contains(" e:")) { ent = Convert.ToInt32(s.Split(new string[] { " e:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } bool pois = false;//poision if (s.Contains(" poi:")) { pois = s.Split(new string[] { " poi:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool stl = false;//stealth if (s.Contains(" stl:")) { stl = s.Split(new string[] { " stl:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool immn = false;//immune if (s.Contains(" imm:")) { immn = s.Split(new string[] { " imm:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool chrg = false;//charge if (s.Contains(" chrg:")) { chrg = s.Split(new string[] { " chrg:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool ex = false;//exhausted if (s.Contains(" ex:")) { ex = s.Split(new string[] { " ex:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } int id = Convert.ToInt32(s.Split(new string[] { " id:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); tempminion = createNewMinion(new Handmanager.Handcard(CardDB.Instance.getCardData(minionname)), id); tempminion.Angr = attack; tempminion.Hp = hp; tempminion.maxHp = maxhp; tempminion.Ready = ready; tempminion.taunt = taunt; tempminion.divineshild = divshield; tempminion.playedThisTurn = ptt; tempminion.windfury = wndfry; tempminion.numAttacksThisTurn = natt; tempminion.entitiyID = ent; tempminion.handcard.entity = ent; tempminion.silenced = silenced; tempminion.exhausted = ex; tempminion.poisonous = pois; tempminion.stealth = stl; tempminion.immune = immn; tempminion.charge = chrg; if (maxhp > hp) { tempminion.wounded = true; } } else { try { Enchantment e = CardDB.getEnchantmentFromCardID(s.Split(' ')[0]); e.controllerOfCreator = Convert.ToInt32(s.Split(' ')[2]); e.creator = Convert.ToInt32(s.Split(' ')[1]); tempminion.enchantments.Add(e); } catch { } } } if (readstate == 4) // minion or enchantment { if (s.Contains(" id:")) { if (counter >= 2) { this.enemyminions.Add(tempminion); } string minionname = s.Split(' ')[0]; int attack = Convert.ToInt32(s.Split(new string[] { " A:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int hp = Convert.ToInt32(s.Split(new string[] { " H:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int maxhp = Convert.ToInt32(s.Split(new string[] { " mH:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); bool ready = s.Split(new string[] { " rdy:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; bool taunt = s.Split(new string[] { " tnt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; bool silenced = false; if (s.Contains(" silenced:")) { silenced = s.Split(new string[] { " silenced:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool divshield = false; if (s.Contains(" divshield:")) { divshield = s.Split(new string[] { " divshield:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool ptt = false;//played this turn if (s.Contains(" ptt:")) { ptt = s.Split(new string[] { " ptt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool wndfry = false;//windfurry if (s.Contains(" wndfr:")) { wndfry = s.Split(new string[] { " wndfr:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } int natt = 0; if (s.Contains(" natt:")) { natt = Convert.ToInt32(s.Split(new string[] { " natt:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } int ent = 1000 + j; if (s.Contains(" e:")) { ent = Convert.ToInt32(s.Split(new string[] { " e:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } bool pois = false;//poision if (s.Contains(" poi:")) { pois = s.Split(new string[] { " poi:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool stl = false;//stealth if (s.Contains(" stl:")) { stl = s.Split(new string[] { " stl:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool immn = false;//immune if (s.Contains(" imm:")) { immn = s.Split(new string[] { " imm:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool chrg = false;//charge if (s.Contains(" chrg:")) { chrg = s.Split(new string[] { " chrg:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } bool ex = false;//exhausted if (s.Contains(" ex:")) { ex = s.Split(new string[] { " ex:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0] == "True" ? true : false; } int id = Convert.ToInt32(s.Split(new string[] { " id:" }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); tempminion = createNewMinion(new Handmanager.Handcard(CardDB.Instance.getCardData(minionname)), id); tempminion.Angr = attack; tempminion.Hp = hp; tempminion.maxHp = maxhp; tempminion.Ready = ready; tempminion.taunt = taunt; tempminion.divineshild = divshield; tempminion.playedThisTurn = ptt; tempminion.windfury = wndfry; tempminion.numAttacksThisTurn = natt; tempminion.entitiyID = ent; tempminion.silenced = silenced; tempminion.exhausted = ex; tempminion.poisonous = pois; tempminion.stealth = stl; tempminion.immune = immn; tempminion.charge = chrg; if (maxhp > hp) { tempminion.wounded = true; } } else { try { Enchantment e = CardDB.getEnchantmentFromCardID(s.Split(' ')[0]); e.controllerOfCreator = Convert.ToInt32(s.Split(' ')[2]); e.creator = Convert.ToInt32(s.Split(' ')[1]); tempminion.enchantments.Add(e); } catch { } } } if (readstate == 5) // minion or enchantment { Handmanager.Handcard card = new Handmanager.Handcard(); string minionname = s.Split(' ')[2]; int pos = Convert.ToInt32(s.Split(' ')[1]); int mana = Convert.ToInt32(s.Split(' ')[3]); card.card = CardDB.Instance.getCardData(minionname); card.entity = Convert.ToInt32(s.Split(' ')[5]); card.manacost = mana; card.position = pos; handcards.Add(card); } if (s.StartsWith("ownhero:")) { readstate = 1; counter = 0; } if (s.StartsWith("enemyhero:")) { readstate = 2; counter = 0; } if (s.StartsWith("OwnMinions:")) { readstate = 3; counter = 0; } if (s.StartsWith("EnemyMinions:")) { if (counter >= 2) { this.ownminions.Add(tempminion); } readstate = 4; counter = 0; } if (s.StartsWith("Own Handcards:")) { if (counter >= 2) { this.enemyminions.Add(tempminion); } readstate = 5; counter = 0; } if (s.StartsWith("player:")) { readstate = 42; counter = 0; } counter++; j++; } Helpfunctions.Instance.logg("rdy"); Hrtprozis.Instance.setOwnPlayer(ownPlayer); Handmanager.Instance.setOwnPlayer(ownPlayer); Hrtprozis.Instance.updatePlayer(this.maxmana, this.mana, this.cardsPlayedThisTurn, this.numMinionsPlayedThisTurn, this.overdrive, 100, 200); Hrtprozis.Instance.updateSecretStuff(this.ownsecretlist, enemySecrets); int numattttHero = 0; bool herowindfury = false; Hrtprozis.Instance.updateOwnHero(this.ownHeroWeapon, this.ownHeroWeaponAttack, this.ownHeroWeaponDurability, ownHeroimmunewhileattacking, this.ownHeroAttack, this.ownherohp, this.ownherodefence, this.ownheroname, this.ownheroready, this.ownHeroFrozen, heroability, abilityReady, numattttHero, herowindfury); Hrtprozis.Instance.updateEnemyHero(this.enemyWeapon, this.enemyWeaponAttack, this.enemyWeaponDur, this.enemyWeaponAttack, this.enemyherohp, this.enemyherodefence, this.enemyheroname, this.enemyFrozen); Hrtprozis.Instance.updateMinions(this.ownminions, this.enemyminions); Handmanager.Instance.setHandcards(this.handcards, this.handcards.Count, 5); }