async def fursuit(cmd): user_data = EwUser(member=cmd.message.author) mutations = user_data.get_mutations() market_data = EwMarket(id_server=cmd.guild.id) if ewcfg.mutation_id_organicfursuit in mutations: days_until = -market_data.day % 31 if days_until == 0: response = "Hair is beginning to grow on the surface of your skin rapidly. Your canine instincts will take over soon!" else: response = "With a basic hairy palm reading, you determine that you'll be particularly powerful in {} day{}.".format(days_until, "s" if days_until != 1 else "") if ewutils.check_fursuit_active(market_data): response = "The full moon shines above! Now's your chance to strike!" else: response = "You're about as hairless as an egg, my friend." await fe_utils.send_message(cmd.client, cmd.message.channel, fe_utils.formatMessage(cmd.message.author, response))
async def adorn(cmd): user_data = EwUser(member=cmd.message.author) market_data = EwMarket(id_server=user_data.id_server) # 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 item_from_slimeoid = None already_adorned = False space_adorned = 0 for item in cosmetic_items: i = EwItem(item.get('id_item')) # Get space used adorned cosmetics if i.item_props['adorned'] == 'true': space_adorned += int(i.item_props['size']) # 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 item_from_slimeoid == None and i.item_props.get( "slimeoid") == 'true': item_from_slimeoid = i continue if i.item_props.get("adorned") == 'true': already_adorned = True elif i.item_props.get( "context") == 'costume' and not ewcfg.dh_active: if not ewcfg.dh_active and not ewutils.check_fursuit_active( market_data): response = "You can't adorn your costume right now." else: item_sought = i break if item_sought == None: item_sought = item_from_slimeoid # If the cosmetic you want to adorn is found if item_sought != None: # Calculate how much space you'll have after adorning... if int(item_sought.item_props['size']) > 0: space_adorned += int(item_sought.item_props['size']) # If you don't have enough space, abort if space_adorned > ewutils.max_adornspace_bylevel( user_data.slimelevel): response = "Oh yeah? And, pray tell, just how do you expect to do that? You’re out of space, you can’t adorn any more garments!" # If you have enough space, adorn else: item_sought.item_props['adorned'] = 'true' # Take the hat from your slimeoid if necessary if item_sought.item_props.get('slimeoid') == 'true': item_sought.item_props['slimeoid'] = 'false' response = "You take your {} from your slimeoid and successfully adorn it.".format( item_sought.item_props.get('cosmetic_name')) else: onadorn_response = item_sought.item_props['str_onadorn'] response = onadorn_response.format( item_sought.item_props['cosmetic_name']) item_sought.persist() user_data.persist() elif already_adorned: response = "You already have that garment adorned!" 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**.'))