Ejemplo n.º 1
0
async def incubate_slimeoid(cmd):
    user_data = EwUser(member=cmd.message.author)
    slimeoid_data = EwSlimeoid(member=cmd.message.author)

    if cmd.message.channel.name != ewcfg.channel_slimeoidlab:
        response = "You must go to the NLACU Laboratories in Brawlden to create a Slimeoid."
        # Go to final response

    elif user_data.life_state == ewcfg.life_state_corpse:
        response = "Ghosts cannot interact with the NLACU Lab apparati."
        # Go to final response

    #TODO: change this because player can have more than one slimeoid now
    # this is f*****g brutal. poor slimeoid
    elif slimeoid_data.life_state == ewcfg.slimeoid_state_active:
        response = "You have already created a Slimeoid. Bottle or dissolve your current slimeoid before incubating a new one."
        # Go to final response

    elif slimeoid_data.life_state == ewcfg.slimeoid_state_forming:
        response = "You are already in the process of incubating a Slimeoid."
        # Go to final response

    else:

        #Check if player has too many slimeoids
        slimeoid_count = get_slimeoid_count(user_id=cmd.message.author.id,
                                            server_id=cmd.guild.id)

        if slimeoid_count >= 3:
            response = "You have too many slimeoids."
            # Go to final response

        else:
            #Check if player has a poudrin
            poudrin = bknd_item.find_item(
                item_search=ewcfg.item_id_slimepoudrin,
                id_user=cmd.message.author.id,
                id_server=cmd.guild.id if cmd.guild is not None else None,
                item_type_filter=ewcfg.it_item)
            if poudrin is None:
                response = "You need a slime poudrin."
                # Go to final response

            else:
                # Get arguement for how big the slimeoid should be made
                injected_slime = None
                if cmd.tokens_count > 1:
                    injected_slime = ewutils.getIntToken(tokens=cmd.tokens,
                                                         allow_all=True)
                    # -1 from getIntToken() means use all slime
                    if injected_slime == -1:
                        injected_slime = user_data.slimes

                if injected_slime == None:
                    response = "You must contribute some of your own slime to create a Slimeoid. Specify how much slime you will sacrifice."
                    # Go to final response

                elif injected_slime > user_data.slimes:
                    response = "You do not have that much slime to sacrifice."
                    # Go to final response

                else:
                    # delete a slime poudrin from the player's inventory
                    bknd_item.item_delete(id_item=poudrin.get('id_item'))

                    # Remove slime
                    user_data.change_slimes(n=-injected_slime)

                    # Setup gestating slimeoid
                    level = len(str(injected_slime))
                    slimeoid_data.life_state = ewcfg.slimeoid_state_forming
                    slimeoid_data.level = level
                    slimeoid_data.id_user = str(user_data.id_user)
                    slimeoid_data.id_server = user_data.id_server

                    # Save changes
                    slimeoid_data.persist()
                    user_data.persist()

                    response = "You place a poudrin into a small opening on the console. As you do, a needle shoots up and pricks your finger, intravenously extracting {injected_slime:,} slime from your body. The poudrin is then dropped into the gestation tank. Looking through the observation window, you see what was once your slime begin to seep into the tank and accrete around the poudrin. The incubation of a new Slimeoid has begun! {slime_emote}".format(
                        injected_slime=injected_slime,
                        slime_emote=ewcfg.emote_slime2)
                    # Go to final response

    # Final response
    await send_response(response, cmd)
