Exemplo n.º 1
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a name. Usage: @greeter guild-member celessa")
            return

        closest_match = utils.find_closest_match(input,
                                                 inventory.members_name_list)
        if closest_match is None:
            yield from client.send_message(
                channel, 'No results found for ' + input +
                '. Check the supplied name. Use @greeter members to get correct name'
            )
            return
        else:
            yield from client.send_message(
                channel, 'Closest match is ' + closest_match + '.')

        toons_for_player = inventory.toons_for_member(closest_match)
        if toons_for_player is None or len(toons_for_player) == 0:
            yield from client.send_message(
                channel,
                'Toons information is not available for ' + input + '.')
            return
        else:
            yield from utils.send_as_table(
                toons_for_player, ['No', 'Toon', 'Star', 'Gear', 'GP'], 30,
                channel, client)
Exemplo n.º 2
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a toon name. Usage: @greeter member-toon lobot")
            return

        closest_match = None

        exact_match = utils.find_case_insensitive_exact_match(
            input, inventory.toons_name_list)
        if exact_match is None:
            alias_matches = utils.find_alias_matches(input,
                                                     inventory.toons_aliases)
            if len(alias_matches) == 1:
                closest_match = alias_matches[0]
            elif len(alias_matches) > 1:
                yield from client.send_message(
                    channel, 'Multiple results returned' + str(alias_matches) +
                    '. Be specific.')
                return
            else:
                closest_match = utils.find_closest_match(
                    input, inventory.toons_name_list)

            if closest_match is None:
                yield from client.send_message(
                    channel, 'No results found for ' + input +
                    '. Check the supplied name. Use @greeter toons to get correct name'
                )
                return
            else:
                yield from client.send_message(
                    channel, 'Closest match is ' + closest_match + '.')
        else:
            closest_match = exact_match

        players_with_toon = inventory.players_with_toon(closest_match)
        if players_with_toon is None or len(players_with_toon) == 0:
            yield from client.send_message(
                channel,
                'Shame!! There is no player in the guild with ' + input + '.')
            return
        else:
            yield from utils.send_as_table(
                players_with_toon, ['No', 'Member', 'Star', 'Gear', 'GP'], 30,
                channel, client)
Exemplo n.º 3
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a ship name. Usage: @greeter member-ship Scimitar"
            )
            return

        closest_match = None

        alias_matches = utils.find_alias_matches(input,
                                                 inventory.ships_aliases)
        if len(alias_matches) == 1:
            closest_match = alias_matches[0]
        elif len(alias_matches) > 1:
            yield from client.send_message(
                channel, 'Multiple results returned' + str(alias_matches) +
                '. Be specific.')
            return
        else:
            closest_match = utils.find_closest_match(input,
                                                     inventory.ships_name_list)

        if closest_match is None:
            yield from client.send_message(
                channel, 'No results found for ' + input +
                '. Check the supplied name. Use @greeter ships to get correct name'
            )
            return
        else:
            yield from client.send_message(
                channel, 'Closest match is ' + closest_match + '.')

        players_with_ship = inventory.players_with_ship(closest_match)
        if players_with_ship is None or len(players_with_ship) == 0:
            yield from client.send_message(
                channel,
                'Shame!! There is no player in the guild with ' + input + '.')
            return
        else:
            yield from utils.send_as_table(players_with_ship,
                                           ['No', 'Member', 'Star', 'GP'], 30,
                                           channel, client)
Exemplo n.º 4
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a name. Usage: @greeter thrawn-ready celessa")
            return

        member_name = utils.find_closest_match(input,
                                               inventory.members_name_list)
        if member_name is None:
            yield from client.send_message(
                channel, 'No results found for ' + input +
                '. Check the supplied name. Use @greeter members to get correct name'
            )
            return
        else:
            yield from client.send_message(
                channel, 'Closest match is ' + member_name + '.')

        # Actual logic for finding Thrawn readiness
        thrawn_rarity = None
        table_data = inventory.get_specific_toons_data_for_member(
            member_name, ['Grand Admiral Thrawn'])
        if len(table_data) == 1:
            thrawn_rarity = table_data[0][1]
            if thrawn_rarity == 7:  #rarity
                yield from client.send_message(
                    channel, member_name + ' already has a 7* Thrawn')
                return

        req_toons = [
            'Ezra Bridger', 'Chopper', 'Garazeb "Zeb" Orrelios',
            'Hera Syndulla', 'Kanan Jarrus', 'Sabine Wren'
        ]
        table_data = inventory.get_specific_toons_data_for_member(
            member_name, req_toons)
        copy_req_toons = list(req_toons)

        output = []
        satisfiedCount = 0
        for row in table_data:
            name = row[0]
            rarity = row[1]
            if rarity < 7:
                if thrawn_rarity is None and rarity >= 5:  # if Thrawn is not there, 5* Phoenix is enough
                    satisfiedCount = satisfiedCount + 1
                else:
                    output.append([name, rarity])
            else:
                satisfiedCount = satisfiedCount + 1
            copy_req_toons.remove(name)

        if len(req_toons) > 0:
            for name in copy_req_toons:
                output.append([name, 'Locked'])

        if satisfiedCount >= 5:
            if thrawn_rarity is None:
                yield from client.send_message(
                    channel, member_name +
                    ' does not have Thrawn yet but has the toons required for unlocking him at 5*'
                )
            else:
                yield from client.send_message(
                    channel,
                    member_name + ' has Thrawn at ' + str(thrawn_rarity) +
                    ' and has the toons required for upgrading him to 7*')
            return

        if thrawn_rarity is None:
            yield from client.send_message(
                channel, member_name +
                ' does not have Thrawn and need to farm following toons to 5* for unlocking him at 5*'
            )
        else:
            yield from client.send_message(
                channel, member_name + ' has Thrawn at ' + str(thrawn_rarity) +
                ' and need to farm following toons to 7* for upgrading him to 7*'
            )

        yield from utils.send_as_table(output, ['Toon', 'Current rarity'], 30,
                                       channel, client)
