Ejemplo n.º 1
0
 def delete(self):
     try:
         self.DistributedAvatar_deleted
     except:
         self.DistributedAvatar_deleted = 1
         Avatar.delete(self)
         DistributedActor.delete(self)
Ejemplo n.º 2
0
 def __init__(self, cr):
     try:
         self.DistributedAvatar_initialized
         return None
     except:
         self.DistributedAvatar_initialized = 1
     DistributedActor.__init__(self, cr)
Ejemplo n.º 3
0
 def disable(self):
     try:
         del self.DistributedAvatar_announced
     except:
         return None
     self.reparentTo(hidden)
     self.disableBodyCollisions()
     DistributedActor.disable(self)
Ejemplo n.º 4
0
 def delete(self):
     DistributedActor.delete(self)
     self.health = None
     self.maxHealth = None
     self.healthLabel = None
     self.healthLabelTrack = None
     self.hood = None
     self.place = None
     return
Ejemplo n.º 5
0
 def generate(self):
     DistributedActor.generate(self)
     if not self.isLocal():
         self.addActive()
         self.considerUnderstandable()
     self.setParent(OTPGlobals.SPHidden)
     self.setTag('avatarDoId', str(self.doId))
     self.accept('nameTagShowAvId', self.__nameTagShowAvId)
     self.accept('nameTagShowName', self.__nameTagShowName)
Ejemplo n.º 6
0
 def announceGenerate(self):
     try:
         self.DistributedAvatar_announced
         return
     except:
         self.DistributedAvatar_announced = 1
     if not self.isLocal():
         self.initializeBodyCollisions('distAvatarCollNode-' + str(self.doId))
     DistributedActor.announceGenerate(self)
 def do_setParent(self, parentToken):
     if not self.isDisabled():
         if parentToken == OTPGlobals.SPHidden:
             self.nametag2dDist &= ~Nametag.CName
         else:
             self.nametag2dDist |= Nametag.CName
         self.nametag.getNametag2d().setContents(self.nametag2dContents & self.nametag2dDist)
         DistributedActor.do_setParent(self, parentToken)
         self.__setTags()
Ejemplo n.º 8
0
 def do_setParent(self, parentToken):
     if not self.isDisabled():
         nametag2d = self.nametag.getNametag2d()
         if parentToken == OTPGlobals.SPHidden:
             nametag2d.hideNametag()
         else:
             nametag2d.showNametag()
         nametag2d.update()
         DistributedActor.do_setParent(self, parentToken)
         self.__setTags()
    def __init__(self, cr):

        try:
            return None
        except:
            self.DistributedAvatar_initialized = 1

        Avatar.__init__(self)
        DistributedActor.__init__(self, cr)
        self.hpText = None
        self.hp = None
        self.maxHp = None
Ejemplo n.º 10
0
    def __init__(self, cr):
        try:
            self.DistributedAvatar_initialized
            return
        except:
            self.DistributedAvatar_initialized = 1

        Avatar.__init__(self)
        DistributedActor.__init__(self, cr)
        self.hpText = None
        self.hpTextSeq = None
        self.hp = None
        self.maxHp = None
        return
 def __init__(self, cr):
     try:
         self.DistributedAvatar_initialized
         return
     except:
         self.DistributedAvatar_initialized = 1
     Avatar.__init__(self)
     DistributedActor.__init__(self, cr)
     self.health = 0
     self.maxHealth = 0
     self.healthLabel = None
     self.healthLabelTrack = None
     self.place = 0
     self.hood = None
     return
    def disable(self):
        try:
            del self.DistributedAvatar_announced
            return
        except:
            self.DistributedAvatar_announced = 1

        self.reparentTo(hidden)
        self.removeActive()
        self.disableBodyCollisions()
        self.hideHpText()
        self.hp = None
        self.ignore('nameTagShowAvId')
        self.ignore('nameTagShowName')
        DistributedActor.disable(self)
