Merge branch 'master' of gitlab.com:ToontownUnited/src

This commit is contained in:
Zach 2015-05-10 18:58:57 -05:00
commit 31379d34d5
13 changed files with 136 additions and 494 deletions

View file

@ -1911,7 +1911,6 @@ dclass DistributedNPCFlippyInToonHall : DistributedNPCToon {
}; };
dclass DistributedNPCScientist : DistributedNPCToonBase { dclass DistributedNPCScientist : DistributedNPCToonBase {
setChat(char [0-1024], uint8, uint32, uint8, uint8) ownsend broadcast;
}; };
dclass DistributedNPCClerk : DistributedNPCToonBase { dclass DistributedNPCClerk : DistributedNPCToonBase {
@ -3280,7 +3279,7 @@ dclass ClientServicesManager : DistributedObjectGlobal {
}; };
dclass TTCodeRedemptionMgr : DistributedObject { dclass TTCodeRedemptionMgr : DistributedObject {
redeemCode(char [0-256]) airecv clsend; redeemCode(char [0-50]) airecv clsend;
redeemCodeResult(uint32); redeemCodeResult(uint32);
}; };

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 3327868546L hashVal = 215686161
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot

View file

@ -358,24 +358,6 @@ class DistributedToonHallInterior(DistributedToonInterior):
self.sillyMeter.stop() self.sillyMeter.stop()
self.ignore('SillyMeterPhase') self.ignore('SillyMeterPhase')
def enterPhase15(self):
self.animSeq = Parallel(ActorInterval(self.sillyMeter, 'phaseFive', duration=604800, constrainedLoop=1, startFrame=1, endFrame=48), Sequence(Func(self.phase5Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase5Sfx, self.sillyMeter)))
self.animSeq.start()
self.smPhase2.show()
self.smPhase3.show()
self.smPhase4.show()
self.accept('SillyMeterPhase', self.startSillyMeter)
def exitPhase15(self):
self.animSeq.finish()
del self.animSeq
self.smPhase2.hide()
self.smPhase3.hide()
self.smPhase4.hide()
self.audio3d.detachSound(self.phase5Sfx)
self.phase5Sfx.stop()
self.sillyMeter.stop()
def enterOff(self): def enterOff(self):
self.ignore('SillyMeterPhase') self.ignore('SillyMeterPhase')
if hasattr(self, 'sillyMeter'): if hasattr(self, 'sillyMeter'):
@ -440,8 +422,8 @@ def sillyPhase(phase):
Set the silly meter phase. Set the silly meter phase.
""" """
if phase < -1 or phase > 15: if phase < -1 or phase > 14:
return 'Phase number must be between 0 and 15!' return 'Phase number must be between 0 and 14!'
messenger.send('SillyMeterPhase', [phase]) messenger.send('SillyMeterPhase', [phase])
return 'Successfully set the silly meter phase!' return 'Successfully set the silly meter phase!'

View file

@ -43,7 +43,6 @@ only include the comma if there are multiple arguments.
class TTCodeRedemptionMgrAI(DistributedObjectAI): class TTCodeRedemptionMgrAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("TTCodeRedemptionMgrAI") notify = DirectNotifyGlobal.directNotify.newCategory("TTCodeRedemptionMgrAI")
codes = { codes = {
# weed code is for testing purposes, remove when done.
'weed': { 'weed': {
'items': [ 'items': [
CatalogClothingItem.CatalogClothingItem(1821, 0) CatalogClothingItem.CatalogClothingItem(1821, 0)
@ -55,6 +54,11 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI):
'items': [ 'items': [
CatalogGardenStarterItem.CatalogGardenStarterItem() CatalogGardenStarterItem.CatalogGardenStarterItem()
] ]
},
'sillymeter': {
'items': [
CatalogClothingItem.CatalogClothingItem(1753, 0)
]
} }
} }
@ -77,6 +81,8 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI):
if not av: if not av:
return return
code = code.lower()
if code in self.codes: if code in self.codes:
if av.isCodeRedeemed(code): if av.isCodeRedeemed(code):
self.sendUpdateToAvatarId(avId, 'redeemCodeResult', [4]) self.sendUpdateToAvatarId(avId, 'redeemCodeResult', [4])

View file

@ -219,23 +219,6 @@ class HoodMgr(DirectObject.DirectObject):
self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList) self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList)
return dropPointList[droppnt] return dropPointList[droppnt]
def getAvailableZones(self):
return self.getZonesInPhase(4) + \
self.getZonesInPhase(6) + \
self.getZonesInPhase(8) + \
self.getZonesInPhase(9) + \
self.getZonesInPhase(10) + \
self.getZonesInPhase(11) + \
self.getZonesInPhase(12) + \
self.getZonesInPhase(13)
def getZonesInPhase(self, phase):
p = []
for i in ToontownGlobals.phaseMap.items():
if i[1] == phase:
p.append(i[0])
return p
def getPhaseFromHood(self, hoodId): def getPhaseFromHood(self, hoodId):
hoodId = ZoneUtil.getCanonicalHoodId(hoodId) hoodId = ZoneUtil.getCanonicalHoodId(hoodId)
return ToontownGlobals.phaseMap[hoodId] return ToontownGlobals.phaseMap[hoodId]

