Start on Fish Bingo

This commit is contained in:
DenialMC 2015-04-19 02:01:14 +03:00
parent 1364ee1021
commit 1ff86c076d
11 changed files with 60 additions and 89 deletions

View file

@ -23,6 +23,10 @@ class HolidayManagerAI:
# Halloween: Black Cat Day # Halloween: Black Cat Day
self.currentHolidays.append(ToontownGlobals.BLACK_CAT_DAY) self.currentHolidays.append(ToontownGlobals.BLACK_CAT_DAY)
if date.weekday() == 6:
# Saturday: Fish Bingo
self.currentHolidays.append(ToontownGlobals.SILLY_SATURDAY_BINGO)
simbase.air.newsManager.setHolidayIdList([self.currentHolidays]) simbase.air.newsManager.setHolidayIdList([self.currentHolidays])
def isHolidayRunning(self, holidayId): def isHolidayRunning(self, holidayId):

View file

@ -195,6 +195,8 @@ class NewsManager(DistributedObject.DistributedObject):
elif holidayId in promotionalSpeedChatHolidays: elif holidayId in promotionalSpeedChatHolidays:
if hasattr(base, 'TTSCPromotionalMenu'): if hasattr(base, 'TTSCPromotionalMenu'):
base.TTSCPromotionalMenu.startHoliday(holidayId) base.TTSCPromotionalMenu.startHoliday(holidayId)
elif holidayId == ToontownGlobals.SILLY_SATURDAY_BINGO:
self.setBingoOngoing()
elif holidayId == ToontownGlobals.MORE_XP_HOLIDAY: elif holidayId == ToontownGlobals.MORE_XP_HOLIDAY:
self.setMoreXpHolidayStart() self.setMoreXpHolidayStart()
elif holidayId == ToontownGlobals.JELLYBEAN_DAY: elif holidayId == ToontownGlobals.JELLYBEAN_DAY:
@ -310,6 +312,8 @@ class NewsManager(DistributedObject.DistributedObject):
elif holidayId in promotionalSpeedChatHolidays: elif holidayId in promotionalSpeedChatHolidays:
if hasattr(base, 'TTSCPromotionalMenu'): if hasattr(base, 'TTSCPromotionalMenu'):
base.TTSCPromotionalMenu.endHoliday(holidayId) base.TTSCPromotionalMenu.endHoliday(holidayId)
elif holidayId == ToontownGlobals.SILLY_SATURDAY_BINGO:
self.setBingoEnd()
elif holidayId == ToontownGlobals.MORE_XP_HOLIDAY: elif holidayId == ToontownGlobals.MORE_XP_HOLIDAY:
self.setMoreXpHolidayEnd() self.setMoreXpHolidayEnd()
elif holidayId == ToontownGlobals.JELLYBEAN_DAY: elif holidayId == ToontownGlobals.JELLYBEAN_DAY:
@ -557,9 +561,7 @@ class NewsManager(DistributedObject.DistributedObject):
def holidayNotify(self): def holidayNotify(self):
for id in self.holidayIdList: for id in self.holidayIdList:
if id == 19: if id == 20:
self.setBingoOngoing()
elif id == 20:
self.setCircuitRaceOngoing() self.setCircuitRaceOngoing()
elif id == 21: elif id == 21:
self.setTrolleyHolidayOngoing() self.setTrolleyHolidayOngoing()

View file

@ -234,7 +234,7 @@ class Estate(Place.Place):
self.notify.info('remove estate-check-toon-underwater to TaskMgr in enterTeleportIn()') self.notify.info('remove estate-check-toon-underwater to TaskMgr in enterTeleportIn()')
taskMgr.remove('estate-check-toon-underwater') taskMgr.remove('estate-check-toon-underwater')
if base.wantPets: if base.wantPets:
if base.localAvatar.hasPet() and not base.localAvatar.bPetTutorialDone: if base.localAvatar.hasPet() and not base.localAvatar.petTutorialDone:
self.nextState = 'petTutorial' self.nextState = 'petTutorial'
def teleportInDone(self): def teleportInDone(self):

