general: first round of fixes for tonight

note to self: add astron support checks to DistributedToonAI changes
This commit is contained in:
John Cote 2019-12-01 17:38:32 -05:00
parent e1d6d9ff3b
commit 758415b3e9
5 changed files with 30 additions and 6 deletions

View file

@ -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

View file

@ -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)

View file

@ -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.'

View file

@ -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)

View file

@ -1,4 +1,5 @@
from pandac.PandaModules import *
from libotp import *
from toontown.toonbase import ToontownGlobals
import random
from toontown.hood import ZoneUtil