示例#1
0
    def __init__(self):
        __metaclass__ = ABCMeta
        DirectObject.__init__(self)
        BaseAttack.__init__(self)
        self.avatar = None
        self.gag = None
        self.target = None
        self.splat = None
        self.splatPos = None
        self.state = GagState.LOADED
        self.woosh = None
        self.handJoint = None
        self.equipped = False
        self.index = None
        self.id = GagGlobals.getIDByName(self.name)
        self.timeout = 5
        self.animTrack = None
        self.holdGag = True

        # Handles the new recharging for certain gags.

        # The time it takes (in seconds) to recharge this gag.
        self.rechargeTime = 0

        # The elapsed time of the current recharge. Should be a float
        self.rechargeElapsedTime = 0

        if metadata.PROCESS == 'client':
            if self.gagType == GagType.THROW:
                self.woosh = base.audio3d.loadSfx(GagGlobals.PIE_WOOSH_SFX)
            self.hitSfx = base.audio3d.loadSfx(self.hitSfxPath)
            self.drawSfx = base.audio3d.loadSfx(GagGlobals.DEFAULT_DRAW_SFX)
 def cleanup(self):
     if self.glowTrack:
         self.glowTrack.finish()
     self.glowTrack = None
     if self.glow:
         self.glow.removeNode()
     self.glow = None
     BaseAttack.cleanup(self)
    def cleanup(self):
        if hasattr(self, 'eyeSfx') and self.eyeSfx:
            base.audio3d.detachSound(self.eyeSfx)
            del self.eyeSfx

        if hasattr(self, 'eyeRoot') and self.eyeRoot:
            self.eyeRoot.removeNode()
            del self.eyeRoot

        BaseAttack.cleanup(self)
示例#4
0
    def equip(self):
        if not BaseAttack.equip(self):
            return False

        if not self.sprayOnlySfx:
            self.sprayOnlySfx = base.loadSfxOnNode(self.SprayOnlyPath,
                                                   self.avatar)

        if not self.coolerAppearSfx:
            self.coolerAppearSfx = base.loadSfxOnNode(self.CoolerAppearPath,
                                                      self.avatar)

        if not self.sprayMdl:
            self.sprayMdl = loader.loadModel(self.SprayPath)
            self.sprayMdl.setTransparency(1)
            self.sprayMdl.setColor(0.75, 0.75, 1.0, 0.8)
            self.sprayMdl.setScale(0.3, 1.0, 0.3)
            self.sprayMdl.setLightOff()
            self.sprayMdl.reparentTo(self.model.find('**/joint_toSpray'))
            self.sprayMdl.hide()

        if not self.splash:
            self.splash = CIGlobals.makeSplat(Point3(0),
                                              (0.75, 0.75, 1.0, 0.8), 0.3,
                                              None)

        return True
示例#5
0
 def unEquip(self):
     if not BaseAttack.unEquip(self):
         return False
         
     self.avatar.doingActivity = False
         
     return True
示例#6
0
    def equip(self):
        if not BaseAttack.equip(self):
            return False

        if not self.pickSound:
            self.pickSound = base.loadSfxOnNode(self.PickSoundPath, self.avatar)

        return True
    def equip(self):
        if not BaseAttack.equip(self):
            return False

        if not self.eyeSfx:
            self.eyeSfx = base.loadSfxOnNode(self.EyeSoundPath, self.avatar)

        return True
示例#8
0
    def cleanup(self):
        if hasattr(self, 'sprayOnlySfx') and self.sprayOnlySfx:
            base.audio3d.detachSound(self.sprayOnlySfx)
            del self.sprayOnlySfx

        if hasattr(self, 'coolerAppearSfx') and self.coolerAppearSfx:
            base.audio3d.detachSound(self.coolerAppearSfx)
            del self.coolerAppearSfx

        if hasattr(self, 'sprayMdl'):
            if self.sprayMdl:
                self.sprayMdl.removeNode()
            del self.sprayMdl

        if hasattr(self, 'splash') and self.splash:
            self.splash.cleanup()
            del self.splash

        BaseAttack.cleanup(self)
    def __init__(self, sharedMetadata=None):
        metadata = {}
        metadata.update(GenericMetadata)
        if sharedMetadata:
            metadata.update(sharedMetadata)
        BaseAttack.__init__(self, metadata)

        self.suitType2ReleaseFrame = {
            SuitType.A: {
                'throw-paper': 73,
                'throw-object': 73
            },
            SuitType.B: {
                'throw-paper': 73,
                'throw-object': 75
            },
            SuitType.C: {
                'throw-paper': 57,
                'throw-object': 56
            }
        }
示例#10
0
 def cleanup(self):
     base.audio3d.detachSound(self.pickSound)
     del self.pickSound
     BaseAttack.cleanup(self)
示例#11
0
 def __init__(self):
     BaseAttack.__init__(self)
     self.pickSound = None
 def __init__(self):
     BaseAttack.__init__(self)
     self.glowTrack = None
     self.glow = None
    def load(self):
        self.eyeRoot = self.avatar.attachNewNode('eyeRoot')
        self.eyeRoot.setPos(self.EyeOrigin)

        BaseAttack.load(self)
示例#14
0
 def cleanup(self):
     if hasattr(self, 'pickSound') and self.pickSound:
         base.audio3d.detachSound(self.pickSound)
     del self.pickSound
     BaseAttack.cleanup(self)
示例#15
0
    def equip(self):
        if not BaseAttack.equip(self):
            return False

        return True
示例#16
0
 def __init__(self):
     BaseAttack.__init__(self)
     self.sprayOnlySfx = None
     self.coolerAppearSfx = None
     self.sprayMdl = None
     self.splash = None
 def __init__(self):
     BaseAttack.__init__(self, EvilEyeShared.Metadata)
     self.eyeSfx = None
     self.eyeRoot = None