NPC fix!!

This commit is contained in:
John 2015-08-12 18:37:17 +03:00
parent c7011bc757
commit 1dcba024d5
4 changed files with 14 additions and 18 deletions

View file

@ -301,6 +301,6 @@ class DistributedStage(DistributedObject.DistributedObject):
self.titleText.setText('') self.titleText.setText('')
def elevatorAlert(self, avId): def elevatorAlert(self, avId):
if base.localAvatar.doId != avId: if base.localAvatar.doId != avId and avId in base.cr.doId2do:
name = base.cr.doId2do[avId].getName() name = base.cr.doId2do[avId].getName()
self.showInfoText(TTLocalizer.stageToonEnterElevator % name) self.showInfoText(TTLocalizer.StageToonEnterElevator % name)

View file

@ -61,3 +61,6 @@ class DistributedNPCToonBaseAI(DistributedToonAI.DistributedToonAI):
def getPositionIndex(self): def getPositionIndex(self):
return self.posIndex return self.posIndex
def getStartAnimState(self):
return 'neutral'

View file

@ -134,10 +134,7 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
npc.setMaxHp(15) npc.setMaxHp(15)
npc.setPositionIndex(posIndex) npc.setPositionIndex(posIndex)
npc.generateWithRequired(zoneId) npc.generateWithRequired(zoneId)
if hasattr(npc, 'getStartAnimState'): npc.d_setAnimState(npc.getStartAnimState(), 1.0)
npc.d_setAnimState(npc.getStartAnimState(), 1.0)
else:
npc.d_setAnimState('neutral', 1.0)
return npc return npc
@ -148,6 +145,7 @@ def createNpcsInZone(air, zoneId):
for npcId in npcIdList: for npcId in npcIdList:
while npcIdList.count(npcId) > 1: while npcIdList.count(npcId) > 1:
npcIdList.remove(npcId) npcIdList.remove(npcId)
npcIdList.sort()
for i in xrange(len(npcIdList)): for i in xrange(len(npcIdList)):
npcId = npcIdList[i] npcId = npcIdList[i]
npcDesc = NPCToonDict.get(npcId) npcDesc = NPCToonDict.get(npcId)
@ -11927,6 +11925,9 @@ del lnames
zone2NpcDict = {} zone2NpcDict = {}
def generateZone2NpcDict(): def generateZone2NpcDict():
if zone2NpcDict:
return
for id, npcDesc in NPCToonDict.items(): for id, npcDesc in NPCToonDict.items():
zoneId = npcDesc[0] zoneId = npcDesc[0]
if zoneId in zone2NpcDict: if zoneId in zone2NpcDict:
@ -11937,20 +11938,12 @@ def generateZone2NpcDict():
def getNPCName(npcId): def getNPCName(npcId):
npc = NPCToonDict.get(npcId) npc = NPCToonDict.get(npcId)
if npc: return npc[1] if npc else None
return npc[1]
else:
return None
return None
def getNPCZone(npcId): def getNPCZone(npcId):
npc = NPCToonDict.get(npcId) npc = NPCToonDict.get(npcId)
if npc: return npc[0] if npc else None
return npc[0]
else:
return None
return None
def getBuildingArticle(zoneId): def getBuildingArticle(zoneId):

View file

@ -4288,7 +4288,7 @@ HeadingToFactoryTitle = '%s'
ForemanConfrontedMsg = '%s is battling the ' + Foreman + '!' ForemanConfrontedMsg = '%s is battling the ' + Foreman + '!'
MintBossConfrontedMsg = '%s is battling the Supervisor!' MintBossConfrontedMsg = '%s is battling the Supervisor!'
StageBossConfrontedMsg = '%s is battling the District Attorney!' StageBossConfrontedMsg = '%s is battling the District Attorney!'
stageToonEnterElevator = '%s \nhas entered the elevator' StageToonEnterElevator = '%s\nhas entered the elevator!'
ForcedLeaveStageAckMsg = 'The Law Clerk was defeated before you could reach him. You did not recover any Jury Notices.' ForcedLeaveStageAckMsg = 'The Law Clerk was defeated before you could reach him. You did not recover any Jury Notices.'
MinigameWaitingForOtherToons = 'Waiting for other toons to join...' MinigameWaitingForOtherToons = 'Waiting for other toons to join...'
MinigamePleaseWait = 'Please wait...' MinigamePleaseWait = 'Please wait...'
@ -4701,7 +4701,7 @@ LawbotBossName = 'Chief Justice'
BossbotBossName = 'C. E. O.' BossbotBossName = 'C. E. O.'
BossCogNameWithDept = '%(name)s\n%(dept)s' BossCogNameWithDept = '%(name)s\n%(dept)s'
BossCogPromoteDoobers = 'You are hereby promoted to full-fledged %s. Congratulations!' BossCogPromoteDoobers = 'You are hereby promoted to full-fledged %s. Congratulations!'
BossCogDoobersAway = {'s': 'Go! And make that sale!'} BossCogDoobersAway = {'s': 'Go! And make that sale!'}
BossCogWelcomeToons = 'Welcome, new Cogs!' BossCogWelcomeToons = 'Welcome, new Cogs!'
BossCogPromoteToons = 'You are hereby promoted to full-fledged %s. Congratu--' BossCogPromoteToons = 'You are hereby promoted to full-fledged %s. Congratu--'
CagedToonInterruptBoss = 'Hey! Hiya! Hey over there!' CagedToonInterruptBoss = 'Hey! Hiya! Hey over there!'