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
- 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
- property details: Embed¶
Returns a rich embed containing full details of an item.
- Returns
Full details of an item.
- Return type
- 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
- 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
- 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
- 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
- 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 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
- 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
- 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
- class LegendaryChest[source]¶
Highest Tier
Chest
. Chips scale in the thousands. Legendary Chests have a small chance of containingCollectible
.
- 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