def setInvasionStatus(self, msgType, cogType, numRemaining, specialSuit): self.notify.info( 'setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, specialSuit: %s' % (msgType, cogType, numRemaining, specialSuit)) if specialSuit == 1: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP else: if specialSuit == 2: cogName = TTLocalizer.SkeleReviveCogName % { 'cog_name': SuitBattleGlobals.SuitAttributes[cogType]['name'] } cogNameP = TTLocalizer.SkeleReviveCogName % { 'cog_name': SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] } else: cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType][ 'pluralname'] if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP self.invading = 1 self.invadingSuit = cogType else: if msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP self.invading = 1 self.invadingSuit = cogType else: if msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 self.invading = 0 self.invadingSuit = None else: if msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP self.invading = 1 self.invadingSuit = cogType else: self.notify.warning( 'setInvasionStatus: invalid msgType: %s' % msgType) return if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start() return
def setInvasionStatus(self, msgType, cogType, numRemaining, skeleton): self.notify.info('setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, skeleton: %s' % (msgType, cogType, numRemaining, skeleton)) cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] if skeleton: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP self.invading = 1 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start()
def setInvasionStatus(self, msgType, cogType, numRemaining, skeleton): # Let the player know the status of any cog invasion taking place self.notify.info("setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, skeleton: %s" % (msgType, cogType, numRemaining, skeleton)) cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] if skeleton: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP # Now are invading self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP # Still invading self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 # No longer invading self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP # Still invading self.invading = 1 else: self.notify.warning("setInvasionStatus: invalid msgType: %s" % (msgType)) return # Update our local display of skill credit to take the invasion # multiplier into account. The actual math and credit is given # on the AI, this is just to inform the player # TODO: this is slightly out of sync because this will get updated # as soon as the invasion is over, whereas the AI multiplier will # not, it is only updated at the start of each battle. Nobody should # complain since the error is in the favor of the Toons (we show less # than you might actually get) if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) # TODO: this gets stomped at load time Sequence( Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name = 'newsManagerWait', autoPause = 1, ).start() return
def setInvasionStatus(self, msgType, suitType, remaining, flags): if msgType not in ToontownGlobals.SuitInvasions: return if suitType in SuitDNA.suitHeadTypes: attributes = SuitBattleGlobals.SuitAttributes[suitType] suitNames = { 'singular': attributes['name'], 'plural': attributes['pluralname'] } elif suitType in SuitDNA.suitDepts: suitNames = { 'singular': SuitDNA.getDeptFullname(suitType), 'plural': SuitDNA.getDeptFullnameP(suitType) } else: return track = Sequence() base.localAvatar.inventory.setInvasionCreditMultiplier( 1 if msgType in ToontownGlobals. EndingInvasions else ToontownBattleGlobals.getInvasionMultiplier()) for i, message in enumerate(ToontownGlobals.SuitInvasions[msgType]): track.append(Wait(5 if i else 1)) track.append( Func(base.localAvatar.setSystemMessage, 0, (TTLocalizer.SuitInvasionPrefix + message) % suitNames)) track.start()
def startInvasion(self, suitName, skel, waiter, startTime, duration): self.startTime = globalClockDelta.networkToLocalTime(startTime, bits = 32) self.notify.info("New invasion! Duration: %s" % duration) self._name, msgs = self.formatInvasionMessage(suitName, skel, waiter, self.__formatBegin) self.displayMsgs(msgs) mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1) base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
def startInvasion(self, suitName, skel, waiter, startTime, duration): self.startTime = globalClockDelta.networkToLocalTime(startTime, bits=32) self.notify.info("New invasion! Duration: %s" % duration) self._name, msgs = self.formatInvasionMessage(suitName, skel, waiter, self.__formatBegin) self.displayMsgs(msgs) mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1) base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
def setInvasionStatus(self, msgType, cogType, numRemaining, specialSuit): self.notify.info( 'setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, specialSuit: %s' % (msgType, cogType, numRemaining, specialSuit)) # Determine if we are spawning a special type of suit. 1 is Skelecog, 2 is v2.0. # If they are a Skelecog or v2.0 cog, we need to change the Cog name. if specialSuit == 1: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP elif specialSuit == 2: cogName = TTLocalizer.SkeleReviveCogName % { 'cog_name': SuitBattleGlobals.SuitAttributes[cogType]['name'] } cogNameP = TTLocalizer.SkeleReviveCogName % { 'cog_name': SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] } else: cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] # Figure out the message type to send if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP self.invading = 1 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start()
def setCurrentInvasion(self, suitName, skel, waiter, startTime, duration): if duration == 0: self.notify.info('duration 0') return self.startTime = globalClockDelta.networkToLocalTime(startTime, bits = 32) elapsed = globalClock.getRealTime() - self.startTime remaining = duration - elapsed self.notify.info("Invasion in progress! Remaining time: %s" % remaining) mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1) base.localAvatar.inventory.setInvasionCreditMultiplier(mult) if not self.__announced: self._name, msgs = self.formatInvasionMessage(suitName, skel, False, self.__formatProgress) self.displayMsgs(msgs)
def setInvasionStatus(self, msgType, cogType, numRemaining, specialSuit): self.notify.info('setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, specialSuit: %s' % (msgType, cogType, numRemaining, specialSuit)) # Determine if we are spawning a special type of suit. 1 is Skelecog, 2 is v2.0. # If they are a Skelecog or v2.0 cog, we need to change the Cog name. if specialSuit == 1: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP elif specialSuit == 2: cogName = TTLocalizer.SkeleReviveCogName % {'cog_name':SuitBattleGlobals.SuitAttributes[cogType]['name']} cogNameP = TTLocalizer.SkeleReviveCogName % {'cog_name':SuitBattleGlobals.SuitAttributes[cogType]['pluralname']} else: cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] # Figure out the message type to send if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP self.invading = 1 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start()
def setCurrentInvasion(self, suitName, skel, waiter, startTime, duration): if duration == 0: self.notify.info('duration 0') return self.startTime = globalClockDelta.networkToLocalTime(startTime, bits=32) elapsed = globalClock.getRealTime() - self.startTime remaining = duration - elapsed self.notify.info("Invasion in progress! Remaining time: %s" % remaining) mult = ToontownBattleGlobals.getInvasionMultiplier(duration == 1) base.localAvatar.inventory.setInvasionCreditMultiplier(mult) if not self.__announced: self._name, msgs = self.formatInvasionMessage( suitName, skel, False, self.__formatProgress) self.displayMsgs(msgs)
def setInvasionStatus(self, msgType, suitType, remaining, flags): if suitType in SuitDNA.suitHeadTypes: suitName = SuitBattleGlobals.SuitAttributes[suitType]['name'] suitNamePlural = SuitBattleGlobals.SuitAttributes[suitType][ 'pluralname'] elif suitType in SuitDNA.suitDepts: suitName = SuitDNA.getDeptFullname(suitType) suitNamePlural = SuitDNA.getDeptFullnameP(suitType) messages = [] if msgType == ToontownGlobals.SuitInvasionBegin: messages.append(TTLocalizer.SuitInvasionBegin1) messages.append(TTLocalizer.SuitInvasionBegin2 % suitNamePlural) self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: messages.append(TTLocalizer.SuitInvasionEnd1 % suitName) messages.append(TTLocalizer.SuitInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionUpdate: messages.append(TTLocalizer.SuitInvasionUpdate1) messages.append(TTLocalizer.SuitInvasionUpdate2) self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionBulletin: messages.append(TTLocalizer.SuitInvasionBulletin1) messages.append(TTLocalizer.SuitInvasionBulletin2 % suitNamePlural) self.invading = 1 elif msgType == ToontownGlobals.SkelecogInvasionBegin: messages.append(TTLocalizer.SkelecogInvasionBegin1) messages.append(TTLocalizer.SkelecogInvasionBegin2) messages.append(TTLocalizer.SkelecogInvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.SkelecogInvasionEnd: messages.append(TTLocalizer.SkelecogInvasionEnd1) messages.append(TTLocalizer.SkelecogInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.SkelecogInvasionBulletin: messages.append(TTLocalizer.SkelecogInvasionBulletin1) messages.append(TTLocalizer.SkelecogInvasionBulletin2) messages.append(TTLocalizer.SkelecogInvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.WaiterInvasionBegin: messages.append(TTLocalizer.WaiterInvasionBegin1) messages.append(TTLocalizer.WaiterInvasionBegin2) self.invading = 1 elif msgType == ToontownGlobals.WaiterInvasionEnd: messages.append(TTLocalizer.WaiterInvasionEnd1) messages.append(TTLocalizer.WaiterInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.WaiterInvasionBulletin: messages.append(TTLocalizer.WaiterInvasionBulletin1) messages.append(TTLocalizer.WaiterInvasionBulletin2) messages.append(TTLocalizer.WaiterInvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.V2InvasionBegin: messages.append(TTLocalizer.V2InvasionBegin1) messages.append(TTLocalizer.V2InvasionBegin2) messages.append(TTLocalizer.V2InvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.V2InvasionEnd: messages.append(TTLocalizer.V2InvasionEnd1) messages.append(TTLocalizer.V2InvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.V2InvasionBulletin: messages.append(TTLocalizer.V2InvasionBulletin1) messages.append(TTLocalizer.V2InvasionBulletin2) messages.append(TTLocalizer.V2InvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.VirtualInvasionBegin: messages.append(TTLocalizer.VirtualInvasionBegin1) messages.append(TTLocalizer.VirtualInvasionBegin2) messages.append(TTLocalizer.VirtualInvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.VirtualInvasionEnd: messages.append(TTLocalizer.VirtualInvasionEnd1) messages.append(TTLocalizer.VirtualInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.VirtualInvasionBulletin: messages.append(TTLocalizer.VirtualInvasionBulletin1) messages.append(TTLocalizer.VirtualInvasionBulletin2) messages.append(TTLocalizer.VirtualInvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.RentalInvasionBegin: messages.append(TTLocalizer.RentalInvasionBegin1) messages.append(TTLocalizer.RentalInvasionBegin2) messages.append(TTLocalizer.RentalInvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.RentalInvasionEnd: messages.append(TTLocalizer.RentalInvasionEnd1) messages.append(TTLocalizer.RentalInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.RentalInvasionBulletin: messages.append(TTLocalizer.RentalInvasionBulletin1) messages.append(TTLocalizer.RentalInvasionBulletin2) messages.append(TTLocalizer.RentalInvasionBulletin3) self.invading = 1 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return multiplier = 1 if self.invading: multiplier = ToontownBattleGlobals.getInvasionMultiplier() base.localAvatar.inventory.setInvasionCreditMultiplier(multiplier) track = Sequence(name='newsManagerWait', autoPause=1) for i, message in enumerate(messages): if i == 0: track.append(Wait(1)) else: track.append(Wait(5)) track.append(Func(base.localAvatar.setSystemMessage, 0, message)) track.start()
def setInvasionStatus(self, msgType, suitType, remaining, flags): if suitType in SuitDNA.suitHeadTypes: suitName = SuitBattleGlobals.SuitAttributes[suitType]['name'] suitNamePlural = SuitBattleGlobals.SuitAttributes[suitType]['pluralname'] elif suitType in SuitDNA.suitDepts: suitName = SuitDNA.getDeptFullname(suitType) suitNamePlural = SuitDNA.getDeptFullnameP(suitType) messages = [] if msgType == ToontownGlobals.SuitInvasionBegin: messages.append(TTLocalizer.SuitInvasionBegin1) messages.append(TTLocalizer.SuitInvasionBegin2 % suitNamePlural) self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: messages.append(TTLocalizer.SuitInvasionEnd1 % suitName) messages.append(TTLocalizer.SuitInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionUpdate: messages.append(TTLocalizer.SuitInvasionUpdate1) messages.append(TTLocalizer.SuitInvasionUpdate2) self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionBulletin: messages.append(TTLocalizer.SuitInvasionBulletin1) messages.append(TTLocalizer.SuitInvasionBulletin2 % suitNamePlural) self.invading = 1 elif msgType == ToontownGlobals.SkelecogInvasionBegin: messages.append(TTLocalizer.SkelecogInvasionBegin1) messages.append(TTLocalizer.SkelecogInvasionBegin2) messages.append(TTLocalizer.SkelecogInvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.SkelecogInvasionEnd: messages.append(TTLocalizer.SkelecogInvasionEnd1) messages.append(TTLocalizer.SkelecogInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.SkelecogInvasionBulletin: messages.append(TTLocalizer.SkelecogInvasionBulletin1) messages.append(TTLocalizer.SkelecogInvasionBulletin2) messages.append(TTLocalizer.SkelecogInvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.WaiterInvasionBegin: messages.append(TTLocalizer.WaiterInvasionBegin1) messages.append(TTLocalizer.WaiterInvasionBegin2) self.invading = 1 elif msgType == ToontownGlobals.WaiterInvasionEnd: messages.append(TTLocalizer.WaiterInvasionEnd1) messages.append(TTLocalizer.WaiterInvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.WaiterInvasionBulletin: messages.append(TTLocalizer.WaiterInvasionBulletin1) messages.append(TTLocalizer.WaiterInvasionBulletin2) messages.append(TTLocalizer.WaiterInvasionBulletin3) self.invading = 1 elif msgType == ToontownGlobals.V2InvasionBegin: messages.append(TTLocalizer.V2InvasionBegin1) messages.append(TTLocalizer.V2InvasionBegin2) messages.append(TTLocalizer.V2InvasionBegin3) self.invading = 1 elif msgType == ToontownGlobals.V2InvasionEnd: messages.append(TTLocalizer.V2InvasionEnd1) messages.append(TTLocalizer.V2InvasionEnd2) self.invading = 0 elif msgType == ToontownGlobals.V2InvasionBulletin: messages.append(TTLocalizer.V2InvasionBulletin1) messages.append(TTLocalizer.V2InvasionBulletin2) messages.append(TTLocalizer.V2InvasionBulletin3) self.invading = 1 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return multiplier = 1 if self.invading: multiplier = ToontownBattleGlobals.getInvasionMultiplier() base.localAvatar.inventory.setInvasionCreditMultiplier(multiplier) track = Sequence(name='newsManagerWait', autoPause=1) for i, message in enumerate(messages): if i == 0: track.append(Wait(1)) else: track.append(Wait(5)) track.append(Func(base.localAvatar.setSystemMessage, 0, message)) track.start()
def setInvasionStatus(self, msgType, cogType, numRemaining, skeleton): self.notify.info( 'setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, skeleton: %s' % (msgType, cogType, numRemaining, skeleton)) if msgType < ToontownGlobals.DepartmentInvasionBegin: cogName = SuitBattleGlobals.SuitAttributes[cogType]['name'] cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] messages = 2 if skeleton: cogName = TTLocalizer.Skeleton cogNameP = TTLocalizer.SkeletonP if msgType == ToontownGlobals.SuitInvasionBegin: msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionUpdate: msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SuitInvasionEnd: msg1 = TTLocalizer.SuitInvasionEnd1 % cogName msg2 = TTLocalizer.SuitInvasionEnd2 self.invading = 0 elif msgType == ToontownGlobals.SuitInvasionBulletin: msg1 = TTLocalizer.SuitInvasionBulletin1 msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP self.invading = 1 elif msgType == ToontownGlobals.SkelecogInvasionBegin: msg1 = TTLocalizer.SkelecogInvasionBegin1 msg2 = TTLocalizer.SkelecogInvasionBegin2 msg3 = TTLocalizer.SkelecogInvasionBegin3 messages = 3 elif msgType == ToontownGlobals.SkelecogInvasionEnd: msg1 = TTLocalizer.SkelecogInvasionEnd1 msg2 = TTLocalizer.SkelecogInvasionEnd2 elif msgType == ToontownGlobals.V2InvasionBegin: msg1 = TTLocalizer.V2InvasionBegin1 msg2 = TTLocalizer.V2InvasionBegin2 msg3 = TTLocalizer.V2InvasionBegin3 messages = 3 elif msgType == ToontownGlobals.V2InvasionEnd: msg1 = TTLocalizer.V2InvasionEnd1 msg2 = TTLocalizer.V2InvasionEnd2 elif msgType == ToontownGlobals.DepartmentInvasionBegin: deptNameP = SuitDNA.getDeptFullnameP(cogType) msg1 = TTLocalizer.SuitInvasionBegin1 msg2 = TTLocalizer.DepartmentInvasionBegin1 % deptNameP elif msgType == ToontownGlobals.DepartmentInvasionEnd: deptName = SuitDNA.getDeptFullname(cogType) msg1 = TTLocalizer.DepartmentInvasionEnd1 % deptName msg2 = TTLocalizer.SuitInvasionEnd2 else: self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType) return if self.invading: mult = ToontownBattleGlobals.getInvasionMultiplier() else: mult = 1 base.localAvatar.inventory.setInvasionCreditMultiplier(mult) if messages == 2: Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), name='newsManagerWait', autoPause=1).start() elif messages == 3: Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2), Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg3), name='newsManagerWait', autoPause=1).start()
def setInvasionStatus(self, msgType, suitType, remaining, flags): if msgType not in ToontownGlobals.SuitInvasions: return if suitType in SuitDNA.suitHeadTypes: attributes = SuitBattleGlobals.SuitAttributes[suitType] suitNames = {'singular': attributes['name'], 'plural': attributes['pluralname']} elif suitType in SuitDNA.suitDepts: suitNames = {'singular': SuitDNA.getDeptFullname(suitType), 'plural': SuitDNA.getDeptFullnameP(suitType)} else: return track = Sequence() base.localAvatar.inventory.setInvasionCreditMultiplier(1 if msgType in ToontownGlobals.EndingInvasions else ToontownBattleGlobals.getInvasionMultiplier()) for i, message in enumerate(ToontownGlobals.SuitInvasions[msgType]): track.append(Wait(5 if i else 1)) track.append(Func(base.localAvatar.setSystemMessage, 0, (TTLocalizer.SuitInvasionPrefix + message) % suitNames)) track.start()