Ejemplo n.º 13
0
    def disable(self):
        try:
            del self.DistributedAvatar_announced
        except:
            return

        self.reparentTo(hidden)
        self.removeActive()
        self.disableBodyCollisions()
        self.hideHpText()
        self.hp = None
        self.ignore('nameTagShowAvId')
        self.ignore('nameTagShowName')
        DistributedActor.disable(self)
        return
    def do_setParent(self, parentToken):
        """do_setParent(self, int parentToken)

        This overrides a function defined in DistributedNode to
        reparent the node somewhere.  A DistributedAvatar wants to
        hide the onscreen nametag when the parent is hidden.
        """
        if not self.isDisabled():
            if parentToken == OTPGlobals.SPHidden:
                self.nametag2dDist &= ~Nametag.CName
            else:
                self.nametag2dDist |= Nametag.CName
            self.nametag.getNametag2d().setContents(self.nametag2dContents
                                                    & self.nametag2dDist)
            DistributedActor.do_setParent(self, parentToken)
            self.__setTags()
Ejemplo n.º 15
0
    def __init__(self, cr):
        try:
            self.DistributedAvatar_initialized
            return
        except:
            self.DistributedAvatar_initialized = 1

        Avatar.__init__(self)
        DistributedActor.__init__(self, cr)
        self.health = 0
        self.maxHealth = 0
        self.healthLabel = None
        self.healthLabelTrack = None
        self.place = 0
        self.hood = None
        return
    def __init__(self, cr):
        """
        Handle distributed updates
        """
        try:
            self.DistributedAvatar_initialized
            return
        except:
            self.DistributedAvatar_initialized = 1

        Avatar.__init__(self)
        DistributedActor.__init__(self, cr)

        # The node that shows the number of hp just gained or lost
        self.hpText = None
        self.hp = None
        self.maxHp = None
    def generate(self):
        """
        This method is called when the DistributedObject is reintroduced
        to the world, either for the first time or from the cache.
        """

        DistributedActor.generate(self)
        if not self.isLocal():
            self.addActive()
            self.considerUnderstandable()

        # Initially, a DistributedAvatar is always parented to hidden
        # on generate, until we are told otherwise.
        self.setParent(OTPGlobals.SPHidden)

        # Now that we have a doId, set a tag so others who find us in
        # the collision system can figure out what avatar they hit.
        self.setTag('avatarDoId', str(self.doId))
        self.accept("nameTagShowAvId", self.__nameTagShowAvId)
        self.accept("nameTagShowName", self.__nameTagShowName)
    def disable(self):
        """
        This method is called when the DistributedObject is removed from
        active duty and stored in a cache.
        """
        try:
            del self.DistributedAvatar_announced
        except:
            return
        self.reparentTo(hidden)
        self.removeActive()
        self.disableBodyCollisions()
        self.hideHpText()
        # By setting hp to None, when the distributed avatar is "uncached",
        # and the hp gets set, it will be as if the avatar is new, and no
        # number will appear over his head. If we don't set this to None,
        # the setHp call might think that the number has changed and call
        # showHpText, which we don't want.
        self.hp = None
        self.ignore("nameTagShowAvId")
        self.ignore("nameTagShowName")

        DistributedActor.disable(self)
Ejemplo n.º 19
0
 def generate(self):
     DistributedActor.generate(self)
Ejemplo n.º 20
0
 def generate(self):
     DistributedActor.generate(self)
     self.setParent(SPRender)
Ejemplo n.º 21
0
 def do_setParent(self, parentToken):
     if not self.isDisabled():
         DistributedActor.do_setParent(self, parentToken)
 def announceGenerate(self):
     DistributedActor.announceGenerate(self)
     self.setPythonTag('avatar', self.doId)
     self.setupHealthLabel()
     self.setParent(CIGlobals.SPHidden)
     self.setBlend(frameBlend=True)
 def generate(self):
     DistributedActor.generate(self)
Ejemplo n.º 24
0
 def disable(self):
     DistributedActor.disable(self)
     self.stopMovingHealthLabel()
     self.detachNode()
 def disable(self):
     DistributedActor.disable(self)
     self.stopMovingHealthLabel()
     self.detachNode()
     return
Ejemplo n.º 26
0
 def announceGenerate(self):
     DistributedActor.announceGenerate(self)
     self.setPythonTag('avatar', self.doId)
     self.setupHealthLabel()
     self.setParent(CIGlobals.SPHidden)