View file

@ -1,7 +1,4 @@
from direct.interval.IntervalGlobal import Sequence, Func, Wait from toontown.safezone import SafeZoneLoader, DDPlayground
from toontown.safezone import SafeZoneLoader
from toontown.safezone import DDPlayground
from toontown.chat.ChatGlobals import CFSpeech
from toontown.toon import NPCToons from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
import random import random
@ -41,15 +38,8 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
self.donald.reparentTo(self.boat) self.donald.reparentTo(self.boat)
self.donald.setHat(48, 0, 0) self.donald.setHat(48, 0, 0)
self.donaldSpeech = Sequence()
random.shuffle(TTLocalizer.DonaldChatter) random.shuffle(TTLocalizer.DonaldChatter)
self.donaldSpeech = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15)
for speechText in TTLocalizer.DonaldChatter:
self.donaldSpeech.append(Func(self.donald.setChatAbsolute, speechText, CFSpeech))
self.donaldSpeech.append(Wait(len(speechText.split(' '))))
self.donaldSpeech.append(Func(self.donald.clearChat))
self.donaldSpeech.append(Wait(15))
self.donaldSpeech.loop(0) self.donaldSpeech.loop(0)
def unload(self): def unload(self):

View file

@ -398,6 +398,9 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
return return
self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack) self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack)
def enterReward(self):
DistributedBossCogAI.DistributedBossCogAI.enterReward(self)
@magicWord(category=CATEGORY_ADMINISTRATOR) @magicWord(category=CATEGORY_ADMINISTRATOR)
def skipVP(): def skipVP():
""" """

View file

