mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
Merge branch 'master' of gitlab.com:ToontownUnited/src
This commit is contained in:
commit
31379d34d5
13 changed files with 136 additions and 494 deletions
|
@ -1911,7 +1911,6 @@ dclass DistributedNPCFlippyInToonHall : DistributedNPCToon {
|
|||
};
|
||||
|
||||
dclass DistributedNPCScientist : DistributedNPCToonBase {
|
||||
setChat(char [0-1024], uint8, uint32, uint8, uint8) ownsend broadcast;
|
||||
};
|
||||
|
||||
dclass DistributedNPCClerk : DistributedNPCToonBase {
|
||||
|
@ -3280,7 +3279,7 @@ dclass ClientServicesManager : DistributedObjectGlobal {
|
|||
};
|
||||
|
||||
dclass TTCodeRedemptionMgr : DistributedObject {
|
||||
redeemCode(char [0-256]) airecv clsend;
|
||||
redeemCode(char [0-50]) airecv clsend;
|
||||
redeemCodeResult(uint32);
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
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
|
||||
|
|
|
@ -358,24 +358,6 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
|||
self.sillyMeter.stop()
|
||||
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):
|
||||
self.ignore('SillyMeterPhase')
|
||||
if hasattr(self, 'sillyMeter'):
|
||||
|
@ -440,8 +422,8 @@ def sillyPhase(phase):
|
|||
Set the silly meter phase.
|
||||
"""
|
||||
|
||||
if phase < -1 or phase > 15:
|
||||
return 'Phase number must be between 0 and 15!'
|
||||
if phase < -1 or phase > 14:
|
||||
return 'Phase number must be between 0 and 14!'
|
||||
|
||||
messenger.send('SillyMeterPhase', [phase])
|
||||
return 'Successfully set the silly meter phase!'
|
|
@ -43,7 +43,6 @@ only include the comma if there are multiple arguments.
|
|||
class TTCodeRedemptionMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("TTCodeRedemptionMgrAI")
|
||||
codes = {
|
||||
# weed code is for testing purposes, remove when done.
|
||||
'weed': {
|
||||
'items': [
|
||||
CatalogClothingItem.CatalogClothingItem(1821, 0)
|
||||
|
@ -55,6 +54,11 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI):
|
|||
'items': [
|
||||
CatalogGardenStarterItem.CatalogGardenStarterItem()
|
||||
]
|
||||
},
|
||||
'sillymeter': {
|
||||
'items': [
|
||||
CatalogClothingItem.CatalogClothingItem(1753, 0)
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,6 +81,8 @@ class TTCodeRedemptionMgrAI(DistributedObjectAI):
|
|||
if not av:
|
||||
return
|
||||
|
||||
code = code.lower()
|
||||
|
||||
if code in self.codes:
|
||||
if av.isCodeRedeemed(code):
|
||||
self.sendUpdateToAvatarId(avId, 'redeemCodeResult', [4])
|
||||
|
|
|
@ -219,23 +219,6 @@ class HoodMgr(DirectObject.DirectObject):
|
|||
self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList)
|
||||
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):
|
||||
hoodId = ZoneUtil.getCanonicalHoodId(hoodId)
|
||||
return ToontownGlobals.phaseMap[hoodId]
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
from direct.interval.IntervalGlobal import Sequence, Func, Wait
|
||||
from toontown.safezone import SafeZoneLoader
|
||||
from toontown.safezone import DDPlayground
|
||||
from toontown.chat.ChatGlobals import CFSpeech
|
||||
from toontown.safezone import SafeZoneLoader, DDPlayground
|
||||
from toontown.toon import NPCToons
|
||||
from toontown.toonbase import TTLocalizer
|
||||
import random
|
||||
|
@ -40,16 +37,9 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
|
|||
self.donald.setPos(0, -1, 3.95)
|
||||
self.donald.reparentTo(self.boat)
|
||||
self.donald.setHat(48, 0, 0)
|
||||
|
||||
self.donaldSpeech = Sequence()
|
||||
|
||||
random.shuffle(TTLocalizer.DonaldChatter)
|
||||
|
||||
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 = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15)
|
||||
self.donaldSpeech.loop(0)
|
||||
|
||||
def unload(self):
|
||||
|
|
|
@ -398,6 +398,9 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
return
|
||||
self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack)
|
||||
|
||||
def enterReward(self):
|
||||
DistributedBossCogAI.DistributedBossCogAI.enterReward(self)
|
||||
|
||||
@magicWord(category=CATEGORY_ADMINISTRATOR)
|
||||
def skipVP():
|
||||
"""
|
||||
|
|
|
@ -1,26 +1,7 @@
|
|||
from pandac.PandaModules import *
|
||||
from toontown.toonbase import TTLocalizer, ToontownGlobals
|
||||
import DistributedNPCToonBase
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from DistributedNPCToonBase import DistributedNPCToonBase
|
||||
|
||||
class DistributedNPCScientist(DistributedNPCToonBase.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()
|
||||
class DistributedNPCScientist(DistributedNPCToonBase):
|
||||
|
||||
def getCollSphereRadius(self):
|
||||
return 2.5
|
||||
|
@ -33,86 +14,53 @@ class DistributedNPCScientist(DistributedNPCToonBase.DistributedNPCToonBase):
|
|||
self.nametag3d.setDepthTest(0)
|
||||
self.nametag3d.setBin('fixed', 0)
|
||||
|
||||
def setChat(self, topic, partPos, partId, progress, flags):
|
||||
msg = TTLocalizer.toontownDialogues[topic][partPos, partId][progress]
|
||||
self.setChatMuted(msg, flags)
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedNPCToonBase.DistributedNPCToonBase.announceGenerate(self)
|
||||
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_HOLIDAY) or base.cr.newsManager.isHolidayRunning(ToontownGlobals.SILLYMETER_EXT_HOLIDAY):
|
||||
self.show()
|
||||
else:
|
||||
self.hide()
|
||||
def setModelHand(self, path):
|
||||
model = loader.loadModel(path)
|
||||
|
||||
for hand in self.getRightHands():
|
||||
placeholder = hand.attachNewNode('RightHandObj')
|
||||
placeholder.setH(180)
|
||||
placeholder.setScale(render, 1.0)
|
||||
placeholder.setPos(0, 0, 0.1)
|
||||
model.instanceTo(placeholder)
|
||||
|
||||
def generateToon(self):
|
||||
self.setLODs()
|
||||
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 = []
|
||||
DistributedNPCToonBase.generateToon(self)
|
||||
self.setupToonNodes()
|
||||
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck':
|
||||
sillyReader = loader.loadModel('phase_4/models/props/tt_m_prp_acs_sillyReader')
|
||||
for rHand in self.getRightHands():
|
||||
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)
|
||||
self.setModelHand('phase_4/models/props/tt_m_prp_acs_%s' % ('sillyReader' if self.style.getAnimal() == 'duck' else 'clipboard'))
|
||||
self.startSequence(config.GetInt('silly-meter-phase', 12))
|
||||
self.accept('SillyMeterPhase', self.startSequence)
|
||||
|
||||
def startLookAround(self):
|
||||
pass
|
||||
|
||||
def startSequence(self, phase):
|
||||
if not self.style.getAnimal() == 'horse':
|
||||
return
|
||||
|
||||
def scientistPlay(self):
|
||||
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck':
|
||||
sillyReaders = self.findAllMatches('**/SillyReader')
|
||||
for sillyReader in sillyReaders:
|
||||
if not sillyReader.isEmpty():
|
||||
sillyReader.stash()
|
||||
sillyReader = None
|
||||
if phase < 4:
|
||||
dialogue = TTLocalizer.ScientistPhase1Dialogue
|
||||
elif phase < 8:
|
||||
dialogue = TTLocalizer.ScientistPhase2Dialogue
|
||||
elif phase < 12:
|
||||
dialogue = TTLocalizer.ScientistPhase3Dialogue
|
||||
elif phase == 12:
|
||||
dialogue = TTLocalizer.ScientistPhase4Dialogue
|
||||
elif phase == 13:
|
||||
dialogue = TTLocalizer.ScientistPhase5Dialogue
|
||||
else:
|
||||
dialogue = TTLocalizer.ScientistPhase6Dialogue
|
||||
|
||||
elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey':
|
||||
clipBoards = self.findAllMatches('**/ClipBoard')
|
||||
for clipBoard in clipBoards:
|
||||
if not clipBoard.isEmpty():
|
||||
clipBoard.stash()
|
||||
clipBoard = None
|
||||
self.stopSequence()
|
||||
self.sequence = self.createTalkSequence(dialogue, 1)
|
||||
self.sequence.loop(0)
|
||||
|
||||
return
|
||||
def stopSequence(self):
|
||||
if hasattr(self, 'sequence'):
|
||||
self.sequence.pause()
|
||||
del self.sequence
|
||||
|
||||
def showScientistProp(self):
|
||||
if self.style.getTorsoSize() == 'short' and self.style.getAnimal() == 'duck':
|
||||
sillyReaders = self.findAllMatches('**/SillyReader;+s')
|
||||
for sillyReader in sillyReaders:
|
||||
if not sillyReader.isEmpty():
|
||||
sillyReader.unstash()
|
||||
sillyReader = None
|
||||
|
||||
elif self.style.getTorsoSize() == 'long' and self.style.getAnimal() == 'monkey':
|
||||
clipBoards = self.findAllMatches('**/ClipBoard;+s')
|
||||
for clipBoard in clipBoards:
|
||||
if not clipBoard.isEmpty():
|
||||
clipBoard.unstash()
|
||||
clipBoard = None
|
||||
|
||||
return
|
||||
def disable(self):
|
||||
self.stopSequence()
|
||||
self.ignore('SillyMeterPhase')
|
||||
DistributedNPCToonBase.disable(self)
|
|
@ -1,239 +1,8 @@
|
|||
import DistributedNPCToonBaseAI
|
||||
from toontown.toonbase import TTLocalizer, ToontownGlobals
|
||||
from direct.fsm import ClassicFSM, State
|
||||
from direct.task.Task import Task
|
||||
import DistributedNPCToonBaseAI, random
|
||||
|
||||
Animation = random.choice(["ScientistPlay", "ScientistWork", "ScientistLessWork", "ScientistJealous"])
|
||||
|
||||
class DistributedNPCScientistAI(DistributedNPCToonBaseAI.DistributedNPCToonBaseAI):
|
||||
|
||||
def __init__(self, air, npcId, questCallback = None, hq = 0):
|
||||
DistributedNPCToonBaseAI.DistributedNPCToonBaseAI.__init__(self, air, npcId, questCallback)
|
||||
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)
|
||||
|
||||
def getStartAnimState(self):
|
||||
return 'ScientistEmcee' if self.npcId == 2020 else Animation
|
|
@ -221,4 +221,4 @@ class DistributedNPCToon(DistributedNPCToonBase):
|
|||
if self.trackChoiceGui:
|
||||
self.trackChoiceGui.destroy()
|
||||
self.trackChoiceGui = None
|
||||
self.sendUpdate('chooseTrack', [trackId])
|
||||
self.sendUpdate('chooseTrack', [trackId])
|
|
@ -133,8 +133,8 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
|
|||
npc.setMaxHp(15)
|
||||
npc.setPositionIndex(posIndex)
|
||||
npc.generateWithRequired(zoneId)
|
||||
if hasattr(npc, 'startAnimState'):
|
||||
npc.d_setAnimState(npc.startAnimState, 1.0)
|
||||
if hasattr(npc, 'getStartAnimState'):
|
||||
npc.d_setAnimState(npc.getStartAnimState(), 1.0)
|
||||
else:
|
||||
npc.d_setAnimState('neutral', 1.0)
|
||||
return npc
|
||||
|
|
|
@ -1789,6 +1789,22 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.holeClipPath = self.attachNewNode(holeClip)
|
||||
self.getGeomNode().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.setActiveShadow(0)
|
||||
|
||||
|
@ -2977,8 +2993,6 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
|
||||
def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||
self.loop('scientistJealous')
|
||||
if hasattr(self, 'showScientistProp'):
|
||||
self.showScientistProp()
|
||||
|
||||
def exitScientistJealous(self):
|
||||
self.stop()
|
||||
|
@ -3003,12 +3017,20 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
|
||||
def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||
self.loop('scientistGame')
|
||||
if hasattr(self, 'scientistPlay'):
|
||||
self.scientistPlay()
|
||||
|
||||
def exitScientistPlay(self):
|
||||
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()
|
||||
compileGlobalAnimList()
|
||||
|
|
|
@ -3190,107 +3190,47 @@ KnockKnockJokes = [['Who', "Bad echo in here, isn't there?"],
|
|||
['Ida', "It's not Ida who, it's Idaho."],
|
||||
['Zippy', 'Mrs. Zippy.'],
|
||||
['Yukon', 'Yukon go away and come back another time.']]
|
||||
SillyPhase1Chatter = ["If you haven't seen the Silly Meter, head to Toon Hall!",
|
||||
'Toontown is getting sillier by the day!',
|
||||
"Cause silly surges in battle to boost Toontown's silly levels!",
|
||||
'Objects on the street are starting to animate!',
|
||||
'I saw a fire hydrant on Silly Street move!']
|
||||
SillyPhase2Chatter = ['Silly levels are still rising!',
|
||||
'The Silly Meter has climbed higher and gotten crazier!',
|
||||
'Someone saw a trash can moving on Maple Street!',
|
||||
'A lot of hydrants on Silly Street have come alive!',
|
||||
'A mailbox on Lighthouse Lane has gone nuts!',
|
||||
'Go see the Silly Meter in Toon Hall!',
|
||||
'Keep causing those silly surges!']
|
||||
SillyPhase3Chatter = ['The Cogs hate how silly Toontown is becoming!',
|
||||
'Keep a sharp eye out for Cog Invasions!',
|
||||
'Cog Invasions have caused the silly levels to drop!',
|
||||
'The Silly Meter went down after the Cog Invasions!',
|
||||
'Every street of Toontown has animated objects now!',
|
||||
'Toontown is sillier than ever!']
|
||||
SillyPhase4Chatter = ['Fire hydrants make your Squirt Gags squirtier!',
|
||||
'Mail Boxes give your Throw Gags a special delivery!',
|
||||
'Those crazy Trash Cans can help boost your Toon-up!',
|
||||
'Objects on the street can help you in battle!',
|
||||
"I just know we'll get the Silly Meter back up soon!",
|
||||
'Enjoy the sillier Toontown!']
|
||||
|
||||
BoringTopic = 'Boring'
|
||||
EmceeDialoguePhase1Topic = 'EmceeDialoguePhase1'
|
||||
EmceeDialoguePhase2Topic = 'EmceeDialoguePhase2'
|
||||
EmceeDialoguePhase3Topic = 'EmceeDialoguePhase3'
|
||||
EmceeDialoguePhase3_5Topic = 'EmceeDialoguePhase3.5'
|
||||
EmceeDialoguePhase4Topic = 'EmceeDialoguePhase4'
|
||||
EmceeDialoguePhase5Topic = 'EmceeDialoguePhase5'
|
||||
EmceeDialoguePhase6Topic = 'EmceeDialoguePhase6'
|
||||
AprilToonsPhasePreTopTopic = 'AprilToonsPhasePreTopTopic'
|
||||
AprilToonsPhaseTopTopic = 'AprilToonsPhaseTopTopic'
|
||||
AprilToonsExtPhaseTopTopic = 'AprilToonsExtPhaseTopTopic'
|
||||
AprilToonsPhasePostTopTopic = 'AprilToonsPhasePostTopTopic'
|
||||
toontownDialogues = {BoringTopic: {(1, 2018): ['Hello Albert', 'It looks like the sillyness levels are rising', 'Yes and dont forget April Toons!'],
|
||||
(2, 2019): ['Hello Newton', 'Yes I wonder how much the parties are contributing to all this'],
|
||||
(3, 2020): ['Why hello there Albert and Newton', 'Halloween was pretty silly too!']},
|
||||
AprilToonsPhasePreTopTopic: {(1, 2020): ['Gadzooks! The Silly Meter has come back to life!',
|
||||
"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!']}}
|
||||
ScientistPhase1Dialogue = ['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."]
|
||||
ScientistPhase2Dialogue = ['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!']
|
||||
ScientistPhase3Dialogue = ['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!']
|
||||
ScientistPhase4Dialogue = ['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!']
|
||||
ScientistPhase5Dialogue = ['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!']
|
||||
ScientistPhase6Dialogue = ['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'
|
||||
FriendsListPanelSecrets = 'True Friend'
|
||||
FriendsListPanelOnlineFriends = 'ONLINE TOON\nFRIENDS'
|
||||
|
|
Loading…
Reference in a new issue