Skip to content

Commit

Permalink
Hack ai/search to teach AI to evaluate destroying _all_ sopas
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 28, 2015
1 parent 57a56cf commit df1ffec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ai/search.js
@@ -1,6 +1,7 @@
"use strict";
var etg = require("../etg");
var Cards = require("../Cards");
var Skills = require("../Skills");
var evalGame = require("./eval");
function getWorstCard(game){
var worstcard = 0, curEval = 2147483647, hash = {};
Expand Down Expand Up @@ -91,6 +92,12 @@ module.exports = function(game, previous) {
var tbits = game.tgtToBits(t) ^ 8;
var gameClone = game.clone();
gameClone.bitsToTgt(cbits).useactive(gameClone.bitsToTgt(tbits));
if (c.status.get("patience") && c.active.cast == Skills.die){
for(var i=0; i<16; i++){
var pr = c.owner.permanents[i];
if (pr && pr.status.get("patience") && pr.active.cast == Skills.die) pr.useactive();
}
}
var v, wc;
if (gameClone.player2.hand.length < 8){
v = evalGame(gameClone);
Expand Down

0 comments on commit df1ffec

Please sign in to comment.