protected void firing(long deltaThreshold,long recentThreshold){
        if ( ctx.gunHeat > 0.0 ) {
            return;
        }
        double maxPower = 0.0;
        double aimDistance = Util.fieldFullDistance;
        MoveType aimType = null;
        Enemy target = null;
        for (Map.Entry<String, Enemy> e : ctx.nextEnemyMap.entrySet()) {
            target = e.getValue();
            if ( ! isStale(target) ) {
                MoveType aimtype = getBestAimType(target);
                Pair<Double,Double> result = calcFire(target,aimtype,deltaThreshold,recentThreshold);
                if ( aimDistance > result.second ) {
                    maxPower = result.first;
                    aimDistance = result.second;
                    aimType = aimtype;
                }
            }
        }

        if ( aimType != null && maxPower > 0 ) {
            if ( ctx.enemies > 1 ) {
                normalMode();
            }
            aimType.updateAim();
            doFire(maxPower,aimDistance,target,aimType.type);
        }
    }