Animated Props client

This commit is contained in:
DenialMC 2015-04-09 20:17:24 +03:00
parent 8797c149a7
commit 168ae65d1e
42 changed files with 349 additions and 1495 deletions

View file

@ -461,7 +461,6 @@ from toontown.safezone import DistributedTreasure/AI
from toontown.coghq import DistributedCashbotBossTreasure/AI from toontown.coghq import DistributedCashbotBossTreasure/AI
from toontown.building import DistributedTrophyMgr/AI from toontown.building import DistributedTrophyMgr/AI
from toontown.building import DistributedBuilding/AI from toontown.building import DistributedBuilding/AI
from toontown.building import DistributedAnimBuilding/AI
from toontown.building import DistributedBuildingQueryMgr/AI from toontown.building import DistributedBuildingQueryMgr/AI
from toontown.building import DistributedToonInterior/AI from toontown.building import DistributedToonInterior/AI
from toontown.building import DistributedToonHallInterior/AI from toontown.building import DistributedToonHallInterior/AI
@ -472,7 +471,6 @@ from toontown.building import DistributedPetshopInterior/AI
from toontown.building import DistributedKartShopInterior/AI from toontown.building import DistributedKartShopInterior/AI
from toontown.building import DistributedLibraryInterior/AI from toontown.building import DistributedLibraryInterior/AI
from toontown.building import DistributedDoor/AI from toontown.building import DistributedDoor/AI
from toontown.building import DistributedAnimDoor/AI
from toontown.estate import DistributedHouseDoor/AI from toontown.estate import DistributedHouseDoor/AI
from toontown.coghq import DistributedCogHQDoor/AI from toontown.coghq import DistributedCogHQDoor/AI
from toontown.coghq import DistributedSellbotHQDoor/AI from toontown.coghq import DistributedSellbotHQDoor/AI
@ -1903,9 +1901,6 @@ dclass DistributedBuilding : DistributedObject {
setVictorReady() airecv clsend; setVictorReady() airecv clsend;
}; };
dclass DistributedAnimBuilding : DistributedBuilding {
};
dclass DistributedBuildingQueryMgr : DistributedObject { dclass DistributedBuildingQueryMgr : DistributedObject {
isSuit(uint8, uint32) airecv clsend; isSuit(uint8, uint32) airecv clsend;
response(uint8, bool); response(uint8, bool);
@ -2055,9 +2050,6 @@ dclass DistributedDoor : DistributedObject {
setExitDoorState(string, int16) required broadcast ram; setExitDoorState(string, int16) required broadcast ram;
}; };
dclass DistributedAnimDoor : DistributedDoor {
};
dclass DistributedHouseDoor : DistributedDoor { dclass DistributedHouseDoor : DistributedDoor {
}; };

View file

@ -2,12 +2,12 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 877728986 hashVal = 2712424547L
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
from toontown.golf import DistributedPhysicsWorld, DistributedGolfHole, DistributedGolfCourse from toontown.golf import DistributedPhysicsWorld, DistributedGolfHole, DistributedGolfCourse
from toontown.building import DistributedAnimatedProp, DistributedTrophyMgr, DistributedBuilding, DistributedAnimBuilding, DistributedBuildingQueryMgr, DistributedToonInterior, DistributedToonHallInterior, DistributedSuitInterior, DistributedHQInterior, DistributedGagshopInterior, DistributedPetshopInterior, DistributedKartShopInterior, DistributedLibraryInterior, DistributedDoor, DistributedAnimDoor, DistributedKnockKnockDoor, DistributedElevator, DistributedElevatorFSM, DistributedElevatorExt, DistributedElevatorInt, DistributedElevatorFloor, DistributedBossElevator, DistributedVPElevator, DistributedCFOElevator, DistributedCJElevator, DistributedBBElevator, DistributedBoardingParty, DistributedTutorialInterior, DistributedClubElevator from toontown.building import DistributedAnimatedProp, DistributedTrophyMgr, DistributedBuilding, DistributedBuildingQueryMgr, DistributedToonInterior, DistributedToonHallInterior, DistributedSuitInterior, DistributedHQInterior, DistributedGagshopInterior, DistributedPetshopInterior, DistributedKartShopInterior, DistributedLibraryInterior, DistributedDoor, DistributedKnockKnockDoor, DistributedElevator, DistributedElevatorFSM, DistributedElevatorExt, DistributedElevatorInt, DistributedElevatorFloor, DistributedBossElevator, DistributedVPElevator, DistributedCFOElevator, DistributedCJElevator, DistributedBBElevator, DistributedBoardingParty, DistributedTutorialInterior, DistributedClubElevator
from toontown.uberdog.DistributedPartyManager import DistributedPartyManager from toontown.uberdog.DistributedPartyManager import DistributedPartyManager
from otp.friends import FriendManager, PlayerFriendsManager, GuildManager, FriendInfo, AvatarFriendInfo from otp.friends import FriendManager, PlayerFriendsManager, GuildManager, FriendInfo, AvatarFriendInfo
from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiveEntity from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiveEntity

View file

@ -201,8 +201,6 @@ class NewsManager(DistributedObject.DistributedObject):
pass pass
elif holidayId == ToontownGlobals.CIRCUIT_RACING_EVENT: elif holidayId == ToontownGlobals.CIRCUIT_RACING_EVENT:
self.setGrandPrixWeekendStart() self.setGrandPrixWeekendStart()
elif holidayId == ToontownGlobals.HYDRANT_ZERO_HOLIDAY:
self.setHydrantZeroHolidayStart()
elif holidayId == ToontownGlobals.APRIL_FOOLS_COSTUMES: elif holidayId == ToontownGlobals.APRIL_FOOLS_COSTUMES:
if hasattr(base, 'localAvatar') and base.localAvatar and hasattr(base.localAvatar, 'chatMgr') and base.localAvatar.chatMgr: if hasattr(base, 'localAvatar') and base.localAvatar and hasattr(base.localAvatar, 'chatMgr') and base.localAvatar.chatMgr:
base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu() base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu()
@ -467,9 +465,6 @@ class NewsManager(DistributedObject.DistributedObject):
def setGrandPrixWeekendEnd(self): def setGrandPrixWeekendEnd(self):
base.localAvatar.setSystemMessage(0, TTLocalizer.GrandPrixWeekendHolidayEnd) base.localAvatar.setSystemMessage(0, TTLocalizer.GrandPrixWeekendHolidayEnd)
def setHydrantZeroHolidayStart(self):
messenger.send('HydrantZeroIsRunning', [True])
def setSellbotNerfHolidayStart(self): def setSellbotNerfHolidayStart(self):
base.localAvatar.setSystemMessage(0, TTLocalizer.SellbotNerfHolidayStart) base.localAvatar.setSystemMessage(0, TTLocalizer.SellbotNerfHolidayStart)

View file

@ -165,7 +165,6 @@ SERVER_BUFFER_TIME = 2.0
SERVER_INPUT_TIMEOUT = CLIENT_INPUT_TIMEOUT + SERVER_BUFFER_TIME SERVER_INPUT_TIMEOUT = CLIENT_INPUT_TIMEOUT + SERVER_BUFFER_TIME
MAX_JOIN_T = TTLocalizer.BBbattleInputTimeout MAX_JOIN_T = TTLocalizer.BBbattleInputTimeout
FACEOFF_TAUNT_T = 3.5 FACEOFF_TAUNT_T = 3.5
FACEOFF_LOOK_AT_PROP_T = 6
ELEVATOR_T = 4.0 ELEVATOR_T = 4.0
BATTLE_SMALL_VALUE = 1e-07 BATTLE_SMALL_VALUE = 1e-07
MAX_EXPECTED_DISTANCE_FROM_BATTLE = 50.0 MAX_EXPECTED_DISTANCE_FROM_BATTLE = 50.0

View file

@ -261,10 +261,7 @@ class BattleCalculatorAI:
return return
def __checkPropBonus(self, track): def __checkPropBonus(self, track):
result = False return self.battle.getInteractivePropTrackBonus() == track
if self.battle.getInteractivePropTrackBonus() == track:
result = True
return result
def __targetDefense(self, suit, atkTrack): def __targetDefense(self, suit, atkTrack):
if atkTrack == HEAL: if atkTrack == HEAL:

View file

@ -39,25 +39,6 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.ignore(self.PlayGameSetPlaceEvent) self.ignore(self.PlayGameSetPlaceEvent)
self.removeCollisionData() self.removeCollisionData()
def setInteractivePropTrackBonus(self, trackBonus):
DistributedBattleBase.DistributedBattleBase.setInteractivePropTrackBonus(self, trackBonus)
if self.interactivePropTrackBonus >= 0:
if base.cr.playGame.hood:
self.calcInteractiveProp()
else:
self.acceptOnce(self.PlayGameSetPlaceEvent, self.calcInteractiveProp)
def calcInteractiveProp(self):
if base.cr.playGame.hood:
loader = base.cr.playGame.hood.loader
if hasattr(loader, 'getInteractiveProp'):
self.interactiveProp = loader.getInteractiveProp(self.zoneId)
self.notify.debug('self.interactiveProp = %s' % self.interactiveProp)
else:
self.notify.warning('no loader.getInteractiveProp self.interactiveProp is None')
else:
self.notify.warning('no hood self.interactiveProp is None')
def setMembers(self, suits, suitsJoining, suitsPending, suitsActive, suitsLured, suitTraps, toons, toonsJoining, toonsPending, toonsActive, toonsRunning, timestamp): def setMembers(self, suits, suitsJoining, suitsPending, suitsActive, suitsLured, suitTraps, toons, toonsJoining, toonsPending, toonsActive, toonsRunning, timestamp):
if self.battleCleanedUp(): if self.battleCleanedUp():
return return
@ -119,9 +100,6 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
camTrack.append(Func(camera.setPos, self.camFOPos)) camTrack.append(Func(camera.setPos, self.camFOPos))
camTrack.append(Func(camera.lookAt, suit.getPos(self))) camTrack.append(Func(camera.lookAt, suit.getPos(self)))
camTrack.append(Wait(faceoffTime)) camTrack.append(Wait(faceoffTime))
if self.interactiveProp:
camTrack.append(Func(camera.lookAt, self.interactiveProp.node.getPos(self)))
camTrack.append(Wait(FACEOFF_LOOK_AT_PROP_T))
suitTrack.append(Wait(delay)) suitTrack.append(Wait(delay))
toonTrack.append(Wait(delay)) toonTrack.append(Wait(delay))
suitTrack.append(Func(suit.headsUp, self, suitPos)) suitTrack.append(Func(suit.headsUp, self, suitPos))
@ -155,8 +133,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
if len(self.toons) > 0 and base.localAvatar == self.toons[0]: if len(self.toons) > 0 and base.localAvatar == self.toons[0]:
Emote.globalEmote.disableAll(self.toons[0], 'dbattle, enterFaceOff') Emote.globalEmote.disableAll(self.toons[0], 'dbattle, enterFaceOff')
self.__faceOff(ts, self.faceOffName, self.__handleFaceOffDone) self.__faceOff(ts, self.faceOffName, self.__handleFaceOffDone)
if self.interactiveProp: prop = self.getInteractiveProp()
self.interactiveProp.gotoFaceoff()
if prop:
prop.gotoBattleCheer()
def __handleFaceOffDone(self): def __handleFaceOffDone(self):
self.notify.debug('FaceOff done') self.notify.debug('FaceOff done')
@ -184,8 +164,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
toon.startSmooth() toon.startSmooth()
self.accept('resumeAfterReward', self.handleResumeAfterReward) self.accept('resumeAfterReward', self.handleResumeAfterReward)
if self.interactiveProp: prop = self.getInteractiveProp()
self.interactiveProp.gotoVictory()
if prop:
prop.gotoVictory()
self.playReward(ts) self.playReward(ts)
def playReward(self, ts): def playReward(self, ts):
@ -213,8 +195,10 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.notify.debug('enterResume()') self.notify.debug('enterResume()')
if self.hasLocalToon(): if self.hasLocalToon():
self.removeLocalToon() self.removeLocalToon()
if self.interactiveProp: prop = self.getInteractiveProp()
self.interactiveProp.requestIdleOrSad()
if prop:
prop.requestIdleOrSad()
def exitResume(self): def exitResume(self):
pass pass

View file

@ -56,8 +56,6 @@ class DistributedBattleAI(DistributedBattleBaseAI.DistributedBattleBaseAI):
self.runableFsm.request('Unrunable') self.runableFsm.request('Unrunable')
self.suits[0].releaseControl() self.suits[0].releaseControl()
timeForFaceoff = self.calcFaceoffTime(self.pos, self.initialSuitPos) + FACEOFF_TAUNT_T + SERVER_BUFFER_TIME timeForFaceoff = self.calcFaceoffTime(self.pos, self.initialSuitPos) + FACEOFF_TAUNT_T + SERVER_BUFFER_TIME
if self.interactivePropTrackBonus >= 0:
timeForFaceoff += FACEOFF_LOOK_AT_PROP_T
self.timer.startCallback(timeForFaceoff, self.__serverFaceOffDone) self.timer.startCallback(timeForFaceoff, self.__serverFaceOffDone)
return None return None

View file

@ -317,12 +317,23 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
def setBattleCellId(self, battleCellId): def setBattleCellId(self, battleCellId):
pass pass
def setInteractivePropTrackBonus(self, trackBonus): def getInteractiveProp(self):
self.interactivePropTrackBonus = trackBonus if self.interactiveProp:
return self.interactiveProp
elif base.cr.playGame.hood:
loader = base.cr.playGame.hood.loader
if hasattr(loader, 'getInteractiveProp'):
self.interactiveProp = base.cr.playGame.hood.loader.getInteractiveProp(self.zoneId)
return self.interactiveProp
return None
def getInteractivePropTrackBonus(self): def getInteractivePropTrackBonus(self):
return self.interactivePropTrackBonus prop = self.getInteractiveProp()
return prop.BattleTrack if prop else -1
def setPosition(self, x, y, z): def setPosition(self, x, y, z):
self.notify.debug('setPosition() - %d %d %d' % (x, y, z)) self.notify.debug('setPosition() - %d %d %d' % (x, y, z))
@ -363,12 +374,17 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
oldsuits = self.suits oldsuits = self.suits
self.suits = [] self.suits = []
suitGone = 0 suitGone = 0
prop = self.getInteractiveProp()
for s in suits: for s in suits:
if s in self.cr.doId2do: if s in self.cr.doId2do:
suit = self.cr.doId2do[s] suit = self.cr.doId2do[s]
suit.setState('Battle') suit.setState('Battle')
self.suits.append(suit) self.suits.append(suit)
suit.interactivePropTrackBonus = self.interactivePropTrackBonus
if prop:
suit.interactivePropTrackBonus = prop.BattleTrack
try: try:
suit.battleTrap suit.battleTrap
except: except:
@ -1048,9 +1064,10 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
return Task.done return Task.done
def enterWaitForInput(self, ts = 0): def enterWaitForInput(self, ts = 0):
self.notify.debug('enterWaitForInput()') prop = self.getInteractiveProp()
if self.interactiveProp:
self.interactiveProp.gotoBattleCheer() if prop:
prop.gotoBattleCheer()
self.choseAttackAlready = 0 self.choseAttackAlready = 0
if self.localToonActive(): if self.localToonActive():
self.__enterLocalToonWaitForInput() self.__enterLocalToonWaitForInput()
@ -1242,7 +1259,10 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
if base.cr.playGame.getPlace() != None: if base.cr.playGame.getPlace() != None:
base.cr.playGame.getPlace().setState('battle', self.localToonBattleEvent) base.cr.playGame.getPlace().setState('battle', self.localToonBattleEvent)
if localAvatar and hasattr(localAvatar, 'inventory') and localAvatar.inventory: if localAvatar and hasattr(localAvatar, 'inventory') and localAvatar.inventory:
localAvatar.inventory.setInteractivePropTrackBonus(self.interactivePropTrackBonus) prop = self.getInteractiveProp()
if prop:
localAvatar.inventory.setInteractivePropTrackBonus(prop.BattleTrack)
camera.wrtReparentTo(self) camera.wrtReparentTo(self)
base.camLens.setMinFov(self.camFov/(4./3.)) base.camLens.setMinFov(self.camFov/(4./3.))
return return

View file

@ -400,8 +400,7 @@ class Movie(DirectObject.DirectObject):
if ival: if ival:
track.append(ival) track.append(ival)
camTrack.append(camIval) camTrack.append(camIval)
hasHealBonus = self.battle.getInteractivePropTrackBonus() == HEAL ival, camIval = MovieHeal.doHeals(self.__findToonAttack(HEAL), self.battle.getInteractivePropTrackBonus() == HEAL)
ival, camIval = MovieHeal.doHeals(self.__findToonAttack(HEAL), hasHealBonus)
if ival: if ival:
track.append(ival) track.append(ival)
camTrack.append(camIval) camTrack.append(camIval)

View file

@ -1,50 +0,0 @@
from pandac.PandaModules import DecalEffect, DepthWriteAttrib
from direct.directnotify import DirectNotifyGlobal
from toontown.building import DistributedBuilding
class DistributedAnimBuilding(DistributedBuilding.DistributedBuilding):
def __init__(self, cr):
DistributedBuilding.DistributedBuilding.__init__(self, cr)
def enterToon(self, ts):
DistributedBuilding.DistributedBuilding.enterToon(self, ts)
self.fixEffects()
def fixEffects(self):
nodes = self.getNodePaths()
for curNode in nodes:
mf = curNode.find('**/*mesh_front*')
sign_joint = curNode.find('**/sign_origin_joint')
if not sign_joint.isEmpty():
self.notify.debug('I found sign_origin_joint 1')
if not mf.isEmpty():
sign = mf.find('**/sign')
mf.clearEffect(DecalEffect.getClassType())
if not sign.isEmpty():
sign.setDepthWrite(1, 1)
sign.setEffect(DecalEffect.make())
sign_joint = curNode.find('**/sign_origin_joint')
allSignJoints = curNode.findAllMatches('**/sign_origin_joint')
num = allSignJoints.getNumPaths()
if num:
sign_joint = allSignJoints.getPath(num - 1)
if not sign_joint.isEmpty():
self.notify.debug('I found sign_origin_joint 2')
sign.wrtReparentTo(sign_joint)
def setupNametag(self):
if not self.wantsNametag():
return
DistributedBuilding.DistributedBuilding.setupNametag(self)
def getSbSearchString(self):
result = 'landmarkBlocks/sb' + str(self.block) + ':*animated_building_*_DNARoot'
return result
def adjustSbNodepathScale(self, nodePath):
nodePath.setScale(0.543667, 1, 1)
def animToToon(self, timeStamp):
DistributedBuilding.DistributedBuilding.animToToon(self, timeStamp)
self.fixEffects()

View file

@ -1,6 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.building.DistributedBuildingAI import DistributedBuildingAI
class DistributedAnimBuildingAI(DistributedBuildingAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedAnimBuildingAI")

View file

@ -1,143 +0,0 @@
from pandac.PandaModules import NodePath, VBase3
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import Parallel, Sequence, Wait, HprInterval, LerpHprInterval, SoundInterval
from toontown.building import DistributedDoor
from toontown.building import DoorTypes
if (__debug__):
import pdb
class DistributedAnimDoor(DistributedDoor.DistributedDoor):
def __init__(self, cr):
DistributedDoor.DistributedDoor.__init__(self, cr)
base.animDoor = self
def getBuilding(self):
if 'building' not in self.__dict__:
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
searchStr = '**/??' + str(self.block) + ':animated_building_*_DNARoot;+s'
self.notify.debug('searchStr=%s' % searchStr)
self.building = self.cr.playGame.hood.loader.geom.find(searchStr)
else:
self.notify.error('DistributedAnimDoor.getBuiding with doorType=%s' % self.doorType)
return self.building
def getDoorNodePath(self):
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
if hasattr(self, 'tempDoorNodePath'):
return self.tempDoorNodePath
else:
building = self.getBuilding()
doorNP = building.find('**/door_origin')
self.notify.debug('creating doorOrigin at %s %s' % (str(doorNP.getPos()), str(doorNP.getHpr())))
otherNP = NodePath('doorOrigin')
otherNP.setPos(doorNP.getPos())
otherNP.setHpr(doorNP.getHpr())
otherNP.reparentTo(doorNP.getParent())
self.tempDoorNodePath = otherNP
else:
self.notify.error('DistributedAnimDoor.getDoorNodePath with doorType=%s' % self.doorType)
return otherNP
def setTriggerName(self):
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
building = self.getBuilding()
if not building.isEmpty():
doorTrigger = building.find('**/door_0_door_trigger')
if not doorTrigger.isEmpty():
doorTrigger.node().setName(self.getTriggerName())
else:
self.notify.warning('setTriggerName failed no building')
else:
self.notify.error('setTriggerName doorTYpe=%s' % self.doorType)
def getAnimBuilding(self):
if 'animBuilding' not in self.__dict__:
if self.doorType == DoorTypes.EXT_ANIM_STANDARD:
bldg = self.getBuilding()
key = bldg.getParent().getParent()
animPropList = self.cr.playGame.hood.loader.animPropDict.get(key)
if animPropList:
for prop in animPropList:
if bldg == prop.getActor().getParent():
self.animBuilding = prop
break
else:
self.notify.error('could not find' + str(key))
else:
self.notify.error('No such door type as ' + str(self.doorType))
return self.animBuilding
def getBuildingActor(self):
result = self.getAnimBuilding().getActor()
return result
def enterOpening(self, ts):
bldgActor = self.getBuildingActor()
rightDoor = bldgActor.controlJoint(None, 'modelRoot', 'def_right_door')
if rightDoor.isEmpty():
self.notify.warning('enterOpening(): did not find rightDoor')
return
otherNP = self.getDoorNodePath()
trackName = 'doorOpen-%d' % self.doId
if self.rightSwing:
h = 100
else:
h = -100
self.finishDoorTrack()
self.doorTrack = Parallel(SoundInterval(self.openSfx, node=rightDoor), Sequence(HprInterval(rightDoor, VBase3(0, 0, 0)), Wait(0.4), LerpHprInterval(nodePath=rightDoor, duration=0.6, hpr=VBase3(h, 0, 0), startHpr=VBase3(0, 0, 0), blendType='easeInOut')), name=trackName)
self.doorTrack.start(ts)
return
def enterClosing(self, ts):
bldgActor = self.getBuildingActor()
rightDoor = bldgActor.controlJoint(None, 'modelRoot', 'def_right_door')
if rightDoor.isEmpty():
self.notify.warning('enterClosing(): did not find rightDoor')
return
otherNP = self.getDoorNodePath()
trackName = 'doorClose-%d' % self.doId
if self.rightSwing:
h = 100
else:
h = -100
self.finishDoorTrack()
self.doorTrack = Sequence(LerpHprInterval(nodePath=rightDoor, duration=1.0, hpr=VBase3(0, 0, 0), startHpr=VBase3(h, 0, 0), blendType='easeInOut'), SoundInterval(self.closeSfx, node=rightDoor), name=trackName)
self.doorTrack.start(ts)
if hasattr(self, 'done'):
request = self.getRequestStatus()
messenger.send('doorDoneEvent', [request])
return
def exitDoorEnterOpening(self, ts):
bldgActor = self.getBuildingActor()
leftDoor = bldgActor.controlJoint(None, 'modelRoot', 'def_left_door')
if self.leftSwing:
h = -100
else:
h = 100
if not leftDoor.isEmpty():
otherNP = self.getDoorNodePath()
trackName = 'doorDoorExitTrack-%d' % self.doId
self.finishDoorExitTrack()
self.doorExitTrack = Parallel(SoundInterval(self.openSfx, node=leftDoor), Sequence(LerpHprInterval(nodePath=leftDoor, duration=0.6, hpr=VBase3(h, 0, 0), startHpr=VBase3(0, 0, 0), blendType='easeInOut')), name=trackName)
self.doorExitTrack.start(ts)
else:
self.notify.warning('exitDoorEnterOpening(): did not find leftDoor')
return
def exitDoorEnterClosing(self, ts):
bldgActor = self.getBuildingActor()
leftDoor = bldgActor.controlJoint(None, 'modelRoot', 'def_left_door')
if self.leftSwing:
h = -100
else:
h = 100
if not leftDoor.isEmpty():
otherNP = self.getDoorNodePath()
trackName = 'doorExitTrack-%d' % self.doId
self.finishDoorExitTrack()
self.doorExitTrack = Sequence(LerpHprInterval(nodePath=leftDoor, duration=1.0, hpr=VBase3(0, 0, 0), startHpr=VBase3(h, 0, 0), blendType='easeInOut'), SoundInterval(self.closeSfx, node=leftDoor), name=trackName)
self.doorExitTrack.start(ts)
return

View file

@ -1,6 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.building.DistributedDoorAI import DistributedDoorAI
class DistributedAnimDoorAI(DistributedDoorAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedAnimDoorAI")

View file

@ -236,8 +236,11 @@ class DistributedBuilding(DistributedObject.DistributedObject):
pass pass
def enterToon(self, ts): def enterToon(self, ts):
if self.getInteractiveProp(): prop = self.getInteractiveProp()
self.getInteractiveProp().buildingLiberated(self.doId)
if prop:
prop.buildingLiberated(self.doId)
self.setToToon() self.setToToon()
def exitToon(self): def exitToon(self):
@ -922,38 +925,30 @@ class DistributedBuilding(DistributedObject.DistributedObject):
self.elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0) self.elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0)
def getSbSearchString(self): def getSbSearchString(self):
result = 'landmarkBlocks/sb' + str(self.block) + ':*_landmark_*_DNARoot' return 'landmarkBlocks/sb' + str(self.block) + ':*_landmark_*_DNARoot'
return result
def adjustSbNodepathScale(self, nodePath): def adjustSbNodepathScale(self, nodePath):
pass pass
def getVisZoneId(self): def getVisZoneId(self):
exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block) exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
visZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId)
return visZoneId return ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId)
def getInteractiveProp(self): def getInteractiveProp(self):
result = None
if self.interactiveProp: if self.interactiveProp:
result = self.interactiveProp return self.interactiveProp
else: elif base.cr.playGame.hood:
visZoneId = self.getVisZoneId() loader = base.cr.playGame.hood.loader
if base.cr.playGame.hood:
loader = base.cr.playGame.hood.loader if hasattr(loader, 'getInteractiveProp'):
if hasattr(loader, 'getInteractiveProp'): self.interactiveProp = base.cr.playGame.hood.loader.getInteractiveProp(self.getVisZoneId())
self.interactiveProp = loader.getInteractiveProp(visZoneId)
result = self.interactiveProp return self.interactiveProp
self.notify.debug('self.interactiveProp = %s' % self.interactiveProp) return None
else:
self.notify.warning('no loader.getInteractiveProp self.interactiveProp is None')
else:
self.notify.warning('no hood self.interactiveProp is None')
return result
def makePropSad(self): def makePropSad(self):
self.notify.debug('makePropSad') prop = self.getInteractiveProp()
if self.getInteractiveProp():
if self.getInteractiveProp().state == 'Sad': if prop and not prop.state == 'Sad':
pass prop.gotoSad(self.doId)
self.getInteractiveProp().gotoSad(self.doId)

