Cleanup some files

This commit is contained in:
John Cote 2015-05-09 13:27:08 -04:00
parent 6b4329d263
commit d597e25e60
9 changed files with 37 additions and 38 deletions

View file

@ -134,7 +134,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
Emote.globalEmote.disableAll(self.toons[0], 'dbattle, enterFaceOff')
self.__faceOff(ts, self.faceOffName, self.__handleFaceOffDone)
prop = self.getInteractiveProp()
if prop:
prop.gotoBattleCheer()
@ -165,7 +165,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
self.accept('resumeAfterReward', self.handleResumeAfterReward)
prop = self.getInteractiveProp()
if prop:
prop.gotoVictory()
self.playReward(ts)
@ -196,7 +196,7 @@ class DistributedBattle(DistributedBattleBase.DistributedBattleBase):
if self.hasLocalToon():
self.removeLocalToon()
prop = self.getInteractiveProp()
if prop:
prop.requestIdleOrSad()

View file

@ -317,25 +317,25 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
def setBattleCellId(self, battleCellId):
pass
def getInteractiveProp(self):
if config.GetBool('want-anim-props', True):
if self.interactiveProp:
return self.interactiveProp
elif base.cr.playGame.hood and hasattr(base.cr.playGame.hood, 'loader'):
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
else:
return None
def getInteractivePropTrackBonus(self):
prop = self.getInteractiveProp()
return prop.BattleTrack if prop else -1
def setPosition(self, x, y, z):
@ -378,16 +378,16 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
self.suits = []
suitGone = 0
prop = self.getInteractiveProp()
for s in suits:
if s in self.cr.doId2do:
suit = self.cr.doId2do[s]
suit.setState('Battle')
self.suits.append(suit)
if prop:
suit.interactivePropTrackBonus = prop.BattleTrack
try:
suit.battleTrap
except:
@ -1068,7 +1068,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
def enterWaitForInput(self, ts = 0):
prop = self.getInteractiveProp()
if prop:
prop.gotoBattleCheer()
self.choseAttackAlready = 0
@ -1263,7 +1263,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
base.cr.playGame.getPlace().setState('battle', self.localToonBattleEvent)
if localAvatar and hasattr(localAvatar, 'inventory') and localAvatar.inventory:
prop = self.getInteractiveProp()
if prop:
localAvatar.inventory.setInteractivePropTrackBonus(prop.BattleTrack)
camera.wrtReparentTo(self)

View file

@ -237,10 +237,10 @@ class DistributedBuilding(DistributedObject.DistributedObject):
def enterToon(self, ts):
prop = self.getInteractiveProp()
if prop:
prop.buildingLiberated(self.doId)
self.setToToon()
def exitToon(self):
@ -935,7 +935,6 @@ class DistributedBuilding(DistributedObject.DistributedObject):
def getVisZoneId(self):
exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
return ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId)
def getInteractiveProp(self):
@ -943,9 +942,9 @@ class DistributedBuilding(DistributedObject.DistributedObject):
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.getVisZoneId())
return self.interactiveProp
return None
return None

View file

@ -76,17 +76,17 @@ class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
def setupActor(self, node):
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
if not self.hoodId == ToontownGlobals.TheBrrrgh:
water = loader.loadModel('phase_5/models/char/tt_m_efx_hydrantSquirt')
self.leftWater = water.find('**/efx_hydrantSquirtLeft')
self.rightWater = water.find('**/efx_hydrantSquirtRight')
if self.leftWater:
self.leftWater.reparentTo(self.node.find('**/dx_left_water'))
base.leftWater = self.leftWater
self.leftWater.hide()
if self.rightWater:
self.rightWater.reparentTo(self.node.find('**/dx_right_water'))
self.rightWater.hide()
@ -108,11 +108,11 @@ class HydrantInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
def getOverrideIval(self, origAnimName):
result = Sequence()
if self.hasOverrideIval(origAnimName):
result.append(Func(self.showWater))
anim = self.createAnimIval('fight0' if 'fightBoost' in origAnimName else 'fight1')
result.append(anim)
result.append(Func(self.hideWater))
return result
return result

View file

@ -451,4 +451,4 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM):
if self.curIval:
self.curIval.finish()
clearPythonIvals(self.curIval)
self.curIval = None
self.curIval = None

View file

@ -76,7 +76,7 @@ class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
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.hide()
InteractiveAnimatedProp.InteractiveAnimatedProp.setupActor(self, node)
def hasSpecialIval(self, origAnimName):
@ -84,10 +84,10 @@ class MailboxInteractiveProp(InteractiveAnimatedProp.InteractiveAnimatedProp):
def getSpecialIval(self, origAnimName):
result = Sequence()
if self.hasSpecialIval(origAnimName):
result.append(Func(self.pieActor.show))
result.append(self.pieActor.actorInterval('fightBoost'))
result.append(Func(self.pieActor.hide))
return result
return result

View file

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

View file

@ -853,12 +853,12 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
toon.b_setBattleId(toonId)
pos = self.battlePosDict[canonicalZoneId]
interactivePropTrackBonus = -1
if simbase.config.GetBool('props-buff-battles', True) and canonicalZoneId in self.cellToGagBonusDict:
interactivePropTrackBonus = self.cellToGagBonusDict[canonicalZoneId]
self.battleMgr.newBattle(
zoneId, zoneId, pos, suit, toonId, self.__battleFinished,
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_SMAX],

View file

@ -291,7 +291,7 @@ class TownLoader(StateData.StateData):
def createAnimatedProps(self, nodeList):
self.animPropDict = {}
self.zoneIdToInteractivePropDict = {}
for i in nodeList:
animPropNodes = i.findAllMatches('**/animated_prop_*')
numAnimPropNodes = animPropNodes.getNumPaths()
@ -313,11 +313,11 @@ class TownLoader(StateData.StateData):
animPropList.append(animPropObj)
interactivePropNodes = i.findAllMatches('**/interactive_prop_*')
for j in xrange(interactivePropNodes.getNumPaths()):
propNode = interactivePropNodes.getPath(j)
propName = propNode.getName()
if 'hydrant' in propName:
prop = HydrantInteractiveProp.HydrantInteractiveProp(propNode)
elif 'trashcan' in propName:
@ -326,12 +326,12 @@ class TownLoader(StateData.StateData):
prop = MailboxInteractiveProp.MailboxInteractiveProp(propNode)
else:
continue
if i in self.animPropDict:
self.animPropDict[i].append(prop)
else:
self.animPropDict[i] = [prop]
self.zoneIdToInteractivePropDict[int(i.getName())] = prop
def deleteAnimatedProps(self):