Beispiel #1
0
 def test_jump_distance_skills_industrial(self):
     """
     Test the correct range for industrials for each JDC skill level
     """
     ship_ranges = [2.5, 3.0, 3.5, 4.0, 4.5, 5.0]
     for skill in range(0, 6):
         jump_range = ship_ranges[skill]
         self.assertEquals(ship_class_to_range('industrial', skill), jump_range)
Beispiel #2
0
 def test_jump_distance_skills_supercarrier(self):
     """
     Test the correct range for titans for each JDC skill level
     """
     ship_ranges = [2.5, 3.0, 3.5, 4.0, 4.5, 5.0]
     for skill in range(0, 6):
         jump_range = ship_ranges[skill]
         self.assertEquals(ship_class_to_range('supercarrier', skill), jump_range)
Beispiel #3
0
 def test_jump_distance_skills_titan(self):
     """
     Test the correct range for titans for each JDC skill level
     """
     ship_ranges = [2.5, 3.0, 3.5, 4.0, 4.5, 5.0]
     for skill in range(0, 6):
         jump_range = ship_ranges[skill]
         self.assertEquals(ship_class_to_range('titan', skill), jump_range)
Beispiel #4
0
 def test_jump_distance_skills_jumpfreighter(self):
     """
     Test the correct range for jump freighters for each JDC skill level
     """
     ship_ranges = [5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
     for skill in range(0, 6):
         jump_range = ship_ranges[skill]
         self.assertEquals(ship_class_to_range('jumpfreighter', skill), jump_range)
Beispiel #5
0
 def test_jump_distance_skills_jumpfreighter(self):
     """
     Test the correct range for jump freighters for each JDC skill level
     """
     ship_ranges = [5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
     for skill in range(0, 6):
         jump_range = ship_ranges[skill]
         self.assertEquals(ship_class_to_range('jumpfreighter', skill),
                           jump_range)
Beispiel #6
0
    def cmd_hit(self, args, msg):
        """Details what class and JDC level is required to jump between two systems"""
        if len(args) != 2:
            return '!hit <source> <destination>'
        source, dest = args

        source = self._system_picker(source)
        if isinstance(source, basestring):
            return source
        dest = self._system_picker(dest)
        if isinstance(dest, basestring):
            return dest

        if self.map.node[dest]['security'] >= 0.5:
            return '{} is a highsec system'.format(self.map.get_system_name(dest))

        ly = self.map.system_distance(source, dest)

        if ly > 6.5 * (1 + (0.25 * 5)):
            return '{} to {} is greater than {}ly (maximum jump range of all ships)'.format(
                self.map.get_system_name(source),
                self.map.get_system_name(dest),
                6.5 * (1 + (0.25 * 5))
            )

        res = []
        for ship_class in base_range.keys():
            res1 = []
            for skill in [4, 5]:
                if ship_class_to_range(ship_class, skill) >= ly:
                    res1.append('JDC{}'.format(skill))
            if len(res1):
                res.append('{}: {}'.format(ship_class, ', '.join(res1)))

        return '{} -> {} ({}ly) Capable Ship Types:\n{}'.format(
            self.map.get_system_name(source),
            self.map.get_system_name(dest),
            round(ly, 2),
            '\n'.join(res)
        )
Beispiel #7
0
    def cmd_hit(self, args, msg):
        """Details what class and JDC level is required to jump between two systems"""
        if len(args) != 2:
            return '!hit <source> <destination>'
        source, dest = args

        source = self._system_picker(source)
        if isinstance(source, basestring):
            return source
        dest = self._system_picker(dest)
        if isinstance(dest, basestring):
            return dest

        if self.map.node[dest]['security'] >= 0.5:
            return '{} is a highsec system'.format(
                self.map.get_system_name(dest))

        ly = self.map.system_distance(source, dest)

        if ly > 6.5 * (1 + (0.25 * 5)):
            return '{} to {} is greater than {}ly (maximum jump range of all ships)'.format(
                self.map.get_system_name(source),
                self.map.get_system_name(dest), 6.5 * (1 + (0.25 * 5)))

        res = []
        for ship_class in base_range.keys():
            res1 = []
            for skill in [4, 5]:
                if ship_class_to_range(ship_class, skill) >= ly:
                    res1.append('JDC{}'.format(skill))
            if len(res1):
                res.append('{}: {}'.format(ship_class, ', '.join(res1)))

        return '{} -> {} ({}ly) Capable Ship Types:\n{}'.format(
            self.map.get_system_name(source), self.map.get_system_name(dest),
            round(ly, 2), '\n'.join(res))
Beispiel #8
0
 def test_jump_distance_dreadnought(self):
     """
     The maximum jump range of a dread is 5LY.
     """
     self.assertEquals(ship_class_to_range('dreadnought', 5), 5)
Beispiel #9
0
 def test_jump_distance_blackops(self):
     """
     The maximum jump range of a bloops is 8LY.
     """
     self.assertEquals(ship_class_to_range('blackops', 5), 8)
Beispiel #10
0
 def test_jump_distance_jumpfreighter(self):
     """
     The maximum jump range of a JF is 10LY.
     """
     self.assertEquals(ship_class_to_range('jumpfreighter', 5), 10)
Beispiel #11
0
 def test_jump_distance_industrial(self):
     """
     The maximum jump range of a rorqual is 5LY.
     """
     self.assertEquals(ship_class_to_range('industrial', 5), 5)
Beispiel #12
0
 def test_jump_distance_dreadnought(self):
     """
     The maximum jump range of a dread is 5LY.
     """
     self.assertEquals(ship_class_to_range('dreadnought', 5), 5)
Beispiel #13
0
 def test_jump_distance_carrier(self):
     """
     The maximum jump range of a carrier is 5LY.
     """
     self.assertEquals(ship_class_to_range('carrier', 5), 5)
Beispiel #14
0
 def test_jump_distance_carrier(self):
     """
     The maximum jump range of a carrier is 5LY.
     """
     self.assertEquals(ship_class_to_range('carrier', 5), 5)
Beispiel #15
0
 def test_jump_distance_industrial(self):
     """
     The maximum jump range of a rorqual is 5LY.
     """
     self.assertEquals(ship_class_to_range('industrial', 5), 5)
Beispiel #16
0
 def test_jump_distance_jumpfreighter(self):
     """
     The maximum jump range of a JF is 10LY.
     """
     self.assertEquals(ship_class_to_range('jumpfreighter', 5), 10)
Beispiel #17
0
 def test_jump_distance_blackops(self):
     """
     The maximum jump range of a bloops is 8LY.
     """
     self.assertEquals(ship_class_to_range('blackops', 5), 8)
Beispiel #18
0
 def test_jump_distance_titan(self):
     """
     The maximum jump range of a titan is 5LY.
     """
     self.assertEquals(ship_class_to_range('titan', 5), 5)
Beispiel #19
0
 def test_jump_distance_titan(self):
     """
     The maximum jump range of a titan is 5LY.
     """
     self.assertEquals(ship_class_to_range('titan', 5), 5)