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 check_manuscript(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.manuscript == -1: response = "You have yet to create a manuscript. Try !createmanuscript" else: book = EwBook(member=cmd.message.author, book_state=0) title = book.title author = book.author pages = book.pages length = 0 for page in range(1, book.pages + 1): length += len(book.book_pages.get(page, "")) cover = book.book_pages.get(0, "") if cover == "": cover_text = "" else: cover_text = " The cover is {}".format(cover) response = "{} by {}. It is {} pages and {:,} characters long.{}".format(title, author, pages, length, cover_text) 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) if district_data.controlling_faction != "": response += "{} control this district. ".format(district_data.controlling_faction.capitalize()) elif district_data.capturing_faction != "" and district_data.cap_side != district_data.capturing_faction: response += "{} are de-capturing this district. ".format(district_data.capturing_faction.capitalize()) elif district_data.capturing_faction != "": response += "{} are capturing this district. ".format(district_data.capturing_faction.capitalize()) else: response += "Nobody has staked a claim to this district yet." response += "\n\n**Current influence: {:,}**\nMinimum influence: {:,}\nMaximum influence: {:,}\nPercentage to maximum influence: {:,}%".format(abs(district_data.capture_points), int(ewcfg.min_influence[district_data.property_class]), int(ewcfg.limit_influence[district_data.property_class]), round((abs(district_data.capture_points) * 100 / (ewcfg.limit_influence[district_data.property_class])), 1)) # if district_data.time_unlock > 0: # response += "\nThis district cannot be captured currently. It will unlock in {}.".format(ewutils.formatNiceTime(seconds = district_data.time_unlock, round_to_minutes = True)) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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 slimeballstop(cmd): # global sb_userid_to_player slimeball_player = sportsutils.sb_userid_to_player.get( cmd.message.author.id) if slimeball_player == None: response = "You have to join a game using {} first.".format( cmd.cmd[1:-4]) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) if not ewutils.channel_name_is_poi(cmd.message.channel.name): response = "You have to go into the city to play Slimeball." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) # global sb_games game_data = sports_utils.sb_games.get(slimeball_player.id_game) poi_data = poi_static.chname_to_poi.get(cmd.message.channel.name) if poi_data.id_poi != game_data.poi: game_poi = poi_static.id_to_poi.get(game_data.poi) response = "Your {} game is happening in the #{} channel.".format( cmd.cmd[1:-4], game_poi.channel) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) slimeball_player.velocity = [0, 0]
async def check_schedule(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]))) user_data = EwUser(member=cmd.message.author) poi = poi_static.id_to_poi.get(user_data.poi) response = "" if poi.is_transport_stop: response = "The following public transit lines stop here:" for line in poi.transport_lines: line_data = poi_static.id_to_transport_line.get(line) response += "\n-" + line_data.str_name elif poi.is_transport: transport_data = EwTransport(id_server=user_data.id_server, poi=poi.id_poi) transport_line = poi_static.id_to_transport_line.get( transport_data.current_line) response = "This {} is following {}.".format( transport_data.transport_type, transport_line.str_name.replace("The", "the")) else: response = "There is no schedule to check here." return 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 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))
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 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 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 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 dye(cmd): hat_id = ewutils.flattenTokenListToString(cmd.tokens[1:2]) dye_id = ewutils.flattenTokenListToString(cmd.tokens[2:]) try: hat_id_int = int(hat_id) except: hat_id_int = None try: dye_id_int = int(dye_id) except: dye_id_int = None if hat_id != None and len(hat_id) > 0 and dye_id != None and len(dye_id) > 0: response = "You don't have one." items = bknd_item.inventory( id_user=cmd.message.author.id, id_server=cmd.guild.id, ) cosmetic = None dye = None for item in items: if int(item.get('id_item')) == hat_id_int or hat_id in ewutils.flattenTokenListToString(item.get('name')): if item.get('item_type') == ewcfg.it_cosmetic and cosmetic is None: cosmetic = item if int(item.get('id_item')) == dye_id_int or dye_id in ewutils.flattenTokenListToString(item.get('name')): if item.get('item_type') == ewcfg.it_item and item.get('name') in static_items.dye_map and dye is None: dye = item if cosmetic != None and dye != None: break if cosmetic != None: if dye != None: cosmetic_item = EwItem(id_item=cosmetic.get("id_item")) dye_item = EwItem(id_item=dye.get("id_item")) hue = hue_static.hue_map.get(dye_item.item_props.get('id_item')) response = "You dye your {} in {} paint!".format(cosmetic_item.item_props.get('cosmetic_name'), hue.str_name) cosmetic_item.item_props['hue'] = hue.id_hue cosmetic_item.persist() bknd_item.item_delete(id_item=dye.get('id_item')) else: response = 'Use which dye? Check your **!inventory**.' else: response = 'Dye which cosmetic? Check your **!inventory**.' 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, 'You need to specify which cosmetic you want to paint and which dye you want to use! Check your **!inventory**.'))
async def clear_quadrant(cmd): response = "" author = cmd.message.author quadrant = None user_data = EwUser(id_user=author.id, id_server=author.guild.id) 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)) for token in cmd.tokens[1:]: if token.lower() in quad_static.quadrants_map: quadrant = quad_static.quadrants_map[token.lower()] if quadrant is not None: break if quadrant is None: response = "Please select a quadrant for your romantic feelings." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) quadrant_data = EwQuadrant(id_server=author.guild.id, id_user=author.id, quadrant=quadrant.id_quadrant) if quadrant_data.id_target != -1: target_member_data = cmd.guild.get_member(quadrant_data.id_target) target_member_data_2 = None if quadrant_data.id_target2 != -1: target_member_data_2 = cmd.guild.get_member( quadrant_data.id_target) quadrant_data = EwQuadrant(id_server=author.guild.id, id_user=author.id, quadrant=quadrant.id_quadrant, id_target=-1, id_target2=-1) quadrant_data.persist() response = "You break up with {}. Maybe it's for the best...".format( target_member_data.display_name) if target_member_data_2 != None: response = "You break up with {} and {}. Maybe it's for the best...".format( target_member_data.display_name, target_member_data_2.display_name) else: response = "You haven't filled out that quadrant, bitch." return 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 beep(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.race == ewcfg.race_robot: roll = random.randrange(100) responses = [] if roll > 19: responses = [ "**BEEP**", "**BOOP**", "**BRRRRRRT**", "**CLICK CLICK**", "**BZZZZT**", "**WHIRRRRRRR**", ] elif roll > 0: responses = [ "`ERROR: 'yiff' not in function library in ewrobot.py ln 366`", "`ERROR: 418 I'm a teapot`", "`ERROR: list index out of range`", "`ERROR: 'response' is undefined`", "https://youtu.be/7nQ2oiVqKHw", "https://youtu.be/Gb2jGy76v0Y" ] else: resp = await cmd_utils.start(cmd=cmd) response = "```CRITICAL ERROR: 'life_state' NOT FOUND\nINITIATING LIFECYCLE TERMINATION SEQUENCE IN " await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, response + "10 SECONDS...```")) for i in range(10, 0, -1): await asyncio.sleep(1) await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage( cmd.message.author, response + "{} SECONDS...```".format(i))) await asyncio.sleep(1) await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, response + "0 SECONDS...```")) await asyncio.sleep(1) await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage( cmd.message.author, response + "0 SECONDS...\nERROR: 'reboot' not in function library in ewrobot.py ln 459```" )) return response = random.choice(responses) else: response = "You people are not allowed to do that." return await fe_utils.send_response(response, cmd)
async def offer_item(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)) user_trade = ewutils.active_trades.get(user_data.id_user) if user_trade != None and len(user_trade) > 0 and user_trade.get("state") > ewcfg.trade_state_proposed: item_search = ewutils.flattenTokenListToString(cmd.tokens[1:]) try: item_id_int = int(item_search) except: item_id_int = None if item_search != None and len(item_search) > 0: item_sought = None inventory = bknd_item.inventory( id_user=user_data.id_user, id_server=user_data.id_server ) for item in inventory: if (item.get('id_item') == item_id_int or item_search in ewutils.flattenTokenListToString(item.get('name'))) \ and item not in ewutils.trading_offers.get(user_data.id_user): item_sought = item if item_sought: item = EwItem(id_item=item_sought.get("id_item")) if not item.soulbound or EwItem(id_item=item_sought.get('id_item')).item_props.get("context") == "housekey": if item.id_item == user_data.weapon and user_data.weaponmarried: response = "Unfortunately for you, the contract you signed before won't let you trade your partner away. You'll have to get your cuckoldry fix from somewhere else." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) ewutils.trading_offers[user_data.id_user].append(item_sought) response = "You add a {} to your offers.".format(item_sought.get("name")) user_trade["state"] = ewcfg.trade_state_ongoing ewutils.active_trades.get(user_trade.get("trader"))["state"] = ewcfg.trade_state_ongoing else: response = "You can't trade soulbound items." else: if item_search: response = "You don't have one." else: response = "Offer which item? (check **!inventory**)" else: response = "You need to be trading with someone to offer an item." await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def store(cmd): user_data = EwUser(member=cmd.message.author) response = "" poi = poi_static.id_to_poi.get(user_data.poi) if poi.community_chest == None: response = "There is no community chest here." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) else: if len(poi.factions) > 0 and user_data.faction not in poi.factions: response = "Get real, asshole. You haven't even enlisted into this gang yet, so it's not like they'd trust you with a key to their valubles." 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 if cmd.guild is not None else None) if item_sought: item = EwItem(id_item=item_sought.get("id_item")) if not item.soulbound: if item.item_type == ewcfg.it_weapon: if user_data.weapon >= 0 and item.id_item == user_data.weapon: if user_data.weaponmarried: weapon = static_weapons.weapon_map.get(item.item_props.get("weapon_type")) response = "Your cuckoldry is appreciated, but your {} will always remain faithful to you.".format(item_sought.get('name')) return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) else: user_data.weapon = -1 user_data.persist() elif item.id_item == user_data.sidearm: user_data.sidearm = -1 user_data.persist() if item.item_type == ewcfg.it_cosmetic: if "adorned" in item.item_props: item.item_props["adorned"] = "false" if "slimeoid" in item.item_props: item.item_props["slimeoid"] = "false" item.persist() bknd_item.give_item(id_item=item.id_item, id_server=item.id_server, id_user=poi.community_chest) response = "You store your {} in the community chest.".format(item_sought.get("name")) else: response = "You can't {} soulbound items.".format(cmd.tokens[0]) else: if item_search: response = "You don't have one" else: response = "{} which item? (check **!inventory**)".format(cmd.tokens[0]) await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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 create(cmd): # if not cmd.message.author.guild_permissions.administrator: if EwUser( member=cmd.message.author ).life_state != ewcfg.life_state_kingpin and not cmd.message.author.guild_permissions.administrator: response = 'Lowly Non-Kingpins cannot hope to create items with their bare hands.' return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) if len(cmd.tokens) not in [4, 5, 6]: response = 'Usage: !create "<item_name>" "<item_desc>" <recipient> <rarity(optional)>, <context>(optional)' return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) item_name = cmd.tokens[1] item_desc = cmd.tokens[2] rarity = cmd.tokens[4] if len( cmd.tokens) >= 5 and ewutils.flattenTokenListToString( cmd.tokens[4]) in ['princeps', 'plebeian', 'patrician' ] else 'princeps' context = cmd.tokens[5] if len(cmd.tokens) >= 6 else '' if cmd.mentions[0]: recipient = cmd.mentions[0] else: response = 'You need to specify a recipient. Usage: !create "<item_name>" "<item_desc>" <recipient>' return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) item_props = { "cosmetic_name": item_name, "cosmetic_desc": item_desc, "adorned": "false", "rarity": rarity, "context": context } new_item_id = bknd_item.item_create(id_server=cmd.guild.id, id_user=recipient.id, item_type=ewcfg.it_cosmetic, item_props=item_props) itm_utils.soulbind(new_item_id) response = 'Item "{}" successfully created.'.format(item_name) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def slimeballgo(cmd): # global sb_userid_to_player slimeball_player = sportsutils.sb_userid_to_player.get( cmd.message.author.id) if slimeball_player == None: response = "You have to join a game using {} first.".format( cmd.cmd[1:-2]) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) if not ewutils.channel_name_is_poi(cmd.message.channel.name): response = "You have to go into the city to play Slimeball." return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) # global sb_games game_data = sports_utils.sb_games.get(slimeball_player.id_game) poi_data = poi_static.chname_to_poi.get(cmd.message.channel.name) if poi_data.id_poi != game_data.poi: game_poi = poi_static.chname_to_poi.get(cmd.message.channel.name) response = "Your Slimeball game is happening in the #{} channel.".format( game_poi.channel) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) target_coords = get_coords(cmd.tokens[1:]) if len(target_coords) != 2: response = "Specify where you want to {} to.".format(cmd.cmd) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response)) target_vector = ewutils.EwVector2D(target_coords) current_vector = ewutils.EwVector2D(slimeball_player.coords) target_direction = target_vector.subtract(current_vector) target_direction = target_direction.normalize() current_direction = ewutils.EwVector2D(slimeball_player.velocity) result_direction = current_direction.add(target_direction) result_direction = result_direction.normalize() slimeball_player.velocity = result_direction.vector
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 collect_bet(cmd, resp, value, user_data, currency_used): response = "" if currency_used == ewcfg.currency_slimecoin: if value == -1: value = user_data.slimecoin if value > user_data.slimecoin: response = "You don't have enough SlimeCoin for that bet." return await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, response)) # subtract costs user_data.change_slimecoin(n=-value, coinsource=ewcfg.coinsource_casino) elif currency_used == ewcfg.currency_slime: if user_data.life_state == ewcfg.life_state_corpse: return await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, ewcfg.str_casino_negaslime_dealer)) if user_data.poi != ewcfg.poi_id_thecasino: response = "You try to shove the slime through your phone into the casino, but it just bounces off the screen. Better use a digital currency. Or your soul." return await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, response)) if value == -1: value = user_data.slimes if value > user_data.slimes: response = "You don't have enough slime for that bet." return await fe_utils.edit_message( cmd.client, resp, fe_utils.formatMessage(cmd.message.author, response)) # Phoebus likes big bets and he cannot lie if ewcfg.slimernalia_active and (value > ewcfg.phoebus_bet_floor): ewstats.change_stat(id_server=user_data.id_server, id_user=user_data.id_user, metric=ewcfg.stat_festivity, n=value / 10000) # subtract costs user_data.change_slimes(n=-value, source=ewcfg.source_casino) # print("Collected bet of {} from {}.".format(value, user_data.id_user)) return value
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 blockparty(cmd): if not cmd.message.author.guild_permissions.administrator: return else: blockstate = EwGamestate(id_server=cmd.guild.id, id_state='blockparty') if cmd.tokens_count > 1: if cmd.tokens[1] == 'slimegen': blockstate.bit = 1 blockstate.persist() response = "Slimegen turned on." elif cmd.tokens[1] == 'close': blockstate.bit = 0 blockstate.value = '' blockstate.persist() response = "OK, closing up." else: poi_sought = ewutils.flattenTokenListToString(cmd.tokens[1:]) poi = poi_static.id_to_poi.get(poi_sought) if poi is not None: time_end = int(time()) + (60 * 60 * 6) # 6 hours blockstate.value = "{}{}".format(poi.id_poi, time_end) blockstate.persist() response = "Block party in {}! Everybody in!".format(poi.str_name) else: response = "Never heard of it." else: response = "I see you haven't gotten any smarter. Try !blockparty <setting>. Settings include 'close', 'slimegen', and any POI." return await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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 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 crystalize_negapoudrin(cmd): user_data = EwUser(member=cmd.message.author) response = "" if user_data.life_state != ewcfg.life_state_corpse: response = "What the f**k do you think you're doing, you corporeal bitch?" elif user_data.slimes >= ewcfg.slimes_to_crystalize_negapoudrin: response = "Crystalizing a negapoudrin requires a lot of negaslime, and you're not quite there yet." else: negapoudrin_data = next(i for i in static_items.item_list if i.id_item == ewcfg.item_id_negapoudrin) bknd_item.item_create(item_type=ewcfg.it_item, id_user=user_data.id_user, id_server=cmd.guild.id, item_props={ 'id_item': negapoudrin_data.id_item, 'item_name': negapoudrin_data.str_name, 'item_desc': negapoudrin_data.str_desc, }) user_data.change_slimes(n=-ewcfg.slimes_to_crystalize_negapoudrin, source=ewcfg.source_spending) user_data.persist() response = "The cathedral's bells toll in the distance, and a rumbling {} can be heard echoing from deep within the sewers. A negapoudrin has formed.".format( ewcfg.cmd_boo) return await fe_utils.send_message( cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
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))