View file

@ -8,7 +8,6 @@ from toontown.building import KartShopBuildingAI
from toontown.building import PetshopBuildingAI from toontown.building import PetshopBuildingAI
from toontown.building import LibraryBuildingAI from toontown.building import LibraryBuildingAI
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
# from toontown.building import DistributedAnimBuildingAI
class DistributedBuildingMgrAI: class DistributedBuildingMgrAI:
@ -93,7 +92,6 @@ class DistributedBuildingMgrAI:
petshopBlocks = [] petshopBlocks = []
kartshopBlocks = [] kartshopBlocks = []
libraryBlocks = [] libraryBlocks = []
animBldgBlocks = []
for i in xrange(self.dnaStore.getNumBlockNumbers()): for i in xrange(self.dnaStore.getNumBlockNumbers()):
blockNumber = self.dnaStore.getBlockNumberAt(i) blockNumber = self.dnaStore.getBlockNumberAt(i)
buildingType = self.dnaStore.getBlockBuildingType(blockNumber) buildingType = self.dnaStore.getBlockBuildingType(blockNumber)
@ -108,19 +106,15 @@ class DistributedBuildingMgrAI:
kartshopBlocks.append(blockNumber) kartshopBlocks.append(blockNumber)
elif buildingType == 'library': elif buildingType == 'library':
libraryBlocks.append(blockNumber) libraryBlocks.append(blockNumber)
elif buildingType == 'animbldg':
animBldgBlocks.append(blockNumber)
else: else:
blocks.append(blockNumber) blocks.append(blockNumber)
return (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks, animBldgBlocks) return (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks)
def findAllLandmarkBuildings(self): def findAllLandmarkBuildings(self):
backups = simbase.backups.load('block-info', (self.air.districtId, self.branchId), default={}) backups = simbase.backups.load('block-info', (self.air.districtId, self.branchId), default={})
(blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks, animBldgBlocks) = self.getDNABlockLists() (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks) = self.getDNABlockLists()
for blockNumber in blocks: for blockNumber in blocks:
self.newBuilding(blockNumber, backup=backups.get(blockNumber, None)) self.newBuilding(blockNumber, backup=backups.get(blockNumber, None))
for blockNumber in animBldgBlocks:
self.newAnimBuilding(blockNumber, backup=backups.get(blockNumber, None))
for blockNumber in hqBlocks: for blockNumber in hqBlocks:
self.newHQBuilding(blockNumber) self.newHQBuilding(blockNumber)
for blockNumber in gagshopBlocks: for blockNumber in gagshopBlocks:
@ -158,9 +152,6 @@ class DistributedBuildingMgrAI:
self.__buildings[blockNumber] = building self.__buildings[blockNumber] = building
return building return building
def newAnimBuilding(self, blockNumber, backup=None):
return self.newBuilding(blockNumber, backup=backup)
def newHQBuilding(self, blockNumber): def newHQBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)