View file

@ -437,8 +437,6 @@ class BingoCardGui(DirectFrame):
def castingStarted(self): def castingStarted(self):
if taskMgr.hasTaskNamed(self.taskNameFlashFish): if taskMgr.hasTaskNamed(self.taskNameFlashFish):
if not base.localAvatar.bFishBingoMarkTutorialDone: if not base.localAvatar.fishBingoMarkTutorialDone:
pass self.showTutorial(BG.TutorialMark)
#todo: fix setFishBingoMarkTutorialDone base.localAvatar.b_setFishBingoMarkTutorialDone(True)
#self.showTutorial(BG.TutorialMark)
#base.localAvatar.b_setFishBingoMarkTutorialDone(True)

View file

@ -136,13 +136,10 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
return self.getZoneId() return self.getZoneId()
def handleTeleportQuery(self, fromAvatar, toAvatar): def handleTeleportQuery(self, fromAvatar, toAvatar):
if base.config.GetBool('want-tptrack', False):
if toAvatar == localAvatar: if toAvatar == localAvatar:
toAvatar.doTeleportResponse(fromAvatar, toAvatar, toAvatar.doId, 1, toAvatar.defaultShard, base.cr.playGame.getPlaceId(), self.getZoneId(), fromAvatar.doId) toAvatar.doTeleportResponse(fromAvatar, toAvatar, toAvatar.doId, 1, toAvatar.defaultShard, base.cr.playGame.getPlaceId(), self.getZoneId(), fromAvatar.doId)
else: else:
self.notify.warning('handleTeleportQuery toAvatar.doId != localAvatar.doId' % (toAvatar.doId, localAvatar.doId)) self.notify.warning('handleTeleportQuery toAvatar.doId != localAvatar.doId' % (toAvatar.doId, localAvatar.doId))
else:
fromAvatar.d_teleportResponse(toAvatar.doId, 1, toAvatar.defaultShard, base.cr.playGame.getPlaceId(), self.getZoneId())
def detectedPhoneCollision(self): def detectedPhoneCollision(self):
self.fsm.request('phone') self.fsm.request('phone')

View file

@ -443,11 +443,9 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
self.castButton.bind(DGG.B3RELEASE, requestLocalCasting) self.castButton.bind(DGG.B3RELEASE, requestLocalCasting)
if self.firstCast and len(self.av.fishCollection) == 0 and len(self.av.fishTank) == 0: if self.firstCast and len(self.av.fishCollection) == 0 and len(self.av.fishTank) == 0:
self.__showHowTo(TTLocalizer.FishingHowToFirstTime) self.__showHowTo(TTLocalizer.FishingHowToFirstTime)
elif base.wantBingo and self.pond.hasPondBingoManager() and not self.av.bFishBingoTutorialDone: elif base.wantBingo and self.pond.hasPondBingoManager() and not self.av.fishBingoTutorialDone:
pass self.__showHowTo(TTLocalizer.FishBingoHelpMain)
#todo: fix b_setFishBingoTutorialDone crash self.av.b_setFishBingoTutorialDone(True)
#self.__showHowTo(TTLocalizer.FishBingoHelpMain)
#self.av.b_setFishBingoTutorialDone(True)
def __moneyChange(self, money): def __moneyChange(self, money):
self.jar['text'] = str(money) self.jar['text'] = str(money)

View file

