def generate(self): DistributedInteractive.generate(self) NodePath.__init__(self, 'RepairBench') self.setInteractOptions(proximityText=PLocalizer.InteractRepairBench, sphereScale=self.interactRadius, diskRadius=self.diskRadius) self.requestDifficulty()
def disable(self): DistributedInteractive.disable(self) if self.invReq: DistributedInventoryBase.cancelGetInventory(localAvatar.getInventoryId()) self.invReq = None self.removeChildren()
def enterWaiting(self): DistributedInteractive.enterWaiting(self) self.avGameState = localAvatar.getGameState() if self.avGameState == 'Battle': self.avGameState = 'LandRoam' localAvatar.b_setGameState('DinghyInteract', [self])
def exitUse(self): DistributedInteractive.exitUse(self) if self.avGameState: if localAvatar.getGameState() == 'DinghyInteract': localAvatar.b_setGameState(self.avGameState) if self.avGameState in [ 'WaterRoam', 'BattleWaterRoam']: localAvatar.motionFSM.setWaterState(True, True) base.cr.interactionMgr.start() self.avGameState = None if self.camIval: self.camIval.pause() self.camIval = None if self.camTask: taskMgr.remove(self.camTask) self.camTask = None if self.shipSelection: self.shipSelection.destroy() self.shipSelection = None
def exitUse(self): DistributedInteractive.exitUse(self) if self.avGameState: if localAvatar.getGameState() == 'DinghyInteract': localAvatar.b_setGameState(self.avGameState) if self.avGameState in [ 'WaterRoam', 'BattleWaterRoam']: localAvatar.motionFSM.setWaterState(True, True) base.cr.interactionMgr.start() self.avGameState = None if self.camIval: self.camIval.pause() self.camIval = None if self.camTask: taskMgr.remove(self.camTask) self.camTask = None if self.shipSelection: self.shipSelection.destroy() self.shipSelection = None
def __init__(self, cr, proximityText): NodePath.__init__(self, self.__class__.__name__) DistributedInteractive.__init__(self, cr) self.holiday = '' self.interactRadius = 10 self.interactMode = 0 self.proximityText = proximityText
def requestInteraction(self, avId, interactType=0): if localAvatar.isUndead(): localAvatar.guiMgr.createWarning( PLocalizer.NoPotionsWhileUndeadWarning, PiratesGuiGlobals.TextFG6) else: DistributedInteractive.requestInteraction(self, avId, interactType)
def __init__(self, cr): DistributedInteractive.__init__(self, cr) self.interactRadius = 15 self.diskRadius = 25 self.difficulty = 0 self.repairBenchDifficultyTextNode = None self.repairBenchDifficultyNodePath = None
def disable(self): DistributedInteractive.disable(self) if self.invReq: DistributedInventoryBase.cancelGetInventory(localAvatar.getInventoryId()) self.invReq = None self.removeChildren()
def generate(self): DistributedInteractive.generate(self) NodePath.__init__(self, 'RepairBench') self.setInteractOptions( proximityText=PLocalizer.CraftPotionInstructions, sphereScale=self.interactRadius, diskRadius=self.diskRadius)
def generate(self): DistributedInteractive.generate(self) self.setInteractOptions( proximityText=PLocalizer.InteractBuriedTreasure, sphereScale=10, diskRadius=10, exclusive=0)
def __init__(self, cr, proximityText): NodePath.__init__(self, self.__class__.__name__) DistributedInteractive.__init__(self, cr) self.holiday = "" self.interactRadius = 10 self.interactMode = 0 self.proximityText = proximityText
def kickInteraction(self): if self.userId == localAvatar.doId: localAvatar.guiMgr.createWarning( PLocalizer.Minigame_Repair_KickedFromRepairSpotWarning) localAvatar.motionFSM.on() DistributedInteractive.rejectInteraction(self)
def disable(self): DistributedInteractive.disable(self) self.getParentObj().builder.removeSectionObj(self.container, self.visZone) if self.container: self.container.removeNode() self.container = None
def enterWaiting(self): DistributedInteractive.enterWaiting(self) self.avGameState = localAvatar.getGameState() if self.avGameState == 'Battle': self.avGameState = 'LandRoam' localAvatar.b_setGameState('DinghyInteract', [ self])
def exitUse(self): if self.gameInterest: self.cr.removeInterest(self.gameInterest) self.gameInterest = None localAvatar.guiMgr.setIgnoreEscapeHotKey(False) localAvatar.b_setGameState('LandRoam') DistributedInteractive.exitUse(self)
def loadTargetIndicator(self): DistributedInteractive.loadTargetIndicator(self) if self.locationId == 0: self.disk.setZ(render, 0.01) self.disk.setP(render, 0) self.disk.setR(render, 0) self.disk.clearBin() self.disk.clearDepthTest()
def disable(self): DistributedInteractive.disable(self) if self.invReq: DistributedInventoryBase.cancelGetInventory( localAvatar.getInventoryId()) self.invReq = None self.get_children().detach() return
def disable(self): self._statePushes.destroy() self._statePushes = None if self.userId == localAvatar.doId: self.stopRepairing() DistributedInteractive.disable(self) self.detachNode()
def disable(self): self._statePushes.destroy() self._statePushes = None if self.userId == localAvatar.doId: self.stopRepairing() DistributedInteractive.disable(self) self.detachNode()
def loadTargetIndicator(self): DistributedInteractive.loadTargetIndicator(self) if self.locationId == 0: self.disk.setZ(render, 0.01) self.disk.setP(render, 0) self.disk.setR(render, 0) self.disk.clearBin() self.disk.clearDepthTest()
def requestExit(self): base.localAvatar.guiMgr.setIgnoreEscapeHotKey(True) now = time.time() if now - self.lastExitRequest > self._MIN_EXIT_DELAY: self.sendUpdate('checkExit') self.lastExitRequest = now DistributedInteractive.requestExit(self)
def enterUse(self): DistributedInteractive.enterUse(self) if self.shipSelection: self.shipSelection.destroy() self.shipSelection = ShipDeployPanel(PLocalizer.ChooseShipTitle, self.requestExit, siegeTeam=self._siegeTeam) self.shipSelection.hide() self.selectionSent = False self.startCamIval() self.offerOwnOptions(localAvatar.getInventory().getShipDoIdList())
def announceGenerate(self): self.setInteractOptions( proximityText=PLocalizer.InteractSearchableContainer, sphereScale=self.getSphereScale(), diskRadius=10, exclusive=0) DistributedInteractive.announceGenerate(self) self.loadContainer() self.getParentObj().builder.addSectionObj(self.container, self.visZone)
def delete(self): if self.camIval: self.camIval.pause() self.camIval = None if self.camTask: taskMgr.remove(self.camTask) self.camTask = None DistributedInteractive.delete(self) return
def announceGenerate(self): DistributedInteractive.announceGenerate(self) self.setAllowInteract(1) self.effect = PotionTableSmoke.getEffect() if self.effect: self.effect.setPos(1.3, 0.1, 3.5) self.effect.setEffectScale(0.25) self.effect.setEffectColor(Vec4(0.6, 0.4, 1.0, 1.0)) self.effect.reparentTo(self) self.effect.play()
def enterUse(self): DistributedInteractive.enterUse(self) if self.shipSelection: self.shipSelection.destroy() self.shipSelection = ShipDeployPanel(PLocalizer.ChooseShipTitle, self.requestExit, siegeTeam = self._siegeTeam) self.shipSelection.hide() self.selectionSent = False self.startCamIval() self.offerOwnOptions(localAvatar.getInventory().getShipDoIdList())
def requestInteraction(self, avId, interactType=0, instant=0): if not base.launcher.getPhaseComplete(5): self.showDownloadAcknowledge() return self.cleanupDinghyDisabledDialog() if localAvatar.zombie and avId == localAvatar.doId: localAvatar.guiMgr.createWarning(PLocalizer.ZombieNoBoats, PiratesGuiGlobals.TextFG6) return DistributedInteractive.requestInteraction(self, avId, interactType, instant) return
def delete(self): if self.camIval: self.camIval.pause() self.camIval = None if self.camTask: taskMgr.remove(self.camTask) self.camTask = None DistributedInteractive.delete(self)
def requestInteraction(self, avId, interactType = 0, instant = 0): if not base.launcher.getPhaseComplete(5): self.showDownloadAcknowledge() return None self.cleanupDinghyDisabledDialog() if localAvatar.zombie and avId == localAvatar.doId: localAvatar.guiMgr.createWarning(PLocalizer.ZombieNoBoats, PiratesGuiGlobals.TextFG6) return None DistributedInteractive.requestInteraction(self, avId, interactType, instant)
def __init__(self, cr): NodePath.__init__(self, 'DistributedSearchableContainer') DistributedInteractive.__init__(self, cr) self.searchTime = None self.type = None self.containerColorR = 1.0 self.containerColorG = 1.0 self.containerColorB = 1.0 self.containerColorA = 1.0 self.sphereScale = 10 self.container = None self.startSearchTime = 0.0
def __init__(self, cr): NodePath.__init__(self, 'DistributedSearchableContainer') DistributedInteractive.__init__(self, cr) self.searchTime = None self.type = None self.containerColorR = 1.0 self.containerColorG = 1.0 self.containerColorB = 1.0 self.containerColorA = 1.0 self.sphereScale = 10 self.container = None self.startSearchTime = 0.0
def __init__(self, cr): NodePath.__init__(self, 'DistributedBuriedTreasure') DistributedInteractive.__init__(self, cr) self.showTreasureIval = None self.raiseTreasureIval = None self.currentDepth = 0.0 self.startingDepth = 0.0 self.visZone = '' self.orientation = 0.0 self.chest = None self.spotRoot = None self.spot = None
def __init__(self, cr): NodePath.__init__(self, 'DistributedBuriedTreasure') DistributedInteractive.__init__(self, cr) self.showTreasureIval = None self.raiseTreasureIval = None self.currentDepth = 0.0 self.startingDepth = 0.0 self.visZone = '' self.orientation = 0.0 self.chest = None self.spotRoot = None self.spot = None
def exitWaiting(self): DistributedInteractive.exitWaiting(self) if (self.newState != 'Use' and self).avGameState: if localAvatar.getGameState() == 'DinghyInteract': localAvatar.b_setGameState(self.avGameState) if self.avGameState in ['WaterRoam', 'BattleWaterRoam']: localAvatar.motionFSM.setWaterState(True, True) base.cr.interactionMgr.start() self.avGameState = None if self.invReq: DistributedInventoryBase.cancelGetInventory(localAvatar.getInventoryId()) self.invReq = None return
def defaultFilter(self, request, args): if request == 'Use': if self.getCurrentOrNextState() != 'Waiting': return None return DistributedInteractive.defaultFilter(self, request, args)
def defaultFilter(self, request, args): if request == 'Use': if self.getCurrentOrNextState() != 'Waiting': return None return DistributedInteractive.defaultFilter(self, request, args)
def __init__(self, cr): NodePath.__init__(self, 'DistributedDinghy') DistributedInteractive.__init__(self, cr) self.interactRadius = 25 self.diskRadius = 45 self.dinghyDisabledDialog = None self.teamFullDialog = None self.locationId = 0 self.shipSelection = None self.camIval = None self.camTask = None self.avGameState = None self.invReq = None self.selectionSent = False self.ownShipSelection = None self.accept('clientLogout', self.cleanupTeamFullDialog) self.accept('shardSwitchComplete', self.cleanupTeamFullDialog)
def __init__(self, cr): NodePath.__init__(self, 'DistributedDinghy') DistributedInteractive.__init__(self, cr) self.interactRadius = 25 self.diskRadius = 45 self.dinghyDisabledDialog = None self.teamFullDialog = None self.locationId = 0 self.shipSelection = None self.camIval = None self.camTask = None self.avGameState = None self.invReq = None self.selectionSent = False self.ownShipSelection = None self.accept('clientLogout', self.cleanupTeamFullDialog) self.accept('shardSwitchComplete', self.cleanupTeamFullDialog)
def exitWaiting(self): DistributedInteractive.exitWaiting(self) if self.newState != 'Use' and self.avGameState: if localAvatar.getGameState() == 'DinghyInteract': localAvatar.b_setGameState(self.avGameState) if self.avGameState in [ 'WaterRoam', 'BattleWaterRoam']: localAvatar.motionFSM.setWaterState(True, True) base.cr.interactionMgr.start() self.avGameState = None if self.invReq: DistributedInventoryBase.cancelGetInventory(localAvatar.getInventoryId()) self.invReq = None
def announceGenerate(self): if not self.spot: self.spot = loader.loadModel('models/effects/pir_m_efx_msc_digSpot') self.spot.hide(OTPRender.MainCameraBitmask) self.spot.showThrough(OTPRender.EnviroCameraBitmask) self.spot.setTransparency(TransparencyAttrib.MAlpha) self.spot.setColorScale(0.80000000000000004, 0.90000000000000002, 0.80000000000000004, 0.34999999999999998) self.spot.setBin('shadow', -10) self.spot.setDepthTest(0) self.spot.setScale(50) self.spotRoot = self.attachNewNode('geomRoot') lod = LODNode('treeLOD') lodNP = self.spotRoot.attachNewNode(lod) self.spot.reparentTo(lodNP) lod.addSwitch(100, 0) DistributedInteractive.announceGenerate(self) self.getParentObj().builder.addSectionObj(self, self.visZone)
def announceGenerate(self): if not self.spot: self.spot = loader.loadModel( 'models/effects/pir_m_efx_msc_digSpot') self.spot.hide(OTPRender.MainCameraBitmask) self.spot.showThrough(OTPRender.EnviroCameraBitmask) self.spot.setTransparency(TransparencyAttrib.MAlpha) self.spot.setColorScale(0.8, 0.9, 0.8, 0.35) self.spot.setBin('shadow', -10) self.spot.setDepthTest(0) self.spot.setScale(50) self.spotRoot = self.attachNewNode('geomRoot') lod = LODNode('treeLOD') lodNP = self.spotRoot.attachNewNode(lod) self.spot.reparentTo(lodNP) lod.addSwitch(100, 0) DistributedInteractive.announceGenerate(self) self.getParentObj().builder.addSectionObj(self, self.visZone)
def announceGenerate(self): DistributedInteractive.announceGenerate(self) ship = self.cr.doId2do[self._shipId] NodePath.__init__(self, 'ship-%s-repairSpot-%s' % (ship.doId, self._index)) ship.repairSpots[self.doId] = self root = ModelNode('ship-%s-repairSpot-%s' % (ship.doId, self._index)) root.setPreserveTransform(1) self.assign(NodePath(root)) locName = PVPGlobals.RepairSpotLocatorNames[self._index] locator = ship.findLocator('**/%s;+s' % locName) self.setPos(locator.getPos(ship.getModelRoot())) self.setHpr(locator.getHpr(ship.getModelRoot())) self.setScale(locator.getScale(ship.getModelRoot())) self.reparentTo(ship.getModelRoot()) self.setInteractOptions(proximityText = PLocalizer.InteractRepairSpot, diskRadius = 10.0, sphereScale = 6.0) self.setAllowInteract(1) self.checkInUse() self._statePushes = DestructiveScratchPad(evalUsable = FunctionCall(self._evalUsableState, ship._repairSpotMgr._state.fullHealth, ship.getWheelInUseSV()).pushCurrentState())
def announceGenerate(self): DistributedInteractive.announceGenerate(self) ship = self.cr.doId2do[self._shipId] NodePath.__init__(self, 'ship-%s-repairSpot-%s' % (ship.doId, self._index)) ship.repairSpots[self.doId] = self root = ModelNode('ship-%s-repairSpot-%s' % (ship.doId, self._index)) root.setPreserveTransform(1) self.assign(NodePath(root)) locName = PVPGlobals.RepairSpotLocatorNames[self._index] locator = ship.findLocator('**/%s;+s' % locName) self.setPos(locator.getPos(ship.getModelRoot())) self.setHpr(locator.getHpr(ship.getModelRoot())) self.setScale(locator.getScale(ship.getModelRoot())) self.reparentTo(ship.getModelRoot()) self.setInteractOptions(proximityText = PLocalizer.InteractRepairSpot, diskRadius = 10.0, sphereScale = 6.0) self.setAllowInteract(1) self.checkInUse() self._statePushes = DestructiveScratchPad(evalUsable = FunctionCall(self._evalUsableState, ship._repairSpotMgr._state.fullHealth, ship.getWheelInUseSV()).pushCurrentState())
def disable(self): DistributedInteractive.disable(self) if self.chest: self.chest.removeNode() self.chest = None if self.showTreasureIval: self.showTreasureIval.pause() self.showTreasureIval = None if self.raiseTreasureIval: self.raiseTreasureIval.pause() self.raiseTreasureIval = None if self.spot: self.spot.removeNode() self.spot = None if self.spotRoot: self.spotRoot.removeNode() self.spotRoot = None self.getParentObj().builder.removeSectionObj(self, self.visZone) return
def disable(self): DistributedInteractive.disable(self) if self.chest: self.chest.removeNode() self.chest = None if self.showTreasureIval: self.showTreasureIval.pause() self.showTreasureIval = None if self.raiseTreasureIval: self.raiseTreasureIval.pause() self.raiseTreasureIval = None if self.spot: self.spot.removeNode() self.spot = None if self.spotRoot: self.spotRoot.removeNode() self.spotRoot = None self.getParentObj().builder.removeSectionObj(self, self.visZone)
def requestInteraction(self, avId, interactType=0): localAvatar.motionFSM.off() DistributedInteractive.requestInteraction(self, avId, interactType)
def exitWaiting(self): DistributedInteractive.exitWaiting(self) self.ignore('shipSinking-' + str(self._shipId))
def enterUse(self): DistributedInteractive.enterUse(self) self.accept('shipSinking-' + str(self._shipId), self.shipSinking) self.startRepairing()
def exitUse(self): self.stopRepairing() DistributedInteractive.exitUse(self) self.ignore('shipSinking-' + str(self._shipId))
def setUserId(self, avId): oldId = self.userId DistributedInteractive.setUserId(self, avId) if oldId != avId: self.checkInUse()
def __init__(self, cr): DistributedInteractive.__init__(self, cr)
def setAllowInteract(self, allow, forceOff = False): DistributedInteractive.setAllowInteract(self, allow) if not allow and forceOff and localAvatar.getDoId() == self.userId: self.requestExit()
def generate(self): DistributedInteractive.generate(self) self.setInteractOptions(proximityText = PLocalizer.DeployShipInstructions, sphereScale = self.interactRadius, diskRadius = self.diskRadius)
def requestInteraction(self, avId, interactType = 0): DistributedInteractive.requestInteraction(self, avId, interactType)
def rejectInteraction(self): if self.userId != localAvatar.doId: localAvatar.motionFSM.on() DistributedInteractive.rejectInteraction(self)
def kickInteraction(self): if self.userId == localAvatar.doId: localAvatar.guiMgr.createWarning(PLocalizer.Minigame_Repair_KickedFromRepairSpotWarning) localAvatar.motionFSM.on() DistributedInteractive.rejectInteraction(self)
def requestExit(self): DistributedInteractive.requestExit(self) self.stopRepairing()
def enterWaiting(self): DistributedInteractive.enterWaiting(self) localAvatar.motionFSM.off() self.accept('shipSinking-' + str(self._shipId), self.shipSinking)