Beispiel #1
0
def _respawn_player(userid):
    """Respawn the given userid after validation."""
    if GunGameStatus.ROUND is GunGameRoundStatus.INACTIVE:
        return
    player = player_dictionary.get(userid)
    if player is not None:
        player.spawn()
def _increment_team_multi_kill(game_event):
    if GunGameStatus.MATCH is not GunGameMatchStatus.ACTIVE:
        return

    attacker = player_dictionary.get(game_event['attacker'])
    if attacker is None:
        return

    victim = player_dictionary[game_event['userid']]
    if victim.team_index == attacker.team_index:
        return

    team = team_dictionary.get(attacker.team_index)
    if team is None:
        return

    weapon = weapon_manager[game_event['weapon']].basename
    if weapon != team.level_weapon:
        if weapon == 'prop_physics' and not prop_physics.get_int():
            return

        elif weapon in melee_weapons and not count_melee_kills.get_int():
            return

        elif weapon in grenade_weapons and not count_grenade_kills.get_int():
            return

    team.increase_multi_kill()
Beispiel #3
0
def _respawn_victims(userid):
    """Respawn all victim's of the given userid."""
    victims = eliminated_players.pop(userid, [])
    if not len(victims):
        return
    if GunGameStatus.ROUND is GunGameRoundStatus.INACTIVE:
        return
    players = list()
    for victim in victims:
        player = player_dictionary.get(victim)
        if player is None:
            continue
        if player.team == 1:
            continue
        players.append(player)
        player.spawn()
    if players:
        message_manager.chat_message(
            'Elimination:Respawning', players[0].index,
            player='\x01, \x03'.join(
                map(
                    attrgetter('name'),
                    players
                )
            )
        )
Beispiel #4
0
def _increment_team_multi_kill(game_event):
    attacker = player_dictionary.get(game_event['attacker'])
    if attacker is None:
        return

    victim = player_dictionary[game_event['userid']]
    if victim.team == attacker.team:
        return

    team = team_dictionary.get(attacker.team)
    if team is None:
        return

    weapon = game_event['weapon']
    if weapon != team.level_weapon:
        if weapon == 'prop_physics' and not prop_physics.get_int():
            return

        elif weapon in melee_weapons and not count_melee_kills.get_int():
            return

        elif weapon in grenade_weapons and not count_grenade_kills.get_int():
            return

    team.increase_multi_kill()