@ -1,26 +1,7 @@
from pandac.PandaModules import * from toontown.toonbase import TTLocalizer
from toontown.toonbase import TTLocalizer, ToontownGlobals from DistributedNPCToonBase import DistributedNPCToonBase
import DistributedNPCToonBase
class DistributedNPCScientist(DistributedNPCToonBase.DistributedNPCToonBase): class DistributedNPCScientist(DistributedNPCToonBase):
def __init__(self, cr):
DistributedNPCToonBase.DistributedNPCToonBase.__init__(self, cr)
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.show()
else:
self.hide()
self.accept('SillyMeterIsRunning', self.sillyMeterIsRunning)
def disable(self):
self.ignore('SillyMeterIsRunning')
DistributedNPCToonBase.DistributedNPCToonBase.disable(self)
def sillyMeterIsRunning(self, isRunning):
if isRunning:
self.show()
else:
self.hide()
def getCollSphereRadius(self): def getCollSphereRadius(self):
return 2.5 return 2.5
@ -33,86 +14,53 @@ class DistributedNPCScientist(DistributedNPCToonBase.DistributedNPCToonBase):
self.nametag3d.setDepthTest(0) self.nametag3d.setDepthTest(0)
self.nametag3d.setBin('fixed', 0) self.nametag3d.setBin('fixed', 0)
def setChat(self, topic, partPos, partId, progress, flags): def setModelHand(self, path):
msg = TTLocalizer.toontownDialogues[topic][partPos, partId][progress] model = loader.loadModel(path)
self.setChatMuted(msg, flags)
def announceGenerate(self): for hand in self.getRightHands():
DistributedNPCToonBase.DistributedNPCToonBase.announceGenerate(self) placeholder = hand.attachNewNode('RightHandObj')
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY): placeholder.setH(180)
self.show() placeholder.setScale(render, 1.0)
else: placeholder.setPos(0, 0, 0.1)
self.hide() model.instanceTo(placeholder)
def generateToon(self): def generateToon(self):
self.setLODs() DistributedNPCToonBase.generateToon(self)
self.generateToonLegs()
self.generateToonHead()
self.generateToonTorso()
self.generateToonColor()
self.parentToonParts()
self.rescaleToon()
self.resetHeight()
self.rightHands = []
self.leftHands = []
self.headParts = []
self.hipsParts = []
self.torsoParts = []
self.legsParts = []
self.__bookActors = []
self.__holeActors = []
self.setupToonNodes() self.setupToonNodes()
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': self.setModelHand('phase_4/models/props/tt_m_prp_acs_%s' % ('sillyReader' if self.style.getAnimal() == 'duck' else 'clipboard'))
sillyReader = loader.loadModel('phase_4/models/props/tt_m_prp_acs_sillyReader') self.startSequence(config.GetInt('silly-meter-phase', 12))
for rHand in self.getRightHands(): self.accept('SillyMeterPhase', self.startSequence)
placeholder = rHand.attachNewNode('SillyReader')
sillyReader.instanceTo(placeholder)
placeholder.setH(180)
placeholder.setScale(render, 1.0)
placeholder.setPos(0, 0, 0.1)
elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey' or self.style.getTorsoSize() == 'medium' and self.style.getAnimal() == 'horse':
clipBoard = loader.loadModel('phase_4/models/props/tt_m_prp_acs_clipboard')
for rHand in self.getRightHands():
placeholder = rHand.attachNewNode('ClipBoard')
clipBoard.instanceTo(placeholder)
placeholder.setH(180)
placeholder.setScale(render, 1.0)
placeholder.setPos(0, 0, 0.1)
def startLookAround(self): def startLookAround(self):
pass pass
def scientistPlay(self): def startSequence(self, phase):
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': if not self.style.getAnimal() == 'horse':
sillyReaders = self.findAllMatches('**/SillyReader') return
for sillyReader in sillyReaders:
if not sillyReader.isEmpty():
sillyReader.stash()
sillyReader = None
elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey': if phase < 4:
clipBoards = self.findAllMatches('**/ClipBoard') dialogue = TTLocalizer.ScientistPhase1Dialogue
for clipBoard in clipBoards: elif phase < 8:
if not clipBoard.isEmpty(): dialogue = TTLocalizer.ScientistPhase2Dialogue
clipBoard.stash() elif phase < 12:
clipBoard = None dialogue = TTLocalizer.ScientistPhase3Dialogue
elif phase == 12:
dialogue = TTLocalizer.ScientistPhase4Dialogue
elif phase == 13:
dialogue = TTLocalizer.ScientistPhase5Dialogue
else:
dialogue = TTLocalizer.ScientistPhase6Dialogue
return self.stopSequence()
self.sequence = self.createTalkSequence(dialogue, 1)
self.sequence.loop(0)
def showScientistProp(self): def stopSequence(self):
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck': if hasattr(self, 'sequence'):
sillyReaders = self.findAllMatches('**/SillyReader;+s') self.sequence.pause()
for sillyReader in sillyReaders: del self.sequence
if not sillyReader.isEmpty():
sillyReader.unstash()
sillyReader = None
elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey': def disable(self):
clipBoards = self.findAllMatches('**/ClipBoard;+s') self.stopSequence()
for clipBoard in clipBoards: self.ignore('SillyMeterPhase')
if not clipBoard.isEmpty(): DistributedNPCToonBase.disable(self)
clipBoard.unstash()
clipBoard = None
return

View file

