Example #1
0
 def setEquippedAttack(self, attackID):
     try:
         self.backpack.setCurrentGag(attackID)
     except:
         # If we couldn't do this, it means that the avatar was most likely disabled.
         pass
     DistributedToon.setEquippedAttack(self, attackID)
Example #2
0
 def disable(self):
     if self.tunnelTrack:
         self.ignore(self.tunnelTrack.getDoneEvent())
         self.tunnelTrack.finish()
         self.tunnelTrack = None
     self.role = None
     self.ghost = None
     self.puInventory = None
     self.equippedPU = None
     if self.backpack:
         self.backpack.cleanup()
         self.backpack = None
     self.firstTimeChangingHP = None
     self.quests = None
     self.tier = None
     self.questHistory = None
     self.busy = None
     self.friends = None
     self.tutDone = None
     self.hoodsDiscovered = None
     self.teleportAccess = None
     self.lastHood = None
     self.defaultShard = None
     self.trackExperience = None
     self.destroyBattleMeter()
     DistributedToon.disable(self)
Example #3
0
    def __init__(self, cr):
        try:
            self.DistributedPlayerToon_initialized
            return
        except:
            self.DistributedPlayerToon_initialized = 1
        DistributedToon.__init__(self, cr)
        DistributedPlayerToonShared.__init__(self)
        self.role = None
        self.ghost = 0
        self.puInventory = []
        self.equippedPU = -1
        self.backpack = Backpack(self)
        self.battleMeter = None

        # Quest-related variables.
        self.quests = ""
        self.tier = None
        self.questHistory = None

        self.busy = 1
        self.friends = None
        self.tutDone = 0
        self.hoodsDiscovered = []
        self.teleportAccess = []
        self.lastHood = 0
        self.defaultShard = 0
        self.tunnelTrack = None
        self.trackExperience = dict(GagGlobals.DefaultTrackExperiences)
        return
Example #4
0
 def updateAttackAmmo(self, gagId, ammo, maxAmmo, ammo2, maxAmmo2, clip,
                      maxClip):
     if self.useBackpack():
         self.backpack.setSupply(gagId, ammo)
     else:
         DistributedToon.updateAttackAmmo(self, gagId, ammo, maxAmmo, ammo2,
                                          maxAmmo2, clip, maxClip)
Example #5
0
    def delete(self):
        try:
            self.DistributedPlayerToon_deleted
        except:
            self.DistributedPlayerToon_deleted = 1
            DistributedPlayerToonShared.delete(self)

            del self.tunnelTrack
            del self.role
            del self.ghost
            del self.puInventory
            del self.equippedPU
            del self.backpack
            del self.quests
            del self.tier
            del self.questHistory
            del self.busy
            del self.friends
            del self.tutDone
            del self.hoodsDiscovered
            del self.teleportAccess
            del self.lastHood
            del self.defaultShard
            del self.trackExperience
            del self.battleMeter
            DistributedToon.delete(self)
        return
    def announceGenerate(self):
        DistributedEntity.announceGenerate(self)
        DistributedToon.announceGenerate(self)
        self.activateSmoothing(True, False)
        self.startSmooth()

        self.reparentTo(render)

        self.setAnimState('Happy')
Example #7
0
    def announceGenerate(self):
        DistributedToon.announceGenerate(self)

        self.bodyNP.setPythonTag('useableObject', self)

        self.startSmooth()

        self.reparentTo(render)

        self.setAnimState('Happy')
Example #8
0
    def setAccessLevel(self, value):
        prevLevel = self.getAccessLevel()
        self.role = AdminCommands.Roles.get(value, None)

        if prevLevel != AdminCommands.NoAccess:
            # Let's remove any tokens that already are showing up.
            DistributedToon.removeAdminToken(self)

        if self.role:
            # Let's put a new token above our head.
            DistributedToon.setAdminToken(self, self.role.token)
Example #9
0
 def setHealth(self, health):
     self.handleHealthChange(health, self.getHealth())
     DistributedToon.setHealth(self, health)
     if self.doId != base.localAvatar.doId:
         if not self.firstTimeChangingHP:
             if health < self.getMaxHealth():
                 if not self.headMeter:
                     self.__makeHeadMeter()
                 else:
                     self.__updateHeadMeter()
             else:
                 self.__removeHeadMeter()
     self.firstTimeChangingHP = False
Example #10
0
    def __init__(self, cr):
        try:
            self.DistributedPlayerToon_initialized
            return
        except:
            self.DistributedPlayerToon_initialized = 1
        DistributedToon.__init__(self, cr)
        DistributedPlayerToonShared.__init__(self)
        self.role = None
        self.ghost = 0
        self.puInventory = []
        self.equippedPU = -1
        self.backpack = Backpack(self)
        self.battleMeter = None
        self.headMeter = None
        self.firstTimeChangingHP = True

        # Quest-related variables.
        self.quests = ""
        self.tier = None
        self.questHistory = None

        self.busy = 1
        self.friends = None
        self.tutDone = 0
        self.hoodsDiscovered = []
        self.teleportAccess = []
        self.lastHood = 0
        self.defaultShard = 0
        self.tunnelTrack = None
        self.trackExperience = dict(GagGlobals.DefaultTrackExperiences)

        self.takeDmgSfx = base.audio3d.loadSfx(
            'phase_5/audio/sfx/tt_s_ara_cfg_toonHit.ogg')
        base.audio3d.attachSoundToObject(self.takeDmgSfx, self)
        return
Example #11
0
 def __init__(self, cr):
     DistributedToon.__init__(self, cr)
     Useable.__init__(self)
Example #12
0
 def announceHealthAndPlaySound(self, level, hp, extraId = -1):
     DistributedToon.announceHealth(self, level, hp, extraId)
     hpSfx = base.audio3d.loadSfx('phase_11/audio/sfx/LB_toonup.ogg')
     base.audio3d.attachSoundToObject(hpSfx, self)
     SoundInterval(hpSfx, node = self).start()
     del hpSfx
Example #13
0
 def delete(self):
     DistributedToon.delete(self)
Example #14
0
 def disable(self):
     self.stopSmooth()
     DistributedToon.disable(self)
Example #15
0
 def generate(self):
     DistributedToon.generate(self)
Example #16
0
 def setupNameTag(self, tempName=None):
     DistributedToon.setupNameTag(self, tempName)
     self.nametag.setNametagColor(
         NametagGlobals.NametagColors[NametagGlobals.CCNPC])
     self.nametag.setActive(0)
     self.nametag.updateAll()
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     DistributedToon.__init__(self, cr)
 def delete(self):
     DistributedEntity.delete(self)
     DistributedToon.delete(self)
Example #19
0
 def disable(self):
     self.money = None
     DistributedToon.disable(self)
Example #20
0
 def __init__(self, cr):
     DistributedToon.__init__(self, cr)
     self.money = 0
Example #21
0
 def stopSmooth(self):
     DistributedToon.stopSmooth(self)
     localAvatarReachable = (hasattr(base, 'localAvatar') and base.localAvatar)
     if localAvatarReachable and self.doId != base.localAvatar.doId:
         self.resetTorsoRotation()
Example #22
0
 def setMaxHealth(self, hp):
     DistributedToon.setMaxHealth(self, hp)
     self.laffMeter.updateMeterNewMax(hp)
Example #23
0
 def setChat(self, chat):
     chat = ChatGlobals.filterChat(chat, self.animal)
     DistributedToon.setChat(self, chat)
 def generate(self):
     DistributedEntity.generate(self)
     DistributedToon.generate(self)