def __init__(self, other=None):
        try:
            self.Avatar_initialized
            return
        except:
            self.Avatar_initialized = 1

        Actor.__init__(self, None, None, other, flattenable=0, setFinal=1)
        self.setBlend(frameBlend=base.wantSmoothAnims)
        self.setLODAnimation(base.lodMaxRange, base.lodMinRange,
                             base.lodDelayFactor)
        ShadowCaster.__init__(self)
        self.name = ''
        self.npcType = None
        self.__font = OTPGlobals.getInterfaceFont()
        self.soundChatBubble = None
        self.avatarType = ''
        self.nametagNodePath = None
        self.__nameVisible = 1
        self.nametag = NametagGroup()
        self.nametag.setAvatar(self)
        interfaceFont = OTPGlobals.getInterfaceFont()
        self.nametag.setFont(interfaceFont)
        self.nametag.setChatFont(interfaceFont)
        self.nametag3d = self.attachNewNode('nametag3d')
        self.nametag3d.setTag('cam', 'nametag')
        self.nametag3d.setLightOff()
        if self.ManagesNametagAmbientLightChanged:
            self.acceptNametagAmbientLightChange()

        OTPRender.renderReflection(False, self.nametag3d, 'otp_avatar_nametag',
                                   None)
        self.getGeomNode().showThrough(OTPRender.ShadowCameraBitmask)
        self.nametag3d.hide(OTPRender.ShadowCameraBitmask)
        self.collTube = None
        self.battleTube = None
        self.scale = 1.0
        self.nametagScale = 1.0
        self.height = 0.0
        self.battleTubeHeight = 0.0
        self.battleTubeRadius = 0.0
        self.style = None
        self.commonChatFlags = 0
        self.understandable = 1
        self.setPlayerType(NametagGlobals.CCNormal)
        self.ghostMode = 0
        self.__chatParagraph = None
        self.__chatMessage = None
        self.__chatFlags = 0
        self.__chatPageNumber = None
        self.__chatAddressee = None
        self.__chatDialogueList = []
        self.__chatSet = 0
        self.__chatLocal = 0
        self.__chatQuitButton = False
        self.__currentDialogue = None
        self.whitelistChatFlags = 0
