Ejemplo n.º 1
0
    def __init__(self):
        self._entities = {}

        self._map = None
        self._player_id = None
        self._tracerts = []
        # just for test
        Entity.subscribe_method_call(
            'Avatar', 'showTracer',
            lambda *args: self._tracerts.append(args[1:]))
Ejemplo n.º 2
0
    def __init__(self):
        self._entities = {}
        self._achievements = {}
        self._ribbons = {}
        self._players = PlayersInfo()
        self._battle_result = None
        self._damage_map = {}
        self._shots_damage_map = {}
        self._death_map = []
        self._map = {}
        self._player_id = None
        self._arena_id = None

        self._dead_planes = {}

        Entity.subscribe_method_call('Avatar', 'onBattleEnd', self.onBattleEnd)
        Entity.subscribe_method_call('Avatar', 'onArenaStateReceived',
                                     self.onArenaStateReceived)
        Entity.subscribe_method_call('Avatar', 'onGameRoomStateChanged',
                                     self.onPlayerInfoUpdate)
        Entity.subscribe_method_call('Avatar', 'receiveVehicleDeath',
                                     self.receiveVehicleDeath)
        # Entity.subscribe_method_call('Vehicle', 'setConsumables', self.onSetConsumable)
        Entity.subscribe_method_call('Avatar', 'onRibbon', self.onRibbon)
        Entity.subscribe_method_call('Avatar', 'onAchievementEarned',
                                     self.onAchievementEarned)
        Entity.subscribe_method_call('Avatar', 'receiveDamageStat',
                                     self.receiveDamageStat)
        Entity.subscribe_method_call('Avatar', 'receive_planeDeath',
                                     self.receive_planeDeath)
        Entity.subscribe_method_call('Avatar', 'onNewPlayerSpawnedInBattle',
                                     self.onNewPlayerSpawnedInBattle)

        Entity.subscribe_method_call('Vehicle', 'receiveDamagesOnShip',
                                     self.g_receiveDamagesOnShip)
Ejemplo n.º 3
0
    def __init__(self):
        self._entities = {}
        self._achievements = {}
        self._ribbons = {}
        self._players = PlayersInfo()
        self._battle_result = None
        self._damage_map = {}
        self._shots_damage_map = {}
        self._death_map = []
        self._map = {}
        self._player_id = None
        self._arena_id = None
        self._dead_planes = {}

        ################################################################################################################
        self._time = 0
        self._previous_time = 0
        self._interval = 0.5
        self._playerInfo: List[PlayerInfo] = []
        self._playerStates: List[PlayerState] = []
        self._timedPlayerStates: Dict[int, List[PlayerState]] = {}
        self._caps_history = {}
        self.owner_team_id = 0
        ################################################################################################################

        Entity.subscribe_method_call('Avatar', 'onBattleEnd', self.onBattleEnd)
        Entity.subscribe_method_call('Avatar', 'onArenaStateReceived',
                                     self.onArenaStateReceived)
        Entity.subscribe_method_call('Avatar', 'onGameRoomStateChanged',
                                     self.onPlayerInfoUpdate)
        Entity.subscribe_method_call('Avatar', 'receiveVehicleDeath',
                                     self.receiveVehicleDeath)
        # Entity.subscribe_method_call('Vehicle', 'setConsumables', self.onSetConsumable)
        Entity.subscribe_method_call('Avatar', 'onRibbon', self.onRibbon)
        Entity.subscribe_method_call('Avatar', 'onAchievementEarned',
                                     self.onAchievementEarned)
        Entity.subscribe_method_call('Avatar', 'receiveDamageStat',
                                     self.receiveDamageStat)
        Entity.subscribe_method_call('Avatar', 'receive_planeDeath',
                                     self.receive_planeDeath)
        Entity.subscribe_method_call('Avatar', 'onNewPlayerSpawnedInBattle',
                                     self.onNewPlayerSpawnedInBattle)
        Entity.subscribe_method_call('Vehicle', 'receiveDamagesOnShip',
                                     self.g_receiveDamagesOnShip)
        Entity.subscribe_method_call('Avatar', 'updateMinimapVisionInfo',
                                     self.updateMinimapVisionInfo)
        Entity.subscribe_property_change('Vehicle', 'health', self.setHealth)