def initToonState(self):
        if self.name in NPCToons.ClerkPositions:
            self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId),
                           rental=True)

        self.setAnimState('neutral', 0.9, None, None)
        self.updatePosition()
Exemplo n.º 2
0
 def checkBoard(self, av):
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.zone)
     if av.hp < self.minLaff:
         return REJECT_MINLAFF
     if not av.readyForPromotion(dept):
         return REJECT_PROMOTION
     return 0
 def checkBoard(self, av):
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.zone)
     if av.hp < self.minLaff:
         return REJECT_MINLAFF
     if not av.readyForPromotion(dept):
         return REJECT_PROMOTION
     return 0
Exemplo n.º 4
0
 def __init__(self, air, bldg, mintId, antiShuffle=0, minLaff=0):
     DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(
         self, air, bldg, antiShuffle=antiShuffle, minLaff=minLaff)
     self.mintId = mintId
     self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId)
     self.type = ELEVATOR_MINT
     self.countdownTime = ElevatorData[self.type]['countdown']
    def initToonState(self):
        self.setAnimState('neutral', 0.9, None, None)
        self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId), rental=True)

        if self.name in NPCToons.LaffRestockPositions:
            pos = NPCToons.LaffRestockPositions[self.name]
            self.setPos(*pos[0])
            self.setH(pos[1])
Exemplo n.º 6
0
    def setFromAvatar(self, av):
        rewardIds = []
        for q in av.quests:
            questId, fromNpcId, toNpcId, rewardId, toonProgress = q
            if rewardId == Quests.NA:
                rewardId = Quests.getFinalRewardId(questId, fAll=1)
            rewardIds.append(rewardId)

        self.notify.debug('Ignoring rewards: %s' % rewardIds)
        self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
        fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % fishHp)
        self.maxHp += fishHp
        flowerHp = int(
            len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % flowerHp)
        self.maxHp += flowerHp
        HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(
            ToontownGlobals.SellbotHQ),
                   ToontownGlobals.cogHQZoneId2deptIndex(
                       ToontownGlobals.LawbotHQ),
                   ToontownGlobals.cogHQZoneId2deptIndex(
                       ToontownGlobals.CashbotHQ))
        levels = av.getCogLevels()
        cogTypes = av.getCogTypes()
        suitHp = 0
        for dept in HQdepts:
            level = levels[dept]
            type = cogTypes[dept]
            if type >= SuitDNA.suitsPerDept - 1:
                for milestoneLevel in ToontownGlobals.CogSuitHPLevels:
                    if level >= milestoneLevel:
                        suitHp += 1
                    else:
                        break

        self.notify.debug('Adding %s hp for cog suits' % suitHp)
        self.maxHp += suitHp
        kartingHp = int(
            av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
        self.maxHp += kartingHp
        golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for golf trophies' % golfHp)
        self.maxHp += golfHp
    def initToonState(self):
        self.setAnimState('neutral', 0.9, None, None)
        self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId),
                       rental=True)

        if self.name in NPCToons.LaffRestockPositions:
            pos = NPCToons.LaffRestockPositions[self.name]
            self.setPos(*pos[0])
            self.setH(pos[1])
    def setFromAvatar(self, av):
        rewardIds = []
        for q in av.quests:
            questId, fromNpcId, toNpcId, rewardId, toonProgress = q
            if rewardId == Quests.NA:
                rewardId = Quests.getFinalRewardId(questId, fAll=1)
            rewardIds.append(rewardId)

        self.notify.debug('Ignoring rewards: %s' % rewardIds)
        self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
        fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % fishHp)
        self.maxHp += fishHp
        flowerHp = int(len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
        self.notify.debug('Adding %s hp for fish collection' % flowerHp)
        self.maxHp += flowerHp
        HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.SellbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.LawbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.CashbotHQ))
        levels = av.getCogLevels()
        cogTypes = av.getCogTypes()
        suitHp = 0
        for dept in HQdepts:
            level = levels[dept]
            type = cogTypes[dept]
            if type >= SuitDNA.suitsPerDept - 1:
                for milestoneLevel in ToontownGlobals.CogSuitHPLevels:
                    if level >= milestoneLevel:
                        suitHp += 1
                    else:
                        break

        self.notify.debug('Adding %s hp for cog suits' % suitHp)
        self.maxHp += suitHp
        kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
        self.maxHp += kartingHp
        golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
        self.notify.debug('Adding %s hp for golf trophies' % golfHp)
        self.maxHp += golfHp
 def handleToonsWon(self, toons):
     extraMerits = [0, 0, 0, 0]
     amount = ToontownGlobals.CountryClubCogBuckRewards[self.level.countryClubId]
     index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.countryClubId)
     extraMerits[index] = amount
     for toon in toons:
         recovered, notRecovered = self.air.questManager.recoverItems(toon, self.suitsKilled, self.getTaskZoneId())
         self.toonItems[toon.doId][0].extend(recovered)
         self.toonItems[toon.doId][1].extend(notRecovered)
         meritArray = self.air.promotionMgr.recoverMerits(toon, self.suitsKilled, self.getTaskZoneId(), getCountryClubCreditMultiplier(self.getTaskZoneId()), extraMerits=extraMerits)
         if toon.doId in self.helpfulToons:
             self.toonMerits[toon.doId] = addListsByValue(self.toonMerits[toon.doId], meritArray)
         else:
             self.notify.debug('toon %d not helpful list, skipping merits' % toon.doId)
