def shoot(base, self, isRepeat=False): global deadBlockTimeOut if not (safeShotConfig['enabled'] and safeShotEnabled): return base(self, isRepeat) if target() is None: if safeShotConfig['wasteShotBlock']: addClientMessage( safeShotConfig['clientMessages']['wasteShotBlockedMessage']) return else: if hasattr(target().publicInfo, 'team'): if safeShotConfig['teamShotBlock'] and player().team is target( ).publicInfo.team and target().isAlive(): if not (safeShotConfig['teamKillerShotUnblock'] and player().guiSessionProvider.getArenaDP().isTeamKiller( target().id)): addChatMessage( safeShotConfig['chatMessages'] ['teamShotBlockedMessage'].replace( '{{target-name}}', target().publicInfo.name).replace( '{{target-vehicle}}', target().typeDescriptor.type.shortUserString)) addClientMessage(safeShotConfig['clientMessages'] ['teamShotBlockedMessage']) return else: if deadBlockEnabled and not target().isAlive() and ( deadBlockTimeOut == 0 or serverTime() - deadDict.get(target().id, 0) < deadBlockTimeOut): addClientMessage(safeShotConfig['clientMessages'] ['deadShotBlockedMessage']) return return base(self, isRepeat)
def handleKey(self, isDown, key, mods): global hotKeyPressed if (key != infoPanelConfig['altKey']) or MessengerEntry.g_instance.gui.isFocused(): return if isDown: InfoPanel.update(player().getVehicleAttached()) hotKeyPressed = True elif not isDown: hotKeyPressed = False if target() is not None: InfoPanel.update(target()) else: InfoPanel.hide()
def isShotAllowed(): if not (safeShotConfig['enabled'] and safeShotEnabled and not isEventBattle): return True if target() is None: if safeShotConfig['wasteShotBlock']: addClientMessage(safeShotConfig['clientMessages']['wasteShotBlockedMessage'], 2) return False elif hasattr(target().publicInfo, 'team'): if safeShotConfig['teamShotBlock'] and (player().team is target().publicInfo.team) and target().isAlive(): if not (safeShotConfig['teamKillerShotUnblock'] and player().guiSessionProvider.getArenaDP().isTeamKiller(target().id)): addChatMessage(safeShotConfig['chatMessages']['teamShotBlockedMessage'].replace('{{target-name}}', target().publicInfo.name).replace('{{target-vehicle}}', target().typeDescriptor.type.shortUserString)) addClientMessage(safeShotConfig['clientMessages']['teamShotBlockedMessage'], 2) return False elif deadBlockEnabled and (not target().isAlive()) and ((deadBlockTimeOut == 0) or ((serverTime() - deadDict.get(target().id, 0)) < deadBlockTimeOut)): addClientMessage(safeShotConfig['clientMessages']['deadShotBlockedMessage'], 2) return False return True
def handleKey(self, isDown): if isDown: self.update(player().getVehicleAttached()) self.hotKeyDown = True elif not isDown: self.hotKeyDown = False _target = target() if _isEntitySatisfiesConditions(_target): self.update(_target) else: self.hide()
def isPremium(): _typeDescriptor = player().getVehicleAttached().typeDescriptor if (( target() is None) or infoPanel.hotKeyDown) else target().typeDescriptor return 'premium' if ('premium' in _typeDescriptor.type.tags) else ''
def isTarget(): return '' if ((target() is None) or infoPanel.hotKeyDown) else 'trg'
def _vehicle(): vehicle = target() if not vehicle: vehicle = player().getVehicleAttached() return vehicle