Exemplo n.º 1
0
async def toss_squatters(user_id=None, server_id=None, keepKeys=False):
    player_info = EwPlayer(id_user=user_id)
    apt_info = EwApartment(id_user=user_id, id_server=server_id)

    client = ewutils.get_client()
    server = client.get_guild(server_id)

    member_data = server.get_member(player_info.id_user)

    if player_info.id_server != None and member_data != None:
        try:
            conn_info = bknd_core.databaseConnect()
            conn = conn_info.get('conn')
            cursor = conn.cursor()
            client = ewutils.get_client()

            # get all players visiting an evicted apartment and kick them out
            cursor.execute(
                "SELECT {} FROM users WHERE {} = %s AND {} = %s".format(
                    ewcfg.col_id_user,
                    ewcfg.col_visiting,
                    ewcfg.col_id_server,
                ), (
                    member_data.id,
                    server_id,
                ))

            squatters = cursor.fetchall()
            key_1 = EwItem(id_item=apt_info.key_1).id_owner
            key_2 = EwItem(id_item=apt_info.key_2).id_owner
            for squatter in squatters:
                sqt_data = EwUser(id_user=squatter[0],
                                  id_server=player_info.id_server)
                if keepKeys and (sqt_data.id_user == key_1
                                 or sqt_data.id_user == key_2):
                    pass
                else:
                    server = ewcfg.server_list[sqt_data.id_server]
                    member_object = server.get_member(squatter[0])
                    sqt_data.poi = sqt_data.poi[3:] if sqt_data.poi[
                        3:] in poi_static.id_to_poi.keys() else sqt_data.poi
                    sqt_data.visiting = ewcfg.location_id_empty
                    sqt_data.persist()
                    await ewrolemgr.updateRoles(client=client,
                                                member=member_object)
        finally:
            # Clean up the database handles.
            cursor.close()
            bknd_core.databaseClose(conn_info)
Exemplo n.º 2
0
async def rejuvenate(cmd):
    user_data = EwUser(member=cmd.message.author)

    if user_data.life_state == ewcfg.life_state_shambler and user_data.poi != ewcfg.poi_id_oozegardens:
        response = "You lack the higher brain functions required to {}.".format(cmd.tokens[0])
        return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
    elif user_data.life_state == ewcfg.life_state_shambler and user_data.poi == ewcfg.poi_id_oozegardens:
        response = "You decide to change your ways and become one of the Garden Gankers in order to overthrow your old master."
        await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))

        await asyncio.sleep(5)

        user_data = EwUser(member=cmd.message.author)
        user_data.life_state = ewcfg.life_state_juvenile
        #user_data.degradation = 0
        # user_data.gvs_currency = 0

        ewutils.moves_active[user_data.id_user] = 0

        user_data.poi = ewcfg.poi_id_og_farms
        user_data.persist()

        client = ewutils.get_client()
        server = client.get_guild(user_data.id_server)
        member = server.get_member(user_data.id_user)

        base_poi_channel = fe_utils.get_channel(cmd.message.guild, ewcfg.channel_og_farms)

        response = "You enter into Atomic Forest inside the farms of Ooze Gardens and are sterilized of the Modelovirus. Hortisolis gives you a big hug and says he's glad you've overcome your desire for vengeance in pursuit of deposing Downpour."

        await ewrolemgr.updateRoles(client=cmd.client, member=member)
        return await fe_utils.send_message(cmd.client, base_poi_channel, fe_utils.formatMessage(cmd.message.author, response))

    else:
        pass
Exemplo n.º 3
0
async def one_eye_dm(id_user = None, id_server = None, poi = None):
    poi_obj = poi_static.id_to_poi.get(poi)
    client = ewutils.get_client()
    server = client.get_guild(id_server)

    server = client.get_guild(str(id_server))

    server = client.get_guild(int(id_server))

    id_player = EwPlayer(id_user=id_user, id_server=id_server)

    if poi_obj.pvp:
        try:
            recipients = bknd_core.execute_sql_query(
                "SELECT {id_user} FROM mutations WHERE {id_server} = %s AND {mutation} = %s and {data} = %s".format(
                    data=ewcfg.col_mutation_data,
                    id_server=ewcfg.col_id_server,
                    id_user=ewcfg.col_id_user,
                    mutation=ewcfg.col_id_mutation,
                ), (
                    id_server,
                    ewcfg.mutation_id_oneeyeopen,
                    str(id_user),
                ))
            for recipient in recipients:
                member = server.get_member(int(recipient[0]))
                mutation = EwMutation(id_server=id_server, id_user=recipient[0], id_mutation=ewcfg.mutation_id_oneeyeopen)
                mutation.data = ""
                mutation.persist()
                await fe_utils.send_message(client, member, fe_utils.formatMessage(member, "{} is stirring...".format(id_player.display_name)))

        except:
            ewutils.logMsg("Failed to do OEO notificaitons for {}.".format(id_user))
Exemplo n.º 4
0
async def send_gangbase_messages(server_id, clock):
    # this can be added onto for events and such
    lucky_lucy = 0
    casino_response = "**Lucky Lucy has arrived!** Now's the time to make your fortune!"
    casino_end = "Aww, Lucy left."

    response = ""
    if clock == 3:
        response = "The police are probably asleep, the lazy f***s. It's a good time for painting the town!"
    elif clock == 11:
        response = "Spray time's over, looks like the cops are back out. F**k those guys."
    if random.randint(1, 50) == 2:
        lucky_lucy = 1

    client = ewutils.get_client()
    server = client.get_guild(server_id)
    channels = ewcfg.hideout_channels
    casino_channel = fe_utils.get_channel(server=server, channel_name=ewcfg.channel_casino)

    if response != "":
        for channel in channels:
            post_channel = fe_utils.get_channel(server, channel)
            await fe_utils.send_message(client, post_channel, response)
    if lucky_lucy == 1:
        await fe_utils.send_message(client, casino_channel, casino_response)
        await asyncio.sleep(300)
        await fe_utils.send_message(client, casino_channel, casino_end)
