Ingame Items

class Item[source]

Any object which exists in the world of PokeGambler.

Parameters
  • description (str) – A description of the item.

  • category (str) – The category of the item.

  • asset_url (str) – The URL of the item’s asset.

  • emoji (str) – The emoji of the item.

  • buyable (bool) – Whether the item can be bought.

  • sellable (bool) – Whether the item can be sold.

  • price (Optional[int]) – The price of the item.

  • premium (bool) – Whether the item is premium.

async get_image()[source]

Downloads and returns the image of the item.

Parameters

sess (aiohttp.ClientSession) – An aiohttp ClientSession object.

Returns

The image of the item.

Return type

PIL.Image.Image

delete()[source]

Deletes the Item from the Collection.

save()[source]

Saves the Item to the Collection. Sets the itemid of the Item after saving.

update()[source]

Updates an existing item.

Parameters

modify_all (Optional[bool]) – Modify all copies of the item, defaults to False

property name: str

Returns the name of the Item.

Returns

The name of the Item.

Return type

str

property category_class: Type[scripts.base.items.Item]

Returns the class of the Item’s category.

Returns

The class of the Item’s category.

Return type

Item

property details: Embed

Returns a rich embed containing full details of an item.

Returns

Full details of an item.

Return type

discord.Embed

classmethod from_id()[source]

Returns an Item from the Collection base on its itemid.

Parameters
  • itemid (int) – The id of the Item.

  • force_new (bool) – Force a new Item to be created, defaults to False.

Returns

The existing/newly created Item.

Return type

Item

classmethod bulk_from_id()[source]

Returns a list of Items from the Collection base on their itemids.

Parameters
  • itemids (List[str]) – The ids of the Items.

  • force_new (bool) – Force a new Item to be created, defaults to False.

Returns

The existing/newly created Items.

Return type

List[Item]

classmethod from_name()[source]

Returns an Item from the Collection base on its name.

Parameters
  • name (str) – The name of the Item.

  • force_new (bool) – Force a new Item to be created, defaults to False.

Returns

The existing/newly created Item.

Return type

Item

classmethod from_dict()[source]

Returns an Item based on available data.

Parameters

data (Dict) – The data of the Item.

Returns

The prepopulated Item.

Return type

Item

classmethod get()[source]

Returns an Item from the Collection base on its itemid.

Parameters

itemid (str) – The id of the Item.

Returns

The dictionary of the Item.

Return type

Dict

classmethod bulk_get()[source]

Returns a list of Items from the Collection base on their itemids.

Parameters

itemids (List[str]) – The ids of the Items.

Returns

The list of dictionaries of the Items.

Return type

List[Dict]

classmethod get_category()[source]

Resolves category to handle chests differently. Returns the base Category of the Item.

Parameters

item (Dict) – The Item to get the category from.

Returns

The base Category of the Item.

Return type

Type[Item]

classmethod get_unique_items()[source]

Gets all items with a unique name.

Returns

A list of all items with a unique name.

Return type

List[Dict]

classmethod latest()[source]

Returns the latest items added to the Collection.

Parameters

limit (Optional[int]) – The maximum number of items to return, defaults to 5.

Returns

A list of the latest items added to the Collection.

Return type

List[Dict]

classmethod insert_many()[source]

Inserts many items into the Collection.

Parameters

items (List[Dict]) – A list of items to insert.

classmethod list_items()[source]

List items of a certain category.

Parameters
  • category (str) – The category of the items to list, defaults to “Tradable”.

  • limit (Optional[int]) – The maximum number of items to return, defaults to 5.

  • premium (Optional[bool]) – If True, only return premium items, defaults to None.

Returns

A list of the items of the given category.

Return type

List

classmethod purge()[source]

Purges the Items collection.

class Tradable[source]

Any buyable and sellable Item is a Tradeable. It should have a fixed base price.

This module contains schematics for all the items in the Pokegambler world.

class Treasure[source]

Any non-buyable Item is considered a Treasure. It is unique to the user and cannot be sold either.

class Collectible[source]

Collectibles are sellable variants of Treasure. They cannot be bought off the market but can be traded among users.

class Consumable[source]

Item buyable from Shop but can’t be sold back.

class Chest[source]

Chests are spawnable Treasure which contain Pokechips based on tiers.

Parameters
  • description (str) – A description of the chest.

  • asset_url (str) – The URL of the chest’s asset.

  • emoji (str) – The emoji of the item.

  • tier (int) – The tier of the chest.

property chips: int

Get a random amount of tier-scaled pokechips.

Returns

Number of Pokechips.

Return type

int

classmethod get_chest()[source]

Get a specified tier Chest.

Parameters

tier (int) – The tier of the Chest.

Returns

A Chest of the specified tier.

Return type

Chest

classmethod get_random_chest()[source]

Get a random tier Chest with weight of (90, 35, 12) for common, gold and legendary resp.

Returns

A Chest of a random tier.

Return type

Chest

get_random_collectible()[source]

Get a random Collectible with chance based on chest tier.

Note

  • Common Chest - 0%

  • Gold Chest - 25%

  • Legendary Chest - 50%

Returns

A random collectible.

Return type

Collectible

classmethod get_items()[source]

Get a list of all Chest items.

Returns

A list of all Chest items.

Return type

List[Item]

Parameters

chest_id (str) –

class CommonChest[source]

Lowest Tier Chest. Chips scale in 100s.

class GoldChest[source]

Mid tier Chest. Chips scale in high-hundreds to low-thousands.

class LegendaryChest[source]

Highest Tier Chest. Chips scale in the thousands. Legendary Chests have a small chance of containing Collectible.

class Lootbag[source]

Lootbags contain other items inside them. Premium Lootbags can also contain Premium Items.

property chips: int

Return random amount of Pokechips in following ranges:

Note

  • Normal => [100, 499]

  • Premium => [500, 1000]

Returns

An amount of Pokechips.

Return type

int

get_random_items()[source]

Get a random Item from a list of categories.

Parameters
  • categories (Optional[List[str]]) – A list of categories to choose from.

  • count (Optional[int]) – The amount of items to choose., default is 3.

Returns

A list of items.

Return type

List[Item]

classmethod get_items()[source]

Get items stored in a Lootbag.

Parameters
  • boxid (int) – The itemid of the Lootbag.

  • bagid (int) –

Returns

A list of stored items.

Return type

List[Item]

class Rewardbox[source]

Lootbag with fixed items and pokechips.

classmethod get_items()[source]

Get items stored in a Rewardbox.

Parameters

boxid (int) – The itemid of the Rewardbox.

Returns

A list of stored items.

Return type

List[Item]

class Gladiator[source]

Minions that can fight in Gladiator matches.

rename()[source]

Rename a Gladiator.

Parameters

name (str) – The new name of the Gladiator.