option.tv.add(terrain + " Terrain Adjusment " + "\n");
if(debug) option.tv.add(terrain + " Terrain Adjusment " + "\n");
    public MoveOption[] calculateMove(Entity entity) {        ArrayList enemy_array = new ArrayList(game.getValidTargets(entity));        ArrayList<Entity> entities = new ArrayList<Entity>(game.getEntitiesVector());        CEntity self = centities.get(entity);        MoveOption[] move_array;        int friends = entities.size() - enemy_array.size();        move_array = secondPass(self, friends, enemy_array, entities);        //top balanced        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(1, 1), 50);        //top damage        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(.5, 1), 50);        move_array = thirdPass(self, enemy_array);        //top balanced        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(1, 1), 30);        //top damage        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(.5, 1), 30);        //reduce self threat, and add bonus for terrain        for (Iterator i = self.pass.values().iterator(); i.hasNext();) {            MoveOption option = (MoveOption) i.next();            option.setState();            option.self_damage *= .5;            option.self_threat *= .5;            //TODO: should scale to the unit bv            double terrain = 2 * ((double) Compute.getTargetTerrainModifier(game, option.getEntity()).getValue());            option.tv.add(terrain + " Terrain Adjusment " + "\n");            option.self_threat -= terrain;        }        move_array = fourthPass(self, enemy_array);        //top balanced        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(1, 1), 20);        //top damage        filterMoves(move_array, self.pass, new MoveOption.WeightedComparator(.5, 1), 20);        //reduce transient damage estimates        for (Iterator i = self.pass.values().iterator(); i.hasNext();) {            MoveOption option = (MoveOption) i.next();            option.self_threat *= .5;            option.self_damage *= .5;        }        move_array = fifthPass(self, enemy_array);        /***********************************************************************         * Return top twenty moves to the lance algorithm         **********************************************************************/        MoveOption[] result = new MoveOption[Math.min(move_array.length, 20)];        int offset = 0;        for (int i = 0; i < Math.min(move_array.length, 20); i++) {            MoveOption next = move_array[i];            if (next.isPhysical && self.range_damages[CEntity.RANGE_SHORT] > 5 && next.doomed) {                if (offset + 20 < move_array.length) {                    next = move_array[offset + 20];                    offset++;                }            }            result[i] = next;        }        return result;    }