Exemplo n.º 5
0
async def send_gangbase_messages(server_id, clock):
    # this can be added onto for events and such
    lucky_lucy = 0
    casino_response = "**Lucky Lucy has arrived!** Now's the time to make your fortune!"
    casino_end = "Aww, Lucy left."

    highnoon = 0

    response = ""
    #if clock == 3:
    #    response = "The police are probably asleep, the lazy f***s. It's a good time for painting the town!"
    #elif clock == 11:
    #    response = "Spray time's over, looks like the cops are back out. F**k those guys."
    if random.randint(1, 50) == 2:
        lucky_lucy = 1

    if clock == 11:
        highnoon = 1
    if clock == 12:
        highnoon = 2

    client = ewutils.get_client()
    server = client.get_guild(server_id)
    channels = ewcfg.hideout_channels
    casino_channel = fe_utils.get_channel(server=server,
                                          channel_name=ewcfg.channel_casino)
    dueling_channel = fe_utils.get_channel(server=server,
                                           channel_name='hang-em-square')

    if response != "":
        for channel in channels:
            post_channel = fe_utils.get_channel(server, channel)
            await fe_utils.send_message(client, post_channel, response)
    if lucky_lucy == 1:
        pass  #taking this out until we have a better method
        #await fe_utils.send_message(client, casino_channel, casino_response)
        #await asyncio.sleep(300)
        #await fe_utils.send_message(client, casino_channel, casino_end)

    if highnoon != 0:
        district = EwDistrict(district='hangemsquare', id_server=server_id)
        if len(
                district.get_players_in_district(
                    min_slimes=0,
                    life_states=[
                        ewcfg.life_state_enlisted, ewcfg.life_state_juvenile,
                        ewcfg.life_state_shambler, ewcfg.life_state_corpse
                    ],
                    ignore_offline=True)) > 0:
            if highnoon == 1:
                response = "It's almost high noon..."
            else:
                response = "**DRAW!!!!**"
            await fe_utils.send_message(client, dueling_channel, response)
Exemplo n.º 6
0
async def kick(id_server):
    # Gets data for all living players from the database
    all_living_players = bknd_core.execute_sql_query("SELECT {poi}, {id_user} FROM users WHERE id_server = %s AND {life_state} > 0 AND {time_last_action} < %s".format(
        poi=ewcfg.col_poi,
        id_user=ewcfg.col_id_user,
        time_last_action=ewcfg.col_time_last_action,
        life_state=ewcfg.col_life_state
    ), (
        id_server,
        (int(time.time()) - ewcfg.time_kickout)
    ))

    client = ewutils.get_client()

    for player in all_living_players:
        try:
            poi = poi_static.id_to_poi[player[0]]
            id_user = player[1]
            

            # checks if the player should be kicked from the subzone and kicks them if they should.
            if poi.is_subzone and poi.id_poi not in [ewcfg.poi_id_thesphere, ewcfg.poi_id_thebreakroom]:
                
                # Don't load the user until we know that we need to
                user_data = EwUser(id_user=id_user, id_server=id_server)
                
                # Some subzones could potentially have multiple mother districts.
                # Make sure to get one that's accessible before attempting a proper kickout.
                mother_district_chosen = random.choice(poi.mother_districts)

                if inaccessible(user_data=user_data, poi=poi_static.id_to_poi.get(mother_district_chosen)):
                    # If the randomly chosen mother district is inaccessible, make one more attempt.
                    mother_district_chosen = random.choice(poi.mother_districts)
                else:
                    pass

                if not inaccessible(user_data=user_data, poi=poi_static.id_to_poi.get(mother_district_chosen)):

                    if user_data.life_state not in [ewcfg.life_state_kingpin, ewcfg.life_state_lucky, ewcfg.life_state_executive] and user_data.id_user != 799933061080416266:
                        server = ewcfg.server_list[id_server]
                        member_object = server.get_member(id_user)

                        user_data.poi = mother_district_chosen
                        user_data.time_lastenter = int(time.time())
                        user_data.persist()
                        await ewrolemgr.updateRoles(client=client, member=member_object)
                        await user_data.move_inhabitants(id_poi=mother_district_chosen)
                        mother_district_channel = fe_utils.get_channel(server, poi_static.id_to_poi[mother_district_chosen].channel)
                        response = "You have been kicked out for loitering! You can only stay in a sub-zone and twiddle your thumbs for 1 hour at a time."
                        await fe_utils.send_message(client, mother_district_channel, fe_utils.formatMessage(member_object, response))
        except:
            ewutils.logMsg('failed to move inactive player out of subzone with poi {}: {}'.format(player[0], player[1]))
Exemplo n.º 7
0
async def beam_me_up(cmd):
    user_data = EwUser(member=cmd.message.author)
    protected = False
    cosmetics = bknd_item.inventory(id_user=user_data.id_user,
                                    id_server=cmd.guild.id,
                                    item_type_filter=ewcfg.it_cosmetic)
    for cosmetic in cosmetics:
        cosmetic_data = EwItem(id_item=cosmetic.get('id_item'))

        print(cosmetic_data.item_props)
        if cosmetic_data.item_props.get('id_cosmetic') == 'skinsuit':
            if cosmetic_data.item_props.get('adorned') == 'true':
                protected = True

    poi_sought = poi_static.id_to_poi.get(user_data.poi)

    shipstate = EwGamestate(id_server=user_data.id_server,
                            id_state='shipstate')

    if not protected:
        response = "Why would aliens abduct you? What makes you so special?"
    elif poi_sought.id_poi == 'ufoufo':
        response = 'You\'re already in here.'
    elif poi_sought.id_poi != ewcfg.poi_id_west_outskirts:
        response = "Hey, get a bit closer. The ship's in the West Outskirts. Beam up power doesn't grow on trees, you know."
    elif shipstate.bit == 1:
        response = 'The ship\'s on the ground right now, it can\'t beam shit.'
    else:
        await fe_utils.send_message(
            cmd.client, cmd.message.channel,
            fe_utils.formatMessage(
                cmd.message.author,
                "You are being abducted by aliens. The ship is 20 seconds away."
            ))
        ewutils.active_restrictions[user_data.id_user] = 2
        await asyncio.sleep(20)

        ewutils.active_restrictions[user_data.id_user] = 0
        ewutils.moves_active[cmd.message.author.id] = 0
        user_data.poi = 'ufoufo'
        user_data.persist()

        await ewrolemgr.updateRoles(client=ewutils.get_client(),
                                    member=cmd.message.author)
        await user_data.move_inhabitants(id_poi='ufoufo')

    return await fe_utils.send_message(
        cmd.client, cmd.message.channel,
        fe_utils.formatMessage(cmd.message.author, response))
