Rental items 95% done.

This commit is contained in:
Loudrob 2015-03-23 16:28:42 -04:00
parent 5199150ed4
commit 4855f1c3b9
4 changed files with 43 additions and 39 deletions

View file

@ -1,29 +1,29 @@
from pandac.PandaModules import * from direct.controls.ControlManager import CollisionHandlerRayStart
from toontown.toonbase.ToonBaseGlobal import * from direct.distributed import DistributedObject
from toontown.toonbase import ToontownGlobals
from direct.distributed.ClockDelta import * from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State from direct.fsm import ClassicFSM, State
from direct.fsm import State from direct.fsm import State
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from direct.task.Task import Task
import math
from pandac.PandaModules import *
from pandac.PandaModules import *
import CannonGlobals
from toontown.effects import DustCloud
from toontown.effects import Splash
from toontown.effects import Wake
from toontown.minigame import CannonGameGlobals
from toontown.minigame import Trajectory
from toontown.nametag.NametagFloat3d import NametagFloat3d
from toontown.toon import ToonHead
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownTimer from toontown.toonbase import ToontownTimer
from direct.task.Task import Task from toontown.toonbase.ToonBaseGlobal import *
from toontown.minigame import Trajectory
import math
from toontown.toon import ToonHead
from toontown.effects import Splash
from toontown.effects import DustCloud
from toontown.minigame import CannonGameGlobals
import CannonGlobals
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from direct.distributed import DistributedObject
from toontown.effects import Wake
from direct.controls.ControlManager import CollisionHandlerRayStart
from toontown.nametag.NametagFloat3d import NametagFloat3d
from toontown.nametag.Nametag import Nametag
LAND_TIME = 2 LAND_TIME = 2
WORLD_SCALE = 2.0 WORLD_SCALE = 2.0
@ -267,7 +267,7 @@ class DistributedCannon(DistributedObject.DistributedObject):
self.curPinballScore = 0 self.curPinballScore = 0
self.curPinballMultiplier = 1 self.curPinballMultiplier = 1
self.incrementPinballInfo(0, 0) self.incrementPinballInfo(0, 0)
if self.cr.doId2do.has_key(self.avId): if self.avId in self.cr.doId2do:
self.av = self.cr.doId2do[self.avId] self.av = self.cr.doId2do[self.avId]
self.acceptOnce(self.av.uniqueName('disable'), self.__avatarGone) self.acceptOnce(self.av.uniqueName('disable'), self.__avatarGone)
self.av.stopSmooth() self.av.stopSmooth()
@ -844,7 +844,6 @@ class DistributedCannon(DistributedObject.DistributedObject):
flyTask.info = info flyTask.info = info
seqTask = Task.sequence(shootTask, smokeTask, flyTask) seqTask = Task.sequence(shootTask, smokeTask, flyTask)
if self.av == base.localAvatar: if self.av == base.localAvatar:
print 'disable controls'
base.localAvatar.disableAvatarControls() base.localAvatar.disableAvatarControls()
taskMgr.add(seqTask, self.taskName('flyingToon') + '-' + str(avId)) taskMgr.add(seqTask, self.taskName('flyingToon') + '-' + str(avId))
self.acceptOnce(self.uniqueName('stopFlyTask'), self.__stopFlyTask) self.acceptOnce(self.uniqueName('stopFlyTask'), self.__stopFlyTask)
@ -866,7 +865,6 @@ class DistributedCannon(DistributedObject.DistributedObject):
def removeAvFromCannon(self): def removeAvFromCannon(self):
place = base.cr.playGame.getPlace() place = base.cr.playGame.getPlace()
print 'removeAvFromCannon'
self.notify.debug('self.inWater = %s' % self.inWater) self.notify.debug('self.inWater = %s' % self.inWater)
if place: if place:
if not hasattr(place, 'fsm'): if not hasattr(place, 'fsm'):
@ -895,7 +893,6 @@ class DistributedCannon(DistributedObject.DistributedObject):
self.av.startSmooth() self.av.startSmooth()
self.av.setScale(1, 1, 1) self.av.setScale(1, 1, 1)
if self.av == base.localAvatar: if self.av == base.localAvatar:
print 'enable controls'
base.localAvatar.enableAvatarControls() base.localAvatar.enableAvatarControls()
self.ignore(self.av.uniqueName('disable')) self.ignore(self.av.uniqueName('disable'))
self.__destroyToonModels() self.__destroyToonModels()
@ -1163,7 +1160,6 @@ class DistributedCannon(DistributedObject.DistributedObject):
if hitP[2] > ToontownGlobals.EstateWakeWaterHeight: if hitP[2] > ToontownGlobals.EstateWakeWaterHeight:
self.notify.debug('we hit the ground before we hit water') self.notify.debug('we hit the ground before we hit water')
self.__hitGround(avatar, pos, extraArgs) self.__hitGround(avatar, pos, extraArgs)
print 'but not really'
return return
self.inWater = 1 self.inWater = 1
self.notify.debug('hit water') self.notify.debug('hit water')
@ -1246,7 +1242,7 @@ class DistributedCannon(DistributedObject.DistributedObject):
for id in doIds: for id in doIds:
t = self.cr.doId2do.get(id) t = self.cr.doId2do.get(id)
if t: if t:
pos = t.nodePath.getPos() pos = t.pos
rad = 10.5 rad = 10.5
height = 10.0 height = 10.0
t_impact = trajectory.checkCollisionWithCylinderSides(pos, rad, height) t_impact = trajectory.checkCollisionWithCylinderSides(pos, rad, height)
@ -1512,7 +1508,7 @@ class DistributedCannon(DistributedObject.DistributedObject):
(0, 1, 5, 4), (0, 1, 5, 4),
(0, 4, 7, 3), (0, 4, 7, 3),
(1, 2, 6, 5)] (1, 2, 6, 5)]
for i in range(len(vertices)): for i in xrange(len(vertices)):
vertex = vertices[i] vertex = vertices[i]
vertexWriter.addData3f(vertex[0], vertex[1], vertex[2]) vertexWriter.addData3f(vertex[0], vertex[1], vertex[2])
colorWriter.addData4f(*colors[i]) colorWriter.addData4f(*colors[i])
@ -1581,5 +1577,4 @@ class DistributedCannon(DistributedObject.DistributedObject):
def turnOnBumperCollision(self, whatever = 0): def turnOnBumperCollision(self, whatever = 0):
if self.bumperCol: if self.bumperCol:
self.bumperCol.setCollideMask(ToontownGlobals.WallBitmask) self.bumperCol.setCollideMask(ToontownGlobals.WallBitmask)# decompiled 0 files: 0 okay, 1 failed, 0 verify failed

