Example #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.getAltitudeAboveObstacle()
Example #2
0
 def _execute(self, sectorId, teamId):
     s = BigWorld.entities.get(sectorId)
     if s is None:
         logEntityDoesNotExistError(sectorId, self)
         return 0
     elif 0 <= teamId < len(s.botFocusCount):
         return s.botFocusCount[teamId]
     else:
         logError(self, 'Input team id is invalid')
         return 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
 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
Example #5
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
Example #6
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
 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
Example #8
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
Example #9
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'
 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()
Example #11
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'
 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]
Example #13
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'
Example #14
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'
Example #15
0
def getArena(component):
    entity = BigWorld.entities[component.planEntityId]
    arena = ArenaProvider().get(entity)
    if arena is None:
        logEntityDoesNotExistError('Arena', component)
    return arena
Example #16
0
def getGameActionsManager(component):
    entity = BigWorld.entities[component.planEntityId]
    mgr = GameActionsManagerProvider().get(entity)
    if mgr is None:
        logEntityDoesNotExistError('GameActionsManager', component)
    return mgr