Exemplo n.º 8
0
async def fake_failed_command(cmd):
    client = ewutils.get_client()
    randint = random.randint(1, 3)
    msg_mistake = "ENDLESS WAR is growing frustrated."
    if randint == 2:
        msg_mistake = "ENDLESS WAR denies you his favor."
    elif randint == 3:
        msg_mistake = "ENDLESS WAR pays you no mind."

    msg = await fe_utils.send_message(client, cmd.message.channel, msg_mistake)
    await asyncio.sleep(2)
    try:
        await msg.delete()
        pass
    except:
        pass
Exemplo n.º 9
0
async def begin_tutorial(member):
    user_data = EwUser(member=member)
    dungeonutils.user_to_tutorial_state[user_data.id_user] = 0

    scene = poi_static.dungeon_tutorial[0]

    if scene.poi != None:
        user_data.poi = scene.poi
    if scene.life_state != None:
        user_data.life_state = scene.life_state

    user_data.persist()

    await ewrolemgr.updateRoles(client=ewutils.get_client(), member=member)

    response = format_tutorial_response(scene)
    poi_def = poi_static.id_to_poi.get(user_data.poi)
    channels = [poi_def.channel]
    return await fe_utils.post_in_channels(
        member.guild.id, fe_utils.formatMessage(member, response), channels)
Exemplo n.º 10
0
async def abduct(cmd):
    user_data = EwUser(member=cmd.message.author)
    item_sought = bknd_item.find_item(item_search='batterypack', id_user=cmd.message.author.id, id_server=cmd.guild.id)

    protected = False
    cosmetics = bknd_item.inventory(id_user=user_data.id_user, id_server=cmd.guild.id,
                                    item_type_filter=ewcfg.it_cosmetic)
    for cosmetic in cosmetics:
        cosmetic_data = EwItem(id_item=cosmetic.get('id_item'))
        if cosmetic_data.item_props.get('id_cosmetic') == 'skinsuit':
            if cosmetic_data.item_props.get('adorned') == 'true':
                protected = True

    shipstate = EwGamestate(id_server=user_data.id_server, id_state='shipstate')

    if user_data.poi != 'ufoufo':
        response = "Abduct what, dumbass? My patience?"
    elif not protected:
        response = "The aliens aren't gonna let you start the ship. You're basically their captive now."
    elif not ewcfg.dh_active or ewcfg.dh_stage != 3:
        response = "Wait, your alien espionage is waaaay out of season."
    elif cmd.mentions_count == 0:
        response = "Abduct who?"
    elif cmd.mentions_count > 1:
        response = "One victim at a time, please."
    elif shipstate.bit == 1:
        response = 'The ship\'s on the ground right now, it can\'t reach you.'

    else:
        if item_sought:
            target_data = EwUser(member = cmd.mentions[0])
            target_poi = poi_static.id_to_poi.get(target_data.poi)
            target_channel = fe_utils.get_channel(cmd.message.guild, target_poi.channel)

            if target_poi.id_poi == 'blackpond' or (
                        not target_poi.is_district and not target_poi.is_outskirts and not target_poi.is_pier and target_poi.id_poi not in [
                    ewcfg.poi_id_slimesendcliffs, ewcfg.poi_id_ferry, ewcfg.poi_id_sodafountain,
                    ewcfg.poi_id_stockexchange, ewcfg.poi_id_ab_farms, ewcfg.poi_id_og_farms, ewcfg.poi_id_jr_farms]):
                response = "The tractor beam on this ship sucks. You can't really see indoors."
                return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
            elif target_poi.id_poi in [ewcfg.poi_id_rowdyroughhouse, ewcfg.poi_id_copkilltown]:
                response = "Don't do that."
                return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))

            bknd_item.item_delete(id_item=item_sought.get('id_item'))
            ewutils.moves_active[target_data.id_user] = 0
            response = 'You plug in your battery pack and begin to abduct {} They\'re 20 seconds away.'.format(cmd.mentions[0].display_name)
            await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))

            await fe_utils.send_message(cmd.client, target_channel, fe_utils.formatMessage(cmd.mentions[0], "You are being abducted by aliens. The ship is 20 seconds away."))
            ewutils.active_restrictions[target_data.id_user] = 2
            await asyncio.sleep(20)

            ewutils.active_restrictions[target_data.id_user] = 0
            ewutils.moves_active[cmd.message.author.id] = 0
            target_data.poi = 'ufoufo'
            user_data.persist()
            target_data.persist()

            await ewrolemgr.updateRoles(client=ewutils.get_client(), member=cmd.mentions[0])
            await target_data.move_inhabitants(id_poi='ufoufo')


        else:
            response = "The going energy cost for abduction is pretty expensive these days. You better have a battery pack before you do something like that."

    return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
