File cleanup and some fixes.

This commit is contained in:
John Cote 2015-05-11 15:05:59 -04:00
parent 85406a5a52
commit 267310adc7
22 changed files with 160 additions and 180 deletions

View file

@ -17,7 +17,7 @@ def doSOSs(calls):
def callerFunc(toon, handle):
toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
handle.d_battleSOS(base.localAvatar.doId)
handle.d_battleSOS(handle.doId)
def calleeFunc(toon, handle):
toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)

View file

@ -29,27 +29,27 @@ WhisperColors = {
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) # Disabled
),
WTSystem: (
((0.0, 0.0, 0.0, 1.0), (0.8, 0.1, 0.1, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (0.8, 0.1, 0.1, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.9, 0.05, 0.05, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) # Disabled
((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.8, 0.4, 1.0, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.8, 0.3, 0.6, 0.6)) # Disabled
),
WTBattleSOS: (
((0.0, 0.0, 0.0, 1.0), (0.8, 0.1, 0.1, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (0.8, 0.1, 0.1, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.9, 0.05, 0.05, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.2, 0.6, 0.8, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) # Disabled
),
WTEmote: (
((0.0, 0.0, 0.0, 1.0), (0.8, 0.1, 0.1, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (0.8, 0.1, 0.1, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.9, 0.05, 0.05, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)) # Disabled
((0.0, 0.0, 0.0, 1.0), (0.1, 0.7, 0.41, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (0.2, 0.7, 0.41, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.1, 0.6, 0.51, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.1, 0.6, 0.41, 0.6)) # Disabled
),
WTToontownBoardingGroup: (
((0.0, 0.0, 0.0, 1.0), (0.9, 0.4, 0.05, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (1.0, 0.5, 0.2, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (1.0, 0.4, 0.0, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.9, 0.5, 0.1, 0.6)), # Normal
((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)), # Click
((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)), # Rollover
((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.1, 0.6)) # Disabled
),
}

View file

@ -71,7 +71,6 @@ class CannonRental(Rental):
if self.validAvatar(av):
treasure.d_setGrab(avId)
self.deleteTreasureSoon(treasure)
else:
treasure.d_setReject()
@ -116,10 +115,8 @@ class DistributedEstateAI(DistributedObjectAI):
self.rentalHandle = None
self.rentalTimestamp = 0
self.houses = [None] * 6
self.pond = None
self.spots = []
self.targets = []
self.owner = None
@ -137,7 +134,6 @@ class DistributedEstateAI(DistributedObjectAI):
target.generateWithRequired(self.zoneId)
self.targets.append(target)
spot = DistributedFishingSpotAI(self.air)
spot.setPondDoId(self.pond.getDoId())
spot.setPosHpr(49.1029, -124.805, 0.344704, 90, 0, 0)
@ -167,7 +163,6 @@ class DistributedEstateAI(DistributedObjectAI):
self.createTreasurePlanner()
def destroy(self):
for house in self.houses:
if house:
@ -245,7 +240,7 @@ class DistributedEstateAI(DistributedObjectAI):
def getDecorData(self):
return self.decorData
def setLastEpochTimeStamp(self, last): #how do I do this
def setLastEpochTimeStamp(self, last):
self.lastEpochTimestamp = last
def d_setLastEpochTimeStamp(self, last):
@ -282,7 +277,6 @@ class DistributedEstateAI(DistributedObjectAI):
expirestamp = self.getRentalTimeStamp()
if expirestamp == 0:
expire = 0
else:
expire = int(expirestamp - time.time())
@ -290,7 +284,6 @@ class DistributedEstateAI(DistributedObjectAI):
self.rentalType = 0
self.d_setRentalType(0)
self.b_setRentalTimeStamp(0)
else:
if self.rentalType == type:
return
@ -304,7 +297,6 @@ class DistributedEstateAI(DistributedObjectAI):
self.rentalHandle = CannonRental(self)
elif self.rentalType == ToontownGlobals.RentalGameTable:
self.rentalHandle = TableRental(self)
else:
self.notify.warning('Unknown rental %s' % self.rentalType)
return
@ -436,7 +428,6 @@ class DistributedEstateAI(DistributedObjectAI):
def getSlot4ToonId(self):
return self.toons[4]
def setSlot4Items(self, items):
self.items[4] = items

View file

@ -44,7 +44,8 @@ class DistributedTarget(DistributedObject.DistributedObject):
def load(self):
self.timer = ToontownTimer.ToontownTimer()
self.timer.setPos(1.1, 0, -0.15)
self.timer.reparentTo(base.a2dBottomRight)
self.timer.setPos(-0.233, 0, 0.85)
self.timer.hide()
self.geom = loader.loadModel('phase_5.5/models/estate/target')
self.geom.reparentTo(base.cr.playGame.hood.loader.geom)

View file

@ -1,13 +1,13 @@
from direct.distributed import DistributedObject
from direct.distributed.DistributedObject import DistributedObject
from pandac.PandaModules import *
from toontown.fishing import FishSellGUI
from toontown.toonbase import ToontownGlobals, TTLocalizer
import TreasureChestGlobals
class DistributedTreasureChest(DistributedObject.DistributedObject):
class DistributedTreasureChest(DistributedObject):
def __init__(self, cr):
DistributedObject.DistributedObject.__init__(self, cr)
DistributedObject.__init__(self, cr)
self.cr = cr
self.createModel(45, -165.75, 0.025, 30)
self.initCollisions()
@ -21,7 +21,7 @@ class DistributedTreasureChest(DistributedObject.DistributedObject):
del self.cSphereNode
del self.cSphereNodePath
del self.model
DistributedObject.DistributedObject.delete(self)
DistributedObject.delete(self)
def destroyFishGui(self):
self.ignore('treasureChestSell')

View file

@ -1,8 +1,8 @@
from direct.distributed import DistributedObjectAI
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.fishing import FishGlobals
import TreasureChestGlobals
class DistributedTreasureChestAI(DistributedObjectAI.DistributedObjectAI):
class DistributedTreasureChestAI(DistributedObjectAI):
def completeSale(self, sell):
avId = self.air.getAvatarIdFromSender()

View file

@ -128,7 +128,6 @@ class EstateLoader(SafeZoneLoader.SafeZoneLoader):
self.sun.setScale(2)
self.sun.setBillboardPointEye()
if self.moon:
self.moon.setP(180)
self.moon.reparentTo(self.sunMoonNode)
self.moon.setY(-270)
self.moon.setScale(15)

View file

@ -1,14 +1,3 @@
########################## TOONTOWN ADVENTURE ##########################
# Filename: GameSprite.py
# Created by: sillypeppymacspeed
# Date: March 28th, 2014
####
# Description:
#
# This codes the sprites for the Garden Drop estate game.
####
### DEFINITELY NOT COPIED FROM TOONTOWN HOUSE
import math
class GameSprite:

View file

@ -39,7 +39,7 @@ class FriendHandle:
def uniqueName(self, idString):
return idString + '-' + str(self.getDoId())
def d_battleSOS(self, requesterId):
def d_battleSOS(self, sendToId):
base.cr.ttuFriendsManager.d_battleSOS(self.doId)
def d_teleportQuery(self, requesterId):

View file

@ -133,7 +133,7 @@ class DistributedNPCGlove(DistributedNPCToonBase):
taskMgr.doMethodLater(45, self.leave, 'npcSleepTask-%s' % self.doId)
self.setChatAbsolute('', CFSpeech)
if base.localAvatar.getMoney() < ToontownGlobals.GloveCost:
if base.localAvatar.getTotalMoney() < ToontownGlobals.GloveCost:
self.setChatAbsolute(self.getMessageById(2), CFSpeech|CFTimeout)
self.reset()
else:

View file

@ -15,7 +15,7 @@ class DistributedNPCGloveAI(DistributedNPCToonBaseAI):
self.sendUpdate('doTransformation', [avId, 1])
return
if av.getMoney() < ToontownGlobals.GloveCost:
if av.getTotalMoney() < ToontownGlobals.GloveCost:
self.sendUpdate('doTransformation', [avId, 2])
return

View file

@ -372,7 +372,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.setChatAbsolute(chatString, CFSpeech | CFTimeout)
ResistanceChat.doEffect(msgIndex, self, nearbyToons)
def d_battleSOS(self, requesterId, sendToId):
def d_battleSOS(self, sendToId):
self.cr.ttuFriendsManager.d_battleSOS(sendToId)
def battleSOS(self, requesterId):