From 758415b3e9e3fd49ce30b99e02e742e838af622d Mon Sep 17 00:00:00 2001 From: John Cote Date: Sun, 1 Dec 2019 17:38:32 -0500 Subject: [PATCH] general: first round of fixes for tonight note to self: add astron support checks to DistributedToonAI changes --- etc/Configrc.prc | 1 + toontown/minigame/MazeMapGui.py | 10 +++++----- toontown/toon/DeathForceAcknowledge.py | 2 +- toontown/toon/DistributedToonAI.py | 22 ++++++++++++++++++++++ toontown/toon/NPCToons.py | 1 + 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/etc/Configrc.prc b/etc/Configrc.prc index 44ccd70..4873647 100644 --- a/etc/Configrc.prc +++ b/etc/Configrc.prc @@ -96,6 +96,7 @@ audio-master-sfx-volume 1 audio-master-music-volume 1 server-type prod want-dev 0 +schellgames-dev 0 text-minfilter linear_mipmap_linear # TEMP diff --git a/toontown/minigame/MazeMapGui.py b/toontown/minigame/MazeMapGui.py index e29a160..74b54e1 100644 --- a/toontown/minigame/MazeMapGui.py +++ b/toontown/minigame/MazeMapGui.py @@ -1,6 +1,6 @@ from direct.showbase.PythonUtil import Enum from direct.gui.DirectGui import DirectFrame, DGG -from pandac.PandaModules import Vec2, VBase4D +from pandac.PandaModules import Vec2, VBase4F from pandac.PandaModules import CardMaker, NodePath from pandac.PandaModules import Texture, PNMImage DEFAULT_MASK_RESOLUTION = 32 @@ -48,7 +48,7 @@ class MazeMapGui(DirectFrame): def _createMapTextureCard(self): mapImage = PNMImage(MAP_RESOLUTION, MAP_RESOLUTION) mapImage.fill(*self._bgColor) - fgColor = VBase4D(*self._fgColor) + fgColor = VBase4F(*self._fgColor) for x in range(self._mazeHeight): for y in range(self._mazeWidth): if self._mazeCollTable[y][x] == 1: @@ -128,15 +128,15 @@ class MazeMapGui(DirectFrame): def _revealSmoothCircle(self, x, y, center): length = (Vec2(x, y) - center).length() goalAlpha = max(0.0, length / float(self._radius) - 0.5) - self._maskImage.setXelA(x, y, VBase4D(0.0, 0.0, 0.0, min(self._maskImage.getAlpha(x, y), goalAlpha * 2.0))) + self._maskImage.setXelA(x, y, VBase4F(0.0, 0.0, 0.0, min(self._maskImage.getAlpha(x, y), goalAlpha * 2.0))) def _revealHardCircle(self, x, y, center): length = (Vec2(x, y) - center).length() if length <= self._radius: - self._maskImage.setXelA(x, y, VBase4D(0, 0, 0, 0)) + self._maskImage.setXelA(x, y, VBase4F(0, 0, 0, 0)) def _revealSquare(self, x, y, center): - self._maskImage.setXelA(x, y, VBase4D(0, 0, 0, 0)) + self._maskImage.setXelA(x, y, VBase4F(0, 0, 0, 0)) def _drawHole(self, x, y): center = Vec2(x, y) diff --git a/toontown/toon/DeathForceAcknowledge.py b/toontown/toon/DeathForceAcknowledge.py index 133798b..9b8eb31 100644 --- a/toontown/toon/DeathForceAcknowledge.py +++ b/toontown/toon/DeathForceAcknowledge.py @@ -18,7 +18,7 @@ class DeathForceAcknowledge: image_color=(0, 0, 0, 0.4), image_scale=3.0, state=DGG.NORMAL) - self.fade.reparentTo(aspect2d, FADE_SORT_INDEX) + self.fade.reparentTo(aspect2d, DGG.FADE_SORT_INDEX) fadeModel.removeNode() else: print 'Problem loading fadeModel.' diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index ac5877b..b87c7fe 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -228,6 +228,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if self.WantOldGMNameBan: self._checkOldGMName() messenger.send('avatarEntered', [self]) + self.sendUpdate('setDefaultShard', [self.air.districtId]) if hasattr(self, 'gameAccess') and self.gameAccess != 2: if self.hat[0] != 0: self.replaceItemInAccessoriesList(ToonDNA.HAT, 0, 0, 0, self.hat[0], self.hat[1], self.hat[2]) @@ -247,6 +248,27 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.b_setShoes(0, 0, 0) self.startPing() + def setLocation(self, parentId, zoneId): + DistributedPlayerAI.DistributedPlayerAI.setLocation(self, parentId, zoneId) + if self.isPlayerControlled(): + if 100 <= zoneId < ToontownGlobals.DynamicZonesBegin: + hood = ZoneUtil.getHoodId(zoneId) + self.sendUpdate('setLastHood', [hood]) + self.setDefaultZone(hood) + self.sendUpdate('setDefaultZone', [hood]) + canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) + canonicalHood = ZoneUtil.getHoodId(canonicalZoneId) + hoodsVisted = list(self.getHoodsVisited()) + if canonicalHood not in hoodsVisted: + hoodsVisted.append(canonicalHood) + self.b_setHoodsVisited(hoodsVisted) + + if canonicalZoneId == ToontownGlobals.GoofySpeedway: + teleportAccess = self.getTeleportAccess() + if ToontownGlobals.GoofySpeedway not in teleportAccess: + teleportAccess.append(ToontownGlobals.GoofySpeedway) + self.b_setTeleportAccess(teleportAccess) + def _doDbCheck(self, task = None): self._dbCheckDoLater = None self.air.sendQueryToonMaxHp(self.doId, self._handleDbCheckResult) diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index 5cedefe..6e6dce5 100644 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -1,4 +1,5 @@ from pandac.PandaModules import * +from libotp import * from toontown.toonbase import ToontownGlobals import random from toontown.hood import ZoneUtil