Ejemplo n.º 2
0
async def spawn_slimeoid(cmd):
    user_data = EwUser(member=cmd.message.author)
    slimeoid_data = EwSlimeoid(member=cmd.message.author)

    # Check if player is in the appropriate POI 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

    if response is None:  # Slimeoid is incubating

        incomplete = False
        required_parts_explanation = ""

        # Check for flavor text purposes
        if slimeoid_data.sltype == ewcfg.sltype_nega:
            slimeoidtype = "Negaslimeoid"
        else:
            slimeoidtype = "Slimeoid"

        # Check if parts are missing
        # Bold missing part names for visual clarity
        if (slimeoid_data.body == ""):
            incomplete = True
            required_parts_explanation += "\nIts **BODY** has not yet been given a distinct form."

        if (slimeoid_data.head == ""):
            incomplete = True
            required_parts_explanation += "\nIt does not yet have a **HEAD**."

        if (slimeoid_data.legs == ""):
            incomplete = True
            required_parts_explanation += "\nIt has no **LEGS** or means of locomotion."

        if (slimeoid_data.weapon == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks a means of **WEAPON**."

        if (slimeoid_data.armor == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks any form of **ARMOR**."

        if (slimeoid_data.special == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks a **SPECIAL** ability."

        if (slimeoid_data.ai == ""):
            incomplete = True
            required_parts_explanation += "\nIt does not yet have a **BRAIN**."

        if ((slimeoid_data.atk + slimeoid_data.defense + slimeoid_data.intel) <
            (slimeoid_data.level)):
            incomplete = True
            required_parts_explanation += "\nIt still has potential that must be distributed between **MOXIE**, **GRIT** and **CHUTZPAH**."

        if (slimeoid_data.name == ""):
            incomplete = True
            required_parts_explanation += "\nIt needs a **NAME**."

        if incomplete:
            # Add explanation of which parts need to be added
            if slimeoidtype == "Slimeoid":
                response = f"Your Slimeoid is not yet ready to be spawned from the gestation vat. {required_parts_explanation}"
            else:
                response = f"Your Negaslimeoid is not yet fully conjured by the Ancient Ones. {required_parts_explanation}"
            # Go to final response

        else:
            # Set slimeoid as active
            slimeoid_data.life_state = ewcfg.slimeoid_state_active
            # Save slimeoid
            slimeoid_data.persist()

            # Generate spawning flavor text
            if slimeoidtype == "Slimeoid":
                response = "You press the big red button labelled 'SPAWN'. The console lights up and there is a rush of mechanical noise as the fluid drains rapidly out of the gestation tube. The newly born Slimeoid within writhes in confusion before being sucked down an ejection chute and spat out messily onto the laboratory floor at your feet. Happy birthday, {slimeoid_name} the Slimeoid!! {slime_heart_emote}".format(
                    slimeoid_name=slimeoid_data.name,
                    slime_heart_emote=ewcfg.emote_slimeheart)
            else:
                response = "You move the Ouija® planchette to 'GOOD BYE'. The whispering around you explodes into a roaring chorus, nearly deafening your ghost ears. The pile of negaslime in front of you, now resembling a Negaslimeoid, ambles towards you. With a blood-curdling screech, the chorus around you dies. Your unholy abomination {slimeoid_name} the Negaslimeoid has been conjured!! {negaslime_emote}".format(
                    slimeoid_name=slimeoid_data.name,
                    negaslime_emote=ewcfg.emote_negaslime)

            # Add slimeoid description
            response += "\n\n{} is a {}-foot-tall {}.".format(
                slimeoid_data.name, str(slimeoid_data.level), slimeoidtype)
            response += slimeoid_utils.slimeoid_describe(slimeoid_data)

            # Add slimeoid's reaction based on brain type
            brain = sl_static.brain_map.get(slimeoid_data.ai)
            response += "\n\n" + brain.str_spawn.format(
                slimeoid_name=slimeoid_data.name)
            # Go to final response

    # Final response
    await send_response(response, cmd)
Ejemplo n.º 3
0
async def spawn_slimeoid(cmd):
    user_data = EwUser(member=cmd.message.author)
    slimeoid_data = EwSlimeoid(member=cmd.message.author)

    # 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

    if response is None:  # Slimeoid is incubating
        incomplete = False
        required_parts_explanation = ""

        # Check if parts are missing
        # Bold missing part names for visual clarity
        if (slimeoid_data.body == ""):
            incomplete = True
            required_parts_explanation += "\nIts **BODY** has not yet been given a distinct form."

        if (slimeoid_data.head == ""):
            incomplete = True
            required_parts_explanation += "\nIt does not yet have a **HEAD**."

        if (slimeoid_data.legs == ""):
            incomplete = True
            required_parts_explanation += "\nIt has no **LEGS** or means of locomotion."

        if (slimeoid_data.weapon == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks a means of **WEAPON**."

        if (slimeoid_data.armor == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks any form of **ARMOR**."

        if (slimeoid_data.special == ""):
            incomplete = True
            required_parts_explanation += "\nIt lacks a **SPECIAL** ability."

        if (slimeoid_data.ai == ""):
            incomplete = True
            required_parts_explanation += "\nIt does not yet have a **BRAIN**."

        if ((slimeoid_data.atk + slimeoid_data.defense + slimeoid_data.intel) <
            (slimeoid_data.level)):
            incomplete = True
            required_parts_explanation += "\nIt still has potential that must be distributed between **MOXIE**, **GRIT** and **CHUTZPAH**."

        if (slimeoid_data.name == ""):
            incomplete = True
            required_parts_explanation += "\nIt needs a **NAME**."

        if incomplete:
            # Add explanation of which parts need to be added
            response = f"Your slimeoid is not yet ready to be spawned from the gestation vat. {required_parts_explanation}"
            # Go to final response

        else:
            # Set slimeoid as active
            slimeoid_data.life_state = ewcfg.slimeoid_state_active
            # Save slimeoid
            slimeoid_data.persist()

            # Generate spawning flavor text
            response = "You press the big red button labelled 'SPAWN'. The console lights up and there is a rush of mechanical noise as the fluid drains rapidly out of the gestation tube. The newly born Slimeoid within writhes in confusion before being sucked down an ejection chute and spat out messily onto the laboratory floor at your feet. Happy birthday, {slimeoid_name} the Slimeoid!! {slime_heart_emote}".format(
                slimeoid_name=slimeoid_data.name,
                slime_heart_emote=ewcfg.emote_slimeheart)

            # Add slimeoid description
            response += "\n\n{} is a {}-foot-tall Slimeoid.".format(
                slimeoid_data.name, str(slimeoid_data.level))
            response += slimeoid_utils.slimeoid_describe(slimeoid_data)

            # Add slimeoid's reaction based on brain type
            brain = sl_static.brain_map.get(slimeoid_data.ai)
            response += "\n\n" + brain.str_spawn.format(
                slimeoid_name=slimeoid_data.name)
            # Go to final response

    # Final response
    await send_response(response, cmd)
Ejemplo n.º 4
0
async def incubate_negaslimeoid(cmd):
    user_data = EwUser(member=cmd.message.author)
    slimeoid_data = EwSlimeoid(member=cmd.message.author)

    # Check for if the player is a corpse
    if user_data.life_state != ewcfg.life_state_corpse:
        if cmd.message.channel.name == ewcfg.channel_wafflehouse:
            response = "You feel as though there is some ancient power here, but the slime coursing through your veins prevents you from using it."
        else:
            response = "Huh? What'd you say?"

    # Check for if the player is at Waffle House
    elif cmd.message.channel.name != ewcfg.channel_wafflehouse:
        response = "You can't exactly summon anything in {}. Go to Waffle House first.".format(
            cmd.message.channel.name)

    # Check if the player already has a Slimeoid or a Negaslimeoid.
    elif slimeoid_data.life_state == ewcfg.slimeoid_state_active:
        if slimeoid_data.sltype == ewcfg.sltype_nega:
            response = "You already have a Negaslimeoid by your side. Destroy your current Negaslimeoid before you commune with the Ancient Ones yet again."
        else:
            response = "You wish to summon a Negaslimeoid, yet you have a Slimeoid that still calls you its master. !destroyslimeoid if you wish to commune with the Ancient Ones properly."

    # Check if the player is already incubating a Slimeoid or Negaslimeoid
    elif slimeoid_data.life_state == ewcfg.slimeoid_state_forming:
        if slimeoid_data.sltype == ewcfg.sltype_nega:
            response = "You are already in the process of conjuring a Negaslimeoid."
        else:
            response = "You wish to summon a Negaslimeoid, yet you have a Slimeoid that is still yet to call you its master. !destroyslimeoid if you wish to commune with the Ancient Ones properly."

    else:

        #Check if player has too many slimeoids
        slimeoid_count = get_slimeoid_count(user_id=cmd.message.author.id,
                                            server_id=cmd.guild.id)

        if slimeoid_count >= 3:
            response = "You have too many slimeoids."
            # Go to final response

        else:
            #Check if player has a negapoudrin
            negapoudrin = bknd_item.find_item(
                item_search=ewcfg.item_id_negapoudrin,
                id_user=cmd.message.author.id,
                id_server=cmd.guild.id if cmd.guild is not None else None,
                item_type_filter=ewcfg.it_item)
            if negapoudrin is None:
                response = "You need a negapoudrin to bind a Negaslimeoid to your command."
                # Go to final response

            else:
                # Get argument for how big the negaslimeoid should be made
                sacrificed_negaslime = None
                if cmd.tokens_count > 1:
                    # -1 from getIntToken() could possibly be gotten from player input, so do a check here.
                    if cmd.tokens[1] == "all":
                        if user_data.slimes < 0:
                            sacrificed_negaslime = -user_data.slimes

                    else:
                        print(cmd.tokens[0])
                        sacrificed_negaslime = ewutils.getIntToken(
                            tokens=cmd.tokens)
                        if sacrificed_negaslime < 0:
                            sacrificed_negaslime = -sacrificed_negaslime

                # Check if player sacrificed any negaslime or if they have enough to sacrifice.
                if sacrificed_negaslime == None:
                    response = "You must sacrifice your own negaslime to conjure a Negaslimeoid. Specify how much negaslime you will sacrifice."
                    # Go to final response

                elif -sacrificed_negaslime < user_data.slimes:
                    response = "You do not have that much negaslime to sacrifice."
                    # Go to final response

                else:
                    # delete a negapoudrin from the player's inventory
                    bknd_item.item_delete(id_item=negapoudrin.get('id_item'))

                    # Remove negaslime
                    user_data.change_slimes(n=+sacrificed_negaslime)

                    # Establish these stats for conjuring the negaslimeoid
                    level = len(str(sacrificed_negaslime))
                    slimeoid_data.life_state = ewcfg.slimeoid_state_forming
                    slimeoid_data.level = level
                    slimeoid_data.sltype = ewcfg.sltype_nega
                    slimeoid_data.hue = ewcfg.hue_id_negative
                    slimeoid_data.id_user = str(user_data.id_user)
                    slimeoid_data.id_server = user_data.id_server

                    # Save changes
                    slimeoid_data.persist()
                    user_data.persist()

                    response = "Floating in front of the Ouija® Board, you place both of your ghastly appendages on the planchette. {sacrificed_negaslime:,} negaslime rises from your body, flowing towards your negapoudrin. The negapoudrin appears to lift into the air, held up by a pool of rising negaslime. Whispers awake around you, indiscernible and unknowable. It feels as though the planchette beneath your ghastly fingers has more than one set of hands on it. \n\nThe conjuration of a Negaslimeoid has begun! {negaslime_emote}".format(
                        sacrificed_negaslime=sacrificed_negaslime,
                        negaslime_emote=ewcfg.emote_negaslime)
                    # Go to final response

    # Final response
    await send_response(response, cmd)