@ -1,239 +1,8 @@
import DistributedNPCToonBaseAI import DistributedNPCToonBaseAI, random
from toontown.toonbase import TTLocalizer, ToontownGlobals
from direct.fsm import ClassicFSM, State Animation = random.choice(["ScientistPlay", "ScientistWork", "ScientistLessWork", "ScientistJealous"])
from direct.task.Task import Task
class DistributedNPCScientistAI(DistributedNPCToonBaseAI.DistributedNPCToonBaseAI): class DistributedNPCScientistAI(DistributedNPCToonBaseAI.DistributedNPCToonBaseAI):
def __init__(self, air, npcId, questCallback = None, hq = 0): def getStartAnimState(self):
DistributedNPCToonBaseAI.DistributedNPCToonBaseAI.__init__(self, air, npcId, questCallback) return 'ScientistEmcee' if self.npcId == 2020 else Animation
self.scientistFSM = ClassicFSM.ClassicFSM('Scientist', [
State.State('Neutral',
self.enterNeutral,
self.exitNeutral, [
'Phase0',
'Phase1',
'Phase2',
'Phase2_5',
'Phase3',
'Phase4',
'Phase5',
'Off']),
State.State('Phase0',
self.enterPhase0,
self.exitPhase0, [
'Phase1',
'Neutral']),
State.State('Phase1',
self.enterPhase1,
self.exitPhase1, [
'Phase2',
'Neutral']),
State.State('Phase2',
self.enterPhase2,
self.exitPhase2, [
'Phase2_5',
'Neutral']),
State.State('Phase2_5',
self.enterPhase2_5,
self.exitPhase2_5, [
'Phase3',
'Neutral']),
State.State('Phase3',
self.enterPhase3,
self.exitPhase3, [
'Phase4',
'Neutral']),
State.State('Phase4',
self.enterPhase4,
self.exitPhase4, [
'Phase5',
'Neutral']),
State.State('Phase5',
self.enterPhase5,
self.exitPhase5, [
'Neutral']),
State.State('Off',
self.enterOff,
self.exitOff, [])],
'Neutral', 'Off')
if self.npcId == 2018 or self.npcId == 2019:
self.startAnimState = 'ScientistJealous'
elif self.npcId == 2020:
self.startAnimState = 'ScientistEmcee'
self.scientistFSM.enterInitialState()
def selectPhase(self, newPhase):
try:
if newPhase <= 4:
gotoPhase = '0'
elif newPhase <= 6:
gotoPhase = '1'
elif newPhase <= 11:
gotoPhase = '2'
elif newPhase <= 12:
gotoPhase = '2_5'
elif newPhase <= 13:
gotoPhase = '3'
elif newPhase <= 14:
gotoPhase = '4'
elif newPhase <= 15:
gotoPhase = '5'
else:
if not self.scientistFSM.getCurrentState() == self.scientistFSM.getStateNamed('Neutral'):
self.scientistFSM.request('Neutral')
return
gotoPhase = 'Phase' + gotoPhase
if not self.scientistFSM.getCurrentState() == self.scientistFSM.getStateNamed(gotoPhase):
self.scientistFSM.request(gotoPhase)
except:
self.notify.warning('Illegal phase transition requested')
def startIfNeeded(self):
if hasattr(simbase.air, 'holidayManager') and simbase.air.holidayManager:
self.curPhase = self.getPhaseToRun()
if self.curPhase != -1:
self.selectPhase(self.curPhase)
def getPhaseToRun(self):
result = -1
enoughInfoToRun = False
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
if hasattr(simbase.air, 'SillyMeterMgr'):
enoughInfoToRun = True
else:
self.notify.debug('simbase.air does not have SillyMeterMgr')
else:
self.notify.debug('holiday is not running')
self.notify.debug('enoughInfoToRun = %s' % enoughInfoToRun)
if enoughInfoToRun and simbase.air.SillyMeterMgr.getIsRunning():
result = simbase.air.SillyMeterMgr.getCurPhase()
return result
def enterNeutral(self):
self.accept('SillyMeterPhase', self.selectPhase)
self.startIfNeeded()
def exitNeutral(self):
self.ignore('SillyMeterPhase')
def enterPhase0(self):
if self.npcId == 2020:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistJealous', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase0(self):
if self.npcId == 2020:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase1(self):
if self.npcId == 2020:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistJealous', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase1(self):
if self.npcId == 2020:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase2(self):
if self.npcId == 2020:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistWork', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase2(self):
if self.npcId == 2020:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePreTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase2_5(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30)
else:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhaseTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistLessWork', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase2_5(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic)
else:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhaseTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase3(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30)
else:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistPlay', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase3(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic)
else:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase4(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30)
else:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistPlay', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase4(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic)
else:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic)
self.ignore('SillyMeterPhase')
def enterPhase5(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic, endPause=30)
else:
self.air.dialogueManager.requestDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic, endPause=30)
elif self.npcId == 2018 or self.npcId == 2019:
self.d_setAnimState('ScientistPlay', 1.0)
self.accept('SillyMeterPhase', self.selectPhase)
def exitPhase5(self):
if self.npcId == 2020:
if simbase.air.holidayManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsExtPhaseTopTopic)
else:
self.air.dialogueManager.leaveDialogue(self, TTLocalizer.AprilToonsPhasePostTopTopic)
self.ignore('SillyMeterPhase')
def enterOff(self):
pass
def exitOff(self):
pass
def delete(self):
self.scientistFSM.requestFinalState()
if hasattr(self, 'scientistFSM'):
del self.scientistFSM
DistributedNPCToonBaseAI.DistributedNPCToonBaseAI.delete(self)

