Esempio n. 1
0
    def on_accuracy(self, e):

        if e.weapon.weapon_type == weapons.COUNTER:
            player_stats = stat_mgr.get_player_stats(e.player)

            counters = 0
            for weapon in model_mgr.get_weapons(weapons.COUNTER):
                if weapon in player_stats.weapons:
                    counters += player_stats.weapons[weapon].bullets_fired
            self.results[e.player] = counters
Esempio n. 2
0
    def on_accuracy(self, e):

        if e.weapon.weapon_type == weapons.COUNTER:
            player_stats = stat_mgr.get_player_stats(e.player)

            counters = 0
            for weapon in model_mgr.get_weapons(weapons.COUNTER):
                if weapon in player_stats.weapons:
                    counters += player_stats.weapons[weapon].bullets_fired
            self.results[e.player] = counters
Esempio n. 3
0
    def get_weapons(self):
        '''
        Provides an index of available weapons.

        Args:
            None

        Returns:
            weapons (list): Returns the list of all weapons.
        '''

        # Build an index of the available players
        results = list()
        for weapon in model_mgr.get_weapons():
            results.append({'id': weapon.id, 'name': weapon.name})

        # Sort the index by weapon name
        results.sort(key=lambda r: r['name'].lower())
        return results
Esempio n. 4
0
    def get_weapons(self):
        '''
        Provides an index of available weapons.

        Args:
            None

        Returns:
            weapons (list): Returns the list of all weapons.
        '''

        # Build an index of the available players
        results = list()
        for weapon in model_mgr.get_weapons():
            results.append({ 'id': weapon.id, 'name': weapon.name })

        # Sort the index by weapon name
        results.sort(key=lambda r: r['name'].lower())
        return results