View file

@ -7,5 +7,4 @@ INT_HOUSE = 6
EXT_COGHQ = 7 EXT_COGHQ = 7
INT_COGHQ = 8 INT_COGHQ = 8
EXT_KS = 9 EXT_KS = 9
INT_KS = 10 INT_KS = 10
EXT_ANIM_STANDARD = 11

View file

@ -62,6 +62,8 @@ class BankGui(DirectFrame):
messenger.send(self.doneEvent, [0]) messenger.send(self.doneEvent, [0])
def __requestTransaction(self): def __requestTransaction(self):
self.ignore(localAvatar.uniqueName('moneyChange'))
self.ignore(localAvatar.uniqueName('bankMoneyChange'))
messenger.send(self.doneEvent, [self.__transactionAmount]) messenger.send(self.doneEvent, [self.__transactionAmount])
def __updateTransaction(self, amount): def __updateTransaction(self, amount):

View file

@ -1,10 +0,0 @@
from toontown.hood import GenericAnimatedProp
class GenericAnimatedBuilding(GenericAnimatedProp.GenericAnimatedProp):
def __init__(self, node):
GenericAnimatedProp.GenericAnimatedProp.__init__(self, node)
def enter(self):
if base.config.GetBool('buildings-animate', False):
GenericAnimatedProp.GenericAnimatedProp.enter(self)

View file

@ -23,8 +23,6 @@ class GenericAnimatedProp(AnimatedProp.AnimatedProp):
nextUnderscore = tempStr.find('_') nextUnderscore = tempStr.find('_')
finalStr = tempStr[nextUnderscore + 1:] finalStr = tempStr[nextUnderscore + 1:]
pathStr = finalStr.split('__')[0] pathStr = finalStr.split('__')[0]
elif code.startswith('animated_building_'):
pathStr = code[len('animated_building_'):].split('__')[0]
phaseDelimeter = len('phase_') + pathStr[len('phase_'):].find('_') phaseDelimeter = len('phase_') + pathStr[len('phase_'):].find('_')
phaseStr = pathStr[:phaseDelimeter] phaseStr = pathStr[:phaseDelimeter]
pathTokens = pathStr[phaseDelimeter + 1:].split('_') pathTokens = pathStr[phaseDelimeter + 1:].split('_')
@ -48,19 +46,7 @@ class GenericAnimatedProp(AnimatedProp.AnimatedProp):
def enter(self): def enter(self):
self.node.postFlatten() self.node.postFlatten()
AnimatedProp.AnimatedProp.enter(self) AnimatedProp.AnimatedProp.enter(self)
doAnimLoop = True self.node.loop('anim')
try:
if type(self).__name__ == 'instance':
if self.__class__.__name__ == 'GenericAnimatedProp':
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HYDRANTS_BUFF_BATTLES):
doAnimLoop = True
else:
doAnimLoop = False
except:
pass
if doAnimLoop:
self.node.loop('anim')
def exit(self): def exit(self):
AnimatedProp.AnimatedProp.exit(self) AnimatedProp.AnimatedProp.exit(self)
@ -81,14 +67,13 @@ class GenericAnimatedProp(AnimatedProp.AnimatedProp):
self.hoodId = ToontownGlobals.ToontownCentral self.hoodId = ToontownGlobals.ToontownCentral
fullString = str(node) fullString = str(node)
splits = fullString.split('/') splits = fullString.split('/')
try: if len(splits) >= 5:
visId = int(splits[2]) visId = int(splits[4])
self.visId = visId self.visId = visId
self.hoodId = ZoneUtil.getCanonicalHoodId(visId) self.hoodId = ZoneUtil.getCanonicalHoodId(visId)
self.notify.debug('calcHoodId %d from %s' % (self.hoodId, fullString)) self.notify.debug('calcHoodId %d from %s' % (self.hoodId, fullString))
except Exception, generic: else:
if 'Editor' not in fullString: self.notify.warning("calcHoodId couldn't parse %s using 0" % fullString)
self.notify.warning("calcHoodId couldn't parse %s using 0" % fullString)
self.hoodId = 0 self.hoodId = 0
self.visId = 0 self.visId = 0

View file

