if (this.tsm_offset){ if (entity.heat == 9){ next.movement_threat -= this.bv / 100 * next.getMovementheatBuildup(); } if (entity.heat < 12 && entity.heat > 9){ next.movement_threat -= this.bv / 500 * next.getMovementheatBuildup(); } }
    protected MoveOption.Table calculateMoveOptions(MoveOption base) {        ArrayList possible = new ArrayList();        MoveOption.Table discovered = new MoveOption.Table();        if (entity.getJumpMPWithTerrain() > 0) {            possible.add(((MovePath) base.clone()).addStep(MovePath.STEP_START_JUMP));        }        possible.add(base);        discovered.put(base);        while (possible.size() > 0) {            MoveOption min = (MoveOption) possible.remove(0);            Iterator adjacent = min.getNextMoves(true, true).iterator();            while (adjacent.hasNext()) {                MoveOption next = (MoveOption) adjacent.next();                if (next.changeToPhysical() && next.isMoveLegal()) {                    discovered.put(next);                } else if (next.isMoveLegal()) {                    //relax edges;                    if (discovered.get(next) == null                        || (next.getDistUtility() < discovered.get(next).getDistUtility())) {                        discovered.put(next);                        if (next.isJumping()) {                            MovePath left = (MoveOption) next.clone();                            MovePath right = (MoveOption) next.clone();                            for (int turn = 0; turn < 2; turn++) {                                left.addStep(MovePath.STEP_TURN_LEFT);                                right.addStep(MovePath.STEP_TURN_RIGHT);                                discovered.put(((MovePath) left.clone()));                                discovered.put(((MovePath) right.clone()));                            }                            right.addStep(MovePath.STEP_TURN_RIGHT);                            discovered.put(right);                        }                        int index = Collections.binarySearch(possible, next, MoveOption.DISTANCE_COMPARATOR);                        if (index < 0) {                            index = -index - 1;                        }                        possible.add(index, next);                    }                }            }        }        //Final check for illeagal and extra weighting for heat        for (Iterator i = discovered.values().iterator(); i.hasNext();) {            MoveOption next = (MoveOption) i.next();            next.clipToPossible();            if (!next.isMoveLegal()) {                i.remove();            }            if (entity.heat > 4) {                next.movement_threat += this.bv / 1000 * next.getMovementheatBuildup();                if (entity.heat > 7) {                    next.movement_threat += this.bv / 500 * next.getMovementheatBuildup();                }                if (entity.heat > 12) {                    next.movement_threat += this.bv / 100 * next.getMovementheatBuildup();                }            }        }        return discovered;    }