Beispiel #2
0
    def __init__(self, other=None):
        self._name = ''
        try:
            self.Avatar_initialized
            return
        except:
            self.Avatar_initialized = 1

        Actor.__init__(self, None, None, other, flattenable=0, setFinal=0)
        ShadowCaster.__init__(self)
        self.__font = OTPGlobals.getInterfaceFont()
        self.__speechFont = OTPGlobals.getInterfaceFont()
        self.soundChatBubble = None
        self.avatarType = ''
        self.nametagNodePath = None
        self.__nameVisible = 1
        self.nametag = NametagGroup()
        self.nametag.setAvatar(self)
        self.nametag.setFont(OTPGlobals.getInterfaceFont())
        self.nametag.setSpeechFont(OTPGlobals.getInterfaceFont())
        self.nametag2dContents = Nametag.CName | Nametag.CSpeech
        self.nametag2dDist = Nametag.CName | Nametag.CSpeech
        self.nametag2dNormalContents = Nametag.CName | Nametag.CSpeech
        self.nametag3d = self.attachNewNode('nametag3d')
        self.nametag3d.setTag('cam', 'nametag')
        self.nametag3d.setLightOff()
        if self.ManagesNametagAmbientLightChanged:
            self.acceptNametagAmbientLightChange()
        OTPRender.renderReflection(False, self.nametag3d, 'otp_avatar_nametag',
                                   None)
        self.getGeomNode().showThrough(OTPRender.ShadowCameraBitmask)
        self.nametag3d.hide(OTPRender.ShadowCameraBitmask)
        self.collTube = None
        self.battleTube = None
        self.scale = 1.0
        self.nametagScale = 1.0
        self.height = 0.0
        self.battleTubeHeight = 0.0
        self.battleTubeRadius = 0.0
        self.style = None
        self.commonChatFlags = 0
        self.understandable = 1
        self.setPlayerType(NametagGroup.CCNormal)
        self.ghostMode = 0
        self.__chatParagraph = None
        self.__chatMessage = None
        self.__chatFlags = 0
        self.__chatPageNumber = None
        self.__chatAddressee = None
        self.__chatDialogueList = []
        self.__chatSet = 0
        self.__chatLocal = 0
        self.__currentDialogue = None
        self.whitelistChatFlags = 0
        self.setBlend(
            frameBlend=config.GetBool('interpolate-animations', True))
        return
    def __init__(self, other = None):
        self.name = ''
        try:
            self.Avatar_initialized
            return
        except:
            self.Avatar_initialized = 1

        Actor.__init__(self, None, None, other, flattenable=0, setFinal=0)
        ShadowCaster.__init__(self)
        self.__font = OTPGlobals.getInterfaceFont()
        self.__speechFont = OTPGlobals.getInterfaceFont()
        self.soundChatBubble = None
        self.avatarType = ''
        self.nametagNodePath = None
        self.__nameVisible = 1
        self.nametag = NametagGroup()
        self.nametag.setAvatar(self)
        self.nametag.setFont(OTPGlobals.getInterfaceFont())
        self.nametag.setSpeechFont(OTPGlobals.getInterfaceFont())
        self.nametag2dContents = Nametag.CName | Nametag.CSpeech
        self.nametag2dDist = Nametag.CName | Nametag.CSpeech
        self.nametag2dNormalContents = Nametag.CName | Nametag.CSpeech
        self.nametag3d = self.attachNewNode('nametag3d')
        self.nametag3d.setTag('cam', 'nametag')
        self.nametag3d.setLightOff()
        if self.ManagesNametagAmbientLightChanged:
            self.acceptNametagAmbientLightChange()
        OTPRender.renderReflection(False, self.nametag3d, 'otp_avatar_nametag', None)
        self.getGeomNode().showThrough(OTPRender.ShadowCameraBitmask)
        self.nametag3d.hide(OTPRender.ShadowCameraBitmask)
        self.collTube = None
        self.battleTube = None
        self.scale = 1.0
        self.nametagScale = 1.0
        self.height = 0.0
        self.battleTubeHeight = 0.0
        self.battleTubeRadius = 0.0
        self.style = None
        self.commonChatFlags = 0
        self.understandable = 1
        self.setPlayerType(NametagGroup.CCNormal)
        self.ghostMode = 0
        self.__chatParagraph = None
        self.__chatMessage = None
        self.__chatFlags = 0
        self.__chatPageNumber = None
        self.__chatAddressee = None
        self.__chatDialogueList = []
        self.__chatSet = 0
        self.__chatLocal = 0
        self.__currentDialogue = None
        self.whitelistChatFlags = 0
        self.wantAdminTag = True
        return
 def delete(self):
     try:
         self.Avatar_deleted
     except:
         self.deleteNametag3d()
         Actor.cleanup(self)
         self.Avatar_deleted = 1
         del self.__font
         del self.style
         del self.soundChatBubble
         self.nametag.destroy()
         del self.nametag
         self.nametag3d.removeNode()
         ShadowCaster.delete(self)
         Actor.delete(self)
Beispiel #5
0
 def delete(self):
     try:
         self.Avatar_deleted
     except:
         self.deleteNametag3d()
         Actor.cleanup(self)
         if self.ManagesNametagAmbientLightChanged:
             self.ignoreNametagAmbientLightChange()
         self.Avatar_deleted = 1
         del self.__font
         del self.style
         del self.soundChatBubble
         del self.nametag
         self.nametag3d.removeNode()
         ShadowCaster.delete(self)
         Actor.delete(self)