View file

@ -1,22 +1,28 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.distributed.PyDatagramIterator import *
from direct.distributed.PyDatagram import *
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
import HouseGlobals import HouseGlobals
import time import time
import random import random
from toontown.fishing.DistributedFishingPondAI import DistributedFishingPondAI from toontown.fishing.DistributedFishingPondAI import DistributedFishingPondAI
from toontown.fishing.DistributedFishingTargetAI import DistributedFishingTargetAI from toontown.fishing.DistributedFishingTargetAI import DistributedFishingTargetAI
from toontown.fishing.DistributedPondBingoManagerAI import DistributedPondBingoManagerAI from toontown.fishing.DistributedPondBingoManagerAI import DistributedPondBingoManagerAI
from toontown.fishing import FishingTargetGlobals from toontown.fishing import FishingTargetGlobals
from toontown.safezone.DistributedFishingSpotAI import DistributedFishingSpotAI from toontown.safezone.DistributedFishingSpotAI import DistributedFishingSpotAI
from toontown.safezone.SZTreasurePlannerAI import SZTreasurePlannerAI from toontown.safezone.SZTreasurePlannerAI import SZTreasurePlannerAI
from toontown.safezone import DistributedTreasureAI
from toontown.safezone import TreasureGlobals from toontown.safezone import TreasureGlobals
from DistributedGardenBoxAI import * from DistributedGardenBoxAI import *
from DistributedGagTreeAI import * from DistributedGagTreeAI import *
from DistributedFlowerAI import * from DistributedFlowerAI import *
import GardenGlobals import GardenGlobals
from DistributedCannonAI import * from DistributedCannonAI import *
from DistributedTargetAI import * from DistributedTargetAI import *
import CannonGlobals import CannonGlobals
@ -26,6 +32,9 @@ NULL_TREES = [NULL_PLANT] * 8
NULL_FLOWERS = [NULL_PLANT] * 10 NULL_FLOWERS = [NULL_PLANT] * 10
NULL_STATUARY = 0 NULL_STATUARY = 0
from direct.distributed.PyDatagramIterator import *
from direct.distributed.PyDatagram import *
def unpackGardenSetter(f): def unpackGardenSetter(f):
def w(klass, data): def w(klass, data):
if data: if data:
@ -181,7 +190,7 @@ class CannonRental(Rental):
def destroy(self): def destroy(self):
self.estate.b_setClouds(0) self.estate.b_setClouds(0)
Rental.destroy(self) Rental.destroy(self)
def generateTreasures(self): def generateTreasures(self):
doIds = [] doIds = []
z = 35 z = 35
@ -189,13 +198,13 @@ class CannonRental(Rental):
for i in xrange(20): for i in xrange(20):
x = random.randint(100, 300) - 200 x = random.randint(100, 300) - 200
y = random.randint(100, 300) - 200 y = random.randint(100, 300) - 200
treasure = DistributedTreasureAI.DistributedTreasureAI(self.estate.air, self, 9, x, y, z) treasure = DistributedTreasureAI.DistributedTreasureAI(self.estate.air, self, 7, x, y, z)
treasure.generateWithRequired(self.estate.zoneId) treasure.generateWithRequired(self.estate.zoneId)
self.objects.add(treasure) self.objects.add(treasure)
doIds.append(treasure.doId) doIds.append(treasure.doId)
self.estate.sendUpdate("setTreasureIds", [doIds]) self.estate.sendUpdate("setTreasureIds", [doIds])
def grabAttempt(self, avId, treasureId): def grabAttempt(self, avId, treasureId):
av = self.estate.air.doId2do.get(avId) av = self.estate.air.doId2do.get(avId)
if av == None: if av == None:

