public HitData rollHitLocation(int table, int side) { int nArmorLoc = LOC_FRONT; boolean bSide = false; if (side == ToHitData.SIDE_LEFT) { nArmorLoc = LOC_LEFT; bSide = true; } else if (side == ToHitData.SIDE_RIGHT) { nArmorLoc = LOC_RIGHT; bSide = true; } else if (side == ToHitData.SIDE_REAR) { nArmorLoc = LOC_REAR; } switch (Compute.d6(2)) { case 2: return new HitData(nArmorLoc, false, HitData.EFFECT_CRITICAL); case 3: return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DESTROYED); case 4: return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED); case 5: if (bSide || getMovementMode() == IEntityMovementMode.HOVER || getMovementMode() == IEntityMovementMode.HYDROFOIL) { return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED); } else { return new HitData(nArmorLoc); } case 6: case 7: case 8: return new HitData(nArmorLoc); case 9: if (bSide && ((getMovementMode() == IEntityMovementMode.HOVER) || (getMovementMode() == IEntityMovementMode.HYDROFOIL))) { return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED); } else { return new HitData(nArmorLoc); } case 10: if (m_bHasNoTurret) { return new HitData(nArmorLoc); } else { return new HitData(LOC_TURRET); } case 11: if (m_bHasNoTurret) { return new HitData(nArmorLoc); } else { return new HitData(LOC_TURRET, false, HitData.EFFECT_VEHICLE_TURRETLOCK); } case 12: if (m_bHasNoTurret || bSide) { return new HitData(nArmorLoc, false, HitData.EFFECT_CRITICAL); } else { return new HitData(LOC_TURRET, false, HitData.EFFECT_CRITICAL); } } return null;
public HitData rollHitLocation(int table, int side, int aimedLocation, int aimingMode) { return rollHitLocation(table, side);
    public HitData rollHitLocation(int table, int side) {        int nArmorLoc = LOC_FRONT;        boolean bSide = false;        if (side == ToHitData.SIDE_LEFT) {            nArmorLoc = LOC_LEFT;            bSide = true;        }        else if (side == ToHitData.SIDE_RIGHT) {            nArmorLoc = LOC_RIGHT;            bSide = true;        }        else if (side == ToHitData.SIDE_REAR) {            nArmorLoc = LOC_REAR;        }        switch (Compute.d6(2)) {            case 2:                return new HitData(nArmorLoc, false, HitData.EFFECT_CRITICAL);            case 3:                return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DESTROYED);            case 4:                return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED);            case 5:                if (bSide || getMovementMode() == IEntityMovementMode.HOVER || getMovementMode() == IEntityMovementMode.HYDROFOIL) {                    return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED);                }                else {                    return new HitData(nArmorLoc);                }            case 6:            case 7:            case 8:                return new HitData(nArmorLoc);            case 9:                if (bSide && ((getMovementMode() == IEntityMovementMode.HOVER) || (getMovementMode() == IEntityMovementMode.HYDROFOIL))) {                    return new HitData(nArmorLoc, false, HitData.EFFECT_VEHICLE_MOVE_DAMAGED);                }                else {                    return new HitData(nArmorLoc);                }            case 10:                if (m_bHasNoTurret) {                    return new HitData(nArmorLoc);                }                else {                    return new HitData(LOC_TURRET);                }            case 11:                if (m_bHasNoTurret) {                    return new HitData(nArmorLoc);                }                else {                    return new HitData(LOC_TURRET, false, HitData.EFFECT_VEHICLE_TURRETLOCK);                }            case 12:                if (m_bHasNoTurret || bSide) {                    return new HitData(nArmorLoc, false, HitData.EFFECT_CRITICAL);                }                else {                    return new HitData(LOC_TURRET, false, HitData.EFFECT_CRITICAL);                }        }        return null;    }