Beispiel #6
0
 def delete(self):
     try:
         self.Avatar_deleted
     except:
         self.deleteNametag3d()
         Actor.cleanup(self)
         if self.ManagesNametagAmbientLightChanged:
             self.ignoreNametagAmbientLightChange()
         self.Avatar_deleted = 1
         del self.__font
         del self.style
         del self.soundChatBubble
         del self.nametag
         self.nametag3d.removeNode()
         ShadowCaster.delete(self)
         Actor.delete(self)
 def __init__(self, name, geom=None):
     an = ActorNode('flyingGagAN')
     NodePath.__init__(self, an)
     self.actorNode = an
     self.gag = None
     self.gagNode = None
     ShadowCaster.__init__(self, False)
     if geom:
         self.gagNode = self.attachNewNode('PieNode')
         self.gag = geom.copyTo(self.gagNode)
         self.gag.setScale(3)
         self.gagNode.setHpr(0, -45, 0)
         self.gagNode.setPos(0, 0, 2)
         self.initializeDropShadow()
         self.setActiveShadow()
         self.dropShadow.setPos(0, 0, 2)
         self.dropShadow.setScale(3)
Beispiel #8
0
 def __init__(self, name, geom = None):
     an = ActorNode('flyingGagAN')
     NodePath.__init__(self, an)
     self.actorNode = an
     self.gag = None
     self.gagNode = None
     ShadowCaster.__init__(self, False)
     if geom:
         self.gagNode = self.attachNewNode('PieNode')
         self.gag = geom.copyTo(self.gagNode)
         self.gag.setScale(3)
         self.gagNode.setHpr(0, -45, 0)
         self.gagNode.setPos(0, 0, 2)
         self.initializeDropShadow()
         self.setActiveShadow()
         self.dropShadow.setPos(0, 0, 2)
         self.dropShadow.setScale(3)
     return
    def __init__( self ,name,geom = None):
        # we need an actor node to do physics
        an = ActorNode("flyingGagAN")
        NodePath.__init__(self, an)
        self.actorNode = an
        self.gag = None
        self.gagNode = None

        ShadowCaster.__init__(self, False)
        if geom:
            self.gagNode = self.attachNewNode("PieNode")
            self.gag = geom.copyTo(self.gagNode)
            self.gag.setScale(3)
            self.gagNode.setHpr(0, -45, 0)
            self.gagNode.setPos(0, 0, 2)
            #self.gag = geom.copyTo(self)
            self.initializeDropShadow()
            self.setActiveShadow()
            self.dropShadow.setPos(0,0,2)
            self.dropShadow.setScale(3)
Beispiel #10
0
    def delete(self):
        try:
            self.Avatar_deleted
            return
        except:
            self.Avatar_deleted = 1

        self.setBlend(frameBlend=False)
        self.deleteNametag3d()
        Actor.cleanup(self)
        if self.ManagesNametagAmbientLightChanged:
            self.ignoreNametagAmbientLightChange()
        del self.__font
        del self.style
        del self.soundChatBubble
        self.nametag.destroy()
        del self.nametag
        self.nametag3d.removeNode()
        ShadowCaster.delete(self)
        Actor.delete(self)
Beispiel #11
0
 def __init__(self, other = None):
     Actor.__init__(self, None, None, other, flattenable=0, setFinal=1)
     ShadowCaster.__init__(self)
     self.__font = OTPGlobals.getInterfaceFont()
     self.name = ''
     self.soundChatBubble = None
     self.avatarType = ''
     self.nametagNodePath = None
     self.__nameVisible = 1
     self.nametag = NametagGroup()
     self.nametag.setAvatar(self)
     self.nametag.setFont(OTPGlobals.getInterfaceFont())
     self.nametag.setSpeechFont(OTPGlobals.getInterfaceFont())
     self.nametag2dContents = Nametag.CName | Nametag.CSpeech
     self.nametag2dDist = Nametag.CName | Nametag.CSpeech
     self.nametag2dNormalContents = Nametag.CName | Nametag.CSpeech
     self.nametag3d = self.attachNewNode('nametag3d')
     self.nametag3d.setTag('cam', 'nametag')
     self.nametag3d.setLightOff()
     self.getGeomNode().showThrough(OTPRender.ShadowCameraBitmask)
     self.nametag3d.hide(OTPRender.ShadowCameraBitmask)
     self.collTube = None
     self.scale = 1.0
     self.height = 0.0
     self.style = None
     self.understandable = 1
     self.setPlayerType(NametagGroup.CCNormal)
     self.ghostMode = 0
     self.__chatParagraph = None
     self.__chatMessage = None
     self.__chatFlags = 0
     self.__chatPageNumber = None
     self.__chatAddressee = None
     self.__chatDialogueList = []
     self.__chatSet = 0
     self.__chatLocal = 0
     self.__currentDialogue = None
     self.wantAdminTag = True
