Card objects¶
In order to easily work with cards (and abilities), pyartifact wraps them in easier to use
objects. The objects are made by inheriting multiple bases, where each base indicates the presence
of a certain attribute. For example all objects inheriting the Unit
class will have
attack, armor and hit_points attributes.
Card types¶
Some cards from Valve’s API are not included in this library, because they are more of a core mechanics, these cards would have the type of Stronghold and Pathing.
Cards¶
-
class
pyartifact.sets_and_cards.
Hero
(**kwargs)[source]¶ Inherts from
CardBase
,ColoredCard
,Unit
andNotAbility
.-
includes
¶ List of all the cards this card includes automatically in a deck.
Return type: List
[Union
[Spell
,Creep
,Improvement
]]
-
passive_abilities
¶ List of the cards passive abilities
Return type: List
[PassiveAbility
]
-
-
class
pyartifact.sets_and_cards.
Creep
(**kwargs)[source]¶ Inherits from
CardBase
,ColoredCard
,Unit
,NotAbility
,Castable
.
-
class
pyartifact.sets_and_cards.
Spell
(**kwargs)[source]¶ Inherits from
CardBase
,ColoredCard
,NotAbility
andCastable
.
-
class
pyartifact.sets_and_cards.
Improvement
(**kwargs)[source]¶ Inherits from CardBase, ColoredCard, NotAbility, Castable.
-
class
pyartifact.sets_and_cards.
Item
(**kwargs)[source]¶ Inherits from
CardBase
,NotAbility
. Also has two attributes unique to this type.Attribute Type Contents gold_cost int How much gold does it take to purchase from the shop. sub_type str Subtype of the item - Weapon, Accessory, Armor, Consumable or Deed
Card Base classes¶
Base¶
-
class
pyartifact.sets_and_cards.
CardBase
(**kwargs)[source]¶ All cards (and abilities) inherit the base.
Attribute Type Contents id int Id of the card base_id int Currently same as id name str Name of the card type str Type of the card, also indicated by the actual class holding the card text str Text on the card, includes html mini_image Optional[str] Url to mini image large_image Optional[str] Url to large image ingame_image Optional[str] Url to ingame image -
references
¶ List of cards that this card references
Return type: List
[Union
[Item
,Hero
,Ability
,PassiveAbility
,Improvement
,Creep
,Spell
]]
-
Colored card¶
Unit¶
NotAbility¶
-
class
pyartifact.sets_and_cards.
NotAbility
(**kwargs)[source]¶ Cards that are not abilities. Card API provides abilities and passive abilities alongside cards, so in the context of this library they are treated as cards.
Attribute Type Contents rarity Optional[str] Rarity of the card, if it has one (base set cards don’t have a rarity item_def Optional[int] Unknown integer, only present when rarity is present illustrator str Name of the illustrator that drew the card art