@ -125,13 +125,13 @@ class GolfKart(StateData.StateData):
del self.noTrolleyBox del self.noTrolleyBox
def __handleNoTrolleyAck(self): def __handleNoTrolleyAck(self):
ntbDoneStatus = self.noTrolleyBox.doneStatus ntdoneStatus = self.noTrolleyBox.doneStatus
if ntbDoneStatus == 'ok': if ntdoneStatus == 'ok':
doneStatus = {} doneStatus = {}
doneStatus['mode'] = 'reject' doneStatus['mode'] = 'reject'
messenger.send(self.doneEvent, [doneStatus]) messenger.send(self.doneEvent, [doneStatus])
else: else:
self.notify.error('Unrecognized doneStatus: ' + str(ntbDoneStatus)) self.notify.error('Unrecognized doneStatus: ' + str(ntdoneStatus))
def enterRequestBoard(self): def enterRequestBoard(self):
return None return None

View file

@ -127,13 +127,13 @@ class PicnicBasket(StateData.StateData):
del self.noTrolleyBox del self.noTrolleyBox
def __handleNoTrolleyAck(self): def __handleNoTrolleyAck(self):
ntbDoneStatus = self.noTrolleyBox.doneStatus ntdoneStatus = self.noTrolleyBox.doneStatus
if ntbDoneStatus == 'ok': if ntdoneStatus == 'ok':
doneStatus = {} doneStatus = {}
doneStatus['mode'] = 'reject' doneStatus['mode'] = 'reject'
messenger.send(self.doneEvent, [doneStatus]) messenger.send(self.doneEvent, [doneStatus])
else: else:
self.notify.error('Unrecognized doneStatus: ' + str(ntbDoneStatus)) self.notify.error('Unrecognized doneStatus: ' + str(ntdoneStatus))
def enterRequestBoard(self): def enterRequestBoard(self):
return None return None

View file

@ -154,9 +154,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.emblems = [0, 0] self.emblems = [0, 0]
self.maxNPCFriends = 16 self.maxNPCFriends = 16
self.petId = 0 self.petId = 0
self.bPetTutorialDone = False self.petTutorialDone = False
self.bFishBingoTutorialDone = False self.fishBingoTutorialDone = False
self.bFishBingoMarkTutorialDone = False self.fishBingoMarkTutorialDone = False
self.accessories = [] self.accessories = []
if base.wantKarts: if base.wantKarts:
self.kartDNA = [-1] * getNumFields() self.kartDNA = [-1] * getNumFields()
@ -1744,35 +1744,35 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def hasPet(self): def hasPet(self):
return self.petId != 0 return self.petId != 0
def b_setPetTutorialDone(self, bDone): def b_setPetTutorialDone(self, done):
self.d_setPetTutorialDone(bDone) self.d_setPetTutorialDone(done)
self.setPetTutorialDone(bDone) self.setPetTutorialDone(done)
def d_setPetTutorialDone(self, bDone): def d_setPetTutorialDone(self, done):
self.sendUpdate('setPetTutorialDone', [bDone]) self.sendUpdate('setPetTutorialDone', [done])
def setPetTutorialDone(self, bDone): def setPetTutorialDone(self, done):
self.bPetTutorialDone = bDone self.petTutorialDone = done
def b_setFishBingoTutorialDone(self, bDone): def b_setFishBingoTutorialDone(self, done):
self.d_setFishBingoTutorialDone(bDone) self.d_setFishBingoTutorialDone(done)
self.setFishBingoTutorialDone(bDone) self.setFishBingoTutorialDone(done)
def d_setFishBingoTutorialDone(self, bDone): def d_setFishBingoTutorialDone(self, done):
self.sendUpdate('setFishBingoTutorialDone', [bDone]) self.sendUpdate('setFishBingoTutorialDone', [done])
def setFishBingoTutorialDone(self, bDone): def setFishBingoTutorialDone(self, done):
self.bFishBingoTutorialDone = bDone self.fishBingoTutorialDone = done
def b_setFishBingoMarkTutorialDone(self, bDone): def b_setFishBingoMarkTutorialDone(self, done):
self.d_setFishBingoMarkTutorialDone(bDone) self.d_setFishBingoMarkTutorialDone(done)
self.setFishBingoMarkTutorialDone(bDone) self.setFishBingoMarkTutorialDone(done)
def d_setFishBingoMarkTutorialDone(self, bDone): def d_setFishBingoMarkTutorialDone(self, done):
self.sendUpdate('setFishBingoMarkTutorialDone', [bDone]) self.sendUpdate('setFishBingoMarkTutorialDone', [done])
def setFishBingoMarkTutorialDone(self, bDone): def setFishBingoMarkTutorialDone(self, done):
self.bFishBingoMarkTutorialDone = bDone self.fishBingoMarkTutorialDone = done
def b_setPetMovie(self, petId, flag): def b_setPetMovie(self, petId, flag):
self.d_setPetMovie(petId, flag) self.d_setPetMovie(petId, flag)

