Exemplo n.º 1
0
    def __init__(self, cr):
        DistributedWeapon.__init__(self, cr)
        DistributedShippart.__init__(self, cr)
        self.baseVel = Vec3(0)
        self.setPos(0, 0, 0)
        self.ball = None
        self.baseTeam = 0
        self.prop = None
        self.av = None
        self.ammoType = 0
        self.shotNum = 0
        self.leftBroadside = []
        self.rightBroadside = []
        self.leftBroadsideConfig = []
        self.rightBroadsideConfig = []
        self.rightPlayShots = []
        self.leftPlayShots = []
        self.collisionLists = {}
        self.listening = False
        if not self.localFireSfx:
            for file in localFireSfxNames:
                self.localFireSfx.append(file)

        if not self.distFireSfx:
            for file in distFireSfxNames:
                self.distFireSfx.append(file)

        self.aimAITrack = None
        if __dev__ and config.GetBool('want-broadside-assist', 0):
            self.tracker = loader.loadModel('models/effects/explosion_sphere')
            self.tracker.reparentTo(render)
            self.tracker.setScale(30)
 def __init__(self, cr):
     DistributedWeapon.__init__(self, cr)
     DistributedShippart.__init__(self, cr)
     self.baseVel = Vec3(0)
     self.setPos(0, 0, 0)
     self.ball = None
     self.baseTeam = 0
     self.prop = None
     self.av = None
     self.ammoType = 0
     self.shotNum = 0
     self.leftBroadside = []
     self.rightBroadside = []
     self.leftBroadsideConfig = []
     self.rightBroadsideConfig = []
     self.rightPlayShots = []
     self.leftPlayShots = []
     self.collisionLists = { }
     self.listening = False
     if not self.localFireSfx:
         for file in localFireSfxNames:
             self.localFireSfx.append(file)
         
     
     if not self.distFireSfx:
         for file in distFireSfxNames:
             self.distFireSfx.append(file)
         
     
     self.aimAITrack = None
     if __dev__ and config.GetBool('want-broadside-assist', 0):
         self.tracker = loader.loadModel('models/effects/explosion_sphere')
         self.tracker.reparentTo(render)
         self.tracker.setScale(30)
 def disable(self):
     self.ignoreAll()
     self.av = None
     self.effectNode.removeNode()
     self.effectNode = None
     taskMgr.remove(self.getTrailTaskName())
     if self.aimAITrack:
         self.aimAITrack.pause()
         self.aimAITrack = None
     
     DistributedWeapon.disable(self)
     DistributedShippart.disable(self)
Exemplo n.º 4
0
    def disable(self):
        self.ignoreAll()
        self.av = None
        self.effectNode.removeNode()
        self.effectNode = None
        taskMgr.remove(self.getTrailTaskName())
        if self.aimAITrack:
            self.aimAITrack.pause()
            self.aimAITrack = None

        DistributedWeapon.disable(self)
        DistributedShippart.disable(self)
    def completeCannonCheck(self):
        for colList in self.collisionLists.values():
            colList.sort()
            ammo = colList[0][1].getFromNodePath().getPythonTag('ammo')
            if not ammo or ammo.destroyed:
                continue
            for entryData in colList:
                DistributedWeapon.projectileHitObject(self, entryData[1])
                if ammo.destroyed:
                    break

        self.collisionLists = {}
        self.listening = False
 def completeCannonCheck(self):
     for colList in self.collisionLists.values():
         colList.sort()
         ammo = colList[0][1].getFromNodePath().getPythonTag('ammo')
         if not ammo or ammo.destroyed:
             continue
         
         for entryData in colList:
             DistributedWeapon.projectileHitObject(self, entryData[1])
             if ammo.destroyed:
                 break
                 continue
         
     
     self.collisionLists = { }
     self.listening = False
 def delete(self):
     for i in self.leftPlayShots:
         i.pause()
     
     del self.leftPlayShots
     for i in self.rightPlayShots:
         i.pause()
     
     del self.rightPlayShots
     del self.rightBroadside
     del self.leftBroadside
     del self.rightBroadsideConfig
     del self.leftBroadsideConfig
     self.ignoreAll()
     self.removeNode()
     if self.ship.broadside:
         self.ship.broadside[1] = None
     
     DistributedWeapon.delete(self)
     DistributedShippart.delete(self)
Exemplo n.º 8
0
    def delete(self):
        for i in self.leftPlayShots:
            i.pause()

        del self.leftPlayShots
        for i in self.rightPlayShots:
            i.pause()

        del self.rightPlayShots
        del self.rightBroadside
        del self.leftBroadside
        del self.rightBroadsideConfig
        del self.leftBroadsideConfig
        self.ignoreAll()
        self.removeNode()
        if self.ship.broadside:
            self.ship.broadside[1] = None

        DistributedWeapon.delete(self)
        DistributedShippart.delete(self)
 def announceGenerate(self):
     self.effectNode = NodePath(ModelNode('broadside-%d-effects' % self.doId))
     self.effectNode.reparentTo(self)
     DistributedWeapon.announceGenerate(self)
     DistributedShippart.announceGenerate(self)
 def generate(self):
     DistributedWeapon.generate(self)
     DistributedShippart.generate(self)
Exemplo n.º 11
0
 def announceGenerate(self):
     self.effectNode = NodePath(
         ModelNode('broadside-%d-effects' % self.doId))
     self.effectNode.reparentTo(self)
     DistributedWeapon.announceGenerate(self)
     DistributedShippart.announceGenerate(self)
Exemplo n.º 12
0
 def generate(self):
     DistributedWeapon.generate(self)
     DistributedShippart.generate(self)