Exemplo n.º 11
0
async def setOffAlarms(id_server=None):
    ewutils.logMsg('Setting off alarms...')

    if id_server != None:
        client = ewutils.get_client()
        server = client.get_guild(id_server)
        time_current = EwMarket(id_server=id_server).clock
        if time_current <= 12:
            displaytime = str(time_current)
            ampm = 'am'
        if time_current > 12:
            displaytime = str(time_current - 12)
            ampm = 'pm'

        if time_current == 24:
            ampm = "am"
        elif time_current == 12:
            ampm = "pm"

        item_search = "alarm clock set to {}{}".format(displaytime, ampm)
        item_search_brick = "brick{:02d}".format(time_current)
        clockinv = item_utils.find_item_all(
            item_search="alarmclock",
            id_server=id_server,
            item_type_filter=ewcfg.it_furniture)
        brickinv = item_utils.find_item_all(
            item_search=item_search_brick,
            id_server=id_server,
            item_type_filter=ewcfg.it_furniture,
            search_names=True)

        for clock in clockinv:
            isFurnished = False
            clock_obj = EwItem(id_item=clock.get('id_item'))

            if clock_obj.item_props.get('furniture_name') == item_search:
                if "decorate" in clock_obj.id_owner:
                    isFurnished = True
                clock_user = clock_obj.id_owner.replace("decorate", "")
                clock_member = server.get_member(user_id=clock_user)
                if clock_member != None:
                    clock_player = EwUser(member=clock_member)
                    if (isFurnished == False or
                        ("apt" in clock_player.poi and clock_player.visiting
                         == "empty")) and clock_member:
                        try:
                            await fe_utils.send_message(
                                client, clock_member,
                                fe_utils.formatMessage(
                                    clock_member,
                                    "BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP"
                                ))
                        except:
                            ewutils.logMsg(
                                "failed to send alarm to user {}".format(
                                    clock_member.id))

        for brick in brickinv:
            brick_obj = EwItem(id_item=brick.get('id_item'))
            id_user = brick_obj.id_owner.replace("brickshit", "")
            print(id_user)
            brick_user = EwUser(id_server=id_server, id_user=id_user)
            brick_member = server.get_member(user_id=int(id_user))
            poi = poi_static.id_to_poi.get(brick_user.poi)
            channel_brick = fe_utils.get_channel(server, poi.channel)
            print('pass1')
            if brick_member != None:
                print('pass2')
                if brick_member:
                    print('pass3')
                    try:
                        await fe_utils.send_message(
                            client, channel_brick,
                            fe_utils.formatMessage(
                                brick_member,
                                "UUUUUUUUUUGGGGGGGGGGGGHHHHHHHHHHH... OOOOOOOOOOOOOOOOOAAAAAAAAAAAAAAAHHHHH th-tunk. You just shit a brick. Congratulations?"
                            ))
                        brick_obj.id_owner = poi.id_poi
                        brick_obj.item_props['furniture_name'] = 'brick'
                        brick_obj.persist()
                    except:
                        ewutils.logMsg(
                            "failed to shit brick on user {}".format(
                                brick_member.id))
Exemplo n.º 12
0
async def rent_time(id_server=None):
    try:
        conn_info = bknd_core.databaseConnect()
        conn = conn_info.get('conn')
        cursor = conn.cursor()
        client = ewutils.get_client()
        if id_server != None:
            # get all players with apartments. If a player is evicted, thir rent is 0, so this will not affect any bystanders.
            cursor.execute(
                "SELECT apartment.rent, users.id_user FROM users INNER JOIN apartment ON users.id_user=apartment.id_user WHERE users.id_server = %s AND apartment.id_server = %s AND apartment.rent > 0"
                .format(), (
                    id_server,
                    id_server,
                ))

            landowners = cursor.fetchall()

            for landowner in landowners:
                owner_id_user = int(landowner[1])
                owner_rent_price = landowner[0]

                user_data = EwUser(id_user=owner_id_user, id_server=id_server)
                user_poi = poi_static.id_to_poi.get(user_data.poi)
                poi = poi_static.id_to_poi.get(user_data.apt_zone)

                if owner_rent_price > user_data.slimecoin:

                    if (user_poi.is_apartment
                            and user_data.visiting == ewcfg.location_id_empty):
                        user_data.poi = user_data.apt_zone  # toss out player
                        user_data.persist()
                        server = ewcfg.server_list[user_data.id_server]
                        member_object = server.get_member(owner_id_user)

                        await ewrolemgr.updateRoles(client=client,
                                                    member=member_object)
                        player = EwPlayer(id_user=owner_id_user)
                        response = "{} just got evicted. Point and laugh, everyone.".format(
                            player.display_name)
                        await fe_utils.send_message(
                            client, fe_utils.get_channel(server, poi.channel),
                            response)

                    user_data = EwUser(id_user=owner_id_user,
                                       id_server=id_server)
                    user_apt = EwApartment(id_user=owner_id_user,
                                           id_server=id_server)
                    poi = poi_static.id_to_poi.get(user_data.apt_zone)

                    toss_items(id_user=str(user_data.id_user) + 'closet',
                               id_server=user_data.id_server,
                               poi=poi)
                    toss_items(id_user=str(user_data.id_user) + 'fridge',
                               id_server=user_data.id_server,
                               poi=poi)
                    toss_items(id_user=str(user_data.id_user) + 'decorate',
                               id_server=user_data.id_server,
                               poi=poi)

                    user_data.apt_zone = ewcfg.location_id_empty
                    user_data.persist()
                    user_apt.rent = 0
                    user_apt.poi = " "
                    user_apt.persist()

                    await toss_squatters(user_id=user_data.id_user,
                                         server_id=id_server)

                else:
                    user_data.change_slimecoin(
                        n=-owner_rent_price,
                        coinsource=ewcfg.coinsource_spending)
                    user_data.persist()
    finally:
        cursor.close()
        bknd_core.databaseClose(conn_info)