View file

@ -75,12 +75,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
ToontownGlobals.FT_Torso: (CogDisguiseGlobals.torsoIndex,)} ToontownGlobals.FT_Torso: (CogDisguiseGlobals.torsoIndex,)}
lastFlagAvTime = globalClock.getFrameTime() lastFlagAvTime = globalClock.getFrameTime()
flagCounts = {} flagCounts = {}
WantTpTrack = simbase.config.GetBool('want-tptrack', False)
BanOnDbCheckFail = simbase.config.GetBool('want-ban-dbcheck', 0)
DbCheckAccountDateEnable = config.GetBool('account-blackout-enable', 1)
DbCheckAccountDateBegin = config.GetString('account-blackout-start', '2013-08-20 12:30:00')
DbCheckAccountDateDisconnect = config.GetBool('account-blackout-disconnect', 0)
WantOldGMNameBan = simbase.config.GetBool('want-old-gm-name-ban', 1)
petId = None petId = None
def __init__(self, air): def __init__(self, air):
@ -183,7 +177,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.hostedParties = [] self.hostedParties = []
self.partiesInvitedTo = [] self.partiesInvitedTo = []
self.partyReplyInfoBases = [] self.partyReplyInfoBases = []
self._dbCheckDoLater = None
self.teleportOverride = 0 self.teleportOverride = 0
self._gmDisabled = False self._gmDisabled = False
self.promotionStatus = [0, 0, 0, 0] self.promotionStatus = [0, 0, 0, 0]
@ -241,9 +234,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
DistributedAvatarAI.DistributedAvatarAI.sendDeleteEvent(self) DistributedAvatarAI.DistributedAvatarAI.sendDeleteEvent(self)
def delete(self): def delete(self):
if self._dbCheckDoLater:
taskMgr.remove(self._dbCheckDoLater)
self._dbCheckDoLater = None
if self.isPlayerControlled(): if self.isPlayerControlled():
messenger.send('avatarExited', [self]) messenger.send('avatarExited', [self])
if simbase.wantPets: if simbase.wantPets:
@ -306,7 +296,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def handleLogicalZoneChange(self, newZoneId, oldZoneId): def handleLogicalZoneChange(self, newZoneId, oldZoneId):
DistributedAvatarAI.DistributedAvatarAI.handleLogicalZoneChange(self, newZoneId, oldZoneId) DistributedAvatarAI.DistributedAvatarAI.handleLogicalZoneChange(self, newZoneId, oldZoneId)
if self.isPlayerControlled() and self.WantTpTrack: if self.isPlayerControlled():
messenger.send(self.staticGetLogicalZoneChangeAllEvent(), [newZoneId, oldZoneId, self]) messenger.send(self.staticGetLogicalZoneChangeAllEvent(), [newZoneId, oldZoneId, self])
def announceZoneChange(self, newZoneId, oldZoneId): def announceZoneChange(self, newZoneId, oldZoneId):
@ -3038,17 +3028,14 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.air.writeServerEvent('suspicious', self.doId, 'setPetMovie: playing pet movie %s on non-pet object %s' % (flag, petId)) self.air.writeServerEvent('suspicious', self.doId, 'setPetMovie: playing pet movie %s on non-pet object %s' % (flag, petId))
return return
def setPetTutorialDone(self, bDone): def setPetTutorialDone(self, done):
self.notify.debug('setPetTutorialDone') self.petTutorialDone = True
self.bPetTutorialDone = True
def setFishBingoTutorialDone(self, bDone): def setFishBingoTutorialDone(self, done):
self.notify.debug('setFishBingoTutorialDone') self.fishBingoTutorialDone = True
self.bFishBingoTutorialDone = True
def setFishBingoMarkTutorialDone(self, bDone): def setFishBingoMarkTutorialDone(self, done):
self.notify.debug('setFishBingoMarkTutorialDone') self.fishBingoMarkTutorialDone = True
self.bFishBingoMarkTutorialDone = True
def enterEstate(self, ownerId, zoneId): def enterEstate(self, ownerId, zoneId):
DistributedToonAI.notify.debug('enterEstate: %s %s %s' % (self.doId, ownerId, zoneId)) DistributedToonAI.notify.debug('enterEstate: %s %s %s' % (self.doId, ownerId, zoneId))
@ -4064,21 +4051,9 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def setName(self, name): def setName(self, name):
DistributedPlayerAI.DistributedPlayerAI.setName(self, name) DistributedPlayerAI.DistributedPlayerAI.setName(self, name)
if self.WantOldGMNameBan:
if self.isGenerated():
self._checkOldGMName()
self._updateGMName() self._updateGMName()
def _checkOldGMName(self):
if '$' in set(self.name):
if config.GetBool('want-ban-old-gm-name', 0):
self.ban('invalid name: %s' % self.name)
else:
self.air.writeServerEvent('suspicious', self.doId, '$ found in toon name')
def teleportResponseToAI(self, toAvId, available, shardId, hoodId, zoneId, fromAvId): def teleportResponseToAI(self, toAvId, available, shardId, hoodId, zoneId, fromAvId):
if not self.WantTpTrack:
return
senderId = self.air.getAvatarIdFromSender() senderId = self.air.getAvatarIdFromSender()
if toAvId != self.doId: if toAvId != self.doId:
self.air.writeServerEvent('suspicious', self.doId, 'toAvId=%d is not equal to self.doId' % toAvId) self.air.writeServerEvent('suspicious', self.doId, 'toAvId=%d is not equal to self.doId' % toAvId)
@ -5225,4 +5200,3 @@ def emblems(silver=10, gold=10):
@magicWord(category=CATEGORY_PROGRAMMER) @magicWord(category=CATEGORY_PROGRAMMER)
def catalog(): def catalog():
simbase.air.catalogManager.deliverCatalogFor(spellbook.getTarget()) simbase.air.catalogManager.deliverCatalogFor(spellbook.getTarget())

View file

@ -125,13 +125,13 @@ class Trolley(StateData.StateData):
del self.noTrolleyBox del self.noTrolleyBox
def __handleNoTrolleyAck(self): def __handleNoTrolleyAck(self):
ntbDoneStatus = self.noTrolleyBox.doneStatus ntdoneStatus = self.noTrolleyBox.doneStatus
if ntbDoneStatus == 'ok': if ntdoneStatus == 'ok':
doneStatus = {} doneStatus = {}
doneStatus['mode'] = 'reject' doneStatus['mode'] = 'reject'
messenger.send(self.doneEvent, [doneStatus]) messenger.send(self.doneEvent, [doneStatus])
else: else:
self.notify.error('Unrecognized doneStatus: ' + str(ntbDoneStatus)) self.notify.error('Unrecognized doneStatus: ' + str(ntdoneStatus))
def enterRequestBoard(self): def enterRequestBoard(self):
return None return None
@ -155,8 +155,6 @@ class Trolley(StateData.StateData):
return None return None
def enterBoarded(self): def enterBoarded(self):
if base.config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: RIDETHETROLLEY: Ride the Trolley')
self.enableExitButton() self.enableExitButton()
return None return None