Пример #1
0
async def waft(cmd):
    user_data = EwUser(member=cmd.message.author)
    mutations = user_data.get_mutations()
    if ewcfg.mutation_id_aposematicstench not in mutations:
        response = "You stink, but not that badly. Get Aposematic Stench before you try that."
    else:
        user_data.applyStatus(ewcfg.status_repelled_id)
        response = "You clench as hard as you can, and your pores excrete a mushroom cloud of pure, olive green musk. It's so caustic you might not have eyebrows anymore. You should be immune from monsters, though!"

    return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
Пример #2
0
async def hogtie(cmd):
    if not cmd.message.author.guild_permissions.administrator:
        return await cmd_utils.fake_failed_command(cmd)
    else:
        if cmd.mentions_count == 1:
            target_data = EwUser(member=cmd.mentions[0])
            target_status = target_data.getStatusEffects()
            if ewcfg.status_hogtied_id in target_status:
                target_data.clear_status(id_status=ewcfg.status_hogtied_id)
                response = "Whew-whee! She's buckin' so we gotta let 'er go."
                await fe_utils.send_message(
                    cmd.client, cmd.message.channel,
                    fe_utils.formatMessage(cmd.message.author, response))
            else:
                target_data.applyStatus(ewcfg.status_hogtied_id)
                response = "Boy howdy! Looks like we lasso'd up a real heifer there! A dang ol' big'un."
                await fe_utils.send_message(
                    cmd.client, cmd.message.channel,
                    fe_utils.formatMessage(cmd.message.author, response))
Пример #3
0
async def revive(cmd, player_auto=None):
    time_now = int(time.time())
    response = ""

    if cmd.message.channel.name != ewcfg.channel_endlesswar and cmd.message.channel.name != ewcfg.channel_sewers and player_auto is None:
        response = "Come to me. I hunger. #{}.".format(ewcfg.channel_sewers)
    else:
        if player_auto:
            player_data = EwUser(id_server=cmd.guild.id, id_user=player_auto)
        else:
            player_data = EwUser(member=cmd.message.author)

        # time_until_revive = (player_data.time_lastdeath + 600) - time_now
        time_until_revive = (player_data.time_lastdeath) - time_now

        if time_until_revive > 0 and player_auto is None:
            response = "ENDLESS WAR is not ready to {} you yet ({}s).".format(
                cmd.tokens[0], time_until_revive)
            return await fe_utils.send_message(
                cmd.client, cmd.message.channel,
                fe_utils.formatMessage(cmd.message.author, response))

        slimeoid = EwSlimeoid(member=cmd.message.author)

        if player_data.life_state == ewcfg.life_state_corpse:
            market_data = EwMarket(id_server=cmd.guild.id)

            # Endless War collects his fee.
            # fee = (player_data.slimecoin / 10)
            # player_data.change_slimecoin(n = -fee, coinsource = ewcfg.coinsource_revival)
            # market_data.slimes_revivefee += fee
            # player_data.busted = False

            # Preserve negaslime
            if player_data.slimes < 0:
                # market_data.negaslime += player_data.slimes
                player_data.change_slimes(n=-player_data.slimes)  # set to 0

            # reset slimelevel to zero
            player_data.slimelevel = 0

            # Set time of last revive. This used to provied spawn protection, but currently isn't used.
            player_data.time_lastrevive = time_now

            if False:  #player_data.degradation >= 100:
                player_data.life_state = ewcfg.life_state_shambler
                player_data.change_slimes(n=0.5 * ewcfg.slimes_shambler)
                player_data.trauma = ""
                poi_death = poi_static.id_to_poi.get(player_data.poi_death)
                if move_utils.inaccessible(poi=poi_death,
                                           user_data=player_data):
                    player_data.poi = ewcfg.poi_id_endlesswar
                else:
                    player_data.poi = poi_death.id_poi
            else:
                # Set life state. This is what determines whether the player is actually alive.
                player_data.life_state = ewcfg.life_state_juvenile
                # Give player some initial slimes.
                player_data.change_slimes(n=ewcfg.slimes_onrevive)
                # Get the player out of the sewers.
                player_data.poi = ewcfg.poi_id_endlesswar

            # Give newly spawned juvies a foul odour
            player_data.applyStatus(ewcfg.status_repelled_id)

            player_data.persist()
            market_data.persist()

            # Shower every district in the city with slime from the sewers.
            sewer_data = EwDistrict(district=ewcfg.poi_id_thesewers,
                                    id_server=cmd.guild.id)
            # the amount of slime showered is divided equally amongst the districts
            districts_amount = len(poi_static.capturable_districts)
            geyser_amount = int(0.5 * sewer_data.slimes / districts_amount)
            # Get a list of all the districts
            for poi in poi_static.capturable_districts:
                district_data = EwDistrict(district=poi,
                                           id_server=cmd.guild.id)

                district_data.change_slimes(n=geyser_amount)
                sewer_data.change_slimes(n=-1 * geyser_amount)

                district_data.persist()
                sewer_data.persist()

            sewer_inv = bknd_item.inventory(id_user=sewer_data.name,
                                            id_server=sewer_data.id_server)
            for item in sewer_inv:
                district = ewcfg.poi_id_slimesea
                if random.random() < 0.5:
                    district = random.choice(poi_static.capturable_districts)
                bknd_item.give_item(id_item=item.get("id_item"),
                                    id_user=district,
                                    id_server=sewer_data.id_server)

            await ewrolemgr.updateRoles(client=cmd.client,
                                        member=cmd.message.author)

            response = '{slime4} Geysers of fresh slime erupt from every manhole in the city, showering their surrounding districts. {slime4} {name} has been reborn in slime. {slime4}'.format(
                slime4=ewcfg.emote_slime4,
                name=cmd.message.author.display_name)
        else:
            response = 'You\'re not dead just yet.'

        #	deathreport = "You were {} by {}. {}".format(kill_descriptor, cmd.message.author.display_name, ewcfg.emote_slimeskull)
        #	deathreport = "{} ".format(ewcfg.emote_slimeskull) + fe_utils.formatMessage(member, deathreport)

        if slimeoid.life_state == ewcfg.slimeoid_state_active:
            reunite = ""
            brain = sl_static.brain_map.get(slimeoid.ai)
            reunite += brain.str_revive.format(slimeoid_name=slimeoid.name)
            new_poi = poi_static.id_to_poi.get(player_data.poi)
            revivechannel = fe_utils.get_channel(cmd.guild, new_poi.channel)
            reunite = fe_utils.formatMessage(cmd.message.author, reunite)
            await fe_utils.send_message(cmd.client, revivechannel, reunite)

    # Send the response to the player.
    await fe_utils.send_message(
        cmd.client, cmd.message.channel,
        fe_utils.formatMessage(cmd.message.author, response))
Пример #4
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))