Exemplo n.º 13
0
async def battle_slimeoids(id_s1, id_s2, challengee_name, challenger_name,
                           channel, battle_type):
    # fetch slimeoid data
    challengee_slimeoid = EwSlimeoid(id_slimeoid=id_s1)
    challenger_slimeoid = EwSlimeoid(id_slimeoid=id_s2)

    client = ewutils.get_client()

    # calculate starting hp
    s1hpmax = 50 + (challengee_slimeoid.level * 20)
    s2hpmax = 50 + (challenger_slimeoid.level * 20)

    # calculate starting sap
    s1sapmax = challengee_slimeoid.level * 2
    s2sapmax = challenger_slimeoid.level * 2

    # initialize combat data for challengee
    s1_combat_data = EwSlimeoidCombatData(
        name=str(challengee_slimeoid.name),
        weapon=sl_static.offense_map.get(challengee_slimeoid.weapon),
        armor=sl_static.defense_map.get(challengee_slimeoid.armor),
        special=sl_static.special_map.get(challengee_slimeoid.special),
        legs=sl_static.mobility_map.get(challengee_slimeoid.legs),
        brain=sl_static.brain_map.get(challengee_slimeoid.ai),
        hue=hue_static.hue_map.get(challengee_slimeoid.hue),
        coating=challengee_slimeoid.coating,
        moxie=challengee_slimeoid.atk + 1,
        grit=challengee_slimeoid.defense + 1,
        chutzpah=challengee_slimeoid.intel + 1,
        hpmax=s1hpmax,
        hp=s1hpmax,
        sapmax=s1sapmax,
        sap=s1sapmax,
        slimeoid=challengee_slimeoid,
        owner=challengee_name,
    )

    # initialize combat data for challenger
    s2_combat_data = EwSlimeoidCombatData(
        name=str(challenger_slimeoid.name),
        weapon=sl_static.offense_map.get(challenger_slimeoid.weapon),
        armor=sl_static.defense_map.get(challenger_slimeoid.armor),
        special=sl_static.special_map.get(challenger_slimeoid.special),
        legs=sl_static.mobility_map.get(challenger_slimeoid.legs),
        brain=sl_static.brain_map.get(challenger_slimeoid.ai),
        hue=hue_static.hue_map.get(challenger_slimeoid.hue),
        coating=challenger_slimeoid.coating,
        moxie=challenger_slimeoid.atk + 1,
        grit=challenger_slimeoid.defense + 1,
        chutzpah=challenger_slimeoid.intel + 1,
        hpmax=s2hpmax,
        hp=s2hpmax,
        sapmax=s2sapmax,
        sap=s2sapmax,
        slimeoid=challenger_slimeoid,
        owner=challenger_name,
    )

    s1_combat_data.apply_weapon_matchup(s2_combat_data)
    s2_combat_data.apply_weapon_matchup(s1_combat_data)

    s1_combat_data.apply_hue_matchup(s2_combat_data)
    s2_combat_data.apply_hue_matchup(s1_combat_data)

    # decide which slimeoid gets to move first
    s1_active = False
    in_range = False

    if challengee_slimeoid.defense > challenger_slimeoid.defense:
        s1_active = True
    elif challengee_slimeoid.defense == challenger_slimeoid.defense:
        coinflip = random.randrange(1, 3)
        if coinflip == 1:
            s1_active = True

    # flavor text for arena battles
    if battle_type == ewcfg.battle_type_arena:
        response = "**{} sends {} out into the Battle Arena!**".format(
            challenger_name, s2_combat_data.name)
        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(1)
        response = "**{} sends {} out into the Battle Arena!**".format(
            challengee_name, s1_combat_data.name)
        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(1)
        response = "\nThe crowd erupts into cheers! The battle between {} and {} has begun! :crossed_swords:".format(
            s1_combat_data.name, s2_combat_data.name)
        #		response += "\n{} {} {} {} {} {}".format(str(s1moxie),str(s1grit),str(s1chutzpah),str(challengee_slimeoid.weapon),str(challengee_slimeoid.armor),str(challengee_slimeoid.special))
        #		response += "\n{} {} {} {} {} {}".format(str(s2moxie),str(s2grit),str(s2chutzpah),str(challenger_slimeoid.weapon),str(challenger_slimeoid.armor),str(challenger_slimeoid.special))
        #		response += "\n{}, {}".format(str(challengee_resistance),str(challengee_weakness))
        #		response += "\n{}, {}".format(str(challenger_resistance),str(challenger_weakness))
        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(3)

    turncounter = 100
    # combat loop
    while s1_combat_data.hp > 0 and s2_combat_data.hp > 0 and turncounter > 0:
        # Limit the number of turns in battle.
        turncounter -= 1

        response = ""
        battlecry = random.randrange(1, 4)

        first_turn = (turncounter % 2) == 1

        # slimeoids regenerate their sap every odd turn
        if first_turn:
            s1_combat_data.sap = s1_combat_data.sapmax - s1_combat_data.hardened_sap
            s2_combat_data.sap = s2_combat_data.sapmax - s2_combat_data.hardened_sap

        # assign active and passive role for the turn
        if s1_active:
            active_data = s1_combat_data
            passive_data = s2_combat_data
        else:
            active_data = s2_combat_data
            passive_data = s1_combat_data

        # obtain action and how much sap to spend on it for both slimeoids
        active_strat, active_sap_spend = active_data.brain.get_strat(
            combat_data=active_data,
            active=True,
            in_range=in_range,
            first_turn=first_turn)
        passive_strat, passive_sap_spend = passive_data.brain.get_strat(
            combat_data=passive_data,
            active=False,
            in_range=in_range,
            first_turn=first_turn)

        # potentially add brain-based flavor text
        if active_strat == ewcfg.slimeoid_strat_attack and battlecry == 1:
            if (active_data.hpmax / active_data.hp) > 3:
                response = active_data.brain.str_battlecry_weak.format(
                    slimeoid_name=active_data.name)
            else:
                response = active_data.brain.str_battlecry.format(
                    slimeoid_name=active_data.name)
            await fe_utils.send_message(client, channel, response)
            await asyncio.sleep(1)

        elif active_strat == ewcfg.slimeoid_strat_evade and battlecry == 1:
            if (active_data.hpmax / active_data.hp) > 3:
                response = active_data.brain.str_movecry_weak.format(
                    slimeoid_name=active_data.name)
            else:
                response = active_data.brain.str_movecry.format(
                    slimeoid_name=active_data.name)
            await fe_utils.send_message(client, channel, response)
            await asyncio.sleep(1)

        # announce active slimeoid's chosen action
        response = ""
        if active_strat == ewcfg.slimeoid_strat_attack:
            if in_range:
                response = "{} attempts to strike {} in close combat!".format(
                    active_data.name, passive_data.name)
            else:
                response = "{} attempts to strike {} from a distance!".format(
                    active_data.name, passive_data.name)

        elif active_strat == ewcfg.slimeoid_strat_evade:
            if in_range:
                response = "{} attempts to avoid being hit, while gaining distance from {}.".format(
                    active_data.name, passive_data.name)
            else:
                response = "{} attempts to avoid being hit, while closing the distance to {}.".format(
                    active_data.name, passive_data.name)

        elif active_strat == ewcfg.slimeoid_strat_block:
            response = "{} focuses on blocking incoming attacks.".format(
                active_data.name)

        response += " (**{} sap**)".format(active_sap_spend)

        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(1)

        # announce passive slimeoid's chosen action
        response = ""
        if passive_strat == ewcfg.slimeoid_strat_attack:
            if in_range:
                response = "{} attempts to strike {} in close combat!".format(
                    passive_data.name, active_data.name)
            else:
                response = "{} attempts to strike {} from a distance!".format(
                    passive_data.name, active_data.name)

        elif passive_strat == ewcfg.slimeoid_strat_evade:
            if in_range:
                response = "{} attempts to avoid being hit, while gaining distance from {}.".format(
                    passive_data.name, active_data.name)
            else:
                response = "{} attempts to avoid being hit, while closing the distance to {}.".format(
                    passive_data.name, active_data.name)

        elif passive_strat == ewcfg.slimeoid_strat_block:
            response = "{} focuses on blocking incoming attacks.".format(
                passive_data.name)

        response += " (**{} sap**)".format(passive_sap_spend)

        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(1)

        # if the chosen actions are in direct competition, the roll is opposed. only one of them can succeed
        # otherwise both actions are resolved separately
        roll_opposed = False

        if active_strat == ewcfg.slimeoid_strat_attack:
            roll_opposed = passive_strat in [
                ewcfg.slimeoid_strat_evade, ewcfg.slimeoid_strat_block
            ]
        elif active_strat == ewcfg.slimeoid_strat_evade:
            roll_opposed = passive_strat in [
                ewcfg.slimeoid_strat_attack, ewcfg.slimeoid_strat_evade
            ]
        elif active_strat == ewcfg.slimeoid_strat_block:
            roll_opposed = passive_strat in [ewcfg.slimeoid_strat_attack]

        active_dos = active_data.attempt_action(strat=active_strat,
                                                sap_spend=active_sap_spend,
                                                in_range=in_range)

        # simultaneous attacks are a special case. the passive slimeoid only rolls the dice, after the active slimeoid's attack has been resolved
        if passive_strat != ewcfg.slimeoid_strat_attack:
            passive_dos = passive_data.attempt_action(
                strat=passive_strat,
                sap_spend=passive_sap_spend,
                in_range=in_range)
            if roll_opposed:
                active_dos -= passive_dos
                passive_dos = -active_dos

                # on an opposed roll, priority for the next turn (the active role) is passed to the winner of the roll
                if active_dos < 0:
                    s1_active = not s1_active
        else:
            passive_dos = 0

        # resolve active slimeoid's attack
        if active_strat == ewcfg.slimeoid_strat_attack:
            # the attack was successful
            if active_dos > 0:
                # calculate damage
                if in_range:
                    damage = int(active_dos * 30 /
                                 (passive_data.hardened_sap + 1))
                else:
                    damage = int(active_dos * 20)

                response = active_data.execute_attack(passive_data, damage,
                                                      in_range)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

                response = passive_data.take_damage(active_data, damage,
                                                    active_dos, in_range)
                if len(response) > 0:
                    await fe_utils.send_message(client, channel, response)
                    await asyncio.sleep(1)

            elif not roll_opposed:
                response = "{} whiffs its attack!".format(active_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)
            elif passive_strat == ewcfg.slimeoid_strat_evade:
                response = "{} dodges {}'s attack!".format(
                    passive_data.name, active_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)
            elif passive_strat == ewcfg.slimeoid_strat_block:
                response = "{} blocks {}'s attack!".format(
                    passive_data.name, active_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # if the active slimeoid's attack killed the passive slimeoid
        if passive_data.hp <= 0:
            break

        if passive_strat == ewcfg.slimeoid_strat_attack:
            passive_dos = passive_data.attempt_action(
                strat=passive_strat,
                sap_spend=passive_sap_spend,
                in_range=in_range)

            if roll_opposed:
                active_dos -= passive_dos
                passive_dos = -active_dos

                if active_dos < 0:
                    s1_active = not s1_active

        # resolve passive slimeoid's attack
        if passive_strat == ewcfg.slimeoid_strat_attack:
            # attack was successful
            if passive_dos > 0:
                # calculate damage
                if in_range:
                    damage = int(passive_dos * 30 /
                                 (active_data.hardened_sap + 1))
                else:
                    damage = int(passive_dos * 20)

                response = passive_data.execute_attack(active_data, damage,
                                                       in_range)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

                response = active_data.take_damage(passive_data, damage,
                                                   passive_dos, in_range)
                if len(response) > 0:
                    await fe_utils.send_message(client, channel, response)
                    await asyncio.sleep(1)

            elif not roll_opposed:
                response = "{} whiffs its attack!".format(passive_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)
            elif active_strat == ewcfg.slimeoid_strat_evade:
                response = "{} dodges {}'s attack!".format(
                    active_data.name, passive_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)
            elif active_strat == ewcfg.slimeoid_strat_block:
                response = "{} blocks {}'s attack!".format(
                    active_data.name, passive_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # resolve active slimeoid's movement
        if active_strat == ewcfg.slimeoid_strat_evade:
            if active_dos > 0:
                response = active_data.change_distance(passive_data, in_range)
                in_range = not in_range
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)
            elif active_dos == 0 and passive_strat == ewcfg.slimeoid_strat_evade:
                in_range = not in_range
                response = "{} and {} circle each other, looking for an opening...".format(
                    active_data.name, passive_data.name)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # resolve active slimeoid's defense
        if active_strat == ewcfg.slimeoid_strat_block:
            if active_dos > 0:
                response = active_data.harden_sap(active_dos)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # resolve passive slimeoid's movement
        if passive_strat == ewcfg.slimeoid_strat_evade:
            if passive_dos > 0:
                response = passive_data.change_distance(active_data, in_range)
                in_range = not in_range
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # resolve passive slimeoid's defense
        if passive_strat == ewcfg.slimeoid_strat_block:
            if passive_dos > 0:
                response = passive_data.harden_sap(passive_dos)
                await fe_utils.send_message(client, channel, response)
                await asyncio.sleep(1)

        # re-fetch slimeoid data
        challenger_slimeoid = EwSlimeoid(id_slimeoid=id_s2)
        challengee_slimeoid = EwSlimeoid(id_slimeoid=id_s1)

        s1_combat_data.slimeoid = challengee_slimeoid
        s2_combat_data.slimeoid = challenger_slimeoid

        # Check if slimeoids have died during the fight
        if challenger_slimeoid.life_state == ewcfg.slimeoid_state_dead:
            s2_combat_data.hp = 0
        elif challengee_slimeoid.life_state == ewcfg.slimeoid_state_dead:
            s1_combat_data.hp = 0

        await asyncio.sleep(2)

    # the challengee has lost
    if s1_combat_data.hp <= 0:
        result = 1
        response = "\n" + s1_combat_data.legs.str_defeat.format(
            slimeoid_name=s1_combat_data.name)
        response += " {}".format(ewcfg.emote_slimeskull)
        response += "\n" + s2_combat_data.brain.str_victory.format(
            slimeoid_name=s2_combat_data.name)

        challenger_slimeoid = EwSlimeoid(id_slimeoid=id_s2)
        challengee_slimeoid = EwSlimeoid(id_slimeoid=id_s1)

        # Losing slimeoid loses clout and has a time_defeated cooldown.
        if channel.name == ewcfg.channel_arena:
            challengee_slimeoid.clout = calculate_clout_loss(
                challengee_slimeoid.clout)
            challengee_slimeoid.time_defeated = int(time.time())
            challengee_slimeoid.persist()

        if channel.name == ewcfg.channel_arena:
            challenger_slimeoid.clout = calculate_clout_gain(
                challenger_slimeoid.clout)
            challenger_slimeoid.persist()

        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(2)
    # the challenger has lost
    else:
        result = -1
        response = "\n" + s2_combat_data.legs.str_defeat.format(
            slimeoid_name=s2_combat_data.name)
        response += " {}".format(ewcfg.emote_slimeskull)
        response += "\n" + s1_combat_data.brain.str_victory.format(
            slimeoid_name=s1_combat_data.name)

        challenger_slimeoid = EwSlimeoid(id_slimeoid=id_s2)
        challengee_slimeoid = EwSlimeoid(id_slimeoid=id_s1)

        # store defeated slimeoid's defeat time in the database
        if channel.name == ewcfg.channel_arena:
            challenger_slimeoid.clout = calculate_clout_loss(
                challenger_slimeoid.clout)
            challenger_slimeoid.time_defeated = int(time.time())
            challenger_slimeoid.persist()

        if channel.name == ewcfg.channel_arena:
            challengee_slimeoid.clout = calculate_clout_gain(
                challengee_slimeoid.clout)
            challengee_slimeoid.persist()

        await fe_utils.send_message(client, channel, response)
        await asyncio.sleep(2)
    return result
Exemplo n.º 14
0
async def handle_hourly_events(id_server=None):
    if id_server != None:
        client = ewutils.get_client()
        server = client.get_guild(id_server)
        time_current = EwMarket(id_server=id_server).clock

        events = bknd_event.get_world_events(id_server, True)
        for we_id, we_type in events.items():
            if we_type in ewcfg.hourly_events:
                we = EwWorldEvent(id_event=we_id)
                if we.event_props.get("time") == str(time_current):
                    # Handle brickshitting code
                    if we_type == ewcfg.event_type_brickshit:

                        brick_obj = EwItem(
                            id_item=we.event_props.get("brick_id"))
                        id_user = brick_obj.id_owner.replace("stomach", "")
                        brick_user = EwUser(id_server=id_server,
                                            id_user=id_user)
                        brick_member = server.get_member(user_id=int(id_user))
                        poi = poi_static.id_to_poi.get(brick_user.poi)
                        channel_brick = fe_utils.get_channel(
                            server, poi.channel)
                        if brick_member:
                            try:
                                await fe_utils.send_message(
                                    client, channel_brick,
                                    fe_utils.formatMessage(
                                        brick_member,
                                        "UUUUUUUUUUGGGGGGGGGGGGHHHHHHHHHHH... OOOOOOOOOOOOOOOOOAAAAAAAAAAAAAAAHHHHH th-tunk. You just shit a brick. Congratulations?"
                                    ))
                                brick_obj.id_owner = poi.id_poi
                                brick_obj.item_props[
                                    'furniture_name'] = 'brick'
                                brick_obj.persist()
                            except:
                                ewutils.logMsg(
                                    "failed to shit brick on user {}".format(
                                        brick_member.id))
                            else:
                                bknd_event.delete_world_event(we_id)

                    # Handle alarm clock code
                    elif we_type == ewcfg.event_type_alarmclock:
                        clock_obj = EwItem(
                            id_item=we.event_props.get("clock_id"))
                        if "decorate" in clock_obj.id_owner:
                            isFurnished = True
                        clock_user = clock_obj.id_owner.replace("decorate", "")
                        clock_member = server.get_member(user_id=clock_user)
                        if clock_member != None:
                            clock_player = EwUser(member=clock_member)
                            if (isFurnished == False or
                                ("apt" in clock_player.poi
                                 and clock_player.visiting
                                 == "empty")) and clock_member:
                                try:
                                    await fe_utils.send_message(
                                        client, clock_member,
                                        fe_utils.formatMessage(
                                            clock_member,
                                            "BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP BLAAAP"
                                        ))
                                except:
                                    ewutils.logMsg(
                                        "failed to send alarm to user {}".
                                        format(clock_member.id))
Exemplo n.º 15
0
async def slap(cmd):
    if ewutils.channel_name_is_poi(cmd.message.channel.name) == False:
        return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, "You must {} in a zone's channel.".format(cmd.tokens[0])))

    time_now = int(time.time())
    user_data = EwUser(member=cmd.message.author)

    user_poi = poi_static.id_to_poi.get(user_data.poi)

    target_data = -1

    mutations = user_data.get_mutations()
    resp_cont = EwResponseContainer(id_server=cmd.guild.id)

    if cmd.tokens_count < 3:
        response = "You'll need to specify who and where you're slapping. Try !slap <target> <location>."
        return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))

    dest_poi = cmd.tokens[2].lower()
    dest_poi_obj = poi_static.id_to_poi.get(dest_poi)

    response = ""

    if cmd.mentions_count == 0:
        response = "Who are you slapping?"
    elif cmd.mentions_count > 1:
        response = "Nobody's that good at slapping. Do it to one person at a time."
    else:
        target_data = EwUser(member=cmd.mentions[0])

    if response != "":
        return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))

    if target_data.poi != user_data.poi:
        response = "Not right now. You can't slap what you can't see."
    elif user_data.id_user == target_data.id_user:
        response = "Stop hitting yourself."
    elif ewutils.active_restrictions.get(target_data.id_user) != None and ewutils.active_restrictions.get(target_data.id_user) > 0:
        response = "They're in the middle of something, be patient."
    elif target_data.life_state == ewcfg.life_state_corpse:
        response = "You give {} a good whack. They're a ghost though, so your hand passes straight through.".format(cmd.mentions[0].display_name)
    elif ewcfg.mutation_id_ditchslap not in mutations:
        response = "You wind up your good arm and tacoom {} hard in the {}. The air gets knocked out of them but they stay firmly in place.".format(cmd.mentions[0].display_name, random.choice(['face', 'face', 'face', 'ass']))
    else:
        mutation_data = EwMutation(id_mutation=ewcfg.mutation_id_ditchslap, id_user=cmd.message.author.id, id_server=cmd.message.guild.id)

        if len(mutation_data.data) > 0:
            time_lastuse = int(mutation_data.data)
        else:
            time_lastuse = 0

        if dest_poi_obj.id_poi not in user_poi.neighbors.keys():
            response = "You can't hit them that far."
        elif move_utils.inaccessible(user_data=target_data, poi=dest_poi_obj):
            response = "That place is locked up good. You can't get a good launch angle to send them there."
        # elif time_lastuse + 180 * 60 > time_now:
        # response = "Your arm is spent from the last time you obliterated someone. Try again in {} minutes.".format(math.ceil((time_lastuse + 180*60 - time_now)/60))
        elif user_data.faction != target_data.faction:
            response = "You try to slap {}, but they realize what you're doing and jump back. Welp, back to the drawing board.".format(cmd.mentions[0].display_name)
        elif user_poi.id_poi in [ewcfg.poi_id_rowdyroughhouse, ewcfg.poi_id_copkilltown] or user_poi.is_apartment:
            response = "They're currently in their room. You'd have to carry {} out of it to slap them, which would be gay.".format(cmd.mentions[0].display_name)
        elif ewcfg.status_slapped_id in target_data.getStatusEffects():
            response = "Don't turn this into domestic abuse now. Can't you see they're still reeling from the last time?"
        elif (ewutils.clenched.get(target_data.id_user) == None or ewutils.clenched.get(target_data.id_user) == 0) and (user_poi.is_subzone or user_poi.is_district):
            response = "You wind up your slappin' hand and take a swing, but {} is all relaxed and you can't get a good angle. They end up flying into the wall. Better not touch people who aren't prepared to get hit...".format(cmd.mentions[0].display_name)
        else:
            response = "You wind up your slap. This one's gonna hurt. Steady as she goes...WHAM! {} is sent flying helplessly into {}!".format(cmd.mentions[0].display_name, dest_poi_obj.str_name)
            target_data.applyStatus(id_status=ewcfg.status_slapped_id)
            dm_response = "WHAP! {} smacked you into {}!".format(cmd.message.author.display_name, dest_poi_obj.str_name)
            target_response = "**CRAAAAAAAAAAAASH!** You arrive in {}!".format(dest_poi_obj.str_name)
            ewutils.moves_active[cmd.message.author.id] = 0
            target_data.poi = dest_poi_obj.id_poi
            user_data.time_lastenter = int(time.time())

            mutation_data.data = str(time_now)
            mutation_data.persist()

            if target_data.poi == ewcfg.poi_id_thesewers:
                target_data.die(cause=ewcfg.cause_suicide)
                target_response += " But you hit your head really hard! Your precious little dome explodes into bits and pieces and you die!"

            user_data.persist()

            await ewrolemgr.updateRoles(client=ewutils.get_client(), member=cmd.mentions[0], new_poi=target_data.poi)
            target_data.persist()

            await user_data.move_inhabitants(id_poi=dest_poi_obj.id_poi)

            await prank_utils.activate_trap_items(dest_poi_obj.id_poi, user_data.id_server, target_data.id_user)

            await fe_utils.send_message(cmd.client, cmd.mentions[0], fe_utils.formatMessage(cmd.mentions[0], dm_response))
            await fe_utils.send_message(cmd.client, fe_utils.get_channel(server=cmd.mentions[0].guild, channel_name=dest_poi_obj.channel), fe_utils.formatMessage(cmd.mentions[0], target_response))

    return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))