@ -2,207 +2,94 @@ from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import Sequence, Func from direct.interval.IntervalGlobal import Sequence, Func
from toontown.hood import InteractiveAnimatedProp from toontown.hood import InteractiveAnimatedProp
from toontown.hood import GenericAnimatedProp
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp): class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp') notify = DirectNotifyGlobal.directNotify.newCategory('HydrantInteractiveProp')
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.SQUIRT_TRACK] BattleTrack = ToontownBattleGlobals.SQUIRT_TRACK
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0', BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
1,
1, ZoneToIdles = {
None, ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_hydrant_idle0', 1, 1, None, 3, 10),
3, ('tt_a_ara_ttc_hydrant_idle2', 1, 1, None, 3, 10),
10), ('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10),
('tt_a_ara_ttc_hydrant_idle2', ('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.DonaldsDock: (('tt_a_ara_ttc_hydrant_idle0', 1, 1, None, 3, 10),
1, ('tt_a_ara_ttc_hydrant_idle2', 1, 1, None, 3, 10),
None, ('tt_a_ara_ttc_hydrant_idle1', 1, 1, None, 3, 10),
3, ('tt_a_ara_ttc_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
10), ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_hydrant_idle0', 3, 10, 'tt_a_ara_dga_hydrant_idle0settle', 3, 10),
('tt_a_ara_ttc_hydrant_idle1', ('tt_a_ara_dga_hydrant_idleLook1', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_hydrant_idleSneeze2', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
None, ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_hydrant_idle0', 3, 10, 'tt_a_ara_mml_hydrant_idle0settle', 3, 10),
3, ('tt_a_ara_mml_hydrant_idle2', 3, 10, 'tt_a_ara_mml_hydrant_idle2settle', 3, 10),
10), ('tt_a_ara_mml_hydrant_idle1', 3, 10, 'tt_a_ara_mml_hydrant_idle1settle', 3, 10),
('tt_a_ara_ttc_hydrant_idleAwesome3', ('tt_a_ara_mml_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_hydrant_idleShiver1', 1, 1, None, 3, 10),
1, ('tt_a_ara_tbr_hydrant_idleRubNose0', 1, 1, None, 3, 10),
None, ('tt_a_ara_tbr_hydrant_idleSneeze2', 1, 1, None, 3, 10),
3, ('tt_a_ara_tbr_hydrant_idleAwesome3', 1, 1, None, 3, 10)),
10)), ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_hydrant_idle0', 3, 10, None, 0, 0),
ToontownGlobals.DonaldsDock: (('tt_a_ara_ttc_hydrant_idle0', ('tt_a_ara_ddl_hydrant_idle1', 1, 1, None, 0, 0),
1, ('tt_a_ara_ddl_hydrant_idle2', 1, 1, None, 0, 0),
1, ('tt_a_ara_ddl_hydrant_idleAwesome3', 1, 1, None, 0, 0))}
None,
3, ZoneToIdleIntoFightAnims = {
10), ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_idleIntoFight',
('tt_a_ara_ttc_hydrant_idle2', ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_idleIntoFight',
1, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_idleIntoFight',
1, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_idleIntoFight',
None, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_idleIntoFight',
3, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_idleIntoFight'}
10),
('tt_a_ara_ttc_hydrant_idle1', ZoneToVictoryAnims = {
1, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_victoryDance',
1, ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_victoryDance',
None, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_victoryDance',
3, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_victoryDance',
10), ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_victoryDance',
('tt_a_ara_ttc_hydrant_idleAwesome3', ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_victoryDance'}
1,
1, ZoneToSadAnims = {
None, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_fightSad',
3, ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_fightSad',
10)), ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_fightSad',
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_hydrant_idle0', ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_fightSad',
3, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_fightSad',
10, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_fightSad'}
'tt_a_ara_dga_hydrant_idle0settle',
3, ZoneToFightAnims = {
10), ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
('tt_a_ara_dga_hydrant_idleLook1', ToontownGlobals.DonaldsDock: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
1, ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_hydrant_fightBoost', 'tt_a_ara_dga_hydrant_fightCheer', 'tt_a_ara_dga_hydrant_fightIdle'),
1, ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_hydrant_fightBoost', 'tt_a_ara_mml_hydrant_fightCheer', 'tt_a_ara_mml_hydrant_fightIdle'),
None, ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_hydrant_fightBoost', 'tt_a_ara_tbr_hydrant_fightCheer', 'tt_a_ara_tbr_hydrant_fightIdle'),
3, ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_hydrant_fightBoost', 'tt_a_ara_ddl_hydrant_fightCheer', 'tt_a_ara_ddl_hydrant_fightIdle')}
10),
('tt_a_ara_dga_hydrant_idleSneeze2',
1,
1,
None,
3,
10),
('tt_a_ara_dga_hydrant_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_hydrant_idle0',
3,
10,
'tt_a_ara_mml_hydrant_idle0settle',
3,
10),
('tt_a_ara_mml_hydrant_idle2',
3,
10,
'tt_a_ara_mml_hydrant_idle2settle',
3,
10),
('tt_a_ara_mml_hydrant_idle1',
3,
10,
'tt_a_ara_mml_hydrant_idle1settle',
3,
10),
('tt_a_ara_mml_hydrant_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_hydrant_idleShiver1',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_hydrant_idleRubNose0',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_hydrant_idleSneeze2',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_hydrant_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_hydrant_idle0',
3,
10,
None,
0,
0),
('tt_a_ara_ddl_hydrant_idle1',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_hydrant_idle2',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_hydrant_idleAwesome3',
1,
1,
None,
0,
0))}
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_idleIntoFight',
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_idleIntoFight',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_idleIntoFight',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_idleIntoFight',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_idleIntoFight',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_idleIntoFight'}
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_victoryDance',
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_victoryDance',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_victoryDance',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_victoryDance',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_victoryDance',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_victoryDance'}
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_hydrant_fightSad',
ToontownGlobals.DonaldsDock: 'tt_a_ara_ttc_hydrant_fightSad',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_hydrant_fightSad',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_hydrant_fightSad',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_hydrant_fightSad',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_hydrant_fightSad'}
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
ToontownGlobals.DonaldsDock: ('tt_a_ara_ttc_hydrant_fightBoost', 'tt_a_ara_ttc_hydrant_fightCheer', 'tt_a_ara_ttc_hydrant_fightIdle'),
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_hydrant_fightBoost', 'tt_a_ara_dga_hydrant_fightCheer', 'tt_a_ara_dga_hydrant_fightIdle'),
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_hydrant_fightBoost', 'tt_a_ara_mml_hydrant_fightCheer', 'tt_a_ara_mml_hydrant_fightIdle'),
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_hydrant_fightBoost', 'tt_a_ara_tbr_hydrant_fightCheer', 'tt_a_ara_tbr_hydrant_fightIdle'),
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_hydrant_fightBoost', 'tt_a_ara_ddl_hydrant_fightCheer', 'tt_a_ara_ddl_hydrant_fightIdle')}
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0) IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
def __init__(self, node): def __init__(self, node):
self.leftWater = None self.leftWater = None
self.rightWater = None self.rightWater = None
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.HYDRANTS_BUFF_BATTLES) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
return
def setupActor(self, node): def setupActor(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node) InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
if not self.hoodId == ToontownGlobals.TheBrrrgh: if not self.hoodId == ToontownGlobals.TheBrrrgh:
water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt') water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt')
self.leftWater = water.find('**/efx_hydrantSquirtLeft') self.leftWater = water.find('**/efx_hydrantSquirtLeft')
self.rightWater = water.find('**/efx_hydrantSquirtRight') self.rightWater = water.find('**/efx_hydrantSquirtRight')
dx_left_water = self.node.find('**/dx_left_water')
if self.leftWater: if self.leftWater:
self.leftWater.reparentTo(dx_left_water) self.leftWater.reparentTo(self.node.find('**/dx_left_water'))
base.leftWater = self.leftWater base.leftWater = self.leftWater
self.leftWater.hide() self.leftWater.hide()
else:
self.notify.warning('couldnt find %s in rig for hood %d' % ('dx_left_water', self.hoodId))
dx_right_water = self.node.find('**/dx_right_water')
if self.rightWater: if self.rightWater:
self.rightWater.reparentTo(dx_right_water) self.rightWater.reparentTo(self.node.find('**/dx_right_water'))
self.rightWater.hide() self.rightWater.hide()
else:
self.notify.warning('couldnt find %s in rig for hood %d' % ('dx_left_water', self.hoodId))
def hideWater(self): def hideWater(self):
if self.leftWater: if self.leftWater:
@ -217,20 +104,15 @@ class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
self.rightWater.show() self.rightWater.show()
def hasOverrideIval(self, origAnimName): def hasOverrideIval(self, origAnimName):
result = False return ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
result = True
return result
def getOverrideIval(self, origAnimName): def getOverrideIval(self, origAnimName):
result = Sequence() result = Sequence()
if ('fightBoost' in origAnimName or 'fightCheer' in origAnimName) and not self.hoodId == ToontownGlobals.TheBrrrgh:
if self.hasOverrideIval(origAnimName):
result.append(Func(self.showWater)) result.append(Func(self.showWater))
if 'fightBoost' in origAnimName: animAndSound = self.createAnimAndSoundIval('fight0' if 'fightBoost' in origAnimName else 'fight1')
animKey = 'fight0'
else:
animKey = 'fight1'
animAndSound = self.createAnimAndSoundIval(animKey)
result.append(animAndSound) result.append(animAndSound)
result.append(Func(self.hideWater)) result.append(Func(self.hideWater))
return result
return result

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class HydrantOneAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantOneAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_ttc_hydrant_firstMoveArmUp1', 40 * PauseTimeMult),
1: ('tt_a_ara_ttc_hydrant_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_ttc_hydrant_firstMoveArmUp2', 10 * PauseTimeMult),
3: ('tt_a_ara_ttc_hydrant_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_ttc_hydrant_firstMoveJumpBalance', 6 * PauseTimeMult),
5: ('tt_a_ara_ttc_hydrant_firstMoveArmUp3', 4 * PauseTimeMult),
6: ('tt_a_ara_ttc_hydrant_firstMoveJumpSpin', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 3
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'hydrant', self.PhaseInfo, ToontownGlobals.HYDRANT_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class HydrantTwoAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantTwoAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_ttc_hydrant_firstMoveArmUp1', 40 * PauseTimeMult),
1: ('tt_a_ara_ttc_hydrant_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_ttc_hydrant_firstMoveArmUp2', 10 * PauseTimeMult),
3: ('tt_a_ara_ttc_hydrant_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_ttc_hydrant_firstMoveJumpBalance', 6 * PauseTimeMult),
5: ('tt_a_ara_ttc_hydrant_firstMoveArmUp3', 4 * PauseTimeMult),
6: ('tt_a_ara_ttc_hydrant_firstMoveJumpSpin', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 5
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'hydrant', self.PhaseInfo, ToontownGlobals.HYDRANT_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,17 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class HydrantZeroAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('HydrantZeroAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_ttc_hydrant_firstMoveArmUp1', 40 * PauseTimeMult),
1: ('tt_a_ara_ttc_hydrant_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_ttc_hydrant_firstMoveArmUp2', 10 * PauseTimeMult),
3: ('tt_a_ara_ttc_hydrant_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_ttc_hydrant_firstMoveJumpBalance', 6 * PauseTimeMult),
5: ('tt_a_ara_ttc_hydrant_firstMoveArmUp3', 4 * PauseTimeMult),
6: ('tt_a_ara_ttc_hydrant_firstMoveJumpSpin', 2 * PauseTimeMult)}
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'hydrant', self.PhaseInfo, ToontownGlobals.HYDRANT_ZERO_HOLIDAY)

View file

@ -30,9 +30,8 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
HpTextGenerator = TextNode('HpTextGenerator') HpTextGenerator = TextNode('HpTextGenerator')
BattleCheerText = '+' BattleCheerText = '+'
def __init__(self, node, holidayId = -1): def __init__(self, node):
FSM.FSM.__init__(self, 'InteractiveProp-%s' % str(node)) FSM.FSM.__init__(self, 'InteractiveProp-%s' % str(node))
self.holidayId = holidayId
self.numIdles = 0 self.numIdles = 0
self.numFightAnims = 0 self.numFightAnims = 0
self.idleInterval = None self.idleInterval = None
@ -49,7 +48,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
self.lastPlayingAnimPhase = 0 self.lastPlayingAnimPhase = 0
self.buildingsMakingMeSad = set() self.buildingsMakingMeSad = set()
GenericAnimatedProp.GenericAnimatedProp.__init__(self, node) GenericAnimatedProp.GenericAnimatedProp.__init__(self, node)
return
def delete(self): def delete(self):
self.exit() self.exit()
@ -58,7 +56,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
self.battleCheerInterval = None self.battleCheerInterval = None
self.sadInterval = None self.sadInterval = None
self.victoryInterval = None self.victoryInterval = None
return
def getCellIndex(self): def getCellIndex(self):
return self.cellIndex return self.cellIndex
@ -114,7 +111,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
self.battleCheerInterval = self.createBattleCheerInterval() self.battleCheerInterval = self.createBattleCheerInterval()
self.victoryInterval = self.createVictoryInterval() self.victoryInterval = self.createVictoryInterval()
self.sadInterval = self.createSadInterval() self.sadInterval = self.createSadInterval()
return
def createIdleInterval(self): def createIdleInterval(self):
result = Sequence() result = Sequence()
@ -202,18 +198,9 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
GenericAnimatedProp.GenericAnimatedProp.enter(self) GenericAnimatedProp.GenericAnimatedProp.enter(self)
if base.config.GetBool('props-buff-battles', True): if base.config.GetBool('props-buff-battles', True):
self.notify.debug('props buff battles is true') self.notify.debug('props buff battles is true')
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.node.stop()
self.notify.debug('holiday is running, doing idle interval') self.node.pose('idle0', 0)
self.node.stop() self.idleInterval.loop()
self.node.pose('idle0', 0)
if base.config.GetBool('interactive-prop-random-idles', 1):
self.requestIdleOrSad()
else:
self.idleInterval.loop()
else:
self.notify.debug('holiday is NOT running, doing nothing')
self.node.stop()
self.node.pose('idle0', 0)
else: else:
self.notify.debug('props do not buff battles') self.notify.debug('props do not buff battles')
self.node.stop() self.node.stop()
@ -343,39 +330,24 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
def gotoFaceoff(self): def gotoFaceoff(self):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.request('Faceoff')
self.request('Faceoff')
else:
self.notify.debug('not going to faceoff because holiday %d is not running' % self.holidayId)
def gotoBattleCheer(self): def gotoBattleCheer(self):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.request('BattleCheer')
self.request('BattleCheer')
else:
self.notify.debug('not going to battleCheer because holiday %d is not running' % self.holidayId)
def gotoIdle(self): def gotoIdle(self):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.request('DoIdleAnim')
self.request('DoIdleAnim')
else:
self.notify.debug('not going to idle because holiday %d is not running' % self.holidayId)
def gotoVictory(self): def gotoVictory(self):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.request('Victory')
self.request('Victory')
else:
self.notify.debug('not going to victory because holiday %d is not running' % self.holidayId)
def gotoSad(self, buildingDoId): def gotoSad(self, buildingDoId):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
self.buildingsMakingMeSad.add(buildingDoId) self.buildingsMakingMeSad.add(buildingDoId)
if base.cr.newsManager.isHolidayRunning(self.holidayId): self.request('Sad')
self.request('Sad')
else:
self.notify.debug('not going to sad because holiday %d is not running' % self.holidayId)
def buildingLiberated(self, buildingDoId): def buildingLiberated(self, buildingDoId):
self.buildingsMakingMeSad.discard(buildingDoId) self.buildingsMakingMeSad.discard(buildingDoId)
@ -391,7 +363,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
self.notify.debugStateCall(self) self.notify.debugStateCall(self)
self.curIval.pause() self.curIval.pause()
self.curIval = None self.curIval = None
return
def calcWhichIdleAnim(self, animName): def calcWhichIdleAnim(self, animName):
result = 0 result = 0
@ -504,5 +475,4 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
if self.curIval: if self.curIval:
self.curIval.finish() self.curIval.finish()
clearPythonIvals(self.curIval) clearPythonIvals(self.curIval)
self.curIval = None self.curIval = None
return

