async def yiff(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.race == ewcfg.race_furry: if cmd.mentions_count == 1: target_data = EwUser(member=cmd.mentions[0]) if target_data.race == ewcfg.race_furry: poi = poi_static.id_to_poi.get(user_data.poi) if (target_data.poi == user_data.poi) and poi.is_apartment: # low effort responses = [ "Wow.", "Mhmm.", "You yiff.", "Yikes.", "🤮", "Yup." "Congratulations." ] response = random.choice(responses) else: response = "Out here, in the streets? F**k no, what's wrong with you?" else: response = "Only furries can yiff, better find another partner." pass elif cmd.mentions_count == 0: response = "You can't yiff by yourself." elif cmd.mentions_count > 1: response = "The world is not prepared for a furry orgy." else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
async def set_pen_name(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state == ewcfg.life_state_shambler: 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)) poi = poi_static.id_to_poi.get(user_data.poi) if not poi.write_manuscript: response = "You'd love to work on your zine, however your current location doesn't strike you as a particularly good place to write. Try heading over the the Cafe, the Comic Shop, or one of the colleges (NLACU/NMS)." elif user_data.hunger >= user_data.get_hunger_max() and user_data.life_state != ewcfg.life_state_corpse: response = "You are just too hungry to alter the pen name of your masterpiece!" elif user_data.manuscript == -1: response = "You have yet to create a manuscript. Try !createmanuscript" else: book = EwBook(member=cmd.message.author, book_state=0) if book.author != cmd.message.author.display_name: book.author = cmd.message.author.display_name book.persist() response = "You scratch out the author name and scrawl \"{}\" under it.".format(book.author) else: response = "If you would like to change your pen name, you must change your nickname." await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def set_title(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state == ewcfg.life_state_shambler: 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)) title = cmd.message.content[(len(cmd.tokens[0])):].strip() poi = poi_static.id_to_poi.get(user_data.poi) if not poi.write_manuscript: response = "You'd love to work on your zine, however your current location doesn't strike you as a particularly good place to write. Try heading over the the Cafe, the Comic Shop, or one of the colleges (NLACU/NMS)." elif user_data.hunger >= user_data.get_hunger_max() and user_data.life_state != ewcfg.life_state_corpse: response = "You are just too hungry to alter the title of your masterpiece!" elif user_data.manuscript == -1: response = "You have yet to create a manuscript. Try !createmanuscript" elif title == "": response = "Please specify the title you want to change it to." elif len(title) > 50: response = "Alright buddy, reel it in. That title is just too long. ({:,}/50)".format(len(title)) else: book = EwBook(member=cmd.message.author, book_state=0) book.title = title book.persist() response = "You scratch out the title and scrawl \"{}\" over it.".format(book.title) await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def shakeoff(cmd): user_data = EwUser(member=cmd.message.author) if cmd.mentions_count == 0: response = "God knows there are like a million third eyes floating around. You'll have to specify whose you're looking for." elif cmd.mentions_count > 1: response = "You're not that good at finding private eyes. Look for one at a time." else: target_data = EwUser(member=cmd.mentions[0]) try: bknd_core.execute_sql_query( "UPDATE mutations SET {data} = %s WHERE {id_server} = %s AND {mutation} = %s and {id_user} = %s;".format( data=ewcfg.col_mutation_data, id_server=ewcfg.col_id_server, id_user=ewcfg.col_id_user, mutation=ewcfg.col_id_mutation, ), ( "", user_data.id_server, ewcfg.mutation_id_oneeyeopen, target_data.id_user )) response = "You search high and low for {}'s third eye, shouting a bit to give it a good scare. If it was stalking you it certainly isn't now.".format(cmd.mentions[0].display_name) except: ewutils.logMsg("Failed to undo tracking for {}.".format(user_data.id_user)) response = "" return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def hailcab(cmd): user_data = EwUser(member = cmd.message.author) blockstate = EwGamestate(id_server=cmd.guild.id, id_state='blockparty') poi = ''.join([i for i in blockstate.value if not i.isdigit()]) if poi == 'outsidethe': poi = ewcfg.poi_id_711 if poi != user_data.poi: response = "You can't hail a cab right now. All the cabbies are hiding for cover thanks to all the violence. Good job on that, by the way." else: if user_data.life_state in [ewcfg.life_state_enlisted, ewcfg.life_state_juvenile]: if user_data.faction == ewcfg.faction_rowdys and user_data.life_state == ewcfg.life_state_enlisted: dest = ewcfg.poi_id_rowdyroughhouse elif user_data.faction == ewcfg.faction_killers and user_data.life_state == ewcfg.life_state_enlisted: dest = ewcfg.poi_id_copkilltown else: dest = ewcfg.poi_id_juviesrow await asyncio.sleep(5) response = "**TAXI!** You shout into the crowd for a ride home. The drivers don't notice you're a miscreant, and pick you up without a second thought. They got nervous when you asked to return to your gang base, and forgot to ask for any fare. Nice!" await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) ewutils.moves_active[cmd.message.author.id] = 0 user_data.poi = dest user_data.persist() await ewrolemgr.updateRoles(client=cmd.client, member=cmd.message.author) return await user_data.move_inhabitants(id_poi=dest, visitor=user_data.id_user) elif user_data.life_state == ewcfg.life_state_corpse: response = "You're already dead. The cabbies unfortunately tend to avoid black people, so you should probably just float back to the sewers." else: response = "The cabbie looks confused. Why would a person like you need a cab?" return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def confuse(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.race == ewcfg.race_other: if cmd.mentions_count == 0: if random.randrange(20) == 0: response = "ENDLESS WAR takes a cursory glance at you. It still doesn't know what the f**k you are." else: response = "You confuse yourself. What?" if cmd.mentions_count > 1: response = "The crowd looks at you, winces slightly, and looks away." if cmd.mentions_count == 1: target_member = cmd.mentions[0] target_data = EwUser(member=target_member) if target_data.race == ewcfg.race_other: response = "You and {} actually understand each other in a way, despite your differences.".format( target_member.display_name) else: responses = [ "{} doesn't know what on earth they're looking at.".format( target_member.display_name), "{} stares at you, expressionless, then turns away.". format(target_member.display_name), "{} gets a little dizzy from staring at you for too long.". format(target_member.display_name), "{} wonders how you're even alive. Are you?".format( target_member.display_name), "{} has seen some shit. Now they've seen some more.". format(target_member.display_name) ] response = random.choice(responses) else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
def get_soul_collection(id_item, id_server): item = EwItem(id_item=id_item) if 'decorate' not in str(item.id_owner): return 'It\'s a soul cylinder. You can\'t really tell whose soul is whose. You\'ve been carrying this thing around and all the souls are jostled and queasy.' id_item_col = "{}collection".format(id_item) soul_inv = bknd_item.inventory(id_server=id_server, id_user=id_item_col) if len(soul_inv) == 0: return "No souls. Just ask anyone." response = "You look into the cylinder to check how the souls are doing.\n\n" for soul in soul_inv: soul_item = EwItem(id_item=soul.get('id_item')) soul_user = EwUser(id_server=id_server, id_user=soul_item.item_props.get('user_id')) if soul_user.race is None or soul_user.race == '': soul_user.race = ewcfg.race_humanoid #do not persist this! soul_text = ewcfg.defined_races.get( soul_user.race).get('soul_behavior') soul_name = soul_item.item_props.get('cosmetic_name') response += "{} {}\n".format(soul_name, soul_text) return response
async def exec_mutations(cmd): user_data = EwUser(member=cmd.message.author) if cmd.mentions_count == 1: user_data = EwUser(member=cmd.mentions[0]) status = user_data.getStatusEffects() if ewcfg.status_n1 in status: response = "They fight without expending themselves due to **Perfection**. They're precise even without a target due to **Indiscriminate Rage**. They're hard to fell and cut deep due to **Monolith Body**. They are immaculate and unaging due to **Immortality**." elif ewcfg.status_n2 in status: response = "They have unparalleled coordination, speed and reaction time due to **F****d Out**. They prioritize best-in-breed productivity and physical enhancement synergy due to **Market Efficiency**. They can take the heat due to **Kevlar Attire**." elif ewcfg.status_n4 in status: response = "They are capable of murder by machine due to **Napalm Hacker**. Their hiding spot evades you due to **Super Amnesia**." elif ewcfg.status_n8 in status: response = "They take advantage of your moments of weakness due to **Opportunist**. They prioritize best-in-breed productivity and physical enhancement synergy due to **Market Efficiency**. They can take the heat due to **Kevlar Attire**." elif ewcfg.status_n11 in status: response = "They command a crowd through fear and punishment due to **Unnatural Intimidation**. They take advantage of your moments of weakness due to **Opportunist**. They prioritize best-in-breed productivity and physical enhancement synergy due to **Market Efficiency**. They can take the heat due to **Kevlar Attire**." elif ewcfg.status_n12 in status: response = "Their body holds untold numbers of quirks and perks due to **Full Aberrant**. They take advantage of your moments of weakness due to **Opportunist**. They prioritize best-in-breed productivity and physical enhancement synergy due to **Market Efficiency**. They can take the heat due to **Kevlar Attire**." elif ewcfg.status_n13 in status: response = "They are prone to explosive entries due to **Tantrum**. They take advantage of your moments of weakness due to **Opportunist**. They prioritize best-in-breed productivity and physical enhancement synergy due to **Market Efficiency**. They can take the heat due to **Kevlar Attire**." elif user_data.life_state == ewcfg.life_state_lucky: response = "They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. They are extremely fortunate due to **Lucky**. " else: response = "Slimecorp hasn't issued them mutations in their current position." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def inhabit(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.life_state != ewcfg.life_state_corpse: # Only ghosts can inhabit other players response = "You have no idea what you're doing." else: if cmd.mentions_count > 1: response = "Are you trying to split yourself in half? You can only inhabit one body at a time." elif cmd.mentions_count == 1: member = cmd.mentions[0] target_data = EwUser(member=member) if ewutils.channel_name_is_poi(cmd.message.channel.name) == False: # Has to be done in a gameplay channel response = "You can't disturb the living from here." elif cmd.message.channel.name == ewcfg.channel_sewers: # Can't be done from the sewers response = "Try doing that in the overworld, it's difficult from down here." elif target_data.life_state == ewcfg.life_state_kingpin: # Can't target generals response = "He is far too strong for you to inhabit his body." elif user_data.poi != target_data.poi: # Player must be on the same location as their target response = "You'll have to find them first." elif target_data.life_state == ewcfg.life_state_corpse: # Can't target ghosts response = "You can't do that to your fellow ghost." elif move_utils.poi_is_pvp(target_data.poi) == False: response = "You can't torment the living here." else: # cancel the ghost's movement ewutils.moves_active[cmd.message.author.id] = 0 # drop any previous inhabitation by the ghost user_data.remove_inhabitation() # add the new inhabitation bknd_core.execute_sql_query( "REPLACE INTO inhabitations({id_ghost}, {id_fleshling}, {id_server}) VALUES (%s, %s, %s)" .format( id_ghost=ewcfg.col_id_ghost, id_fleshling=ewcfg.col_id_fleshling, id_server=ewcfg.col_id_server, ), ( user_data.id_user, target_data.id_user, user_data.id_server, )) response = "{}\'s body is inhabited by the ghost of {}!".format( member.display_name, cmd.message.author.display_name) else: response = "Your spookiness is appreciated, but ENDLESS WAR didn\'t understand that name." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def check_farm(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state == ewcfg.life_state_shambler: 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)) response = "" levelup_response = "" mutations = user_data.get_mutations() # Checking availability of check farm action if user_data.life_state != ewcfg.life_state_juvenile: response = "Only Juveniles of pure heart and with nothing better to do can farm." elif cmd.message.channel.name not in [ewcfg.channel_jr_farms, ewcfg.channel_og_farms, ewcfg.channel_ab_farms]: response = "Do you remember planting anything here in this barren wasteland? No, you don’t. Idiot." else: poi = poi_static.id_to_poi.get(user_data.poi) district_data = EwDistrict(district=poi.id_poi, id_server=user_data.id_server) if district_data.is_degraded(): response = "{} has been degraded by shamblers. You can't {} here anymore.".format(poi.str_name, cmd.tokens[0]) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) if user_data.poi == ewcfg.poi_id_jr_farms: farm_id = ewcfg.poi_id_jr_farms elif user_data.poi == ewcfg.poi_id_og_farms: farm_id = ewcfg.poi_id_og_farms else: # if it's the farm in arsonbrook farm_id = ewcfg.poi_id_ab_farms farm = EwFarm( id_server=cmd.guild.id, id_user=cmd.message.author.id, farm=farm_id ) if farm.time_lastsow == 0: response = "You missed a step, you haven’t planted anything here yet." elif farm.action_required == ewcfg.farm_action_none: if farm.phase == ewcfg.farm_phase_reap: response = "Your crop is ready for the harvest." elif farm.phase == ewcfg.farm_phase_sow: response = "You only just planted the seeds. Check back later." else: if farm.slimes_onreap < ewcfg.reap_gain: response = "Your crop looks frail and weak." elif farm.slimes_onreap < ewcfg.reap_gain + 3 * ewcfg.farm_slimes_peraction: response = "Your crop looks small and generally unremarkable." elif farm.slimes_onreap < ewcfg.reap_gain + 6 * ewcfg.farm_slimes_peraction: response = "Your crop seems to be growing well." else: response = "Your crop looks powerful and bursting with nutrients." else: farm_action = farm_static.id_to_farm_action.get(farm.action_required) response = farm_action.str_check await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def dedorn(cmd): user_data = EwUser(member=cmd.message.author) # ewutils.moves_active[cmd.message.author.id] = 0 # Check to see if you even have the item you want to repair item_id = ewutils.flattenTokenListToString(cmd.tokens[1:]) try: item_id_int = int(item_id) except: item_id_int = None if item_id is not None and len(item_id) > 0: response = "You don't have one." cosmetic_items = bknd_item.inventory( id_user=cmd.message.author.id, id_server=cmd.guild.id, item_type_filter=ewcfg.it_cosmetic ) item_sought = None already_adorned = False # Check all cosmetics found for item in cosmetic_items: i = EwItem(item.get('id_item')) # Search for desired cosmetic if item.get('id_item') == item_id_int or item_id in ewutils.flattenTokenListToString(item.get('name')): if i.item_props.get("adorned") == 'true': already_adorned = True item_sought = i break # If the cosmetic you want to adorn is found if item_sought != None: # Unadorn the cosmetic if already_adorned: item_sought.item_props['adorned'] = 'false' unadorn_response = str(item_sought.item_props['str_unadorn']) response = unadorn_response.format(item_sought.item_props['cosmetic_name']) item_sought.persist() user_data.persist() # That garment has not be adorned.. else: response = "You haven't adorned that garment in the first place! How can you dedorn something you haven't adorned? You disgust me." await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) else: await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, 'Adorn which cosmetic? Check your **!inventory**.'))
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))
async def renounce(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state == ewcfg.life_state_shambler: 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)) if user_data.life_state == ewcfg.life_state_corpse: response = "You're dead, bitch." 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_enlisted: response = "What exactly are you renouncing? Your lackadaisical, idyllic life free of vice and violence? You aren't actually currently enlisted in any gang, retard." elif user_data.poi not in [ewcfg.poi_id_rowdyroughhouse, ewcfg.poi_id_copkilltown, ewcfg.poi_id_thebreakroom]: response = "To turn in your badge, you must return to your soon-to-be former gang base." else: renounce_fee = int(user_data.slimes) / 2 user_data.change_slimes(n=-renounce_fee) faction = user_data.faction user_data.life_state = ewcfg.life_state_juvenile user_data.weapon = -1 user_data.sidearm = -1 user_data.persist() response = "You are no longer enlisted in the {}, but you are not free of association with them. Your former teammates immediately begin to beat the shit out of you, knocking {} slime out of you before you're able to get away.".format(faction, renounce_fee) await ewrolemgr.updateRoles(client=cmd.client, member=cmd.message.author) await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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
async def shamble(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state != ewcfg.life_state_shambler and user_data.poi != ewcfg.poi_id_assaultflatsbeach: response = "You have too many higher brain functions left 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 in [ewcfg.life_state_juvenile, ewcfg.life_state_enlisted] and user_data.poi == ewcfg.poi_id_assaultflatsbeach: response = "You feel an overwhelming sympathy for the plight of the Shamblers and decide to join their ranks." 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_shambler user_data.degradation = 100 ewutils.moves_active[user_data.id_user] = 0 user_data.poi = ewcfg.poi_id_nuclear_beach_edge user_data.persist() member = cmd.message.author base_poi_channel = fe_utils.get_channel(cmd.message.guild, 'nuclear-beach-edge') response = 'You arrive inside the facility and are injected with a unique strain of the Modelovirus. Not long after, a voice on the intercom chimes in.\n**"Welcome, {}. Welcome to Downpour Laboratories. It\'s safer here. Please treat all machines and facilities with respect, they are precious to our cause."**'.format(member.display_name) 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
async def name_slimeoid(cmd): user_data = EwUser(member=cmd.message.author) slimeoid_data = EwSlimeoid(member=cmd.message.author) command_used = "" # Check if player is in the labs and has a slimeoid incubating response = basic_slimeoid_incubation_checks( channel_name=cmd.message.channel.name, user_data=user_data, slimeoid_data=slimeoid_data) # If response returns None go to final response # Lifestate check for flavor text if slimeoid_data.sltype == ewcfg.sltype_nega: slimeoidtype = "Negaslimeoid" else: slimeoidtype = "Slimeoid" if response is None: # Slimeoid is incubating # Check if player has specified a name if cmd.tokens_count < 2: response = "You must specify a name." # Go to final response else: # Turn entire message minus "!nameslimeoid" in to name variable command_used = ewutils.flattenTokenListToString(cmd.tokens[0]) name = cmd.message.content[(len(command_used) + len(ewcfg.cmd_prefix)):].strip() # Limit name length to 32 characters if len(name) > 32: response = "That name is too long. ({:,}/32)".format(len(name)) # Go to final response else: # Save slimeoid name slimeoid_data.name = str(name) user_data.persist() slimeoid_data.persist() if slimeoidtype == "Slimeoid": response = "You enter the name {} into the console.".format( str(name)) else: response = "You move the planchette between letters, spelling out the name {}.".format( str(name)) # Go to final response # Final response await send_response(response, cmd)
def mutation_commands(cmd): response = "\n**CURRENT MUTATIONS:**" user_data = EwUser(member=cmd.message.author) mutations = user_data.get_mutations() for mutation in mutations: if ewcfg.mutation_unique_commands.get(mutation) is not None: response += "\n" + ewcfg.mutation_unique_commands.get(mutation) if response != "\n**CURRENT MUTATIONS:**": return response else: return ""
async def cultivate(cmd): user_data = EwUser(member=cmd.message.author) if user_data.life_state == ewcfg.life_state_shambler: 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)) response = "" levelup_response = "" mutations = user_data.get_mutations() # Checking availability of irrigate action if user_data.life_state != ewcfg.life_state_juvenile: response = "Only Juveniles of pure heart and with nothing better to do can tend to their crops." elif cmd.message.channel.name not in [ewcfg.channel_jr_farms, ewcfg.channel_og_farms, ewcfg.channel_ab_farms]: response = "Do you remember planting anything here in this barren wasteland? No, you don’t. Idiot." else: poi = poi_static.id_to_poi.get(user_data.poi) district_data = EwDistrict(district=poi.id_poi, id_server=user_data.id_server) if district_data.is_degraded(): response = "{} has been degraded by shamblers. You can't {} here anymore.".format(poi.str_name, cmd.tokens[0]) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) if user_data.poi == ewcfg.poi_id_jr_farms: farm_id = ewcfg.poi_id_jr_farms elif user_data.poi == ewcfg.poi_id_og_farms: farm_id = ewcfg.poi_id_og_farms else: # if it's the farm in arsonbrook farm_id = ewcfg.poi_id_ab_farms farm = EwFarm( id_server=cmd.guild.id, id_user=cmd.message.author.id, farm=farm_id ) farm_action = farm_static.cmd_to_farm_action.get(cmd.tokens[0].lower()) if farm.time_lastsow == 0: response = "You missed a step, you haven’t planted anything here yet." elif farm.action_required != farm_action.id_action: response = farm_action.str_execute_fail farm.slimes_onreap -= ewcfg.farm_slimes_peraction farm.slimes_onreap = max(farm.slimes_onreap, 0) farm.persist() else: response = farm_action.str_execute # gvs - farm actions award more slime farm.slimes_onreap += ewcfg.farm_slimes_peraction * 2 farm.action_required = ewcfg.farm_action_none farm.persist() await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def flutter(cmd): user_data = EwUser(member=cmd.message.author) if user_data.race == ewcfg.race_avian: district_data = EwDistrict(district=user_data.poi, id_server=cmd.guild.id) market_data = EwMarket(id_server=cmd.guild.id) response = "You flap your wings in an attempt to fly, but " excuses = [] if market_data.weather == ewcfg.weather_lightning: excuses.append("the current weather would make that a bit dangerous, so you decide not to.") if ewcfg.mutation_id_bigbones in user_data.get_mutations(): excuses.append("your bones are too big for you to get off the ground.") if ewcfg.mutation_id_lightasafeather in user_data.get_mutations(): excuses.append("your wings are too skinny to generate enough lift.") if 6 <= market_data.clock >= 20: excuses.append("it's not safe to fly at night, so you decide not to.") else: excuses.append("flying in plain daylight might get you shot off the sky, so you decide not to.") if user_data.slimes > 1000000: excuses.append("you have too much slime on you, so you don't even get off the ground.") else: excuses.append("you're too weak for this right now, gonna need to get more slime.") if user_data.life_state == ewcfg.life_state_corpse: excuses.append("your incorporeal wings generate no lift.") elif user_data.life_state == ewcfg.life_state_juvenile: excuses.append("you lack the moral fiber to do so.") else: if user_data.faction == ewcfg.faction_rowdys: excuses.append("you end up thrashing with your wings in an unorganized fashion.") if user_data.faction == ewcfg.faction_killers: excuses.append("you end up doing rapid dabs instead.") if len(district_data.get_players_in_district()) > 1: excuses.append("it's embarassing to do so with other people around.") else: excuses.append("you can't be bothered if there's no one here to see you do it.") if user_data.hunger / user_data.get_hunger_max() < 0.5: excuses.append("you're too hungry, and end up looking for worms instead.") else: excuses.append("you're too full from your last meal for such vigorous exercise.") response += random.choice(excuses) else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
async def graft(cmd): user_data = EwUser(member=cmd.message.author) if cmd.message.channel.name != ewcfg.channel_clinicofslimoplasty: response = "Chemotherapy doesn't just grow on trees. You'll need to go to the clinic in Crookline to get some." 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_corpse: response = '"You get out of here, dirty nega. We don\'t serve your kind." \n\n Auntie Dusttrap threatingly flails a jar of cole slaw at you. Looks like you need a body to mutate a body.' return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) elif len(cmd.tokens) <= 1: response = '"What, just anything? I love a good improv surgery! I had to leave town the last one I did though, so you\'ll have to pick an actual surgical procedure. Sorry, sonny."' return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) target_name = ewutils.flattenTokenListToString(cmd.tokens[1:]) target = ewutils.get_mutation_alias(target_name) mutations = user_data.get_mutations() incompatible = False if target == 0: response = '"What? My ears aren\'t what they used to be. I thought you suggested I give you {}. Only braindead squicks would say that."'.format(' '.join(cmd.tokens[1:])) incompatible = True elif target in mutations: response = '"Nope, you already have that mutation. Hey, I thought I was supposed to be the senile one here!"' incompatible = True elif user_data.get_mutation_level() + static_mutations.mutations_map[target].tier > min([user_data.slimelevel, 50]): response = '"Your body\'s already full of mutations. Your sentient tumors will probably start bitin\' once I take out my scalpel."\n\nLevel:{}/50\nMutation Levels Added:{}/{}'.format(user_data.slimelevel, user_data.get_mutation_level(), min(user_data.slimelevel, 50)) incompatible = True elif static_mutations.mutations_map.get(target).tier * 10000 > user_data.slimes: response = '"We\'re not selling gumballs here. It\'s cosmetic surgery. It\'ll cost at least {} slime, ya idjit!"'.format(static_mutations.mutations_map.get(target).tier * 10000) incompatible = True for mutation in mutations: mutation = static_mutations.mutations_map[mutation] if target in mutation.incompatible: response = mutation.incompatible[target] incompatible = True break if incompatible: return await fe_utils.send_response(response, cmd) else: price = static_mutations.mutations_map.get(target).tier * 10000 user_data.change_slimes(n=-price, source=ewcfg.source_spending) user_data.persist() user_data.add_mutation(id_mutation=target, is_artificial=1) response = static_mutations.mutations_map[target].str_transplant + "\n\nMutation Levels Added:{}/{}".format(user_data.get_mutation_level(), min(user_data.slimelevel, 50)) await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def change_spray(cmd): user_data = EwUser(member=cmd.message.author) newspray = cmd.message.content[(len(ewcfg.cmd_changespray)):].strip() if newspray == "": response = "You need to add an image link to change your spray." elif len(newspray) > 400: response = "F*****g christ, are you painting the Sistine Chapel? Use a shorter link." else: response = "Got it. Spray set." user_data.spray = newspray user_data.persist() return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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))
async def preserve(cmd): user_data = EwUser(member=cmd.message.author) mutations = user_data.get_mutations() item_search = ewutils.flattenTokenListToString(cmd.tokens[1:]) item_sought = bknd_item.find_item(item_search=item_search, id_user=cmd.message.author.id, id_server=cmd.guild.id if cmd.guild is not None else None) if item_sought: item_obj = EwItem(id_item=item_sought.get('id_item')) if item_obj.item_props.get('preserved') == None: preserve_id = 0 else: preserve_id = int(item_obj.item_props.get('preserved')) if ewcfg.mutation_id_rigormortis not in mutations: response = "You can't just preserve something by saying you're going to. Everything ends eventually." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) elif item_obj.soulbound == True: response = "This thing's bound to your soul. There's no need to preserve it twice." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) elif preserve_id == int(user_data.id_user): response = "Didn't you already preserve this? You're so paranoid." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) elif item_obj.item_props.get('preserved') == "nopreserve": response = "You shove it into your body but it just won't fit for some reason. That phrasing was completely intentional, by the way." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) else: rigor = EwMutation(id_user=cmd.message.author.id, id_server=cmd.message.guild.id, id_mutation=ewcfg.mutation_id_rigormortis) if rigor.data.isdigit() == False: num = 0 else: num = int(rigor.data) if num >= 5: response = "Your body's dried up, it's lost its ability to preserve objects." else: response = "You take the {} and embrace it with all your might. As you squeeze, it slowly but surely begins to phase inside your body. That won't get stolen anytime soon!".format(item_sought.get('name')) num += 1 rigor.data = str(num) item_obj.item_props['preserved'] = user_data.id_user rigor.persist() item_obj.persist() return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) else: response = "Preserve what?" return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def clowncar(cmd): #shoves everyone not there into JR or the sewers if not cmd.message.author.guild_permissions.administrator: return id_server = cmd.guild.id server = ewcfg.server_list[cmd.guild.id] gellphones = itm_utils.find_item_all(item_search=ewcfg.item_id_gellphone, id_server=id_server, item_type_filter=ewcfg.it_item) for phone in gellphones: phone_data = EwItem(id_item=phone.get('id_item')) phone_data.item_props['gellphoneactive'] = 'false' phone_data.persist() if phone_data.id_owner.isnumeric() and int(phone_data.id_owner) > 0: print(phone_data.id_owner) member_object = server.get_member(int(phone_data.id_owner)) if member_object is None: continue user_data = EwUser(member=member_object) print('{}{}'.format('clowning:', user_data.id_user)) user_data.poi = 'juviesrow' user_data.persist() await ewrolemgr.updateRoles(client=cmd.client, member=member_object) if id_server != None: try: selection = bknd_core.execute_sql_query( "SELECT {id_user} FROM users WHERE id_server = %s AND {poi} NOT IN('juviesrow', 'thesewers', 'rowdyroughhouse', 'copkilltown')" .format(id_user=ewcfg.col_id_user, poi=ewcfg.col_poi), ([str(id_server)])) bknd_core.execute_sql_query( "UPDATE users SET {poi} = %s WHERE id_server = %s AND {poi} NOT IN('juviesrow', 'thesewers', 'rowdyroughhouse', 'copkilltown')" .format(poi=ewcfg.col_poi), ('juviesrow', [str(id_server)])) iterator = 0 for member in selection: iterator += 1 if iterator % 20 == 0: await asyncio.sleep(5) member_object = server.get_member(member[0]) await ewrolemgr.updateRoles(client=cmd.client, member=member_object) except: ewutils.logMsg('server {}: failed to clowncar.'.format( cmd.message.guild.id, cmd.message.author.id))
async def tracker(cmd): user_data = EwUser(member=cmd.message.author) mutations = user_data.get_mutations() if ewcfg.mutation_id_oneeyeopen not in mutations: response = "Your third eye is tucked snugly into your forehead. Actually, who are you fooling? You don't have a third eye. What, are you stupid?" else: mutation = EwMutation(id_server=cmd.message.guild.id, id_user=cmd.message.author.id, id_mutation=ewcfg.mutation_id_oneeyeopen) if mutation.data == "": response = "Your third eye isn't tracking anyone right now." else: target = EwPlayer(id_server=cmd.message.guild.id, id_user=mutation.data) response = "You're tracking {} right now. LOL, they're lookin pretty dumb over there.".format(target.display_name) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def jiggle(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.race == ewcfg.race_slimederived: if cmd.mentions_count == 0: response = "You pleasantly jiggle by yourself." if cmd.mentions_count > 1: response = "You jiggle at the crowd." if cmd.mentions_count == 1: target_member = cmd.mentions[0] target_data = EwUser(member=target_member) #jiggle with fellow slime-derived if target_data.race == ewcfg.race_slimederived: response = "You jiggle along with {}.".format( target_member.display_name) #jiggle at ghost elif target_data.life_state == ewcfg.life_state_corpse and user_data.life_state != ewcfg.life_state_corpse: response = "You jiggle in fear of {}.".format( target_member.display_name) #jiggle at kingpin elif target_data.life_state == ewcfg.life_state_kingpin: if target_data.life_state == ewcfg.life_state_enlisted and target_data.faction != user_data.faction: response = "You spitefully jiggle at {}.".format( target_member.display_name) else: response = "You jiggle in awe of {}.".format( target_member.display_name) #jiggle at gangster elif target_data.life_state == ewcfg.life_state_enlisted: if target_data.faction == user_data.faction: response = "You jiggle at {} as a gesture of friendship.".format( target_member.display_name) else: response = "You jiggle at {} menacingly.".format( target_member.display_name) #catch all else: response = "You jiggle at {}.".format( target_member.display_name) else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
async def rattle(cmd): user_data = EwUser(member=cmd.message.author) if user_data.race == ewcfg.race_skeleton: time_now = int(time.time()) # generate bone item when off cooldown if (time_now > user_data.time_racialability or ewutils.DEBUG_OPTIONS['no_race_cooldown'] == True ) and random.randrange( 10) == 0: #pass cooldown check when debug racecooldown is on bone_item = next(i for i in static_items.item_list if i.context == "player_bone") bknd_item.item_create(item_type=ewcfg.it_item, id_user=user_data.poi, id_server=cmd.guild.id, item_props={ 'id_item': bone_item.id_item, 'context': bone_item.context, 'item_name': bone_item.str_name, 'item_desc': bone_item.str_desc, }) user_data.time_racialability = time_now + ewcfg.cd_drop_bone user_data.persist() # spook mentioned player if cmd.mentions_count == 1: responses = [ ", sending a shiver down their spine.", ", who clearly does not appreciate it.", ". They almost faint in shock.", ", scaring them so bad they pee themselves a little.", ". **NYEEEH!**", ", trying to appeal to the bones deep within them.", " a little bit too hard. Oof ouch owie.", " so viciously they actually get offended.", " in an attempt to socialize, but they don't think you should.", ] response = "You rattle your bones at {}{}".format( cmd.mentions[0].display_name, random.choice(responses)) # rattle alone else: response = "You rattle your bones." else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
async def launch(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')) if cosmetic_data.item_props.get('id_cosmetic') == 'skinsuit': if cosmetic_data.item_props.get('adorned') == 'true': protected = True if user_data.poi != 'ufoufo': response = "Launch 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." else: launchstate = EwGamestate(id_state='shipstate', id_server=cmd.guild.id) if launchstate.bit == 1: response = "PCHOOOOOOOOOO! Weird bleeps and bloops begin to increase in frequency as the ship rises back into the air!" launchstate.bit = 0 launchstate.persist() else: response = "WHOOOOOOOO -CRASH! Your poor piloting crashes the ship back down. Your fellow alien crew seems excited, like you just chugged a whole bottle of their galactic lager or something. Good thing the hull is so shock resistant or you wouldn't be able to joyride again." launchstate.bit = 1 launchstate.persist() return await fe_utils.send_message(cmd.client, cmd.message.channel,fe_utils.formatMessage(cmd.message.author, response))
async def capture_progress(cmd): user_data = EwUser(member=cmd.message.author) response = "" poi = poi_static.id_to_poi.get(user_data.poi) response += "**{}**: ".format(poi.str_name) if not user_data.poi in poi_static.capturable_districts: response += "This zone cannot be captured." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) district_data = EwDistrict(id_server=user_data.id_server, district=user_data.poi) percent_progress_after = int(district_data.capture_points / district_data.max_capture_points * 100) if district_data.capturing_faction not in ["", district_data.controlling_faction] and district_data.controlling_faction != '': response += "{} have been de-capturing this district. ".format(district_data.capturing_faction.capitalize()) elif district_data.controlling_faction == district_data.capturing_faction and district_data.controlling_faction != '': response += "{} have been tightening control of this district. ".format(district_data.capturing_faction.capitalize()) elif district_data.controlling_faction != "": response += "{} control this district. ".format(district_data.controlling_faction.capitalize()) elif district_data.capturing_faction != "": response += "{} have been capturing this district. ".format(district_data.capturing_faction.capitalize()) else: response += "Nobody has staked a claim to this district yet. " if district_data.time_unlock > 0: response += "\n\n**It's impossible to capture at the moment.**" if not district_data.all_neighbors_friendly(): response += "But the lock is starting to decay..." response += "Current progress: {progress}%".format(progress=percent_progress_after) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def sacrifice(cmd): user_data = EwUser(member=cmd.message.author) if len(cmd.tokens) == 1: response = "Hey, don't hesitate now. You better cough up something to sacrifice." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) item_search = ewutils.flattenTokenListToString(cmd.tokens[1:]) item_sought = bknd_item.find_item(item_search=item_search, id_user=cmd.message.author.id, id_server=cmd.guild.id) item_property = '' if ewcfg.dh_active: if user_data.poi != 'endlesswar': response = 'The altars are next to ENDLESS WAR. Sacrifice your worldly possessions over there.' elif not item_sought: response = "Are you sure you have that item?" else: item = EwItem(item_sought.get('id_item')) if item.soulbound == True: response = "You try to unbind the {} from your soul to place it on the altar, but it refuses to let go of you. It's crazy that even inanimate objects are smarter than you." else: item.id_owner = '{}sacrificed'.format(user_data.id_user) item.persist() property_type = ewcfg.id_item_convert.get(item.item_type) print('') if item.item_props.get('context') == 'slimeoidheart': property_type = 'slimeoidheart' elif property_type is None: property_type = 'normal' else: pass item_name = item.item_props.get(property_type) if property_type == 'normal': item_name = 'normal' arr_sac = ewcfg.sacrifice_rates.get(item_name) if arr_sac == None and item.item_type == ewcfg.it_food: arr_sac = [3, "Tasty."] if arr_sac == None: arr_sac = [ 1, "You toss your worldly posessions to the altar." ] response = "{} The {} bursts into flames, vanishing before your very eyes. Favor increased by {}.".format( arr_sac[1], item_sought.get('name'), arr_sac[0]) ewstats.change_stat(id_server=cmd.guild.id, id_user=cmd.message.author.id, metric='sacrificerate', n=arr_sac[0]) else: response = "Now's a bad time for that." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))