1 #ifndef CORE_ITEMS_ITEM_HPP
2 #define CORE_ITEMS_ITEM_HPP
32 static Id cast(
unsigned int id);
85 static const std::vector<Id>&
validIds();
124 std::vector<pplmn::OwnedPeoplemon>* team =
nullptr,
125 std::vector<pplmn::BattlePeoplemon>* battleTeam =
nullptr);
190 static std::unordered_map<Id, std::string>* names;
191 static std::unordered_map<Id, std::string>* descriptions;
192 static std::unordered_map<Id, int>* values;
Type
The type classification of an item. This is used to determine when an item may be used and how to use...
Category
Represents a category that an item can belong to. Used for bag sorting.
Id
Represents an item in its simplist form.
Core classes and functionality for both the editor and game.
Base class for battlers in the game. This provides storage for peoplemon and turn choices.
Loads and stores metadata surrounding items in the game.
Collection of static methods centered around items.
static std::string getUseLine(Id item, const pplmn::OwnedPeoplemon &ppl)
Returns the text to display when the item is used on the given peoplemon.
static void setDataSource(file::ItemDB &source)
Set the data source for the item methods.
static const std::string & getDescription(item::Id item)
Returns the description of the given item.
static Category getCategory(Id item)
Returns the category of the given item.
static pplmn::MoveId getTmMove(Id tm)
Returns the move taught by the TM.
static void useOnPlayer(Id item, player::State &state)
Uses the given item on the player.
static const std::string & getName(item::Id item)
Returns the name of the given item.
static bool canUseInBattle(Id item)
Returns whether or not the item can be used in battle.
static Type getType(Id item)
Returns the type of the given item.
static void useOnPeoplemon(Id item, pplmn::OwnedPeoplemon &ppl, std::vector< pplmn::OwnedPeoplemon > *team=nullptr, std::vector< pplmn::BattlePeoplemon > *battleTeam=nullptr)
Applies the given item to the peoplemon.
static float getPeopleballRate(Id ball, pplmn::Id ppl, int turnNumber, float levelRatio)
Returns the catch rate for the given peopleball.
static const std::vector< Id > & validIds()
Returns the list of valid item ids.
static int getValue(item::Id item)
Returns the value of the given item.
static Id cast(unsigned int id)
Helper function to cast a raw id to an item Id.
static bool hasEffectOnPeoplemon(Id item, const pplmn::OwnedPeoplemon &ppl)
Returns whether or not the given item will affect the peoplemon.
static bool hasEffectOnPlayer(Id item, const player::State &state)
Returns whether or not the given item will affect the player.
Represents a Peoplemon in battle. Stores some extra state that only exists in battle....
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon....