GARDENS: Needs to get done.

This commit is contained in:
Loudrob 2015-06-11 13:48:13 -04:00
parent b29da23a0a
commit 5101a94e5a
5 changed files with 12 additions and 2 deletions

View file

@ -613,8 +613,9 @@ class DistributedEstateAI(DistributedObjectAI):
def gameTableOver(self):
pass
def placeStarterGarden(self, avatar):
# TODO: Place garden if a toon already owns one.
avId = avatar.doId
slot = self.toons.index(avId)
plotPos = GardenGlobals.estatePlots[slot]
@ -643,6 +644,7 @@ class DistributedEstateAI(DistributedObjectAI):
newPlot.generateWithRequired(self.zoneId)
self.plots[slot].append(newPlot)
elif i == GardenGlobals.FLOWER_TYPE:
# TODO: Place flower plots more accurately.
x, y, h = n[:3]
newPlot = DistributedGardenPlotAI(self.air)
newPlot.setEstate(self.doId)

View file

@ -1,6 +1,9 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.estate.DistributedPlantBaseAI import DistributedPlantBaseAI
# TODO: Add flower to basket when picking, give shovel skill only if the
# flower is player's tier.
class DistributedFlowerAI(DistributedPlantBaseAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedFlowerAI")

View file

@ -26,6 +26,7 @@ class DistributedGagTreeAI(DistributedPlantBaseAI):
return self.wilted
def requestHarvest(self, doId):
# TODO: Actually harvest the gags and add them to toon inventory.
av = simbase.air.doId2do.get(doId)
harvested = 0
track, level = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)

View file

@ -49,7 +49,7 @@ class DistributedGardenPlotAI(DistributedLawnDecorAI):
def addData(self):
estate = simbase.air.doId2do.get(self.getEstate())
plantedAt = int(datetime.datetime.now().strftime('%Y%m%d%H%M'))
plantedAt = int(datetime.datetime.now().strftime('%Y%m%d%H%M')) # TODO: Possibly store this in mongodb/cPickle instead.
if isinstance(self.planted, DistributedFlowerAI):
data = [
self.getPlot(),
@ -181,6 +181,7 @@ class DistributedGardenPlotAI(DistributedLawnDecorAI):
self.sendUpdate('setMovie', [GardenGlobals.MOVIE_PLANT, toon])
def plantNothing(self, burntBeans, toon):
# TODO: Fix exploit.
av = simbase.air.doId2do.get(toon)
av.takeMoney(burntBeans)
self.planted = None

View file

@ -51,6 +51,8 @@ class DistributedPlantBaseAI(DistributedLawnDecorAI):
return self.growthLevel
def waterPlant(self, avId):
# TODO: Proper water threshold for watering can type.
# Not supposed to be 16 for all watering cans.
self.lastWateredBy = avId
newLevel = self.waterLevel + 1
if newLevel > self.maxWaterLevel:
@ -69,6 +71,7 @@ class DistributedPlantBaseAI(DistributedLawnDecorAI):
del self.lastWateredBy
estate = simbase.air.doId2do.get(self.getEstate())
dataIndex = -1
# TODO: Possibly store this in mongodb/cPickle instead.
for n, item in enumerate(estate.items[self.getOwnerIndex()]):
if item[0] == self.getPlot():
dataIndex = n