View file

@ -155,12 +155,12 @@ class DistributedTarget(DistributedObject.DistributedObject):
def showTimer(self): def showTimer(self):
if base.localAvatar.animFSM.getCurrentState().getName() != 'ReadBook': if base.localAvatar.animFSM.getCurrentState().getName() != 'ReadBook':
base.setCellsAvailable([base.rightCells[0]], 0) base.setCellsActive([base.rightCells[0]], 0)
self.timer.show() self.timer.show()
def hideTimer(self): def hideTimer(self):
self.timer.hide() self.timer.hide()
base.setCellsAvailable([base.rightCells[0]], 1) base.setCellsActive([base.rightCells[0]], 1)
def setPosition(self, x, y, z): def setPosition(self, x, y, z):
self.geom.setPos(x, y, z) self.geom.setPos(x, y, z)

View file

@ -43,8 +43,8 @@ BossbotHQCameraFar = 3000.0
BossbotHQCameraNear = 1.0 BossbotHQCameraNear = 1.0
SpeedwayCameraFar = 8000.0 SpeedwayCameraFar = 8000.0
SpeedwayCameraNear = 1.0 SpeedwayCameraNear = 1.0
MaxMailboxContents = 30 MaxMailboxContents = 60
MaxHouseItems = 45 MaxHouseItems = 250
MaxAccessories = 50 MaxAccessories = 50
ExtraDeletedItems = 5 ExtraDeletedItems = 5
DeletedItemLifetime = 7 * 24 * 60 DeletedItemLifetime = 7 * 24 * 60
@ -1688,4 +1688,4 @@ PropIdToColor = [
(0.93, 0.623, 0.196, 1), (0.93, 0.623, 0.196, 1),
(0.96, 0.356, 0.839, 1), (0.96, 0.356, 0.839, 1),
(0.196, 0.917, 0.929, 1) (0.196, 0.917, 0.929, 1)
] ]