Exemplo n.º 1
0
    def filterTargets(self, ids):
        targetSvc = sm.services.get('target', None)
        if not targetSvc:
            return []

        ballpark = eve.LocalSvc("michelle").GetBallpark()
        if not ballpark:
            return []

        controlRange = self.getDroneControlRange()
        result = []

        for id in ids:
            invItem = ballpark.GetInvItem(id)
            if not invItem:
                continue

            if not (id in targetSvc.targets):
                continue

            flag = getFlagName(id)
            if (flag != "HostileNPC") and (flag is not None):
                continue

            if getPriority(id) < 0:
                continue

            if ballpark.DistanceBetween(eve.session.shipid, id) > controlRange:
                continue

            result.append(id)

        return result
Exemplo n.º 2
0
 def filterTargets(self, ids):
     targetSvc = sm.services.get('target', None)
     if not targetSvc:
         return []
     
     ballpark = eve.LocalSvc("michelle").GetBallpark()
     if not ballpark:
         return []
     
     controlRange = self.getDroneControlRange()
     result = []
     
     for id in ids:
         invItem = ballpark.GetInvItem(id)
         if not invItem:
             continue
         
         if not (id in targetSvc.targets):
             continue
         
         flag = getFlagName(id)
         if (flag != "HostileNPC") and (flag is not None):
             continue
         
         if getPriority(id) < 0:
             continue
         
         if ballpark.DistanceBetween(eve.session.shipid, id) > controlRange:
             continue
             
         result.append(id)
     
     return result
Exemplo n.º 3
0
 def filterTargets(self, ids, chanceToHitGetter):
     ballpark = eve.LocalSvc("michelle").GetBallpark()
     result = []
     
     cannotHit = set()
     minChanceToHit = float(getPref("MinimumChanceToHit", 1)) / 100.0
     
     for id in ids:
         invItem = ballpark.GetInvItem(id)
         if not invItem:
             continue
             
         flag = getFlagName(id)
         if (flag != "HostileNPC") and (flag is not None):
             continue
         
         if getPriority(id) < 0:
             continue
         
         if chanceToHitGetter(id) < minChanceToHit:
             cannotHit.add(id)
             continue
             
         result.append(id)
     
     if (len(cannotHit) > 0) and (len(result) == 0):
         log("Cannot hit target(s) %s", ", ".join(getNamesOfIDs(cannotHit)))
     
     return result
Exemplo n.º 4
0
    def filterTargets(self, ids, chanceToHitGetter):
        ballpark = eve.LocalSvc("michelle").GetBallpark()
        result = []

        cannotHit = set()
        minChanceToHit = float(getPref("MinimumChanceToHit", 1)) / 100.0

        for id in ids:
            invItem = ballpark.GetInvItem(id)
            if not invItem:
                continue

            flag = getFlagName(id)
            if (flag != "HostileNPC") and (flag is not None):
                continue

            if getPriority(id) < 0:
                continue

            if chanceToHitGetter(id) < minChanceToHit:
                cannotHit.add(id)
                continue

            result.append(id)

        if (len(cannotHit) > 0) and (len(result) == 0):
            log("Cannot hit target(s) %s", ", ".join(getNamesOfIDs(cannotHit)))

        return result