View file

@ -133,8 +133,8 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
npc.setMaxHp(15) npc.setMaxHp(15)
npc.setPositionIndex(posIndex) npc.setPositionIndex(posIndex)
npc.generateWithRequired(zoneId) npc.generateWithRequired(zoneId)
if hasattr(npc, 'startAnimState'): if hasattr(npc, 'getStartAnimState'):
npc.d_setAnimState(npc.startAnimState, 1.0) npc.d_setAnimState(npc.getStartAnimState(), 1.0)
else: else:
npc.d_setAnimState('neutral', 1.0) npc.d_setAnimState('neutral', 1.0)
return npc return npc

View file

@ -1789,6 +1789,22 @@ class Toon(Avatar.Avatar, ToonHead):
self.holeClipPath = self.attachNewNode(holeClip) self.holeClipPath = self.attachNewNode(holeClip)
self.getGeomNode().setClipPlane(self.holeClipPath) self.getGeomNode().setClipPlane(self.holeClipPath)
self.nametag3d.setClipPlane(self.holeClipPath) self.nametag3d.setClipPlane(self.holeClipPath)
avHeight = max(self.getHeight(), 3)
if self == base.localAvatar:
def lerpCam(task):
degrees = task.time * 52.941
radians = degrees * (math.pi / 180.0)
x = -12 * math.sin(radians)
y = -12 * math.cos(radians)
z = base.localAvatar.getHeight()
camera.setPos(x, y, z)
camera.setH(-degrees)
if task.time > 3.4:
return Task.done
return Task.cont
taskMgr.add(lerpCam, 'lerpCam')
self.track.start(ts) self.track.start(ts)
self.setActiveShadow(0) self.setActiveShadow(0)
@ -2977,8 +2993,6 @@ class Toon(Avatar.Avatar, ToonHead):
def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []): def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
self.loop('scientistJealous') self.loop('scientistJealous')
if hasattr(self, 'showScientistProp'):
self.showScientistProp()
def exitScientistJealous(self): def exitScientistJealous(self):
self.stop() self.stop()
@ -3003,12 +3017,20 @@ class Toon(Avatar.Avatar, ToonHead):
def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []): def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
self.loop('scientistGame') self.loop('scientistGame')
if hasattr(self, 'scientistPlay'):
self.scientistPlay()
def exitScientistPlay(self): def exitScientistPlay(self):
self.stop() self.stop()
def createTalkSequence(self, speech, waitTime):
sequence = Sequence()
for text in speech:
sequence.append(Func(self.setChatAbsolute, text, CFSpeech))
sequence.append(Wait(len(text.split(' '))))
sequence.append(Func(self.clearChat))
sequence.append(Wait(waitTime))
return sequence
loadModels() loadModels()
compileGlobalAnimList() compileGlobalAnimList()

View file