View file

@ -2,201 +2,92 @@ from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import Sequence, Func from direct.interval.IntervalGlobal import Sequence, Func
from toontown.hood import InteractiveAnimatedProp from toontown.hood import InteractiveAnimatedProp
from toontown.hood import GenericAnimatedProp
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp): class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxInteractiveProp') notify = DirectNotifyGlobal.directNotify.newCategory('MailboxInteractiveProp')
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.THROW_TRACK] BattleTrack = ToontownBattleGlobals.THROW_TRACK
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0', BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
3,
10, ZoneToIdles = {
'tt_a_ara_ttc_mailbox_idle0settle', ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_mailbox_idle0', 3, 10, 'tt_a_ara_ttc_mailbox_idle0settle', 3, 10),
3, ('tt_a_ara_ttc_mailbox_idleTake2', 1, 1, None, 3, 10),
10), ('tt_a_ara_ttc_mailbox_idleLook1', 1, 1, None, 3, 10),
('tt_a_ara_ttc_mailbox_idleTake2', ('tt_a_ara_ttc_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_mailbox_idle0', 3, 10, 'tt_a_ara_dod_mailbox_idle0settle', 3, 10),
1, ('tt_a_ara_dod_mailbox_idle2', 1, 1, None, 3, 10),
None, ('tt_a_ara_dod_mailbox_idle1', 1, 1, None, 3, 10),
3, ('tt_a_ara_dod_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
10), ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_mailbox_idle0', 3, 10, 'tt_a_ara_dga_mailbox_idle0settle', 3, 10),
('tt_a_ara_ttc_mailbox_idleLook1', ('tt_a_ara_dga_mailbox_idleTake1', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_mailbox_idleLook2', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
None, ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_mailbox_idle0', 3, 10, 'tt_a_ara_mml_mailbox_idle0settle', 3, 10),
3, ('tt_a_ara_mml_mailbox_idleTake1', 1, 1, None, 3, 10),
10), ('tt_a_ara_mml_mailbox_idleLook2', 1, 1, None, 3, 10),
('tt_a_ara_ttc_mailbox_idleAwesome3', ('tt_a_ara_mml_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_mailbox_idleShiver1', 1, 1, None, 3, 10),
1, ('tt_a_ara_tbr_mailbox_idleSneeze2', 1, 1, None, 3, 10),
None, ('tt_a_ara_tbr_mailbox_idleSpin0', 1, 1, None, 3, 10),
3, ('tt_a_ara_tbr_mailbox_idleAwesome3', 1, 1, None, 3, 10)),
10)), ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_mailbox_idleSleep0', 3, 10, None, 0, 0),
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_mailbox_idle0', ('tt_a_ara_ddl_mailbox_idleShake2', 1, 1, None, 0, 0),
3, ('tt_a_ara_ddl_mailbox_idleSnore1', 1, 1, None, 0, 0),
10, ('tt_a_ara_ddl_mailbox_idleAwesome3', 1, 1, None, 0, 0))}
'tt_a_ara_dod_mailbox_idle0settle',
3, ZoneToIdleIntoFightAnims = {
10), ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_idleIntoFight',
('tt_a_ara_dod_mailbox_idle2', ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_idleIntoFight',
1, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_idleIntoFight',
1, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_idleIntoFight',
None, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_idleIntoFight',
3, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_idleIntoFight'}
10),
('tt_a_ara_dod_mailbox_idle1', ZoneToVictoryAnims = {
1, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_victoryDance',
1, ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_victoryDance',
None, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_victoryDance',
3, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_victoryDance',
10), ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_victoryDance',
('tt_a_ara_dod_mailbox_idleAwesome3', ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_victoryDance'}
1,
1, ZoneToSadAnims = {
None, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_fightSad',
3, ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_fightSad',
10)), ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_fightSad',
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_mailbox_idle0', ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_fightSad',
3, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_fightSad',
10, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_fightSad'}
'tt_a_ara_dga_mailbox_idle0settle',
3, ZoneToFightAnims = {
10), ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
('tt_a_ara_dga_mailbox_idleTake1', ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_mailbox_fightBoost', 'tt_a_ara_dod_mailbox_fightCheer', 'tt_a_ara_dod_mailbox_fightIdle'),
1, ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_mailbox_fightBoost', 'tt_a_ara_dga_mailbox_fightCheer', 'tt_a_ara_dga_mailbox_fightIdle'),
1, ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_mailbox_fightBoost', 'tt_a_ara_mml_mailbox_fightCheer', 'tt_a_ara_mml_mailbox_fightIdle'),
None, ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_mailbox_fightBoost', 'tt_a_ara_tbr_mailbox_fightCheer', 'tt_a_ara_tbr_mailbox_fightIdle'),
3, ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_mailbox_fightBoost', 'tt_a_ara_ddl_mailbox_fightCheer', 'tt_a_ara_ddl_mailbox_fightIdle')}
10),
('tt_a_ara_dga_mailbox_idleLook2',
1,
1,
None,
3,
10),
('tt_a_ara_dga_mailbox_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_mailbox_idle0',
3,
10,
'tt_a_ara_mml_mailbox_idle0settle',
3,
10),
('tt_a_ara_mml_mailbox_idleTake1',
1,
1,
None,
3,
10),
('tt_a_ara_mml_mailbox_idleLook2',
1,
1,
None,
3,
10),
('tt_a_ara_mml_mailbox_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_mailbox_idleShiver1',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_mailbox_idleSneeze2',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_mailbox_idleSpin0',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_mailbox_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_mailbox_idleSleep0',
3,
10,
None,
0,
0),
('tt_a_ara_ddl_mailbox_idleShake2',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_mailbox_idleSnore1',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_mailbox_idleAwesome3',
1,
1,
None,
0,
0))}
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_idleIntoFight',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_idleIntoFight',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_idleIntoFight',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_idleIntoFight',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_idleIntoFight',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_idleIntoFight'}
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_victoryDance',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_victoryDance',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_victoryDance',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_victoryDance',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_victoryDance',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_victoryDance'}
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_mailbox_fightSad',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_mailbox_fightSad',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_mailbox_fightSad',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_mailbox_fightSad',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_mailbox_fightSad',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_mailbox_fightSad'}
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_mailbox_fightBoost', 'tt_a_ara_ttc_mailbox_fightCheer', 'tt_a_ara_ttc_mailbox_fightIdle'),
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_mailbox_fightBoost', 'tt_a_ara_dod_mailbox_fightCheer', 'tt_a_ara_dod_mailbox_fightIdle'),
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_mailbox_fightBoost', 'tt_a_ara_dga_mailbox_fightCheer', 'tt_a_ara_dga_mailbox_fightIdle'),
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_mailbox_fightBoost', 'tt_a_ara_mml_mailbox_fightCheer', 'tt_a_ara_mml_mailbox_fightIdle'),
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_mailbox_fightBoost', 'tt_a_ara_tbr_mailbox_fightCheer', 'tt_a_ara_tbr_mailbox_fightIdle'),
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_mailbox_fightBoost', 'tt_a_ara_ddl_mailbox_fightCheer', 'tt_a_ara_ddl_mailbox_fightIdle')}
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0) IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
def __init__(self, node): def __init__(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.MAILBOXES_BUFF_BATTLES) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)
def setupActor(self, node): def setupActor(self, node):
self.pieActor = Actor.Actor('phase_5/models/char/tt_r_prp_ext_piePackage', {'fightBoost': 'phase_5/models/char/tt_a_prp_ext_piePackage_fightBoost'}) self.pieActor = Actor.Actor('phase_5/models/char/tt_r_prp_ext_piePackage', {'fightBoost': 'phase_5/models/char/tt_a_prp_ext_piePackage_fightBoost'})
self.pieActor.reparentTo(self.node) self.pieActor.reparentTo(self.node)
self.pieActor.hide() self.pieActor.hide()
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node) InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
def hasSpecialIval(self, origAnimName): def hasSpecialIval(self, origAnimName):
result = False return 'fightBoost' in origAnimName
if 'fightBoost' in origAnimName:
result = True
return result
def getSpecialIval(self, origAnimName): def getSpecialIval(self, origAnimName):
result = Sequence() result = Sequence()
if 'fightBoost' in origAnimName:
if self.hasSpecialIval(origAnimName):
result.append(Func(self.pieActor.show)) result.append(Func(self.pieActor.show))
result.append(self.pieActor.actorInterval('fightBoost')) result.append(self.pieActor.actorInterval('fightBoost'))
result.append(Func(self.pieActor.hide)) result.append(Func(self.pieActor.hide))
return result
return result

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class MailboxOneAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxOneAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin1', 40 * PauseTimeMult),
1: (('tt_a_ara_dod_mailbox_firstMoveStruggle', 'tt_a_ara_dod_mailbox_firstMoveJump'), 20 * PauseTimeMult),
2: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin2', 10 * PauseTimeMult),
3: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin3', 8 * PauseTimeMult),
4: ('tt_a_ara_dod_mailbox_firstMoveJumpSummersault', 6 * PauseTimeMult),
5: ('tt_a_ara_dod_mailbox_firstMoveJumpFall', 4 * PauseTimeMult),
6: ('tt_a_ara_dod_mailbox_firstMoveJump3Summersaults', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 3
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'mailbox', self.PhaseInfo, ToontownGlobals.MAILBOX_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class MailboxTwoAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxTwoAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin1', 40 * PauseTimeMult),
1: (('tt_a_ara_dod_mailbox_firstMoveStruggle', 'tt_a_ara_dod_mailbox_firstMoveJump'), 20 * PauseTimeMult),
2: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin2', 10 * PauseTimeMult),
3: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin3', 8 * PauseTimeMult),
4: ('tt_a_ara_dod_mailbox_firstMoveJumpSummersault', 6 * PauseTimeMult),
5: ('tt_a_ara_dod_mailbox_firstMoveJumpFall', 4 * PauseTimeMult),
6: ('tt_a_ara_dod_mailbox_firstMoveJump3Summersaults', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 5
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'mailbox', self.PhaseInfo, ToontownGlobals.MAILBOX_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,17 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class MailboxZeroAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxZeroAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin1', 40 * PauseTimeMult),
1: (('tt_a_ara_dod_mailbox_firstMoveStruggle', 'tt_a_ara_dod_mailbox_firstMoveJump'), 20 * PauseTimeMult),
2: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin2', 10 * PauseTimeMult),
3: ('tt_a_ara_dod_mailbox_firstMoveFlagSpin3', 8 * PauseTimeMult),
4: ('tt_a_ara_dod_mailbox_firstMoveJumpSummersault', 6 * PauseTimeMult),
5: ('tt_a_ara_dod_mailbox_firstMoveJumpFall', 4 * PauseTimeMult),
6: ('tt_a_ara_dod_mailbox_firstMoveJump3Summersaults', 2 * PauseTimeMult)}
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'mailbox', self.PhaseInfo, ToontownGlobals.MAILBOX_ZERO_HOLIDAY)

