Esempio n. 1
0
    def updateWeapons(self):
        if self.disabled:
            self.__updateTimer = None
            return

        weaponModules = findModules(groupNames=WeaponGroupNames)

        for moduleID, module in weaponModules.items():
            if hasattr(module, "ChangeAmmo"):
                self.ensureModuleHooked(module)

            canActivate = canActivateModule(module)[0]
            canDeactivate = canDeactivateModule(module)[0]

            currentTarget = self.__activeModules.get(moduleID, None)
            if currentTarget:
                isActive = isModuleActive(module)
                if isActive == False:
                    del self.__activeModules[moduleID]
                    currentTarget = None

            if (((currentTarget is not None) and canDeactivate)
                    or canActivate):
                uthread.pool("DoUpdateModule", self.doUpdateModule, moduleID,
                             module, currentTarget)
Esempio n. 2
0
 def updateWeapons(self):
     if self.disabled:
         self.__updateTimer = None
         return
     
     weaponModules = findModules(groupNames=WeaponGroupNames)
     
     for moduleID, module in weaponModules.items():
         if hasattr(module, "ChangeAmmo"):
             self.ensureModuleHooked(module)
                     
         canActivate = canActivateModule(module)[0]
         canDeactivate = canDeactivateModule(module)[0]
         
         currentTarget = self.__activeModules.get(moduleID, None)
         if currentTarget:
             isActive = isModuleActive(module)
             if isActive == False:
                 del self.__activeModules[moduleID]
                 currentTarget = None                    
         
         if (
             ((currentTarget is not None) and canDeactivate) or
             canActivate
         ):
             uthread.pool("DoUpdateModule", self.doUpdateModule, moduleID, module, currentTarget)
Esempio n. 3
0
 def updateModules(self):
     if self.disabled:
         self.__updateTimer = None
         return
     activeModules = findModules(groupNames=ModuleGroupNames)
     
     for moduleID, module in activeModules.items():
         if (canActivateModule(module) and (not isModuleActive(module))):
             activateModule(module)
def launchProbe():
    modtype = "Scan Probe Launcher"
    launcher = findModule(modtype)
    if canActivateModule(launcher):
        activateModule(launcher, pulse=True)
Esempio n. 5
0
 def myChangeAmmoType(typeID, singleton):
     if not canActivateModule(module)[0]:
         self.__ammoChanges[module] = (_oldChangeAmmoType, typeID, singleton)
     else:
         return _oldChangeAmmoType(typeID, singleton)
Esempio n. 6
0
 def myChangeAmmo(itemID, quantity):
     if not canActivateModule(module)[0]:
         self.__ammoChanges[module] = (_oldChangeAmmo, itemID, quantity)
     else:
         return _oldChangeAmmo(itemID, quantity)
def launchProbe():
    modtype = "Scan Probe Launcher"
    launcher = findModule(modtype)
    if canActivateModule(launcher):
        activateModule(launcher, pulse=True)
Esempio n. 8
0
 def myChangeAmmoType(typeID, singleton):
     if not canActivateModule(module)[0]:
         self.__ammoChanges[module] = (_oldChangeAmmoType, typeID,
                                       singleton)
     else:
         return _oldChangeAmmoType(typeID, singleton)
Esempio n. 9
0
 def myChangeAmmo(itemID, quantity):
     if not canActivateModule(module)[0]:
         self.__ammoChanges[module] = (_oldChangeAmmo, itemID,
                                       quantity)
     else:
         return _oldChangeAmmo(itemID, quantity)