本文整理汇总了Python中toontown.suit.SuitDNA类的典型用法代码示例。如果您正苦于以下问题:Python SuitDNA类的具体用法?Python SuitDNA怎么用?Python SuitDNA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SuitDNA类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: createStreet
def createStreet(self, streetZone, shopZone, hqZone):
flunky = DistributedTutorialSuitAI.DistributedTutorialSuitAI(self.air)
suitType = SuitDNA.getSuitType('f')
suitTrack = SuitDNA.getSuitDept('f')
flunky.setupSuitDNA(1, suitType, suitTrack)
flunky.generateWithRequired(streetZone)
desc = NPCToons.NPCToonDict.get(20001)
npc = NPCToons.createNPC(self.air, 20001, desc, streetZone)
npc.setTutorial(1)
npc.d_setPos(207.4, 18.81, -0.475)
npc.d_setHpr(90.0, 0, 0)
开发者ID:ToonTownInfiniteRepo,项目名称:ToontownInfinite,代码行数:12,代码来源:TutorialManagerAI.py
示例2: __setupSuitInfo
def __setupSuitInfo(self, suit, bldgTrack, suitLevel, suitType):
suitName, skeleton, v2, waiter = simbase.air.suitInvasionManager.getInvadingCog()
if suitName and self.respectInvasions:
suitType = SuitDNA.getSuitType(suitName)
bldgTrack = SuitDNA.getSuitDept(suitName)
suitLevel = min(max(suitLevel, suitType), suitType + 4)
dna = SuitDNA.SuitDNA()
dna.newSuitRandom(suitType, bldgTrack)
suit.dna = dna
self.notify.debug('Creating suit type ' + suit.dna.name + ' of level ' + str(suitLevel) + ' from type ' + str(suitType) + ' and track ' + str(bldgTrack))
suit.setLevel(suitLevel)
return (skeleton, v2, waiter)
开发者ID:Keithybub,项目名称:ToonTownReviveOld,代码行数:12,代码来源:SuitPlannerInteriorAI.py
示例3: __setupSuitInfo
def __setupSuitInfo(self, suit, bldgTrack, suitLevel, suitType):
suitDeptIndex, suitTypeIndex, flags = simbase.air.suitInvasionManager.getInvadingCog()
if self.respectInvasions:
if suitDeptIndex is not None:
bldgTrack = SuitDNA.suitDepts[suitDeptIndex]
if suitTypeIndex is not None:
suitName = SuitDNA.getSuitName(suitDeptIndex, suitTypeIndex)
suitType = SuitDNA.getSuitType(suitName)
suitLevel = min(max(suitLevel, suitType), suitType + 4)
dna = SuitDNA.SuitDNA()
dna.newSuitRandom(suitType, bldgTrack)
suit.dna = dna
suit.setLevel(suitLevel)
return flags
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:14,代码来源:SuitPlannerCogdoInteriorAI.py
示例4: __setupSuitInfo
def __setupSuitInfo(self, suit, bldgTrack, suitLevel, suitType):
suitDeptIndex, suitTypeIndex, flags = simbase.air.suitInvasionManager.getInvadingCog()
if self.respectInvasions:
if suitDeptIndex is not None:
bldgTrack = SuitDNA.suitDepts[suitDeptIndex]
if suitTypeIndex is not None:
suitName = SuitDNA.getSuitName(suitDeptIndex, suitTypeIndex)
suitType = SuitDNA.getSuitType(suitName)
suitLevel = min(max(suitLevel, suitType), suitType + 4)
dna = SuitDNA.SuitDNA()
dna.newSuitRandom(suitType, bldgTrack)
suit.dna = dna
self.notify.debug('Creating suit type ' + suit.dna.name + ' of level ' + str(suitLevel) + ' from type ' + str(suitType) + ' and track ' + str(bldgTrack))
suit.setLevel(suitLevel)
return flags
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:15,代码来源:SuitPlannerCogdoInteriorAI.py
示例5: getSuitName
def getSuitName(self):
if self.suitDeptIndex is not None:
if self.suitTypeIndex is not None:
return SuitDNA.getSuitName(self.suitDeptIndex, self.suitTypeIndex)
else:
return SuitDNA.suitDepts[self.suitDeptIndex]
else:
return SuitDNA.suitHeadTypes[0]
开发者ID:nate97,项目名称:src,代码行数:8,代码来源:SuitInvasionManagerAI.py
示例6: getCogdoTrack
def getCogdoTrack(suitName):
tracks = getAllowedTracks()
if not tracks:
return None
track = SuitDNA.getSuitDept(suitName)
return track if track in tracks else random.choice(tracks)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:9,代码来源:CogdoUtil.py
示例7: setInvasionStatus
def setInvasionStatus(self, msgType, suitType, remaining, flags):
if msgType not in ToontownGlobals.SuitInvasions:
return
if suitType in SuitDNA.suitHeadTypes:
attributes = SuitBattleGlobals.SuitAttributes[suitType]
suitNames = {'singular': attributes['name'], 'plural': attributes['pluralname']}
elif suitType in SuitDNA.suitDepts:
suitNames = {'singular': SuitDNA.getDeptFullname(suitType), 'plural': SuitDNA.getDeptFullnameP(suitType)}
else:
return
track = Sequence()
base.localAvatar.inventory.setInvasionCreditMultiplier(1 if msgType in ToontownGlobals.EndingInvasions else ToontownBattleGlobals.getInvasionMultiplier())
for i, message in enumerate(ToontownGlobals.SuitInvasions[msgType]):
track.append(Wait(5 if i else 1))
track.append(Func(base.localAvatar.setSystemMessage, 0, (TTLocalizer.SuitInvasionPrefix + message) % suitNames))
track.start()
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:20,代码来源:NewsManager.py
示例8: foodDetach
def foodDetach(self=self, diner=diner):
foodModel = diner.getRightHand().getChild(0)
(foodModel.reparentTo(serviceLoc),)
(foodModel.setPosHpr(0, 0, 0, 0, 0, 0),)
scaleAdj = 1
if SuitDNA.getSuitBodyType(diner.dna.name) == "c":
scaleAdj = 0.59999999999999998
else:
scakeAdj = 0.80000000000000004
oldScale = foodModel.getScale()
newScale = oldScale / scaleAdj
foodModel.setScale(newScale)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:12,代码来源:DistributedBanquetTable.py
示例9: foodDetach
def foodDetach(self = self, diner = diner):
if diner.getRightHand().getNumChildren() < 1:
return
foodModel = diner.getRightHand().getChild(0)
(foodModel.reparentTo(serviceLoc),)
(foodModel.setPosHpr(0, 0, 0, 0, 0, 0),)
scaleAdj = 1
if SuitDNA.getSuitBodyType(diner.dna.name) == 'c':
scaleAdj = 0.6
else:
scakeAdj = 0.8
oldScale = foodModel.getScale()
newScale = oldScale / scaleAdj
foodModel.setScale(newScale)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:14,代码来源:DistributedBanquetTable.py
示例10: foodAttach
def foodAttach(self = self, diner = diner):
foodModel = self.serviceLocs[chairIndex].getChild(0)
(foodModel.reparentTo(diner.getRightHand()),)
(foodModel.setHpr(Point3(0, -94, 0)),)
(foodModel.setPos(Point3(-0.15, -0.7, -0.4)),)
scaleAdj = 1
if SuitDNA.getSuitBodyType(diner.dna.name) == 'c':
scaleAdj = 0.6
(foodModel.setPos(Point3(0.1, -0.25, -0.31)),)
else:
scaleAdj = 0.8
(foodModel.setPos(Point3(-0.25, -0.85, -0.34)),)
oldScale = foodModel.getScale()
newScale = oldScale * scaleAdj
foodModel.setScale(newScale)
开发者ID:Grant11,项目名称:mf0DJnN,代码行数:15,代码来源:DistributedBanquetTable.py
示例11: __genSuitObject
def __genSuitObject(self, suitDict, reserve):
suit = self.cogCtor(simbase.air, self)
dna = SuitDNA.SuitDNA()
dna.newSuitRandom(level=SuitDNA.getRandomSuitType(suitDict["level"]), dept=suitDict["track"])
suit.dna = dna
suit.setLevel(suitDict["level"])
suit.setSkeleRevives(suitDict.get("revives"))
suit.setLevelDoId(self.level.doId)
suit.setCogId(suitDict["cogId"])
suit.setReserve(reserve)
if suitDict["skeleton"]:
suit.setSkelecog(1)
suit.generateWithRequired(suitDict["zoneId"])
suit.boss = suitDict["boss"]
return suit
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:15,代码来源:LevelSuitPlannerAI.py
示例12: __init__
def __init__(self, numFloors, bldgLevel, bldgTrack, zone):
self.dbg_4SuitsPerFloor = config.GetBool('4-suits-per-floor', 0)
self.dbg_1SuitPerFloor = config.GetBool('1-suit-per-floor', 0)
self.zoneId = zone
self.numFloors = numFloors
self.respectInvasions = bldgTrack != "x"
dbg_defaultSuitName = simbase.config.GetString('suit-type', 'random')
if dbg_defaultSuitName == 'random':
self.dbg_defaultSuitType = None
else:
self.dbg_defaultSuitType = SuitDNA.getSuitType(dbg_defaultSuitName)
if isinstance(bldgLevel, types.StringType):
self.notify.warning('bldgLevel is a string!')
bldgLevel = int(bldgLevel)
self._genSuitInfos(numFloors, bldgLevel if bldgTrack != "x" else 19, bldgTrack)
开发者ID:gamerdave54321,项目名称:Toontown-House-Code,代码行数:15,代码来源:SuitPlannerInteriorAI.py
示例13: foodAttach
def foodAttach(self=self, diner=diner):
foodModel = self.serviceLocs[chairIndex].getChild(0)
(foodModel.reparentTo(diner.getRightHand()),)
(foodModel.setHpr(Point3(0, -94, 0)),)
(foodModel.setPos(Point3(-0.14999999999999999, -0.69999999999999996, -0.40000000000000002)),)
scaleAdj = 1
if SuitDNA.getSuitBodyType(diner.dna.name) == "c":
scaleAdj = 0.59999999999999998
(foodModel.setPos(Point3(0.10000000000000001, -0.25, -0.31)),)
else:
scaleAdj = 0.80000000000000004
(foodModel.setPos(Point3(-0.25, -0.84999999999999998, -0.34000000000000002)),)
oldScale = foodModel.getScale()
newScale = oldScale * scaleAdj
foodModel.setScale(newScale)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:15,代码来源:DistributedBanquetTable.py
示例14: createDiner
def createDiner(self, i):
diner = Suit.Suit()
diner.dna = SuitDNA.SuitDNA()
level = self.dinerInfo[i][2]
level -= 4
diner.dna.newSuitRandom(level=level, dept='c')
diner.setDNA(diner.dna)
if self.useNewAnimations:
diner.loop('sit', fromFrame=i)
else:
diner.pose('landing', 0)
locator = self.tableGroup.find('**/chair_%d' % (i + 1))
locatorScale = locator.getNetTransform().getScale()[0]
correctHeadingNp = locator.attachNewNode('correctHeading')
self.chairLocators[i] = correctHeadingNp
heading = self.rotationsPerSeatIndex[i]
correctHeadingNp.setH(heading)
sitLocator = correctHeadingNp.attachNewNode('sitLocator')
base.sitLocator = sitLocator
pos = correctHeadingNp.getPos(render)
if SuitDNA.getSuitBodyType(diner.dna.name) == 'c':
sitLocator.setPos(0.5, 3.65, -3.75)
else:
sitLocator.setZ(-2.4)
sitLocator.setY(2.5)
sitLocator.setX(0.5)
self.sitLocators[i] = sitLocator
diner.setScale(1.0 / locatorScale)
diner.reparentTo(sitLocator)
newLoc = NodePath('serviceLoc-%d-%d' % (self.index, i))
newLoc.reparentTo(correctHeadingNp)
newLoc.setPos(0, 3.0, 1)
self.serviceLocs[i] = newLoc
base.serviceLoc = newLoc
head = diner.find('**/joint_head')
newIndicator = DinerStatusIndicator.DinerStatusIndicator(parent=head, pos=Point3(0, 0, 3.5), scale=5.0)
newIndicator.wrtReparentTo(diner)
self.dinerStatusIndicators[i] = newIndicator
# remove nametag (rip lag)
diner.nametag3d.stash()
diner.nametag.destroy()
return diner
开发者ID:Grant11,项目名称:mf0DJnN,代码行数:44,代码来源:DistributedBanquetTable.py
示例15: setupSuitBuilding
def setupSuitBuilding(self, nodePath):
if nodePath.isEmpty():
return
dnaStore = self.cr.playGame.dnaStore
level = int(self.difficulty / 2) + 1
suitNP = dnaStore.findNode("suit_landmark_" + chr(self.track) + str(level))
zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
if not buildingTitle:
buildingTitle = TTLocalizer.CogsInc
else:
buildingTitle += TTLocalizer.CogsIncExt
buildingTitle += "\n%s" % SuitDNA.getDeptFullname(chr(self.track))
textNode = TextNode("sign")
textNode.setTextColor(1.0, 1.0, 1.0, 1.0)
textNode.setFont(ToontownGlobals.getSuitFont())
textNode.setAlign(TextNode.ACenter)
textNode.setWordwrap(17.0)
textNode.setText(buildingTitle)
textHeight = textNode.getHeight()
zScale = (textHeight + 2) / 3.0
signOrigin = suitBuildingNP.find("**/sign_origin;+s")
backgroundNP = loader.loadModel("phase_5/models/modules/suit_sign")
backgroundNP.reparentTo(signOrigin)
backgroundNP.setPosHprScale(0.0, 0.0, textHeight * 0.8 / zScale, 0.0, 0.0, 0.0, 8.0, 8.0, 8.0 * zScale)
backgroundNP.node().setEffect(DecalEffect.make())
signTextNodePath = backgroundNP.attachNewNode(textNode.generate())
signTextNodePath.setPosHprScale(
0.0, 0.0, -0.21 + textHeight * 0.1 / zScale, 0.0, 0.0, 0.0, 0.1, 0.1, 0.1 / zScale
)
signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0)
frontNP = suitBuildingNP.find("**/*_front/+GeomNode;+s")
backgroundNP.wrtReparentTo(frontNP)
frontNP.node().setEffect(DecalEffect.make())
suitBuildingNP.setName("sb" + str(self.block) + ":_landmark__DNARoot")
suitBuildingNP.setPosHprScale(nodePath, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)
suitBuildingNP.flattenMedium()
self.loadElevator(suitBuildingNP)
return suitBuildingNP
开发者ID:ponyboy837,项目名称:TTI-Leak--From-2015-,代码行数:42,代码来源:DistributedBuilding.py
示例16: setupSuitBuilding
def setupSuitBuilding(self, nodePath):
dnaStore = self.cr.playGame.dnaStore
level = 1
if chr(self.track) != "x": suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) + str(level))
else: suitNP = loader.loadModel('phase_5/models/modules/suit_landmark_money2')
zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
if not buildingTitle:
buildingTitle = TTLocalizer.CogsInc
else:
buildingTitle += TTLocalizer.CogsIncExt
buildingTitle += '\n%s' % (SuitDNA.getDeptFullname(chr(self.track)) if chr(self.track) != "x" else "Loblao's Troll")
textNode = TextNode('sign')
textNode.setTextColor(1.0, 1.0, 1.0, 1.0)
textNode.setFont(ToontownGlobals.getSuitFont())
textNode.setAlign(TextNode.ACenter)
textNode.setWordwrap(17.0)
textNode.setText(buildingTitle.decode(sys.getdefaultencoding()))
textHeight = textNode.getHeight()
zScale = (textHeight + 2) / 3.0
signOrigin = suitBuildingNP.find('**/sign_origin;+s')
if signOrigin.isEmpty(): signOrigin = hidden.attachNewNode("garbage")
backgroundNP = loader.loadModel('phase_5/models/modules/suit_sign')
backgroundNP.reparentTo(signOrigin)
backgroundNP.setPosHprScale(0.0, 0.0, textHeight * 0.8 / zScale, 0.0, 0.0, 0.0, 8.0, 8.0, 8.0 * zScale)
backgroundNP.node().setEffect(DecalEffect.make())
signTextNodePath = backgroundNP.attachNewNode(textNode.generate())
signTextNodePath.setPosHprScale(0.0, 0.0, -0.21 + textHeight * 0.1 / zScale, 0.0, 0.0, 0.0, 0.1, 0.1, 0.1 / zScale)
signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0)
frontNP = suitBuildingNP.find('**/*_front/+GeomNode;+s')
if frontNP.isEmpty(): frontNP = hidden.attachNewNode("garbage")
backgroundNP.wrtReparentTo(frontNP)
frontNP.node().setEffect(DecalEffect.make())
suitBuildingNP.setName('sb' + str(self.block) + ':_landmark__DNARoot')
suitBuildingNP.setPosHprScale(nodePath, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)
suitBuildingNP.flattenMedium()
self.loadElevator(suitBuildingNP)
return suitBuildingNP
开发者ID:Teku16,项目名称:MikeyTheRepository,代码行数:41,代码来源:DistributedBuilding.py
示例17: setupSuitBuilding
def setupSuitBuilding(self, nodePath):
if nodePath.isEmpty():
return
dnaStore = self.cr.playGame.dnaStore
level = int(self.difficulty / 2) + 1
if level > 5:
self.notify.warning('Level is bigger than 5: %s' % level)
suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) + str(min(level, 5)))
zoneId = dnaStore.getZoneFromBlockNumber(self.block)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
if not buildingTitle:
buildingTitle = TTLocalizer.CogsInc
else:
buildingTitle += TTLocalizer.CogsIncExt
buildingTitle += '\n%s' % SuitDNA.getDeptFullname(chr(self.track))
textNode = TextNode('sign')
textNode.setTextColor(1.0, 1.0, 1.0, 1.0)
textNode.setFont(ToontownGlobals.getSuitFont())
textNode.setAlign(TextNode.ACenter)
textNode.setWordwrap(17.0)
textNode.setText(buildingTitle)
textHeight = textNode.getHeight()
zScale = (textHeight + 2) / 3.0
signOrigin = suitBuildingNP.find('**/sign_origin;+s')
backgroundNP = loader.loadModel('phase_5/models/modules/suit_sign')
backgroundNP.reparentTo(signOrigin)
backgroundNP.setPosHprScale(0.0, 0.0, textHeight * 0.8 / zScale, 0.0, 0.0, 0.0, 8.0, 8.0, 8.0 * zScale)
signTextNodePath = backgroundNP.attachNewNode(textNode.generate())
signTextNodePath.setPosHprScale(0.0, 0.0, -0.21 + textHeight * 0.1 / zScale, 0.0, 0.0, 0.0, 0.1, 0.1, 0.1 / zScale)
signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0)
frontNP = suitBuildingNP.find('**/*_front/+GeomNode;+s')
backgroundNP.wrtReparentTo(frontNP)
frontNP.node().setEffect(DecalEffect.make())
signTextNodePath.setAttrib(DepthOffsetAttrib.make(1))
suitBuildingNP.setName('sb' + str(self.block) + ':_landmark__DNARoot')
suitBuildingNP.setPosHprScale(nodePath, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)
suitBuildingNP.flattenMedium()
self.loadElevator(suitBuildingNP)
return suitBuildingNP
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:41,代码来源:DistributedBuilding.py
示例18: sendInvasionStatus
def sendInvasionStatus(self):
if self.invading:
if self.suitDeptIndex is not None:
if self.suitTypeIndex is not None:
type = SuitBattleGlobals.SuitAttributes[self.getSuitName()]['name']
else:
type = SuitDNA.getDeptFullname(self.getSuitName())
else:
type = None
status = {
'invasion': {
'type': type,
'flags': self.flags,
'remaining': self.remaining,
'total': self.total,
'start': self.start
}
}
else:
status = {'invasion': None}
self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status])
开发者ID:nate97,项目名称:src,代码行数:21,代码来源:SuitInvasionManagerAI.py
示例19: createDiner
def createDiner(self, i):
diner = Suit.Suit()
diner.dna = SuitDNA.SuitDNA()
level = self.dinerInfo[i][2]
level -= 4
diner.dna.newSuitRandom(level=level, dept="c")
diner.setDNA(diner.dna)
if self.useNewAnimations:
diner.loop("sit", fromFrame=i)
else:
diner.pose("landing", 0)
locator = self.tableGroup.find("**/chair_%d" % (i + 1))
locatorScale = locator.getNetTransform().getScale()[0]
correctHeadingNp = locator.attachNewNode("correctHeading")
self.chairLocators[i] = correctHeadingNp
heading = self.rotationsPerSeatIndex[i]
correctHeadingNp.setH(heading)
sitLocator = correctHeadingNp.attachNewNode("sitLocator")
base.sitLocator = sitLocator
pos = correctHeadingNp.getPos(render)
if SuitDNA.getSuitBodyType(diner.dna.name) == "c":
sitLocator.setPos(0.5, 3.6499999999999999, -3.75)
else:
sitLocator.setZ(-2.3999999999999999)
sitLocator.setY(2.5)
sitLocator.setX(0.5)
self.sitLocators[i] = sitLocator
diner.setScale(1.0 / locatorScale)
diner.reparentTo(sitLocator)
newLoc = NodePath("serviceLoc-%d-%d" % (self.index, i))
newLoc.reparentTo(correctHeadingNp)
newLoc.setPos(0, 3.0, 1)
self.serviceLocs[i] = newLoc
base.serviceLoc = newLoc
head = diner.find("**/joint_head")
newIndicator = DinerStatusIndicator.DinerStatusIndicator(parent=head, pos=Point3(0, 0, 3.5), scale=5.0)
newIndicator.wrtReparentTo(diner)
self.dinerStatusIndicators[i] = newIndicator
return diner
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:39,代码来源:DistributedBanquetTable.py
示例20: setInvasionStatus
def setInvasionStatus(self, msgType, cogType, numRemaining, skeleton):
self.notify.info('setInvasionStatus: msgType: %s cogType: %s, numRemaining: %s, skeleton: %s' % (msgType,
cogType,
numRemaining,
skeleton))
if msgType < ToontownGlobals.DepartmentInvasionBegin:
cogName = SuitBattleGlobals.SuitAttributes[cogType]['name']
cogNameP = SuitBattleGlobals.SuitAttributes[cogType]['pluralname']
messages = 2
if skeleton:
cogName = TTLocalizer.Skeleton
cogNameP = TTLocalizer.SkeletonP
if msgType == ToontownGlobals.SuitInvasionBegin:
msg1 = TTLocalizer.SuitInvasionBegin1
msg2 = TTLocalizer.SuitInvasionBegin2 % cogNameP
self.invading = 1
elif msgType == ToontownGlobals.SuitInvasionUpdate:
msg1 = TTLocalizer.SuitInvasionUpdate1 % numRemaining
msg2 = TTLocalizer.SuitInvasionUpdate2 % cogNameP
self.invading = 1
elif msgType == ToontownGlobals.SuitInvasionEnd:
msg1 = TTLocalizer.SuitInvasionEnd1 % cogName
msg2 = TTLocalizer.SuitInvasionEnd2
self.invading = 0
elif msgType == ToontownGlobals.SuitInvasionBulletin:
msg1 = TTLocalizer.SuitInvasionBulletin1
msg2 = TTLocalizer.SuitInvasionBulletin2 % cogNameP
self.invading = 1
elif msgType == ToontownGlobals.SkelecogInvasionBegin:
msg1 = TTLocalizer.SkelecogInvasionBegin1
msg2 = TTLocalizer.SkelecogInvasionBegin2
msg3 = TTLocalizer.SkelecogInvasionBegin3
messages = 3
elif msgType == ToontownGlobals.SkelecogInvasionEnd:
msg1 = TTLocalizer.SkelecogInvasionEnd1
msg2 = TTLocalizer.SkelecogInvasionEnd2
elif msgType == ToontownGlobals.V2InvasionBegin:
msg1 = TTLocalizer.V2InvasionBegin1
msg2 = TTLocalizer.V2InvasionBegin2
msg3 = TTLocalizer.V2InvasionBegin3
messages = 3
elif msgType == ToontownGlobals.V2InvasionEnd:
msg1 = TTLocalizer.V2InvasionEnd1
msg2 = TTLocalizer.V2InvasionEnd2
elif msgType == ToontownGlobals.DepartmentInvasionBegin:
deptNameP = SuitDNA.getDeptFullnameP(cogType)
msg1 = TTLocalizer.SuitInvasionBegin1
msg2 = TTLocalizer.DepartmentInvasionBegin1 % deptNameP
elif msgType == ToontownGlobals.DepartmentInvasionEnd:
deptName = SuitDNA.getDeptFullname(cogType)
msg1 = TTLocalizer.DepartmentInvasionEnd1 % deptName
msg2 = TTLocalizer.SuitInvasionEnd2
else:
self.notify.warning('setInvasionStatus: invalid msgType: %s' % msgType)
return
if self.invading:
mult = ToontownBattleGlobals.getInvasionMultiplier()
else:
mult = 1
base.localAvatar.inventory.setInvasionCreditMultiplier(mult)
if messages == 2:
Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1),
Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2),
name='newsManagerWait', autoPause=1).start()
elif messages == 3:
Sequence(Wait(1.0), Func(base.localAvatar.setSystemMessage, 0, msg1),
Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg2),
Wait(5.0), Func(base.localAvatar.setSystemMessage, 0, msg3),
name='newsManagerWait', autoPause=1).start()
开发者ID:Keithybub,项目名称:ToonTownReviveOld,代码行数:69,代码来源:NewsManager.py
注:本文中的toontown.suit.SuitDNA类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论