View file

@ -1,26 +0,0 @@
import AnimatedProp
from direct.interval.IntervalGlobal import *
from direct.task import Task
import math
class SleepingHydrantAnimatedProp(AnimatedProp.AnimatedProp):
def __init__(self, node):
AnimatedProp.AnimatedProp.__init__(self, node)
self.task = None
return
def bobTask(self, task):
self.node.setSz(1.0 + 0.08 * math.sin(task.time))
return Task.cont
def enter(self):
AnimatedProp.AnimatedProp.enter(self)
self.task = taskMgr.add(self.bobTask, self.uniqueName('bobTask'))
def exit(self):
AnimatedProp.AnimatedProp.exit(self)
if self.task:
taskMgr.remove(self.task)
self.task = None
return

View file

@ -1,184 +1,72 @@
from direct.actor import Actor from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from toontown.hood import InteractiveAnimatedProp from toontown.hood import InteractiveAnimatedProp
from toontown.hood import GenericAnimatedProp
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals, TTLocalizer
class TrashcanInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp): class TrashcanInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanInteractiveProp') notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanInteractiveProp')
BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[ToontownBattleGlobals.HEAL_TRACK] BattleTrack = ToontownBattleGlobals.HEAL_TRACK
ZoneToIdles = {ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2', BattleCheerText = TTLocalizer.InteractivePropTrackBonusTerms[BattleTrack]
1,
1, ZoneToIdles = {
None, ToontownGlobals.ToontownCentral: (('tt_a_ara_ttc_trashcan_idleTake2', 1, 1, None, 3, 10),
3, ('tt_a_ara_ttc_trashcan_idleHiccup0', 1, 1, None, 3, 10),
10), ('tt_a_ara_ttc_trashcan_idleLook1', 1, 1, None, 3, 10),
('tt_a_ara_ttc_trashcan_idleHiccup0', ('tt_a_ara_ttc_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_trashcan_idleBounce2', 3, 10, 'tt_a_ara_dod_trashcan_idle0settle', 3, 10),
1, ('tt_a_ara_dod_trashcan_idle0', 1, 1, None, 3, 10),
None, ('tt_a_ara_dod_trashcan_idle1', 1, 1, None, 3, 10),
3, ('tt_a_ara_dod_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
10), ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_trashcan_idleTake2', 1, 1, None, 3, 10),
('tt_a_ara_ttc_trashcan_idleLook1', ('tt_a_ara_dga_trashcan_idleHiccup0', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_trashcan_idleLook1', 1, 1, None, 3, 10),
1, ('tt_a_ara_dga_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
None, ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_trashcan_idleBounce0', 3, 10, 'tt_a_ara_mml_trashcan_idle0settle', 3, 10),
3, ('tt_a_ara_mml_trashcan_idleLook1', 1, 1, None, 3, 10),
10), ('tt_a_ara_mml_trashcan_idleHelicopter2', 1, 1, None, 3, 10),
('tt_a_ara_ttc_trashcan_idleAwesome3', ('tt_a_ara_mml_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
1, ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_trashcan_idleShiver1', 1, 1, None, 3, 10),
1, ('tt_a_ara_tbr_trashcan_idleSneeze2', 1, 1, None, 3, 10),
None, ('tt_a_ara_tbr_trashcan_idle0', 1, 1, None, 3, 10),
3, ('tt_a_ara_tbr_trashcan_idleAwesome3', 1, 1, None, 3, 10)),
10)), ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_trashcan_idleSleep0', 3, 10, None, 0, 0),
ToontownGlobals.DonaldsDock: (('tt_a_ara_dod_trashcan_idleBounce2', ('tt_a_ara_ddl_trashcan_idleShake2', 1, 1, None, 0, 0),
3, ('tt_a_ara_ddl_trashcan_idleSnore1', 1, 1, None, 0, 0),
10, ('tt_a_ara_ddl_trashcan_idleAwesome3', 1, 1, None, 0, 0))}
'tt_a_ara_dod_trashcan_idle0settle',
3, ZoneToIdleIntoFightAnims = {
10), ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_idleIntoFight',
('tt_a_ara_dod_trashcan_idle0', ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_idleIntoFight',
1, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_idleIntoFight',
1, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_idleIntoFight',
None, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_idleIntoFight',
3, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_idleIntoFight'}
10),
('tt_a_ara_dod_trashcan_idle1', ZoneToVictoryAnims = {
1, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_victoryDance',
1, ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_victoryDance',
None, ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_victoryDance',
3, ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_victoryDance',
10), ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_victoryDance',
('tt_a_ara_dod_trashcan_idleAwesome3', ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_victoryDance'}
1,
1, ZoneToSadAnims = {
None, ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_fightSad',
3, ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_fightSad',
10)), ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_fightSad',
ToontownGlobals.DaisyGardens: (('tt_a_ara_dga_trashcan_idleTake2', ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_fightSad',
1, ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_fightSad',
1, ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_fightSad'}
None,
3, ZoneToFightAnims = {
10), ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
('tt_a_ara_dga_trashcan_idleHiccup0', ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_trashcan_fightBoost', 'tt_a_ara_dod_trashcan_fightCheer', 'tt_a_ara_dod_trashcan_fightIdle'),
1, ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_trashcan_fightBoost', 'tt_a_ara_dga_trashcan_fightCheer', 'tt_a_ara_dga_trashcan_fightIdle'),
1, ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_trashcan_fightBoost', 'tt_a_ara_mml_trashcan_fightCheer0', 'tt_a_ara_mml_trashcan_fightCheer1', 'tt_a_ara_mml_trashcan_fightIdle'),
None, ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_trashcan_fightBoost', 'tt_a_ara_tbr_trashcan_fightCheer', 'tt_a_ara_tbr_trashcan_fightIdle'),
3, ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_trashcan_fightBoost', 'tt_a_ara_ddl_trashcan_fightCheer', 'tt_a_ara_ddl_trashcan_fightIdle')}
10),
('tt_a_ara_dga_trashcan_idleLook1',
1,
1,
None,
3,
10),
('tt_a_ara_dga_trashcan_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.MinniesMelodyland: (('tt_a_ara_mml_trashcan_idleBounce0',
3,
10,
'tt_a_ara_mml_trashcan_idle0settle',
3,
10),
('tt_a_ara_mml_trashcan_idleLook1',
1,
1,
None,
3,
10),
('tt_a_ara_mml_trashcan_idleHelicopter2',
1,
1,
None,
3,
10),
('tt_a_ara_mml_trashcan_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.TheBrrrgh: (('tt_a_ara_tbr_trashcan_idleShiver1',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_trashcan_idleSneeze2',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_trashcan_idle0',
1,
1,
None,
3,
10),
('tt_a_ara_tbr_trashcan_idleAwesome3',
1,
1,
None,
3,
10)),
ToontownGlobals.DonaldsDreamland: (('tt_a_ara_ddl_trashcan_idleSleep0',
3,
10,
None,
0,
0),
('tt_a_ara_ddl_trashcan_idleShake2',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_trashcan_idleSnore1',
1,
1,
None,
0,
0),
('tt_a_ara_ddl_trashcan_idleAwesome3',
1,
1,
None,
0,
0))}
ZoneToIdleIntoFightAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_idleIntoFight',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_idleIntoFight',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_idleIntoFight',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_idleIntoFight',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_idleIntoFight',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_idleIntoFight'}
ZoneToVictoryAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_victoryDance',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_victoryDance',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_victoryDance',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_victoryDance',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_victoryDance',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_victoryDance'}
ZoneToSadAnims = {ToontownGlobals.ToontownCentral: 'tt_a_ara_ttc_trashcan_fightSad',
ToontownGlobals.DonaldsDock: 'tt_a_ara_dod_trashcan_fightSad',
ToontownGlobals.DaisyGardens: 'tt_a_ara_dga_trashcan_fightSad',
ToontownGlobals.MinniesMelodyland: 'tt_a_ara_mml_trashcan_fightSad',
ToontownGlobals.TheBrrrgh: 'tt_a_ara_tbr_trashcan_fightSad',
ToontownGlobals.DonaldsDreamland: 'tt_a_ara_ddl_trashcan_fightSad'}
ZoneToFightAnims = {ToontownGlobals.ToontownCentral: ('tt_a_ara_ttc_trashcan_fightBoost', 'tt_a_ara_ttc_trashcan_fightCheer', 'tt_a_ara_ttc_trashcan_fightIdle'),
ToontownGlobals.DonaldsDock: ('tt_a_ara_dod_trashcan_fightBoost', 'tt_a_ara_dod_trashcan_fightCheer', 'tt_a_ara_dod_trashcan_fightIdle'),
ToontownGlobals.DaisyGardens: ('tt_a_ara_dga_trashcan_fightBoost', 'tt_a_ara_dga_trashcan_fightCheer', 'tt_a_ara_dga_trashcan_fightIdle'),
ToontownGlobals.MinniesMelodyland: ('tt_a_ara_mml_trashcan_fightBoost',
'tt_a_ara_mml_trashcan_fightCheer0',
'tt_a_ara_mml_trashcan_fightCheer1',
'tt_a_ara_mml_trashcan_fightIdle'),
ToontownGlobals.TheBrrrgh: ('tt_a_ara_tbr_trashcan_fightBoost', 'tt_a_ara_tbr_trashcan_fightCheer', 'tt_a_ara_tbr_trashcan_fightIdle'),
ToontownGlobals.DonaldsDreamland: ('tt_a_ara_ddl_trashcan_fightBoost', 'tt_a_ara_ddl_trashcan_fightCheer', 'tt_a_ara_ddl_trashcan_fightIdle')}
IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0) IdlePauseTime = base.config.GetFloat('prop-idle-pause-time', 0.0)
def __init__(self, node): def __init__(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node, ToontownGlobals.TRASHCANS_BUFF_BATTLES) InteractiveAnimatedProp.InteractiveAnimatedProp.__init__(self, node)

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class TrashcanOneAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanOneAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dga_trashcan_firstMoveLidFlip1', 40 * PauseTimeMult),
1: ('tt_a_ara_dga_trashcan_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_dga_trashcan_firstMoveLidFlip2', 10 * PauseTimeMult),
3: ('tt_a_ara_dga_trashcan_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_dga_trashcan_firstMoveLidFlip3', 6 * PauseTimeMult),
5: ('tt_a_ara_dga_trashcan_firstMoveJumpHit', 4 * PauseTimeMult),
6: ('tt_a_ara_dga_trashcan_firstMoveJumpJuggle', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 3
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'trashcan', self.PhaseInfo, ToontownGlobals.TRASHCAN_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,32 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class TrashcanTwoAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanTwoAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dga_trashcan_firstMoveLidFlip1', 40 * PauseTimeMult),
1: ('tt_a_ara_dga_trashcan_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_dga_trashcan_firstMoveLidFlip2', 10 * PauseTimeMult),
3: ('tt_a_ara_dga_trashcan_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_dga_trashcan_firstMoveLidFlip3', 6 * PauseTimeMult),
5: ('tt_a_ara_dga_trashcan_firstMoveJumpHit', 4 * PauseTimeMult),
6: ('tt_a_ara_dga_trashcan_firstMoveJumpJuggle', 2 * PauseTimeMult)}
PhaseWeStartAnimating = 5
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'trashcan', self.PhaseInfo, ToontownGlobals.TRASHCAN_ZERO_HOLIDAY)
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= self.PhaseWeStartAnimating:
self.request('DoAnim')
except:
pass
def handleNewPhase(self, newPhase):
if newPhase < self.PhaseWeStartAnimating:
self.request('Off')
else:
self.startIfNeeded()

View file

@ -1,17 +0,0 @@
from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class TrashcanZeroAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('TrashcanZeroAnimatedProp')
PauseTimeMult = base.config.GetFloat('zero-pause-mult', 1.0)
PhaseInfo = {0: ('tt_a_ara_dga_trashcan_firstMoveLidFlip1', 40 * PauseTimeMult),
1: ('tt_a_ara_dga_trashcan_firstMoveStruggle', 20 * PauseTimeMult),
2: ('tt_a_ara_dga_trashcan_firstMoveLidFlip2', 10 * PauseTimeMult),
3: ('tt_a_ara_dga_trashcan_firstMoveJump', 8 * PauseTimeMult),
4: ('tt_a_ara_dga_trashcan_firstMoveLidFlip3', 6 * PauseTimeMult),
5: ('tt_a_ara_dga_trashcan_firstMoveJumpHit', 4 * PauseTimeMult),
6: ('tt_a_ara_dga_trashcan_firstMoveJumpJuggle', 2 * PauseTimeMult)}
def __init__(self, node):
ZeroAnimatedProp.ZeroAnimatedProp.__init__(self, node, 'trashcan', self.PhaseInfo, ToontownGlobals.TRASHCAN_ZERO_HOLIDAY)

View file

@ -1,177 +0,0 @@
import types
import math
from direct.interval.IntervalGlobal import Sequence, Wait, ActorInterval, Func, SoundInterval, Parallel
from direct.task import Task
from direct.fsm import FSM
from direct.showbase.PythonUtil import weightedChoice
from toontown.hood import GenericAnimatedProp
from toontown.hood import AnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class ZeroAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
notify = DirectNotifyGlobal.directNotify.newCategory('ZeroAnimatedProp')
def __init__(self, node, propString, phaseInfo, holidayId):
self.propString = propString
self.phaseInfo = phaseInfo
self.holidayId = holidayId
GenericAnimatedProp.GenericAnimatedProp.__init__(self, node)
FSM.FSM.__init__(self, '%sZeroAnimPropFsm' % self.propString)
self.node.unloadAnims('anim')
self.loadPhaseAnims()
self.phaseIvals = []
self.curIval = None
self.curPhase = -1
self.okToStartNextAnim = False
return
def delete(self):
self.exit()
GenericAnimatedProp.GenericAnimatedProp.delete(self)
def loadPhaseAnims(self):
animDict = {}
for key, info in self.phaseInfo.iteritems():
if type(info[0]) == types.TupleType:
for index, anims in enumerate(info[0]):
fullPath = self.path + '/' + anims
animName = 'phase%d_%d' % (key, index)
animDict[animName] = fullPath
else:
animName = 'phase%d' % key
fullPath = self.path + '/' + info[0]
animDict[animName] = fullPath
self.node.loadAnims(animDict)
def createPhaseIntervals(self):
if self.phaseIvals:
self.notify.debug('not creating phase ivals again')
return
self.phaseIvals = []
for key, info in self.phaseInfo.iteritems():
self.notify.debug('key=%s' % key)
if type(info[0]) == types.TupleType:
ival = Sequence()
for index, anims in enumerate(info[0]):
animName = 'phase%d_%d' % (key, index)
animIval = self.node.actorInterval(animName)
animIvalDuration = animIval.getDuration()
soundIval = self.createSoundInterval(anims, animIvalDuration)
soundIvalDuration = soundIval.getDuration()
animAndSound = Parallel(soundIval, animIval)
ival.append(animAndSound)
self.phaseIvals.append(ival)
else:
animName = 'phase%d' % key
animIval = self.node.actorInterval('phase%d' % key)
animIvalDuration = animIval.getDuration()
soundIval = self.createSoundInterval(info[0], animIvalDuration)
soundIvalDuration = soundIval.getDuration()
ival = Parallel(animIval, soundIval)
self.phaseIvals.append(ival)
def enter(self):
self.node.postFlatten()
self.createPhaseIntervals()
AnimatedProp.AnimatedProp.enter(self)
defaultAnim = self.node.getAnimControl('anim')
numFrames = defaultAnim.getNumFrames()
self.node.pose('phase0', 0)
self.accept('%sZeroPhase' % self.propString, self.handleNewPhase)
self.accept('%sZeroIsRunning' % self.propString, self.handleNewIsRunning)
self.startIfNeeded()
def startIfNeeded(self):
try:
self.curPhase = self.getPhaseToRun()
if self.curPhase >= 0:
self.request('DoAnim')
except:
pass
def chooseAnimToRun(self):
result = self.curPhase
if base.config.GetBool('anim-props-randomized', True):
pairs = []
for i in xrange(self.curPhase + 1):
pairs.append((math.pow(2, i), i))
sum = math.pow(2, self.curPhase + 1) - 1
result = weightedChoice(pairs, sum=sum)
self.notify.debug('chooseAnimToRun curPhase=%s pairs=%s result=%s' % (self.curPhase, pairs, result))
return result
def createAnimSequence(self, animPhase):
result = Sequence(self.phaseIvals[animPhase], Wait(self.phaseInfo[self.curPhase][1]), Func(self.startNextAnim))
return result
def startNextAnim(self):
self.notify.debug('startNextAnim self.okToStartNextAnim=%s' % self.okToStartNextAnim)
self.curIval = None
if self.okToStartNextAnim:
self.notify.debug('got pass okToStartNextAnim')
whichAnim = self.chooseAnimToRun()
self.notify.debug('whichAnim=%s' % whichAnim)
self.lastPlayingAnimPhase = whichAnim
self.curIval = self.createAnimSequence(whichAnim)
self.notify.debug('starting curIval of length %s' % self.curIval.getDuration())
self.curIval.start()
else:
self.notify.debug('false self.okToStartNextAnim=%s' % self.okToStartNextAnim)
return
def enterDoAnim(self):
self.notify.debug('enterDoAnim curPhase=%d' % self.curPhase)
self.okToStartNextAnim = True
self.startNextAnim()
def exitDoAnim(self):
self.notify.debug('exitDoAnim curPhase=%d' % self.curPhase)
self.okToStartNextAnim = False
self.curIval.finish()
self.curIval = None
return
def getPhaseToRun(self):
result = -1
enoughInfoToRun = False
if base.cr.newsManager.isHolidayRunning(self.holidayId):
zeroMgrString = '%sZeroMgr' % self.propString
if hasattr(base.cr, zeroMgrString):
zeroMgr = eval('base.cr.%s' % zeroMgrString)
if not zeroMgr.isDisabled():
enoughInfoToRun = True
else:
self.notify.debug('isDisabled = %s' % zeroMgr.isDisabled())
else:
self.notify.debug('base.cr does not have %s' % zeroMgrString)
else:
self.notify.debug('holiday is not running')
self.notify.debug('enoughInfoToRun = %s' % enoughInfoToRun)
if enoughInfoToRun and zeroMgr.getIsRunning():
curPhase = zeroMgr.getCurPhase()
if curPhase >= len(self.phaseIvals):
curPhase = len(self.phaseIvals) - 1
self.notify.warning('zero mgr says to go to phase %d, but we only have %d ivals. forcing curPhase to %d' % (curPhase, len(self.phaseIvals), curPhase))
result = curPhase
return result
def exit(self):
self.okToStartNextAnim = False
self.ignore('%sZeroPhase' % self.propString)
self.ignore('%sZeroIsRunning' % self.propString)
GenericAnimatedProp.GenericAnimatedProp.exit(self)
self.request('Off')
def handleNewPhase(self, newPhase):
self.startIfNeeded()
def handleNewIsRunning(self, isRunning):
if isRunning:
self.startIfNeeded()
else:
self.request('Off')

View file

@ -1626,22 +1626,6 @@ class DistributedPhotoGame(DistributedMinigame, PhotoGameBase.PhotoGameBase):
animPropList = self.animPropDict.setdefault(i, []) animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(animPropObj) animPropList.append(animPropObj)
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
numInteractivePropNodes = interactivePropNodes.getNumPaths()
for j in xrange(numInteractivePropNodes):
interactivePropNode = interactivePropNodes.getPath(j)
className = 'GenericAnimatedProp'
symbols = {}
base.cr.importModule(symbols, 'toontown.hood', [className])
classObj = getattr(symbols[className], className)
interactivePropObj = classObj(interactivePropNode)
animPropList = self.animPropDict.get(i)
if animPropList is None:
animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(interactivePropObj)
return
def deleteAnimatedProps(self): def deleteAnimatedProps(self):
for animPropListKey in self.animPropDict: for animPropListKey in self.animPropDict:
animPropList = self.animPropDict[animPropListKey] animPropList = self.animPropDict[animPropListKey]

View file

@ -222,22 +222,6 @@ class SafeZoneLoader(StateData.StateData):
animPropList = self.animPropDict.setdefault(i, []) animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(animPropObj) animPropList.append(animPropObj)
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
numInteractivePropNodes = interactivePropNodes.getNumPaths()
for j in xrange(numInteractivePropNodes):
interactivePropNode = interactivePropNodes.getPath(j)
className = 'GenericAnimatedProp'
symbols = {}
base.cr.importModule(symbols, 'toontown.hood', [className])
classObj = getattr(symbols[className], className)
interactivePropObj = classObj(interactivePropNode)
animPropList = self.animPropDict.get(i)
if animPropList is None:
animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(interactivePropObj)
return
def deleteAnimatedProps(self): def deleteAnimatedProps(self):
for zoneNode, animPropList in self.animPropDict.items(): for zoneNode, animPropList in self.animPropDict.items():
for animProp in animPropList: for animProp in animPropList:

View file

@ -60,7 +60,9 @@ class DistributedSuitBase(DistributedAvatar.DistributedAvatar, Suit.Suit, SuitBa
self.maxSkeleRevives = 0 self.maxSkeleRevives = 0
self.sillySurgeText = False self.sillySurgeText = False
self.interactivePropTrackBonus = -1 self.interactivePropTrackBonus = -1
return
def setInteractivePropTrackBonus(self, trackBonus):
self.interactivePropTrackBonus = trackBonus
def setVirtual(self, virtual): def setVirtual(self, virtual):
pass pass

View file

@ -97,13 +97,10 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
self.notify.debug('Creating a building manager AI in zone' + str(self.zoneId)) self.notify.debug('Creating a building manager AI in zone' + str(self.zoneId))
self.buildingMgr = self.air.buildingManagers.get(self.zoneId) self.buildingMgr = self.air.buildingManagers.get(self.zoneId)
if self.buildingMgr: if self.buildingMgr:
(blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks, animBldgBlocks) = self.buildingMgr.getDNABlockLists() (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, libraryBlocks) = self.buildingMgr.getDNABlockLists()
for currBlock in blocks: for currBlock in blocks:
bldg = self.buildingMgr.getBuilding(currBlock) bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self) bldg.setSuitPlannerExt(self)
for currBlock in animBldgBlocks:
bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self)
self.dnaStore.resetBlockNumbers() self.dnaStore.resetBlockNumbers()
self.initBuildingsAndPoints() self.initBuildingsAndPoints()
numSuits = simbase.config.GetInt('suit-count', -1) numSuits = simbase.config.GetInt('suit-count', -1)
@ -855,7 +852,11 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
if hasattr(toon, 'doId'): if hasattr(toon, 'doId'):
toon.b_setBattleId(toonId) toon.b_setBattleId(toonId)
pos = self.battlePosDict[canonicalZoneId] pos = self.battlePosDict[canonicalZoneId]
# TODO
interactivePropTrackBonus = -1 interactivePropTrackBonus = -1
# TODO
self.battleMgr.newBattle( self.battleMgr.newBattle(
zoneId, zoneId, pos, suit, toonId, self.__battleFinished, zoneId, zoneId, pos, suit, toonId, self.__battleFinished,
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_SMAX], self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_SMAX],

