Less dan.

This commit is contained in:
Loudrob 2015-06-11 08:33:28 -04:00
parent 0da6a108e4
commit 8a01138fc6
14 changed files with 286 additions and 18 deletions

View file

@ -0,0 +1,32 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,17 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,17 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,17 @@
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

@ -855,9 +855,16 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
pos = self.battlePosDict[canonicalZoneId]
interactivePropTrackBonus = -1
if simbase.config.GetBool('props-buff-battles', True) and canonicalZoneId in self.cellToGagBonusDict:
interactivePropTrackBonus = self.cellToGagBonusDict[canonicalZoneId]
if simbase.config.GetBool('props-buff-battles', True) and self.cellToGagBonusDict.has_key(canonicalZoneId):
tentativeBonusTrack = self.cellToGagBonusDict[canonicalZoneId]
trackToHolidayDict = {
ToontownBattleGlobals.SQUIRT_TRACK: ToontownGlobals.HYDRANTS_BUFF_BATTLES,
ToontownBattleGlobals.THROW_TRACK: ToontownGlobals.MAILBOXES_BUFF_BATTLES,
ToontownBattleGlobals.HEAL_TRACK: ToontownGlobals.TRASHCANS_BUFF_BATTLES }
if tentativeBonusTrack in trackToHolidayDict:
holidayId = trackToHolidayDict[tentativeBonusTrack]
if simbase.air.holidayManager.isHolidayRunning(holidayId):#and simbase.air.holidayManager.getCurPhase(holidayId) >= 1:
interactivePropTrackBonus = tentativeBonusTrack
self.battleMgr.newBattle(
zoneId, zoneId, pos, suit, toonId, self.__battleFinished,

View file

@ -3,7 +3,7 @@ from direct.directnotify.DirectNotifyGlobal import *
from toontown.hood import ZoneUtil, HoodUtil
from toontown.toonbase import ToontownGlobals, ToontownBattleGlobals
from toontown.building import SuitBuildingGlobals
from toontown.dna.DNAParser import DNASuitPoint, DNAInteractiveProp, DNAStorage, loadDNAFileAI
from toontown.dna.DNAParser import *
class SuitPlannerBase:
notify = directNotify.newCategory('SuitPlannerBase')
@ -544,18 +544,33 @@ class SuitPlannerBase:
vg = self.dnaStore.getDNAVisGroupAI(i)
zoneId = int(self.extractGroupName(vg.getName()))
if vg.getNumBattleCells() >= 1:
if vg.getNumBattleCells() == 1:
battleCell = vg.getBattleCell(0)
self.battlePosDict[zoneId] = battleCell.getPos()
self.battlePosDict[zoneId] = vg.getBattleCell(0).getPos()
elif vg.getNumBattleCells() > 1:
self.notify.warning('multiple battle cells for zone: %d' % zoneId)
self.battlePosDict[zoneId] = vg.getBattleCell(0).getPos()
for i in xrange(vg.getNumChildren()):
childDnaGroup = vg.at(i)
if True:
for i in xrange(vg.getNumChildren()):
childDnaGroup = vg.at(i)
if isinstance(childDnaGroup, DNAInteractiveProp) and not zoneId in self.cellToGagBonusDict:
propType = HoodUtil.calcPropType(childDnaGroup.getName())
if isinstance(childDnaGroup, DNAInteractiveProp):
self.notify.debug('got interactive prop %s' % childDnaGroup)
battleCellId = childDnaGroup.getCellId()
if propType in ToontownBattleGlobals.PropTypeToTrackBonus:
self.cellToGagBonusDict[zoneId] = ToontownBattleGlobals.PropTypeToTrackBonus[propType]
if battleCellId == -1:
self.notify.warning('interactive prop %s at %s not associated with a a battle' % (childDnaGroup, zoneId))
elif battleCellId == 0:
if self.cellToGagBonusDict.has_key(zoneId):
self.notify.error('FIXME battle cell at zone %s has two props %s %s linked to it' % (zoneId, self.cellToGagBonusDict[zoneId], childDnaGroup))
else:
name = childDnaGroup.getName()
propType = HoodUtil.calcPropType(name)
if propType in ToontownBattleGlobals.PropTypeToTrackBonus:
trackBonus = ToontownBattleGlobals.PropTypeToTrackBonus[propType]
self.cellToGagBonusDict[zoneId] = trackBonus
self.dnaStore.resetDNAGroups()
self.dnaStore.resetDNAVisGroups()

View file

@ -883,8 +883,11 @@ BEAN_COUNTER_INVASION = 54
DOUBLE_TALKER_INVASION = 55
DOWNSIZER_INVASION = 56
WINTER_CAROLING = 57
HYDRANT_ZERO_HOLIDAY = 58
VALENTINES_DAY = 59
SILLYMETER_HOLIDAY = 60
MAILBOX_ZERO_HOLIDAY = 61
TRASHCAN_ZERO_HOLIDAY = 62
SILLY_SURGE_HOLIDAY = 63
HYDRANTS_BUFF_BATTLES = 64
MAILBOXES_BUFF_BATTLES = 65

View file

@ -290,7 +290,7 @@ class TownLoader(StateData.StateData):
for i in nodeList:
animPropNodes = i.findAllMatches('**/animated_prop_*')
numAnimPropNodes = animPropNodes.getNumPaths()
for j in xrange(numAnimPropNodes):
for j in range(numAnimPropNodes):
animPropNode = animPropNodes.getPath(j)
if animPropNode.getName().startswith('animated_prop_generic'):
className = 'GenericAnimatedProp'
@ -309,7 +309,7 @@ class TownLoader(StateData.StateData):
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
numInteractivePropNodes = interactivePropNodes.getNumPaths()
for j in xrange(numInteractivePropNodes):
for j in range(numInteractivePropNodes):
interactivePropNode = interactivePropNodes.getPath(j)
className = 'InteractiveAnimatedProp'
if 'hydrant' in interactivePropNode.getName():