From f8d82e356d322c44703e529d9e74926247b8de04 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Fri, 10 Apr 2015 14:45:08 +0300 Subject: [PATCH] Give people teleport access to the HQ when they get their last suit --- toontown/suit/SuitDNA.py | 6 +++++- toontown/toon/DistributedToonAI.py | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/toontown/suit/SuitDNA.py b/toontown/suit/SuitDNA.py index 86cbeb41..b3ad661d 100644 --- a/toontown/suit/SuitDNA.py +++ b/toontown/suit/SuitDNA.py @@ -1,7 +1,7 @@ import random from pandac.PandaModules import * from direct.directnotify.DirectNotifyGlobal import * -from toontown.toonbase import TTLocalizer +from toontown.toonbase import TTLocalizer, ToontownGlobals import random from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator @@ -75,6 +75,10 @@ suitDepts = ['c', 'l', 'm', 's'] +suitDeptZones = [ToontownGlobals.BossbotHQ, + ToontownGlobals.LawbotHQ, + ToontownGlobals.CashbotHQ, + ToontownGlobals.SellbotHQ] suitDeptFullnames = {'c': TTLocalizer.Bossbot, 'l': TTLocalizer.Lawbot, 'm': TTLocalizer.Cashbot, diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index b43e883b..2180939c 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -1223,6 +1223,14 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo 0, 0] else: + for i in xrange(len(types)): + if types[i] == SuitDNA.suitsPerDept - 1: + zoneId = SuitDNA.suitDeptZones[i] + tpAccess = self.getTeleportAccess() + + if zoneId not in tpAccess: + tpAccess.append(zoneId) + self.b_setTeleportAccess(tpAccess) self.cogTypes = types def d_setCogTypes(self, types):