Loudrob pls

This commit is contained in:
John 2015-07-23 12:59:17 +03:00
parent a0d8025621
commit 6ce7485ef4
8 changed files with 99 additions and 45 deletions

View file

@ -1217,7 +1217,6 @@ struct lawnItem {
};
dclass DistributedEstate : DistributedObject {
string DcObjectType db;
setEstateReady() broadcast;
setClientReady() airecv clsend;
setEstateType(uint8 type = 0) required broadcast db;
@ -1244,6 +1243,8 @@ dclass DistributedEstate : DistributedObject {
setSlot5Garden(blob g) required airecv db;
setIdList(uint32 []) broadcast ram;
completeFlowerSale(uint8) airecv clsend;
completeFishSale() airecv clsend;
thankSeller(int8, int8, int8);
awardedTrophy(uint32) broadcast;
setClouds(uint8) required broadcast ram;
cannonsOver() broadcast;

View file

@ -22,11 +22,6 @@ class CatalogGardenItem(CatalogItem.CatalogItem):
else:
return 100
def reachedPurchaseLimit(self, avatar):
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder or self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
return 1
return 0
def getAcceptItemErrorText(self, retcode):
if retcode == ToontownGlobals.P_ItemAvailable:
return TTLocalizer.CatalogAcceptGarden
@ -39,17 +34,16 @@ class CatalogGardenItem(CatalogItem.CatalogItem):
return TTLocalizer.GardenTypeName
def getName(self):
name = GardenGlobals.Specials[self.gardenIndex]['photoName']
return name
return GardenGlobals.Specials[self.gardenIndex]['photoName']
def recordPurchase(self, avatar, optional):
if avatar:
avatar.addGardenItem(self.gardenIndex, self.numItems)
if 1:
return ToontownGlobals.P_ItemAvailable
def getPicture(self, avatar):
photoModel = GardenGlobals.Specials[self.gardenIndex]['photoModel']
if 'photoAnimation' in GardenGlobals.Specials[self.gardenIndex]:
modelPath = photoModel + GardenGlobals.Specials[self.gardenIndex]['photoAnimation'][0]
animationName = GardenGlobals.Specials[self.gardenIndex]['photoAnimation'][1]
@ -75,7 +69,6 @@ class CatalogGardenItem(CatalogItem.CatalogItem):
self.model.setScale(photoScale)
self.hasPicture = True
return (frame, None)
return None
def cleanupPicture(self):
CatalogItem.CatalogItem.cleanupPicture(self)

View file

@ -6,27 +6,16 @@ from direct.interval.IntervalGlobal import *
import math
from toontown.toonbase import ToontownGlobals
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
from direct.fsm import State
from toontown.toon import Toon
from direct.showbase import RandomNumGen
from direct.task.Task import Task
from toontown.toonbase import TTLocalizer
import random
import cPickle
import time
from direct.showbase import PythonUtil
from toontown.hood import Place
import Estate
import HouseGlobals
from toontown.estate import GardenGlobals
from toontown.estate import DistributedFlower
from toontown.estate import DistributedGagTree
from toontown.estate import DistributedStatuary
import GardenProgressMeter
from toontown.estate import FlowerSellGUI
from toontown.toontowngui import TTDialog
from toontown.fishing import FishSellGUI
class DistributedEstate(DistributedObject.DistributedObject):
notify = directNotify.newCategory('DistributedEstate')
@ -44,16 +33,15 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.initCamera()
self.plotTable = []
self.idList = []
base.estate = self
self.flowerGuiDoneEvent = 'flowerGuiDone'
return
self.fishGuiDoneEvent = 'fishGuiDone'
def disable(self):
self.notify.debug('disable')
self.__stopBirds()
self.__stopCrickets()
DistributedObject.DistributedObject.disable(self)
self.ignore('enterFlowerSellBox')
self.ignoreAll()
def delete(self):
self.notify.debug('delete')
@ -61,12 +49,14 @@ class DistributedEstate(DistributedObject.DistributedObject):
DistributedObject.DistributedObject.delete(self)
def load(self):
self.lt = base.localAvatar
self.defaultSignModel = loader.loadModel('phase_13/models/parties/eventSign')
self.activityIconsModel = loader.loadModel('phase_4/models/parties/eventSignIcons')
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN):
self.loadWitch()
else:
self.loadAirplane()
self.loadFlowerSellBox()
self.loadFishSellBox()
self.oldClear = base.win.getClearColor()
base.win.setClearColor(Vec4(0.09, 0.55, 0.21, 1.0))
@ -95,7 +85,10 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.flowerSellBox.removeNode()
del self.flowerSellBox
self.flowerSellBox = None
return
if self.fishSellBox:
self.fishSellBox.removeNode()
del self.fishSellBox
self.fishSellBox = None
def announceGenerate(self):
DistributedObject.DistributedObject.announceGenerate(self)
@ -189,7 +182,6 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.housePos = posList
self.numHouses = len(self.houseType)
self.house = [None] * self.numHouses
return
def __startAirplaneTask(self):
self.theta = 0
@ -371,13 +363,57 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.ignore('stoppedAsleep')
self.flowerGui.destroy()
self.flowerGui = None
return
def popupFlowerGUI(self):
self.acceptOnce(self.flowerGuiDoneEvent, self.__handleSaleDone)
self.flowerGui = FlowerSellGUI.FlowerSellGUI(self.flowerGuiDoneEvent)
self.accept('stoppedAsleep', self.__handleSaleDone)
def loadFishSellBox(self):
self.fishSellBox = loader.loadModel('phase_4/models/minigames/treasure_chest.bam')
self.fishSellBox.setPos(45, -165.75, 0.025)
self.fishSellBox.setH(210)
self.fishSellBox.reparentTo(render)
cSphere = CollisionSphere(0.0, 0.0, 0.0, 2.25)
cSphere.setTangible(0)
colNode = CollisionNode('FishSellBox')
colNode.addSolid(cSphere)
cSpherePath = self.fishSellBox.attachNewNode(colNode)
cSpherePath.hide()
cSpherePath.setCollideMask(ToontownGlobals.WallBitmask)
self.accept('enterFishSellBox', self.__touchedFishSellBox)
def __touchedFishSellBox(self, entry):
if base.localAvatar.doId in self.idList:
if base.localAvatar.fishTank.getFish():
self.popupFishGUI()
def __handleFishSaleDone(self, sell=0):
if sell:
self.sendUpdate('completeFishSale')
else:
base.localAvatar.setSystemMessage(0, TTLocalizer.STOREOWNER_NOFISH)
base.setCellsAvailable(base.bottomCells, 1)
base.cr.playGame.getPlace().setState('walk')
self.ignore(self.fishGuiDoneEvent)
self.ignore('stoppedAsleep')
self.fishGui.destroy()
self.fishGui = None
def popupFishGUI(self):
base.setCellsAvailable(base.bottomCells, 0)
base.cr.playGame.getPlace().setState('stopped')
self.acceptOnce(self.fishGuiDoneEvent, self.__handleFishSaleDone)
self.fishGui = FishSellGUI.FishSellGUI(self.fishGuiDoneEvent)
self.accept('stoppedAsleep', self.__handleFishSaleDone)
def thankSeller(self, mode, fish, maxFish):
if mode == ToontownGlobals.FISHSALE_TROPHY:
base.localAvatar.setSystemMessage(0, TTLocalizer.STOREOWNER_TROPHY % (fish, maxFish))
elif mode == ToontownGlobals.FISHSALE_COMPLETE:
base.localAvatar.setSystemMessage(0, TTLocalizer.STOREOWNER_THANKSFISH)
def closedAwardDialog(self, value):
self.awardDialog.destroy()
base.cr.playGame.getPlace().detectedGardenPlotDone()

View file

@ -7,13 +7,14 @@ import time, random
from toontown.fishing.DistributedFishingPondAI import DistributedFishingPondAI
from toontown.fishing.DistributedFishingTargetAI import DistributedFishingTargetAI
from toontown.fishing.DistributedPondBingoManagerAI import DistributedPondBingoManagerAI
from toontown.fishing import FishingTargetGlobals
from toontown.fishing import FishingTargetGlobals, FishGlobals
from toontown.safezone import TreasureGlobals
from toontown.safezone.SZTreasurePlannerAI import SZTreasurePlannerAI
from toontown.safezone import DistributedTreasureAI
from toontown.safezone import ButterflyGlobals
from toontown.safezone import DistributedButterflyAI
from toontown.safezone.DistributedFishingSpotAI import DistributedFishingSpotAI
from toontown.parties.DistributedPartyJukeboxActivityAI import DistributedPartyJukeboxActivityAI
from DistributedGardenBoxAI import *
from DistributedGardenPlotAI import *
@ -486,11 +487,11 @@ class DistributedEstateAI(DistributedObjectAI):
self.houses = [None] * 6
self.rentalType = 0
self.rentalHandle = None
self.doId2do = { }
self.pond = None
self.jukebox = None
self.spots = []
self.butterflies = []
self.targets = []
self.owner = None
@ -498,6 +499,10 @@ class DistributedEstateAI(DistributedObjectAI):
self.gardenManager = GardenManager(self)
self.__pendingGardens = {}
@property
def hostId(self):
return 1000000001
def generate(self):
DistributedObjectAI.generate(self)
@ -545,18 +550,28 @@ class DistributedEstateAI(DistributedObjectAI):
spot.generateWithRequired(self.zoneId)
self.spots.append(spot)
self.jukebox = DistributedPartyJukeboxActivityAI(self.air, self.doId, (0, 0, 0, 0))
self.jukebox.generateWithRequired(self.zoneId)
self.jukebox.sendUpdate('setX', [-21.8630])
self.jukebox.sendUpdate('setY', [-154.669])
self.jukebox.sendUpdate('setH', [148.7050])
self.jukebox.sendUpdate('unloadSign')
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.ESTATE)
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.ESTATE]):
for j in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.ESTATE]):
bfly = DistributedButterflyAI.DistributedButterflyAI(self.air, ButterflyGlobals.ESTATE, i, self.zoneId)
bfly.generateWithRequired(self.zoneId)
bfly.start()
self.addDistObj(bfly)
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, ButterflyGlobals.ESTATE, i, self.zoneId)
butterfly.generateWithRequired(self.zoneId)
butterfly.start()
self.butterflies.append(butterfly)
def destroy(self):
for house in self.houses:
if house:
house.requestDelete()
for butterfly in self.butterflies:
if butterfly:
butterfly.requestDelete()
del self.houses[:]
if self.pond:
for spot in self.spots:
@ -567,6 +582,8 @@ class DistributedEstateAI(DistributedObjectAI):
self.targets = []
self.pond.requestDelete()
self.pond = None
if self.jukebox:
self.jukebox.requestDelete()
if self.treasurePlanner:
self.treasurePlanner.stop()
@ -890,6 +907,18 @@ class DistributedEstateAI(DistributedObjectAI):
av.b_setGardenTrophies(range(len(collection) // 10))
def completeFishSale(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av:
return
if self.air.fishManager.creditFishTank(av):
self.sendUpdateToAvatarId(avId, 'thankSeller', [ToontownGlobals.FISHSALE_TROPHY, len(av.fishCollection), FishGlobals.getTotalNumFish()])
else:
self.sendUpdateToAvatarId(avId, 'thankSeller', [ToontownGlobals.FISHSALE_COMPLETE, 0, 0])
def setClouds(self, clouds):
self.cloudType = clouds

View file

@ -12,7 +12,6 @@ class DistributedGarden(DistributedObject.DistributedObject):
def __init__(self, cr):
self.notify.debug('init')
DistributedObject.DistributedObject.__init__(self, cr)
self.lt = base.localAvatar
self.props = []
self.pos = None
self.radius = 0
@ -23,7 +22,6 @@ class DistributedGarden(DistributedObject.DistributedObject):
self.dx = 1.0 / self.gridCells
self.occupied = []
return
def generate(self):
DistributedObject.DistributedObject.generate(self)

View file

@ -146,7 +146,7 @@ __targetInfoDict = {ToontownGlobals.ToontownCentral: (2,
-2.1,
14,
-2.1 - 0.378),
ToontownGlobals.MyEstate: (5,
ToontownGlobals.MyEstate: (3,
30,
-126,
-0.3,

View file

@ -163,7 +163,6 @@ class DistributedTugOfWarGame(DistributedMinigame):
def unload(self):
self.notify.debug('unload')
DistributedMinigame.unload(self)
del self.lt
self.timer.destroy()
del self.timer
self.room.removeNode()
@ -250,7 +249,6 @@ class DistributedTugOfWarGame(DistributedMinigame):
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
self.lt = base.localAvatar
NametagGlobals.setGlobalNametagScale(1)
self.arrowKeys = ArrowKeys.ArrowKeys()
self.room.reparentTo(render)

View file

@ -1622,9 +1622,8 @@ BMovementSpeedMultiplier = 1.3
BugReportSite = 'https://bugs.launchpad.net/toontown-united/+filebug'
CostPerLaffRestock = 3
FISHSALE_NONE = 0
FISHSALE_COMPLETE = 1
FISHSALE_TROPHY = 2
FISHSALE_COMPLETE = 0
FISHSALE_TROPHY = 1
NPCCollisionDelay = 2.5
KnockKnockHeal = 12
KnockKnockCooldown = 600