View file

@ -4536,6 +4536,18 @@ def maxMoney(maxMoney):
spellbook.getTarget().b_setMaxMoney(maxMoney) spellbook.getTarget().b_setMaxMoney(maxMoney)
return "Set {0}'s max money value to {1}!".format(target.getName(), maxMoney) return "Set {0}'s max money value to {1}!".format(target.getName(), maxMoney)
@magicWord(category=CATEGORY_PROGRAMMER, types=[int])
def maxBankMoney(maxBankMoney):
"""
Modifies the target's max bank money value.
"""
if not 10000 <= maxBankMoney <= 30000:
return 'Max bank money value must be in xrange (10000-30000).'
target = spellbook.getTarget()
spellbook.getTarget().b_setMaxBankMoney(maxBankMoney)
return "Set {0}'s max bank money value to {1}!".format(target.getName(), maxBankMoney)
@magicWord(category=CATEGORY_PROGRAMMER, types=[int]) @magicWord(category=CATEGORY_PROGRAMMER, types=[int])
def money(money): def money(money):
""" """
@ -4548,39 +4560,18 @@ def money(money):
target.b_setMoney(money) target.b_setMoney(money)
return "Set %s's money value to %d!" % (target.getName(), money) return "Set %s's money value to %d!" % (target.getName(), money)
@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int]) @magicWord(category=CATEGORY_PROGRAMMER, types=[int])
def bank(command, value): def bank(money):
""" """
Modifies the target's bank money values. Modifies the target's current bank money value.
""" """
command = command.lower()
target = spellbook.getTarget() target = spellbook.getTarget()
if command == 'transfer': maxMoney = target.getMaxBankMoney()
if value == 0:
return 'Invalid bank transfer.' if not 0 <= money <= maxMoney:
bankMoney = target.getBankMoney() return 'Bank money must be in xrange (0-%d.)' % maxMoney
maxBankMoney = target.getMaxBankMoney() target.b_setBankMoney(money)
money = target.getMoney() return "Set %s's bank money value to %d!" % (target.getName(), money)
maxMoney = target.getMaxMoney()
if value > 0:
maxDeposit = money
maxDeposit = min(maxDeposit, maxBankMoney - money)
deposit = min(value, maxDeposit)
bankMoney += deposit
money -= deposit
target.b_setBankMoney(bankMoney)
target.b_setMoney(money)
else:
maxWithdrawl = maxMoney - money
maxWithdrawl = min(maxWithdrawl, bankMoney)
withdrawl = min(value, maxWithdrawl)
bankMoney -= withdrawl
money += withdrawl
target.b_setBankMoney(bankMoney)
target.b_setMoney(money)
return 'Bank transfer successful!'
else:
return 'Invalid command!'
@magicWord(category=CATEGORY_PROGRAMMER, types=[int]) @magicWord(category=CATEGORY_PROGRAMMER, types=[int])
def fishingRod(rod): def fishingRod(rod):

