def _addedToMap(self, map): self.mapGeom.setScale(aspect2d, 0.3) overlayNode = map.getOverlayNode() worldNode = map.getWorldNode() transform = self.mapGeom.getTransform(overlayNode) self.hpMeter = HpMeter(width=0.4, parent=overlayNode) self.hpMeter.setP(-90) if self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.hpMeter.setPos(transform.getPos() + (50, 0, 0)) else: self.hpMeter.setPos(InvasionGlobals.getMainCapturePointHpPos(self.holidayId)) self.hpMeter.setScale(transform.getScale()) self.hpMeter['sortOrder'] = MinimapCapturePoint.SORT self.hpMeter.setAlphaScale(1, 1) self.hpMeter.categoryLabel['text_scale'] = 0.1 self.hpMeter.update(1, 1) topGui = loader.loadModel('models/gui/toplevel_gui') if self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.barricadeIcon = OnscreenImage(parent=self.mapGeom, image=topGui.find('**/pir_t_gui_gen_barricade'), scale=1.5, hpr=(0, 90, 0), color=(1.0, 0.5, 0.0, 1)) self.barricadeDestroyed = OnscreenImage(parent=overlayNode, image=topGui.find('**/pir_t_gui_gen_Xred'), scale=transform.getScale() * 4.0, pos=transform.getPos(), hpr=(0, -90, 0)) self.barricadeDestroyed.hide() topGui.removeNode() self.mouseOver = GuiButton(parent=self.hpMeter, relief=None, state=DGG.NORMAL, scale=3.0, image=None, frameSize=(-0.1, 0.15, -0.03, 0.03), helpText=PLocalizer.CapturePointNames[self.holidayId][self.zone], helpPos=(0.1, 0, -0.08), helpDelay=0, helpOpaque=True, sortOrder=MinimapShop.SORT) return
def setHp(self, hp, maxHp): if self.hpMeter: if hp != self.hpMeter.meter['value']: pass hpMismatch = hp != maxHp self.hp = hp self.maxHp = hp self.hpMeter.update(hp, maxHp) if hpMismatch: if self.blinker: self.blinker.finish() self.blinker.start() if hp <= 0 and maxHp >= 0 and not (self.sentRemove): self.sentRemove = True if self.hpMeter: self.hpMeter.destroy() self.hpMeter = None if self.blinker: self.blinker.pause() self.blinker = None if self.barricadeIcon: self.barricadeIcon.destroy() self.barricadeIcon = None if self.barricadeDestroyed and self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.barricadeDestroyed.show() return True else: return False
def setHp(self, hp, maxHp): if self.hpMeter: if hp != self.hpMeter.meter['value']: pass hpMismatch = hp != maxHp self.hp = hp self.maxHp = hp self.hpMeter.update(hp, maxHp) if hpMismatch: if self.blinker: self.blinker.finish() self.blinker.start() if hp <= 0 and maxHp >= 0 and not (self.sentRemove): self.sentRemove = True if self.hpMeter: self.hpMeter.destroy() self.hpMeter = None if self.blinker: self.blinker.pause() self.blinker = None if self.barricadeIcon: self.barricadeIcon.destroy() self.barricadeIcon = None if self.barricadeDestroyed and self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.barricadeDestroyed.show() return True else: return False
def _addedToMap(self, map): self.mapGeom.setScale(aspect2d, 0.29999999999999999) overlayNode = map.getOverlayNode() worldNode = map.getWorldNode() transform = self.mapGeom.getTransform(overlayNode) self.hpMeter = HpMeter(width = 0.40000000000000002, parent = overlayNode) self.hpMeter.setP(-90) if self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.hpMeter.setPos(transform.getPos() + (50, 0, 0)) else: self.hpMeter.setPos(InvasionGlobals.getMainCapturePointHpPos(self.holidayId)) self.hpMeter.setScale(transform.getScale()) self.hpMeter['sortOrder'] = MinimapCapturePoint.SORT self.hpMeter.setAlphaScale(1, 1) self.hpMeter.categoryLabel['text_scale'] = 0.10000000000000001 self.hpMeter.update(1, 1) topGui = loader.loadModel('models/gui/toplevel_gui') if self.zone != InvasionGlobals.getTotalCapturePoints(self.holidayId): self.barricadeIcon = OnscreenImage(parent = self.mapGeom, image = topGui.find('**/pir_t_gui_gen_barricade'), scale = 1.5, hpr = (0, 90, 0), color = (1.0, 0.5, 0.0, 1)) self.barricadeDestroyed = OnscreenImage(parent = overlayNode, image = topGui.find('**/pir_t_gui_gen_Xred'), scale = transform.getScale() * 4.0, pos = transform.getPos(), hpr = (0, -90, 0)) self.barricadeDestroyed.hide() topGui.removeNode() self.mouseOver = GuiButton(parent = self.hpMeter, relief = None, state = DGG.NORMAL, scale = 3.0, image = None, frameSize = (-0.10000000000000001, 0.14999999999999999, -0.029999999999999999, 0.029999999999999999), helpText = PLocalizer.CapturePointNames[self.holidayId][self.zone], helpPos = (0.10000000000000001, 0, -0.080000000000000002), helpDelay = 0, helpOpaque = True, sortOrder = MinimapShop.SORT)
def announceGenerate(self): DistributedObject.DistributedObject.announceGenerate(self) self.parentObj = self.getParentObj() self.linearFog = Fog('LinearInvasionFog') localAvatar.b_setInInvasion(True) base.options.setInvasion(True) PooledEffect.setGlobalLimit(20) messenger.send('grid-detail-changed', [Options.option_low]) base.options.setRuntimeSpecialEffects() base.setNoticeSystem(0) islandMusic = SoundGlobals.getMainMusic(self.parentObj.uniqueId) if islandMusic: base.musicMgr.requestFadeOut(islandMusic) base.musicMgr.request(SoundGlobals.MUSIC_TORMENTA, looping=True) numCapturePoints = InvasionGlobals.getTotalCapturePoints( self.holidayId) if base.launcher.getPhaseComplete(5): self.canPlaySfx = True else: self.canPlaySfx = False self.cleanedUp = False
def announceGenerate(self): DistributedObject.DistributedObject.announceGenerate(self) self.parentObj = self.getParentObj() self.linearFog = Fog('LinearInvasionFog') localAvatar.b_setInInvasion(True) base.options.setInvasion(True) PooledEffect.setGlobalLimit(20) messenger.send('grid-detail-changed', [ Options.option_low]) base.options.setRuntimeSpecialEffects() base.setNoticeSystem(0) islandMusic = SoundGlobals.getMainMusic(self.parentObj.uniqueId) if islandMusic: base.musicMgr.requestFadeOut(islandMusic) base.musicMgr.request(SoundGlobals.MUSIC_TORMENTA, looping = True) numCapturePoints = InvasionGlobals.getTotalCapturePoints(self.holidayId) if base.launcher.getPhaseComplete(5): self.canPlaySfx = True else: self.canPlaySfx = False self.cleanedUp = False
def setHolidayId(self, holidayId): self.holidayId = HolidayGlobals.getHolidayClass(holidayId) self.holidayName = HolidayGlobals.getHolidayName(self.holidayId) self.totalPhases = InvasionGlobals.getTotalPhases(self.holidayId) self.mainZone = InvasionGlobals.getTotalCapturePoints(self.holidayId)
def setHolidayId(self, holidayId): self.holidayId = HolidayGlobals.getHolidayClass(holidayId) self.holidayName = HolidayGlobals.getHolidayName(self.holidayId) self.totalPhases = InvasionGlobals.getTotalPhases(self.holidayId) self.mainZone = InvasionGlobals.getTotalCapturePoints(self.holidayId)