Exemple #1
0
    private short defineStatus(VehicleXmlParser parser)
    {
        if (parser.hasOnlyOneTurret())
        {
            return(ONLY_ONE_TURRET);
        }

        /**
         * Some britain SPGs has absolutely two equal turrets but one of them is not used by WG interface.
         * WG screwed up again.
         * Ignore this turret.
         *
         * As for 10 aug 2013 the screwed SPGs are:
         * gb27_sexton, amx_ob_am105, gb77_fv304, su14_1, gb29_crusader_5inch
         */
        if (parser.turretsHasEqualHP())
        {
            return(ONLY_ONE_TURRET);
        }

        if (parser.turretUnlocksSomething())
        {
            XmlNodeList    unlocks            = parser.getSecondTurretUnlocks();
            List <XmlNode> guns               = parser.separateGuns(unlocks);
            int            maxUnlockedGunCost = parser.mostExpensive(guns);
            int            chassisCost        = parser.getChassisCost();
            return(unlockedGunIsTotalCrap(maxUnlockedGunCost, chassisCost));
        }

        return(STOCK_TURRET_TOP_GUN_POSSIBLE);
    }
Exemple #2
0
    private short unlockedGunIsTotalCrap()
    {
        // Looks like only Patton and Pershing are affected by this. Could be done manually.
        // Now have to switch T-50-2 manually to status-2
        if (vehicleParser.getChassisCost() > vehicleParser.getUnlockedGunCost() * 4)
        {
            /*
             * *3 <- low level tanks have top guns cost much less than chassis
             * if Gun unlocked by second turret is crap -> top gun is possible to mount at stock turret
             */
            return(STOCK_TURRET_TOP_GUN_POSSIBLE);
        }

        return(STOCK_TURRET_NO_TOP_GUN);
    }
Exemple #3
0
    private short defineStatus(VehicleXmlParser parser)
    {
        if (parser.hasOnlyOneTurret())
            return ONLY_ONE_TURRET;

        if (parser.turretUnlocksSomething())
        {
            XmlNodeList unlocks = parser.getSecondTurretUnlocks();
            List<XmlNode> guns = parser.separateGuns(unlocks);
            int maxUnlockedGunCost = parser.mostExpensive(guns);
            int chassisCost = parser.getChassisCost();
            return unlockedGunIsTotalCrap(maxUnlockedGunCost, chassisCost);
        }

        return STOCK_TURRET_TOP_GUN_POSSIBLE;
    }
Exemple #4
0
    private short defineStatus()
    {
        if (vehParser.hasOnlyOneTurret())
        {
            return(ONLY_ONE_TURRET);
        }

        if (vehParser.turretUnlocksSomething())
        {
            XmlNodeList    unlocks            = vehParser.getSecondTurretUnlocks();
            List <XmlNode> guns               = vehParser.separateGuns(unlocks);
            int            maxUnlockedGunCost = vehParser.mostExpensive(guns);
            int            chassisCost        = vehParser.getChassisCost();
            return(unlockedGunIsTotalCrap(maxUnlockedGunCost, chassisCost));
        }

        return(STOCK_TURRET_TOP_GUN_POSSIBLE);
    }
Exemple #5
0
    private short defineStatus(VehicleXmlParser parser)
    {
        if (parser.hasOnlyOneTurret())
            return ONLY_ONE_TURRET;

        /**
         * Some britain SPGs has absolutely two equal turrets but one of them is not used by WG interface.
         * WG screwed up again.
         * Ignore this turret.
         * 
         * As for 10 aug 2013 the screwed SPGs are:
         * gb27_sexton, amx_ob_am105, gb77_fv304, su14_1, gb29_crusader_5inch
         */
        if (parser.turretsHasEqualHP())
            return ONLY_ONE_TURRET;

        if (parser.turretUnlocksSomething())
        {
            XmlNodeList unlocks = parser.getSecondTurretUnlocks();
            List<XmlNode> guns = parser.separateGuns(unlocks);
            int maxUnlockedGunCost = parser.mostExpensive(guns);
            int chassisCost = parser.getChassisCost();
            return unlockedGunIsTotalCrap(maxUnlockedGunCost, chassisCost);
        }

        return STOCK_TURRET_TOP_GUN_POSSIBLE;
    }