def init_items(self): item_list = [items.Item('stick'), items.Item('keys'), items.Item('mirror'), items.Container('chest'), items.Container('pond'), items.ContainedItem('map'), items.ContainedItem('sphere'), items.Blocker('rubble') ] return item_list
async def harvest(ctx, *args): current_player = play.players[ctx.message.author] loot = items.Container([]) for plot in current_player.farm.plots: item = plot.harvest() if item is not None: loot += item if len(loot) == 0: await client.say( f"Sorry {ctx.message.author.mention}, but there was nothing too harvest!" ) return else: embed = discord.Embed(title="*Harvest Results:*", colour=0xffe48e) text = "" for item in loot: text += f"{item.emoji} **{item.name}** (x{item.amount})\n" current_player.items += item embed.add_field(name="**__Items__:**", value=text) await client.send_message(ctx.message.channel, f"{current_player.player.mention} ->", embed=embed)
def __init__(self, player): # This'll be the discord object that represents the player self.player = player self.farm = None self.items = items.Container() self.money = 20
def __init__(self, drops, name, pos=(0, 0)): pygame.sprite.Sprite.__init__(self) self.name = name self.isalive = True self.pos = pos self.last_pos = self.pos self.image = self.set_image(self.mob_image) self.rect = self.update_rect() self.tile = con.GAME_CONSTANTS["TILE"] self.corpse = items.Container(self.name, drops) self.speed = con.DIFFICULTY["ENEMY_SPEED"] self.aggro_dist = con.DIFFICULTY["AGGRO_DIST"]
cookie = items.Food("Cookie", "A chocolate chip cookie. Seems delicious.") bed = items.Item("Bed", "Your average-looking bed.") ball = items.Ball("Ball", "A regular, old tennis ball.") techRoomKey = items.Item( "Key", "The key has a message engraved that says 'Tech Room Key'...") backwardsGun = items.BackwardsGun( "Gun", "It's a gun, but its barrel is pointing the opposite way.") water = items.Drink( "Water Bottle", "A water bottle that has an off-center label that says 'Fiji'.") cookieMask = items.Mask( "Mask", "A mask of a smiling man wearing glasses with slits in the eyes. Wonder what you'd use it for." ) shirt = items.Shirt("Shirt", "Just a plain white shirt.") weirdBag = items.Container("Backpack", "Just a regular backpack.", 4) # rooms BEDROOM = Room( "Bedroom", "You are in a bedroom full of anime posters, figures, etc.\n" "You have a computer sitting on a desk to your north, and a door to the east.", "COMPUTER", None, "HALLWAY", None, None, None, None, bed) COMPUTER = Room( "Computer", "On the desk lies a computer with a crappy membrane keyboard and a mouse. " "On the computer lies a weird game called 'osu!'...", None, "BEDROOM", "HALLWAY", None, None, None, None, weirdBag) HALLWAY = Room( "Hallway", "The hallway has a few paintings with a dull red carpet on the wooden floor."