public void simmulateWholeTurn() { help.ErrorLog("####################################################"); help.logg("simulate best board"); help.ErrorLog("####################################################"); //this.bestboard.printActions(); Playfield tempbestboard = new Playfield(); if (bestmove != null) // save the guessed move, so we doesnt need to recalc! { bestmove.print(); tempbestboard.doAction(bestmove); } else { tempbestboard.mana = -100; } help.logg("-------------"); tempbestboard.printBoard(); foreach (Action bestmovee in bestboard.playactions) { help.logg("stepp"); if (bestmovee != null) // save the guessed move, so we doesnt need to recalc! { bestmovee.print(); tempbestboard.doAction(bestmovee); } else { tempbestboard.mana = -100; } help.logg("-------------"); tempbestboard.printBoard(); } help.logg("AFTER ENEMY TURN:"); tempbestboard.sEnemTurn = this.simulateEnemyTurn; tempbestboard.endTurn(this.secondturnsim, this.playaround, true); }
public void simmulateWholeTurn() { help.ErrorLog("########################################################################################################"); help.ErrorLog("simulate best board"); help.ErrorLog("########################################################################################################"); //this.bestboard.printActions(); Playfield tempbestboard = new Playfield(); tempbestboard.printBoard(); if (bestmove != null && bestmove.actionType != actionEnum.endturn) // save the guessed move, so we doesnt need to recalc! { bestmove.print(); tempbestboard.doAction(bestmove); } else { tempbestboard.mana = -100; } help.logg("-------------"); tempbestboard.printBoard(); foreach (Action bestmovee in this.bestActions) { help.logg("stepp"); if (bestmovee != null && bestmovee.actionType != actionEnum.endturn) // save the guessed move, so we doesnt need to recalc! { bestmovee.print(); tempbestboard.doAction(bestmovee); } else { tempbestboard.mana = -100; } help.logg("-------------"); tempbestboard.printBoard(); } //help.logg("AFTER ENEMY TURN:" ); tempbestboard.sEnemTurn = true; tempbestboard.endTurn(false, this.playaround, false, Settings.Instance.playaroundprob, Settings.Instance.playaroundprob2); help.logg("ENEMY TURN:-----------------------------"); tempbestboard.value = int.MinValue; tempbestboard.prepareNextTurn(tempbestboard.isOwnTurn); Ai.Instance.enemyTurnSim[0].simulateEnemysTurn(tempbestboard, true, playaround, true, Settings.Instance.playaroundprob, Settings.Instance.playaroundprob2); }
public void simmulateWholeTurn() { help.logg("simulate best board"); //this.bestboard.printActions(); Playfield tempbestboard = new Playfield(); if (bestmove != null) // save the guessed move, so we doesnt need to recalc! { bestmove.print(); if (bestmove.cardplay) { help.logg("card"); //pf.playCard(c, hc.position - 1, hc.entity, trgt.target, trgt.targetEntity, 0, bestplace, cardplayPenality); Handmanager.Handcard hc = tempbestboard.owncards.Find(x => x.entity == bestmove.cardEntitiy); if (bestmove.owntarget >= 0 && bestmove.enemytarget >= 0 && bestmove.enemytarget <= 9 && bestmove.owntarget < bestmove.enemytarget) { tempbestboard.playCard(bestmove.handcard, hc.position - 1, hc.entity, bestmove.enemytarget - 1, bestmove.enemyEntitiy, bestmove.druidchoice, bestmove.owntarget, 0); } else { tempbestboard.playCard(bestmove.handcard, hc.position - 1, hc.entity, bestmove.enemytarget, bestmove.enemyEntitiy, bestmove.druidchoice, bestmove.owntarget, 0); } } if (bestmove.minionplay) { help.logg("min"); //.attackWithMinion(m, trgt.target, trgt.targetEntity, attackPenality); Minion mm = tempbestboard.ownMinions.Find(x => x.entitiyID == bestmove.ownEntitiy); tempbestboard.attackWithMinion(mm, bestmove.enemytarget, bestmove.enemyEntitiy, 0); } if (bestmove.heroattack) { help.logg("hero"); tempbestboard.attackWithWeapon(bestmove.enemytarget, bestmove.enemyEntitiy, 0); } if (bestmove.useability) { help.logg("abi"); //.activateAbility(p.ownHeroAblility, trgt.target, trgt.targetEntity, abilityPenality); tempbestboard.activateAbility(this.nextMoveGuess.ownHeroAblility, bestmove.enemytarget, bestmove.enemyEntitiy, 0); } } else { tempbestboard.mana = -1; } help.logg("-------------"); tempbestboard.printBoard(); foreach (Action bestmovee in bestboard.playactions) { help.logg("stepp"); if (bestmovee != null) // save the guessed move, so we doesnt need to recalc! { bestmovee.print(); if (bestmovee.cardplay) { help.logg("card"); //pf.playCard(c, hc.position - 1, hc.entity, trgt.target, trgt.targetEntity, 0, bestplace, cardplayPenality); Handmanager.Handcard hc = tempbestboard.owncards.Find(x => x.entity == bestmovee.cardEntitiy); if (bestmovee.owntarget >= 0 && bestmovee.enemytarget >= 0 && bestmovee.enemytarget <= 9 && bestmovee.owntarget < bestmovee.enemytarget) { tempbestboard.playCard(bestmovee.handcard, hc.position - 1, hc.entity, bestmovee.enemytarget - 1, bestmovee.enemyEntitiy, bestmovee.druidchoice, bestmovee.owntarget, 0); } else { tempbestboard.playCard(bestmovee.handcard, hc.position - 1, hc.entity, bestmovee.enemytarget, bestmovee.enemyEntitiy, bestmovee.druidchoice, bestmovee.owntarget, 0); } } if (bestmovee.minionplay) { help.logg("min"); //.attackWithMinion(m, trgt.target, trgt.targetEntity, attackPenality); Minion mm = tempbestboard.ownMinions.Find(x => x.entitiyID == bestmovee.ownEntitiy); tempbestboard.attackWithMinion(mm, bestmovee.enemytarget, bestmovee.enemyEntitiy, 0); } if (bestmovee.heroattack) { help.logg("hero"); tempbestboard.attackWithWeapon(bestmovee.enemytarget, bestmovee.enemyEntitiy, 0); } if (bestmovee.useability) { help.logg("abi"); //.activateAbility(p.ownHeroAblility, trgt.target, trgt.targetEntity, abilityPenality); tempbestboard.activateAbility(this.nextMoveGuess.ownHeroAblility, bestmovee.enemytarget, bestmovee.enemyEntitiy, 0); } } else { tempbestboard.mana = -1; } help.logg("-------------"); tempbestboard.printBoard(); } help.logg("AFTER ENEMY TURN:"); tempbestboard.sEnemTurn = this.simulateEnemyTurn; tempbestboard.endTurn(this.secondturnsim, this.playaround, true); }