Exemplo n.º 10
0
 def requestExit(self):
     avatarID = self.air.getAvatarIdFromSender()
     if avatarID in self.avatarsWhoAreEntering:
         del self.avatarsWhoAreEntering[avatarID]
     if avatarID not in self.avatarsWhoAreExiting:
         dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
         self.avatarsWhoAreExiting[avatarID] = 1
         self.sendUpdate('avatarExit', [avatarID])
         self.openDoor(self.exitDoorFSM)
         if self.lockedDoor:
             av = self.air.doId2do[avatarID]
             if self.doorType == DoorTypes.EXT_COGHQ:
                 av.b_setCogIndex(-1)
             else:
                 av.b_setCogIndex(dept)
 def requestEnter(self):
     avId = self.air.getAvatarIdFromSender()
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
     av = self.air.doId2do.get(avId)
     if av:
         if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
             parts = av.getCogParts()
             if CogDisguiseGlobals.isSuitComplete(parts, dept):
                 allowed = 1
             else:
                 allowed = 0
         else:
             allowed = 1
         if not allowed:
             self.sendReject(avId, self.isLockedDoor())
         else:
             print("********\nRequesting Lobby GUI...\n********")
             self.sendUpdate('selectLobby', [avId])
Exemplo n.º 12
0
 def requestEnter(self):
     avId = self.air.getAvatarIdFromSender()
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
     av = self.air.doId2do.get(avId)
     if av:
         if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
             parts = av.getCogParts()
             if CogDisguiseGlobals.isSuitComplete(parts, dept):
                 allowed = 1
             else:
                 allowed = 0
         else:
             allowed = 1
         if not allowed:
             self.sendReject(avId, self.isLockedDoor())
         else:
             print("********\nRequesting Lobby GUI...\n********")
             self.sendUpdate('selectLobby', [avId])
Exemplo n.º 13
0
 def requestEnter(self):
     avatarID = self.air.getAvatarIdFromSender()
     dept = ToontownGlobals.cogHQZoneId2deptIndex(self.destinationZone)
     av = self.air.doId2do.get(avatarID)
     if av:
         if self.doorType == DoorTypes.EXT_COGHQ and self.isLockedDoor():
             parts = av.getCogParts()
             if CogDisguiseGlobals.isSuitComplete(parts, dept):
                 allowed = 1
             else:
                 allowed = 0
         else:
             allowed = 1
         if not allowed:
             self.sendReject(avatarID, self.isLockedDoor())
         else:
             self.enqueueAvatarIdEnter(avatarID)
             self.sendUpdateToAvatarId(avatarID, 'setOtherZoneIdAndDoId', [self.destinationZone, self.otherDoor.getDoId()])
 def handleToonsWon(self, toons):
     extraMerits = [0, 0, 0, 0]
     amount = ToontownGlobals.MintCogBuckRewards[self.level.mintId]
     index = ToontownGlobals.cogHQZoneId2deptIndex(self.level.mintId)
     extraMerits[index] = amount
     for toon in toons:
         recovered, notRecovered = self.air.questManager.recoverItems(
             toon, self.suitsKilled, self.getTaskZoneId())
         self.toonItems[toon.doId][0].extend(recovered)
         self.toonItems[toon.doId][1].extend(notRecovered)
         meritArray = self.air.promotionMgr.recoverMerits(
             toon,
             self.suitsKilled,
             self.getTaskZoneId(),
             getMintCreditMultiplier(self.getTaskZoneId()),
             extraMerits=extraMerits)
         if toon.doId in self.helpfulToons:
             self.toonMerits[toon.doId] = addListsByValue(
                 self.toonMerits[toon.doId], meritArray)
         else:
             self.notify.debug('toon %d not helpful list, skipping merits' %
                               toon.doId)
 def __init__(self, air, bldg, mintId, antiShuffle = 0, minLaff = 0):
     DistributedElevatorExtAI.DistributedElevatorExtAI.__init__(self, air, bldg, antiShuffle=antiShuffle, minLaff=minLaff)
     self.mintId = mintId
     self.cogDept = ToontownGlobals.cogHQZoneId2deptIndex(self.mintId)
     self.type = ELEVATOR_MINT
     self.countdownTime = ElevatorData[self.type]['countdown']
    def initToonState(self):
        if self.name in NPCToons.ClerkPositions:
            self.putOnSuit(ToontownGlobals.cogHQZoneId2deptIndex(self.zoneId), rental=True)

        self.setAnimState('neutral', 0.9, None, None)
        self.updatePosition()