Exemplo n.º 1
0
    def GenTLI(self, weapdb):
        # get the weapons
        WEAP = 0

        for i, weapname in enumerate(self.weapons):
            idx = weapdb.names.index(weapname)
            # try the ammo supply factor
            try:
                weap_ASE = qjm_interps.ASE(self.ammo[i] /
                                           weapdb.weapons[idx].RF)
            except:
                if i == 0:
                    weap_ASE = 1
                    weap_RF = weapdb.weapons[idx].RF
                elif i == 1:
                    weap_ASE = 0.5
                elif i == 3:
                    weap_ASE = 0.33
                else:
                    weap_ASE = 1 / i
                pass
            WEAP += weapdb.weapons[idx].TLI * weap_ASE / Di

        # weapons from squad
        WEAP_SQUAD = self.squad

        MOF = 0.15 * (self.speed)**0.5
        RA = 0.08 * (self.range)**0.5
        PF = self.weight / 4 * (2 * self.weight)**0.5
        ARMF = armour_factor(self)
        AME = 1
        if self.amphibious:
            AME = 1.1
        CL = 1
        self.TLI = (((WEAP) * MOF * RA) + PF * ARMF) * AME * CL + WEAP_SQUAD
Exemplo n.º 2
0
    def GenTLI(self, weapdb):

        # get the weapons
        WEAP = 0

        for i, weapname in enumerate(self.weapons):
            idx = weapdb.names.index(weapname)
            if i == 0:
                factor = 1
                weapRF = weapdb.weapons[idx].RF
            elif i == 1:
                factor = 0.5
            elif i == 3:
                factor = 0.33
            else:
                factor = i / 4
            WEAP += weapdb.weapons[idx].TLI / Di

        # weapons from squad
        WEAP_SQUAD = 0

        MOF = 0.15 * (self.speed)**0.5
        RA = 0.08 * (self.range)**0.5
        PF = self.weight / 4 * (2 * self.weight)**0.5
        ARMF = armour_factor(self)
        FCE = fire_control_factor(self)
        RFE = 1
        ASE = qjm_interps.ASE(self.ammo_store / weapRF)
        AME = 1
        CL = 1
        self.TLI = (((WEAP + WEAP_SQUAD) * MOF * RA) +
                    PF * ARMF) * RFE * FCE * ASE * AME * CL
Exemplo n.º 3
0
    def GenTLI(self, weapdb):
        # get the weapons
        WEAP = 0

        #print("WEAPS -",self.name)
        for i, weapname in enumerate(self.weapons):
            idx = weapdb.names.index(weapname)
            # try the ammo supply factor
            try:
                weap_ASE = qjm_interps.ASE(self.ammo[i] /
                                           weapdb.weapons[idx].RF)
            except:
                if i == 0:
                    weap_ASE = 1
                    weapRF = weapdb.weapons[idx].RF
                elif i == 1:
                    weap_ASE = 0.5
                elif i == 3:
                    weap_ASE = 0.33
                else:
                    weap_ASE = 1 / i
            if weapdb.weapons[idx].type == "Automatic gun":
                WEAP += weapdb.weapons[
                    idx].TLI * weap_ASE / Di * 0.25  # all aircraft weapons degraded by .25
            else:  # if it's not a gun or automatic gun, then ammo is the quantity of weapons
                WEAP += weapdb.weapons[idx].TLI / Di * 0.25 * math.log(
                    2 * self.ammo[i] -
                    1)  # all aircraft weapons degraded by .25
            #print("{} {:,.0f}".format(weapdb.weapons[idx].name,weapdb.weapons[idx].TLI))
            #WEAP += weapdb.weapons[idx].TLI / Di * factor * 0.25 # all aircraft weapons degraded by .25
            #WEAP += weapdb.weapons[idx].TLI / Di * 0.25 # all aircraft weapons degraded by .25 - remove degradation of redundant weapons?

        MOF = 0.15 * (
            500 + 0.1 * (max(0, self.speed - 500)) + 0.01 *
            (max(0, self.speed - 1500)))**0.5  # max clips the value at zero
        RA = 0.08 * (self.range)**0.5
        PF = self.weight / 4 * (2 *
                                self.weight)**0.5 / 2  # half PF for aircraft
        # parse the armour value
        FCE = 1
        RFE = 1
        ASE = 1
        CL = 1 + 0.02 * min(0, (self.ceiling - 30000) / 1000) + 0.005 * max(
            0, (self.ceiling - 30000) / 1000
        )  # +.005 for each 1k ft above 30k, -0.02 for each 1k ft below 30k

        #print("Aircraft ",self.name,"| WEAP",WEAP,"| CL",CL,"| MOF",MOF,"| RA",RA)

        self.TLI = ((WEAP * MOF * RA) + PF) * RFE * FCE * ASE * CL
Exemplo n.º 4
0
    def GenTLI(self, weapdb):
        # get the weapons
        WEAP = 0

        for i, weapname in enumerate(self.weapons):
            idx = weapdb.names.index(weapname)
            # try the ammo supply factor
            try:
                weap_ASE = qjm_interps.ASE(self.ammo[i] /
                                           weapdb.weapons[idx].RF)
            except:
                if i == 0:
                    weap_ASE = 1
                    weap_RF = weapdb.weapons[idx].RF
                elif i == 1:
                    weap_ASE = 0.5
                elif i == 3:
                    weap_ASE = 0.33
                else:
                    weap_ASE = 1 / i
                pass
            WEAP += weapdb.weapons[idx].TLI * weap_ASE / Di

        MOF = 0.15 * (self.speed)**0.5
        RA = 0.08 * (self.range)**0.5
        PF = self.weight / 4 * (
            2 * self.weight)**0.5 / 2  # divided by two for assault guns
        # parse the armour value
        ARMF = armour_factor(self)
        RFE = 1
        ASE = 1
        AME = 1
        if self.amphibious:
            AME = 1.1
        CL = 1

        self.TLI = ((WEAP * MOF * RA) + PF * ARMF) * RFE * ASE * AME * CL