Beispiel #12
0
 def delete(self):
     ShadowCaster.delete(self)
     NodePath.remove(self)
     self.gag = None
     return
Beispiel #13
0
    def __init__(self, other=None):
        """
        Create the toon, suit, or char specified by the dna array
        """
        self.name = "" # name is used in debugPrint.
        assert self.debugPrint("Avatar()")
        try:
            self.Avatar_initialized
            return
        except:
            self.Avatar_initialized = 1

        # create an empty actor to add parts to
        Actor.__init__(self, None, None, other, flattenable = 0, setFinal = 1)
        ShadowCaster.__init__(self)

        # The default font.
        self.__font = OTPGlobals.getInterfaceFont()

        self.soundChatBubble = None

        # Holds Type of Avatar
        self.avatarType = ""

        self.nametagNodePath = None

        # Set up a nametag (actually, a group of nametags,
        # including a Nametag2d and a Nametag3d) for the avatar.
        # The nametag won't be visible until it is managed, which
        # will happen during addActive().
        self.__nameVisible = 1
        self.nametag = NametagGroup()
        self.nametag.setAvatar(self)
        self.nametag.setFont(OTPGlobals.getInterfaceFont())
        self.nametag2dContents = Nametag.CName | Nametag.CSpeech
        # nametag2dDist is changed only by DistributedAvatar.
        self.nametag2dDist = Nametag.CName | Nametag.CSpeech
        self.nametag2dNormalContents = Nametag.CName | Nametag.CSpeech

        self.nametag3d = self.attachNewNode('nametag3d')
        self.nametag3d.setTag('cam', 'nametag')
        self.nametag3d.setLightOff()

        #Accept ambient lighting changes
        if self.ManagesNametagAmbientLightChanged:
            self.acceptNametagAmbientLightChange()

        # do not display in reflections
        OTPRender.renderReflection (False, self.nametag3d, 'otp_avatar_nametag', None)

        # But do show in shadows, except for the nametag.
        self.getGeomNode().showThrough(OTPRender.ShadowCameraBitmask)
        self.nametag3d.hide(OTPRender.ShadowCameraBitmask)

        self.collTube = None
        self.battleTube = None

        # set some initial values
        self.scale = 1.0
        self.nametagScale = 1.0
        self.height = 0.0
        self.battleTubeHeight = 0.0
        self.battleTubeRadius = 0.0
        self.style = None

        # commonChatFlags is a bitmask that may include the CommonChat
        # and SuperChat bits.
        self.commonChatFlags = 0

        # This is either CCNonPlayer, CCSuit, or CCNormal,
        # according to whether there's a human behind the avatar
        # or not.  This determines the color nametag that is
        # assigned, as well as whether chat messages from this
        # avatar will be garbled.
        self.understandable = 1
        self.setPlayerType(NametagGroup.CCNormal)

        self.ghostMode = 0

        # Page chat private vars
        self.__chatParagraph = None
        self.__chatMessage = None
        self.__chatFlags = 0
        self.__chatPageNumber = None
        self.__chatAddressee = None
        self.__chatDialogueList = []
        self.__chatSet = 0
        self.__chatLocal = 0
        # Record current dialogue so it can be interrupted the
        # next time the avatar talks
        self.__currentDialogue = None

        # since whiteListChatFlags is not a required field, init it just in case
        self.whitelistChatFlags = 0
Beispiel #14
0
 def delete(self):
     ShadowCaster.delete(self)
     NodePath.remove(self)
     self.gag = None
     return
 def __init__(self, cr):
     ShadowCaster.__init__(self)
     DistributedSmoothNode.__init__(self, cr)
     NodePath.__init__(self, 'Projectile')
Beispiel #16
0
 def __init__(self, cr):
     ShadowCaster.__init__(self)
     DistributedSmoothNode.__init__(self, cr)
     NodePath.__init__(self, "Projectile")