View file

@ -42,7 +42,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
self.__battleCreditMultiplier = base.baseXpMultiplier self.__battleCreditMultiplier = base.baseXpMultiplier
self.__invasionCreditMultiplier = base.baseXpMultiplier self.__invasionCreditMultiplier = base.baseXpMultiplier
self.__respectInvasions = 1 self.__respectInvasions = 1
self._interactivePropTrackBonus = -1 self.interactivePropTrackBonus = -1
self.tutorialFlag = 0 self.tutorialFlag = 0
self.gagTutMode = 0 self.gagTutMode = 0
self.showSuperGags = ShowSuperGags self.showSuperGags = ShowSuperGags
@ -61,10 +61,10 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
return self.__battleCreditMultiplier return self.__battleCreditMultiplier
def setInteractivePropTrackBonus(self, trackBonus): def setInteractivePropTrackBonus(self, trackBonus):
self._interactivePropTrackBonus = trackBonus self.interactivePropTrackBonus = trackBonus
def getInteractivePropTrackBonus(self): def getInteractivePropTrackBonus(self):
return self._interactivePropTrackBonus return self.interactivePropTrackBonus
def setInvasionCreditMultiplier(self, mult): def setInvasionCreditMultiplier(self, mult):
self.__invasionCreditMultiplier = mult self.__invasionCreditMultiplier = mult
@ -996,7 +996,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
else: else:
shadowColor = self.ShadowColor shadowColor = self.ShadowColor
button.configure(image0_image=self.upButton, image2_image=self.rolloverButton, text_shadow=shadowColor, geom_color=self.PressableGeomColor, commandButtons=(DGG.LMB,)) button.configure(image0_image=self.upButton, image2_image=self.rolloverButton, text_shadow=shadowColor, geom_color=self.PressableGeomColor, commandButtons=(DGG.LMB,))
if self._interactivePropTrackBonus == track: if self.interactivePropTrackBonus == track:
button.configure(image_color=self.PropBonusPressableImageColor) button.configure(image_color=self.PropBonusPressableImageColor)
self.addToPropBonusIval(button) self.addToPropBonusIval(button)
else: else:
@ -1022,7 +1022,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
else: else:
shadowColor = self.ShadowColor shadowColor = self.ShadowColor
button.configure(image0_image=self.upButton, image2_image=self.rolloverButton, text_shadow=shadowColor, geom_color=self.PressableGeomColor, commandButtons=(DGG.LMB,)) button.configure(image0_image=self.upButton, image2_image=self.rolloverButton, text_shadow=shadowColor, geom_color=self.PressableGeomColor, commandButtons=(DGG.LMB,))
if self._interactivePropTrackBonus == track: if self.interactivePropTrackBonus == track:
button.configure(image_color=self.PropBonusNoncreditPressableImageColor) button.configure(image_color=self.PropBonusNoncreditPressableImageColor)
self.addToPropBonusIval(button) self.addToPropBonusIval(button)
else: else:
@ -1187,10 +1187,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
messenger.send('exitTrackFrame', [track]) messenger.send('exitTrackFrame', [track])
def checkPropBonus(self, track): def checkPropBonus(self, track):
result = False return track == self.interactivePropTrackBonus
if track == self._interactivePropTrackBonus:
result = True
return result
def stopAndClearPropBonusIval(self): def stopAndClearPropBonusIval(self):
if self.propBonusIval and self.propBonusIval.isPlaying(): if self.propBonusIval and self.propBonusIval.isPlaying():

View file

@ -897,15 +897,9 @@ BEAN_COUNTER_INVASION = 54
DOUBLE_TALKER_INVASION = 55 DOUBLE_TALKER_INVASION = 55
DOWNSIZER_INVASION = 56 DOWNSIZER_INVASION = 56
WINTER_CAROLING = 57 WINTER_CAROLING = 57
HYDRANT_ZERO_HOLIDAY = 58
VALENTINES_DAY = 59 VALENTINES_DAY = 59
SILLYMETER_HOLIDAY = 60 SILLYMETER_HOLIDAY = 60
MAILBOX_ZERO_HOLIDAY = 61
TRASHCAN_ZERO_HOLIDAY = 62
SILLY_SURGE_HOLIDAY = 63 SILLY_SURGE_HOLIDAY = 63
HYDRANTS_BUFF_BATTLES = 64
MAILBOXES_BUFF_BATTLES = 65
TRASHCANS_BUFF_BATTLES = 66
SILLY_CHATTER_ONE = 67 SILLY_CHATTER_ONE = 67
SILLY_CHATTER_TWO = 68 SILLY_CHATTER_TWO = 68
SILLY_CHATTER_THREE = 69 SILLY_CHATTER_THREE = 69

View file

@ -17,8 +17,7 @@ from toontown.toon.Toon import teleportDebug
from toontown.battle import BattleParticles from toontown.battle import BattleParticles
from direct.fsm import StateData from direct.fsm import StateData
from toontown.building import ToonInterior from toontown.building import ToonInterior
from toontown.hood import QuietZoneState from toontown.hood import QuietZoneState, ZoneUtil, HydrantInteractiveProp, MailboxInteractiveProp, TrashcanInteractiveProp
from toontown.hood import ZoneUtil
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
from toontown.dna.DNAParser import DNABulkLoader from toontown.dna.DNAParser import DNABulkLoader
@ -292,6 +291,7 @@ class TownLoader(StateData.StateData):
def createAnimatedProps(self, nodeList): def createAnimatedProps(self, nodeList):
self.animPropDict = {} self.animPropDict = {}
self.zoneIdToInteractivePropDict = {} self.zoneIdToInteractivePropDict = {}
for i in nodeList: for i in nodeList:
animPropNodes = i.findAllMatches('**/animated_prop_*') animPropNodes = i.findAllMatches('**/animated_prop_*')
numAnimPropNodes = animPropNodes.getNumPaths() numAnimPropNodes = animPropNodes.getNumPaths()
@ -313,50 +313,26 @@ class TownLoader(StateData.StateData):
animPropList.append(animPropObj) animPropList.append(animPropObj)
interactivePropNodes = i.findAllMatches('**/interactive_prop_*') interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
numInteractivePropNodes = interactivePropNodes.getNumPaths()
for j in xrange(numInteractivePropNodes): for j in xrange(interactivePropNodes.getNumPaths()):
interactivePropNode = interactivePropNodes.getPath(j) propNode = interactivePropNodes.getPath(j)
className = 'InteractiveAnimatedProp' propName = propNode.getName()
if 'hydrant' in interactivePropNode.getName():
className = 'HydrantInteractiveProp' if 'hydrant' in propName:
elif 'trashcan' in interactivePropNode.getName(): prop = HydrantInteractiveProp.HydrantInteractiveProp(propNode)
className = 'TrashcanInteractiveProp' elif 'trashcan' in propName:
elif 'mailbox' in interactivePropNode.getName(): prop = TrashcanInteractiveProp.TrashcanInteractiveProp(propNode)
className = 'MailboxInteractiveProp' elif 'mailbox' in propName:
symbols = {} prop = MailboxInteractiveProp.MailboxInteractiveProp(propNode)
base.cr.importModule(symbols, 'toontown.hood', [className]) else:
classObj = getattr(symbols[className], className) continue
interactivePropObj = classObj(interactivePropNode)
animPropList = self.animPropDict.get(i) if i in self.animPropDict:
if animPropList is None: self.animPropDict[i].append(prop)
animPropList = self.animPropDict.setdefault(i, []) else:
animPropList.append(interactivePropObj) self.animPropDict[i] = [prop]
if interactivePropObj.getCellIndex() == 0:
zoneId = int(i.getName()) self.zoneIdToInteractivePropDict[int(i.getName())] = prop
if zoneId not in self.zoneIdToInteractivePropDict:
self.zoneIdToInteractivePropDict[zoneId] = interactivePropObj
else:
self.notify.error('already have interactive prop %s in zone %s' % (self.zoneIdToInteractivePropDict, zoneId))
animatedBuildingNodes = i.findAllMatches('**/*:animated_building_*;-h')
for np in animatedBuildingNodes:
if np.getName().startswith('sb'):
animatedBuildingNodes.removePath(np)
numAnimatedBuildingNodes = animatedBuildingNodes.getNumPaths()
for j in xrange(numAnimatedBuildingNodes):
animatedBuildingNode = animatedBuildingNodes.getPath(j)
className = 'GenericAnimatedBuilding'
symbols = {}
base.cr.importModule(symbols, 'toontown.hood', [className])
classObj = getattr(symbols[className], className)
animatedBuildingObj = classObj(animatedBuildingNode)
animPropList = self.animPropDict.get(i)
if animPropList is None:
animPropList = self.animPropDict.setdefault(i, [])
animPropList.append(animatedBuildingObj)
return
def deleteAnimatedProps(self): def deleteAnimatedProps(self):
for zoneNode, animPropList in self.animPropDict.items(): for zoneNode, animPropList in self.animPropDict.items():
@ -374,7 +350,6 @@ class TownLoader(StateData.StateData):
animProp.exit() animProp.exit()
def getInteractiveProp(self, zoneId): def getInteractiveProp(self, zoneId):
result = None
if zoneId in self.zoneIdToInteractivePropDict: if zoneId in self.zoneIdToInteractivePropDict:
result = self.zoneIdToInteractivePropDict[zoneId] return self.zoneIdToInteractivePropDict[zoneId]
return result return None