Exemplo n.º 5
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a name. Usage: @greeter jtr-ready celessa")
            return

        closest_match = utils.find_closest_match(input,
                                                 inventory.members_name_list)
        if closest_match is None:
            yield from client.send_message(
                channel, 'No results found for ' + input +
                '. Check the supplied name. Use @greeter members to get correct name'
            )
            return
        else:
            yield from client.send_message(
                channel, 'Closest match is ' + closest_match + '.')

        # Actual logic for finding JTR readiness
        table_data = inventory.get_specific_toons_data_for_member(
            closest_match, ['Rey (Jedi Training)'])
        if len(table_data) == 1:
            yield from client.send_message(
                channel, closest_match + ' already has a 7* JTR')
            return

        req_toons = [
            'Finn', 'Rey (Scavenger)', 'BB-8', 'Veteran Smuggler Chewbacca',
            'Veteran Smuggler Han Solo'
        ]
        table_data = inventory.get_specific_toons_data_for_member(
            closest_match, req_toons)
        copy_req_toons = list(req_toons)

        output = []
        satisfiedCount = 0
        for row in table_data:
            name = row[0]
            rarity = row[1]
            if rarity != 7:
                output.append([name, rarity])
            else:
                satisfiedCount = satisfiedCount + 1
            copy_req_toons.remove(name)

        if len(req_toons) > 0:
            for name in copy_req_toons:
                output.append([name, 'Locked'])

        if satisfiedCount == 5:
            yield from client.send_message(
                channel, closest_match +
                ' does not have JTR yet but has the toons required for unlocking her at 7*'
            )
            return

        yield from client.send_message(
            channel, closest_match +
            ' does not have JTR and need to farm following toons to 7* for unlocking her at 7*'
        )
        yield from utils.send_as_table(output, ['Toon', 'Current rarity'], 30,
                                       channel, client)
Exemplo n.º 6
0
    def execute(self, client, input, inventory, channel):
        if len(input) == 0:
            yield from client.send_message(
                channel,
                "Must supply a name. Usage: @greeter cls-ready celessa")
            return

        closest_match = utils.find_closest_match(input,
                                                 inventory.members_name_list)
        if closest_match is None:
            yield from client.send_message(
                channel, 'No results found for ' + input +
                '. Check the supplied name. Use @greeter members to get correct name'
            )
            return
        else:
            yield from client.send_message(
                channel, 'Closest match is ' + closest_match + '.')

        # Actual logic for finding CLS readiness
        table_data = inventory.get_specific_toons_data_for_member(
            closest_match, ['Commander Luke Skywalker'])
        if len(table_data) == 1:
            yield from client.send_message(
                channel,
                closest_match + ' already has a 7* Commander Luke Skywalker')
            return

        req_toons = [
            'Princess Leia', 'Stormtrooper Han', 'Luke Skywalker (Farmboy)',
            'R2-D2', 'Obi-Wan Kenobi (Old Ben)'
        ]
        table_data = inventory.get_specific_toons_data_for_member(
            closest_match, req_toons)
        copy_req_toons = list(req_toons)

        output = []
        satisfiedCount = 0
        for row in table_data:
            name = row[0]
            rarity = row[1]
            if rarity != 7:
                output.append([name, rarity])
            else:
                satisfiedCount = satisfiedCount + 1
            copy_req_toons.remove(name)

        if len(req_toons) > 0:
            for name in copy_req_toons:
                output.append([name, 'Locked'])

        if satisfiedCount == 5:
            yield from client.send_message(
                channel, closest_match +
                ' does not have Commander Luke Skywalker yet but has the toons required for unlocking him at 7*'
            )
            return

        yield from client.send_message(
            channel, closest_match +
            ' does not have Commander Luke Skywalker and need to farm following toons to 7* for unlocking him at 7*'
        )
        yield from utils.send_as_table(output, ['Toon', 'Current rarity'], 30,
                                       channel, client)