def simpleShipHit(self, hitObject, entry, skillId, ammoSkillId):
     ship = hitObject.getNetPythonTag('ship')
     if not ship:
         return None
     
     fromNodePath = entry.getFromNodePath()
     shotNum = int(fromNodePath.getNetTag('shotNum'))
     if shotNum not in self.shipsHitByShotNum:
         self.shipsHitByShotNum[shotNum] = []
         self.removeShotNumTasks.append(taskMgr.doMethodLater(5.0, self.removeShotNumTask, self.uniqueName('removeShotNum%s' % shotNum), extraArgs = [
             shotNum]))
     
     if ship.doId in self.shipsHitByShotNum[shotNum]:
         return None
     
     self.shipsHitByShotNum[shotNum].append(ship.doId)
     return DistributedIslandCannon.simpleShipHit(self, hitObject, entry, skillId, ammoSkillId)
Example #2
0
 def simpleShipHit(self, hitObject, entry, skillId, ammoSkillId):
     ship = hitObject.getNetPythonTag('ship')
     if not ship:
         return
     fromNodePath = entry.getFromNodePath()
     shotNum = int(fromNodePath.getNetTag('shotNum'))
     if shotNum not in self.shipsHitByShotNum:
         self.shipsHitByShotNum[shotNum] = []
         self.removeShotNumTasks.append(
             taskMgr.doMethodLater(5.0,
                                   self.removeShotNumTask,
                                   self.uniqueName('removeShotNum%s' %
                                                   shotNum),
                                   extraArgs=[shotNum]))
     if ship.doId in self.shipsHitByShotNum[shotNum]:
         return
     self.shipsHitByShotNum[shotNum].append(ship.doId)
     return DistributedIslandCannon.simpleShipHit(self, hitObject, entry,
                                                  skillId, ammoSkillId)