@ -3190,107 +3190,47 @@ KnockKnockJokes = [['Who', "Bad echo in here, isn't there?"],
['Ida', "It's not Ida who, it's Idaho."], ['Ida', "It's not Ida who, it's Idaho."],
['Zippy', 'Mrs. Zippy.'], ['Zippy', 'Mrs. Zippy.'],
['Yukon', 'Yukon go away and come back another time.']] ['Yukon', 'Yukon go away and come back another time.']]
SillyPhase1Chatter = ["If you haven't seen the Silly Meter, head to Toon Hall!", ScientistPhase1Dialogue = ['Fellow Toons, this is the Silly Meter!',
'Toontown is getting sillier by the day!', "It is tracking Toontown's rising silly levels...",
"Cause silly surges in battle to boost Toontown's silly levels!", 'Which are causing objects on the street to animate!',
'Objects on the street are starting to animate!', 'And YOU can help push these levels higher!',
'I saw a fire hydrant on Silly Street move!'] 'Battle Cogs to cause Silly Surges...',
SillyPhase2Chatter = ['Silly levels are still rising!', 'Make Toontown sillier than ever...',
'The Silly Meter has climbed higher and gotten crazier!', "And let's watch the world come alive!",
'Someone saw a trash can moving on Maple Street!', "Now I'll repeat what I said, but only once more."]
'A lot of hydrants on Silly Street have come alive!', ScientistPhase2Dialogue = ['Good Gag work, Toons!',
'A mailbox on Lighthouse Lane has gone nuts!', "You're keeping those silly levels rising...",
'Go see the Silly Meter in Toon Hall!', 'And Toontown is getting sillier every day!',
'Keep causing those silly surges!'] 'Fire hydrants, trash cans, and mailboxes are springing to life...',
SillyPhase3Chatter = ['The Cogs hate how silly Toontown is becoming!', 'Making the world more animated than ever!',
'Keep a sharp eye out for Cog Invasions!', "You know the Cogs aren't happy about this...",
'Cog Invasions have caused the silly levels to drop!', 'But Toons sure are!']
'The Silly Meter went down after the Cog Invasions!', ScientistPhase3Dialogue = ['Gadzooks! The Silly Meter is even crazier than expected!',
'Every street of Toontown has animated objects now!', 'Your Silly Surges are working wonders...',
'Toontown is sillier than ever!'] 'And Toontown is getting more animated every day!',
SillyPhase4Chatter = ['Fire hydrants make your Squirt Gags squirtier!', 'Keep up the good Gag work...',
'Mail Boxes give your Throw Gags a special delivery!', 'And lets see how silly we can make Toontown!',
'Those crazy Trash Cans can help boost your Toon-up!', "You know the Cogs aren't happy about what's going on...",
'Objects on the street can help you in battle!', 'But Toons sure are!']
"I just know we'll get the Silly Meter back up soon!", ScientistPhase4Dialogue = ['YOU DID IT TOONS!',
'Enjoy the sillier Toontown!'] 'You brought the streets of Toontown to life!',
'You deserve a reward!',
BoringTopic = 'Boring' 'Enter the code SILLYMETER in your Shticker Book...',
EmceeDialoguePhase1Topic = 'EmceeDialoguePhase1' '...to get a Silly Meter T-Shirt!']
EmceeDialoguePhase2Topic = 'EmceeDialoguePhase2' ScientistPhase5Dialogue = ['Attention all Toons!',
EmceeDialoguePhase3Topic = 'EmceeDialoguePhase3' 'The Cog invasions have been an unhappy event.',
EmceeDialoguePhase3_5Topic = 'EmceeDialoguePhase3.5' 'As a result, silly levels have rapidly fallen...',
EmceeDialoguePhase4Topic = 'EmceeDialoguePhase4' 'And no new objects are coming to life.',
EmceeDialoguePhase5Topic = 'EmceeDialoguePhase5' 'But those that have are very thankful...',
EmceeDialoguePhase6Topic = 'EmceeDialoguePhase6' 'And are showing their appreciation by helping in battle!',
AprilToonsPhasePreTopTopic = 'AprilToonsPhasePreTopTopic' 'We may hold off the Cogs yet, so keep up the fight!']
AprilToonsPhaseTopTopic = 'AprilToonsPhaseTopTopic' ScientistPhase6Dialogue = ['Congratulations Toons!',
AprilToonsExtPhaseTopTopic = 'AprilToonsExtPhaseTopTopic' 'You all succesfully held off the Cog Invasions...',
AprilToonsPhasePostTopTopic = 'AprilToonsPhasePostTopTopic' 'With a little help from our newly animated friends...',
toontownDialogues = {BoringTopic: {(1, 2018): ['Hello Albert', 'It looks like the sillyness levels are rising', 'Yes and dont forget April Toons!'], 'And brought Toontown back to its usual silly self!',
(2, 2019): ['Hello Newton', 'Yes I wonder how much the parties are contributing to all this'], 'We hope to get the Silly Meter rising again soon...',
(3, 2020): ['Why hello there Albert and Newton', 'Halloween was pretty silly too!']}, 'So in the meantime, keep up the Cog fight...',
AprilToonsPhasePreTopTopic: {(1, 2020): ['Gadzooks! The Silly Meter has come back to life!', 'And enjoy the silliest place ever, Toontown!']
"It's rising every day, and will reach the top soon!",
'When it does, something silly is sure to happen!',
'So get ready to get ridiculous!']},
AprilToonsPhaseTopTopic: {(1, 2020): ['The Silly Meter has hit the top!',
'Doodles are talking, Estates are bouncy!',
"There's only one thing to say\xe2\x80\xa6",
'HAPPY APRIL TOONS!']},
AprilToonsExtPhaseTopTopic: {(1, 2020): ['The Silly Meter has hit the top!', 'Doodles are talking, Estates are bouncy!']},
AprilToonsPhasePostTopTopic: {(1, 2020): ['April Toons is over!',
"It's time for us to return to our lab.",
'But when things get REALLY crazy again\xe2\x80\xa6',
'The Silly Meter will return!']},
EmceeDialoguePhase1Topic: {(1, 2020): ['Fellow Toons, this is the Silly Meter!',
"It is tracking Toontown's rising silly levels...",
'Which are causing objects on the street to animate!',
'And YOU can help push these levels higher!',
'Battle Cogs to cause Silly Surges...',
'Make Toontown sillier than ever...',
"And let's watch the world come alive!",
"Now I'll repeat what I said, but only once more."]},
EmceeDialoguePhase2Topic: {(1, 2020): ['Good Gag work, Toons!',
"You're keeping those silly levels rising...",
'And Toontown is getting sillier every day!',
'Fire hydrants, trash cans, and mailboxes are springing to life...',
'Making the world more animated than ever!',
"You know the Cogs aren't happy about this...",
'But Toons sure are!']},
EmceeDialoguePhase3Topic: {(1, 2020): ['Gadzooks! The Silly Meter is even crazier than expected!',
'Your Silly Surges are working wonders...',
'And Toontown is getting more animated every day!',
'Keep up the good Gag work...',
'And lets see how silly we can make Toontown!',
"You know the Cogs aren't happy about what's going on...",
'But Toons sure are!']},
EmceeDialoguePhase3_5Topic: {(1, 2020): ['YOU DID IT TOONS!',
'You brought the streets of Toontown to life!',
'You deserve a reward!',
'Enter the code SILLYMETER in your Shticker Book...',
'...to get a Silly Meter T-Shirt!']},
EmceeDialoguePhase4Topic: {(1, 2020): ['Attention all Toons!',
'The sudden Cog invasions have been an unhappy event.',
'As a result, silly levels have rapidly fallen...',
'And no new objects are coming to life.',
'But those that have are very thankful...',
"So perhaps they'll find a way to show their appreciation!",
'Stay Tooned!']},
EmceeDialoguePhase5Topic: {(1, 2020): ['Attention all Toons!',
'The Cog invasions have been an unhappy event.',
'As a result, silly levels have rapidly fallen...',
'And no new objects are coming to life.',
'But those that have are very thankful...',
'And are showing their appreciation by helping in battle!',
'We may hold off the Cogs yet, so keep up the fight!']},
EmceeDialoguePhase6Topic: {(1, 2020): ['Congratulations Toons!',
'You all succesfully held off the Cog Invasions...',
'With a little help from our newly animated friends...',
'And brought Toontown back to its usual silly self!',
'We hope to get the Silly Meter rising again soon...',
'So in the meantime, keep up the Cog fight...',
'And enjoy the silliest place ever, Toontown!']}}
FriendsListPanelNewFriend = 'New Friend' FriendsListPanelNewFriend = 'New Friend'
FriendsListPanelSecrets = 'True Friend' FriendsListPanelSecrets = 'True Friend'
FriendsListPanelOnlineFriends = 'ONLINE TOON\nFRIENDS' FriendsListPanelOnlineFriends = 'ONLINE TOON\nFRIENDS'