Ejemplo n.º 1
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isAvatar(e):
         logNotSupportedEntityError(e, self)
         return 0
     else:
         return e.getSpeed() * METERS_PER_SEC_TO_KMH_FACTOR
Ejemplo n.º 2
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return ''
     elif not isSector(e):
         logNotSupportedEntityError(e, self)
         return ''
     else:
         return e.settings.presetName
Ejemplo n.º 3
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isSector(e):
         logNotSupportedEntityError(e, self)
         return 0
     else:
         return e.capturePoints
Ejemplo n.º 4
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isAvatar(e):
         logNotSupportedEntityError(e, self)
         return 0
     else:
         return e.getAltitudeAboveObstacle()
Ejemplo n.º 5
0
 def _tryGetAvatar(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return
     elif not isAvatar(e):
         logNotSupportedEntityError(e, self)
         return
     else:
         return e
Ejemplo n.º 6
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isSector(e):
         logNotSupportedEntityError(e, self)
         return 0
     else:
         center, radius = e.settings.geometry.boundingCircle
         return radius
Ejemplo n.º 7
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isAvatar(e):
         logNotSupportedEntityError(e, self)
         return 0
     else:
         return _performanceCharacteristics_db.airplanes[
             e.globalID].maxSpeed
Ejemplo n.º 8
0
 def _execute(self, entityId, position):
     from Bot.BotConsts import STRATEGY_TARGET_TYPE, StrategyTargetPointData
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return
     elif not isAvatarBot(e):
         logNotSupportedEntityError(e, self)
         return
     else:
         e.updateStrategyTarget(STRATEGY_TARGET_TYPE.POINT, StrategyTargetPointData(position))
         return 'out'
Ejemplo n.º 9
0
 def _execute(self, entityId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isSector(e):
         logNotSupportedEntityError(e, self)
         return 0
     elif e.stateContainer.state != SECTOR_STATE.LOCKED:
         return 0
     else:
         return e.stateContainer.nextStateTimestamp - BigWorld.time()
Ejemplo n.º 10
0
 def _execute(self, entityId, triggerName, isOn):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return
     elif not isAvatar(e) and not isTeamObject(e):
         logNotSupportedEntityError(e, self)
         return
     else:
         e.controllers['modelManipulator'].setEffectVisible(
             triggerName, isOn)
         return 'out'
Ejemplo n.º 11
0
 def _execute(self, entityId, teamId):
     e = BigWorld.entities.get(entityId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return 0
     elif not isSector(e):
         logNotSupportedEntityError(e, self)
         return 0
     elif teamId not in TEAM_ID.CHOSEN:
         logError(self, 'Invalid team id, team code: ' + str(teamId))
         return 0
     else:
         return e.captureStatus[teamId]
Ejemplo n.º 12
0
 def _execute(self, entityId, targetId):
     from Bot.BotConsts import STRATEGY_TARGET_TYPE, StrategyTargetEntityData
     e = BigWorld.entities.get(entityId)
     t = BigWorld.entities.get(targetId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return
     elif t is None:
         logEntityDoesNotExistError(targetId, self)
         return
     elif not isAvatarBot(e):
         logNotSupportedEntityError(e, self)
         return
     else:
         e.updateStrategyTarget(STRATEGY_TARGET_TYPE.ENTITY, StrategyTargetEntityData(position=t.position, entityID=targetId))
         return 'out'
Ejemplo n.º 13
0
 def _execute(self, entityId, sectorId):
     from Bot.BotConsts import STRATEGY_TARGET_TYPE, StrategyTargetSectorData
     e = BigWorld.entities.get(entityId)
     s = BigWorld.entities.get(sectorId)
     if e is None:
         logEntityDoesNotExistError(entityId, self)
         return
     elif s is None:
         logEntityDoesNotExistError(sectorId, self)
         return
     elif not isAvatarBot(e):
         logNotSupportedEntityError(e, self)
         return
     elif not isSector(s):
         logNotSupportedEntityError(s, self)
         return
     else:
         e.updateStrategyTarget(STRATEGY_TARGET_TYPE.SECTOR, StrategyTargetSectorData(position=s.position, sectorID=s.ident, sectorEntityID=sectorId))
         return 'out'