How to use the hearthstone.enums.GameTag function in hearthstone

To help you get started, we’ve selected a few hearthstone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HearthSim / python-hearthstone / hearthstone / cardxml.py View on Github external
def _make_tag_element(element, tagname, tag, value):
	e = ElementTree.SubElement(element, tagname, enumID=str(int(tag)))
	if not isinstance(tag, GameTag):
		try:
			tag = GameTag(tag)
			name = tag.name
			value = str(int(value))
		except ValueError:
			name = str(value)
			value = str(value)
	else:
		name = tag.name
		value = str(int(value))

	e.attrib["name"] = name
	e.attrib["type"] = "Int"
	e.attrib["value"] = value

	return e
github HearthSim / python-hearthstone / hearthstone / enums.py View on Github external
# Not present at the time
	LOCSTRING = -2


TAG_TYPES = {
	GameTag.TRIGGER_VISUAL: Type.BOOL,
	GameTag.ELITE: Type.BOOL,
	GameTag.CARD_SET: CardSet,
	GameTag.CARDTEXT_INHAND: Type.LOCSTRING,
	GameTag.CARDNAME: Type.LOCSTRING,
	GameTag.WINDFURY: Type.BOOL,
	GameTag.TAUNT: Type.BOOL,
	GameTag.STEALTH: Type.BOOL,
	GameTag.SPELLPOWER: Type.BOOL,
	GameTag.DIVINE_SHIELD: Type.BOOL,
	GameTag.CHARGE: Type.BOOL,
	GameTag.CLASS: CardClass,
	GameTag.CARDRACE: Race,
	GameTag.FACTION: Faction,
	GameTag.RARITY: Rarity,
	GameTag.CARDTYPE: CardType,
	GameTag.FREEZE: Type.BOOL,
	GameTag.ENRAGED: Type.BOOL,
	GameTag.DEATHRATTLE: Type.BOOL,
	GameTag.BATTLECRY: Type.BOOL,
	GameTag.SECRET: Type.BOOL,
	GameTag.COMBO: Type.BOOL,
	GameTag.IMMUNE: Type.BOOL,
	# GameTag.AttackVisualType: AttackVisualType,
	GameTag.CardTextInPlay: Type.LOCSTRING,
	# GameTag.DevState: DevState,
github HearthSim / python-hearthstone / hearthstone / enums.py View on Github external
GameTag.WINDFURY: "Windfury",
	GameTag.TAUNT: "Taunt",
	GameTag.STEALTH: "Stealth",
	GameTag.SPELLPOWER: "Spellpower",
	GameTag.DIVINE_SHIELD: "Divine Shield",
	GameTag.CHARGE: "Charge",
	GameTag.CLASS: "Class",
	GameTag.CARDRACE: "Race",
	GameTag.FACTION: "Faction",
	GameTag.RARITY: "Rarity",
	GameTag.CARDTYPE: "CardType",
	GameTag.FREEZE: "Freeze",
	GameTag.ENRAGED: "Enrage",
	GameTag.RECALL: "Recall",
	GameTag.DEATHRATTLE: "Deathrattle",
	GameTag.BATTLECRY: "Battlecry",
	GameTag.SECRET: "Secret",
	GameTag.COMBO: "Combo",
	GameTag.IMMUNE: "Cant Be Damaged",
	GameTag.AttackVisualType: "AttackVisualType",
	GameTag.CardTextInPlay: "CardTextInPlay",
	GameTag.DevState: "DevState",
	GameTag.MORPH: "Morph",
	GameTag.COLLECTIBLE: "Collectible",
	GameTag.TARGETING_ARROW_TEXT: "TargetingArrowText",
	GameTag.ENCHANTMENT_BIRTH_VISUAL: "EnchantmentBirthVisual",
	GameTag.ENCHANTMENT_IDLE_VISUAL: "EnchantmentIdleVisual",
	GameTag.InvisibleDeathrattle: "InvisibleDeathrattle",
	GameTag.TAG_ONE_TURN_EFFECT: "OneTurnEffect",
	GameTag.SILENCE: "Silence",
	GameTag.COUNTER: "Counter",
	GameTag.ARTISTNAME: "ArtistName",
github HearthSim / python-hearthstone / hearthstone / enums.py View on Github external
GameTag.COMBO: Type.BOOL,
	GameTag.IMMUNE: Type.BOOL,
	# GameTag.AttackVisualType: AttackVisualType,
	GameTag.CardTextInPlay: Type.LOCSTRING,
	# GameTag.DevState: DevState,
	GameTag.MORPH: Type.BOOL,
	GameTag.COLLECTIBLE: Type.BOOL,
	GameTag.TARGETING_ARROW_TEXT: Type.LOCSTRING,
	GameTag.ENCHANTMENT_BIRTH_VISUAL: EnchantmentVisual,
	GameTag.ENCHANTMENT_IDLE_VISUAL: EnchantmentVisual,
	GameTag.InvisibleDeathrattle: Type.BOOL,
	GameTag.TAG_ONE_TURN_EFFECT: Type.BOOL,
	GameTag.SILENCE: Type.BOOL,
	GameTag.COUNTER: Type.BOOL,
	GameTag.ARTISTNAME: Type.STRING,
	GameTag.LocalizationNotes: Type.STRING,
	GameTag.ImmuneToSpellpower: Type.BOOL,
	GameTag.ADJACENT_BUFF: Type.BOOL,
	GameTag.FLAVORTEXT: Type.LOCSTRING,
	GameTag.HealTarget: Type.BOOL,
	GameTag.AURA: Type.BOOL,
	GameTag.POISONOUS: Type.BOOL,
	GameTag.HOW_TO_EARN: Type.LOCSTRING,
	GameTag.HOW_TO_EARN_GOLDEN: Type.LOCSTRING,
	GameTag.AI_MUST_PLAY: Type.BOOL,
	GameTag.AFFECTED_BY_SPELL_POWER: Type.BOOL,
	GameTag.SPARE_PART: Type.BOOL,
	GameTag.PLAYSTATE: PlayState,
	GameTag.ZONE: Zone,
	GameTag.STEP: Step,
	GameTag.NEXT_STEP: Step,
	GameTag.STATE: State,
github HearthSim / python-hearthstone / hearthstone / enums.py View on Github external
GameTag.TAUNT: Type.BOOL,
	GameTag.STEALTH: Type.BOOL,
	GameTag.SPELLPOWER: Type.BOOL,
	GameTag.DIVINE_SHIELD: Type.BOOL,
	GameTag.CHARGE: Type.BOOL,
	GameTag.CLASS: CardClass,
	GameTag.CARDRACE: Race,
	GameTag.FACTION: Faction,
	GameTag.RARITY: Rarity,
	GameTag.CARDTYPE: CardType,
	GameTag.FREEZE: Type.BOOL,
	GameTag.ENRAGED: Type.BOOL,
	GameTag.DEATHRATTLE: Type.BOOL,
	GameTag.BATTLECRY: Type.BOOL,
	GameTag.SECRET: Type.BOOL,
	GameTag.COMBO: Type.BOOL,
	GameTag.IMMUNE: Type.BOOL,
	# GameTag.AttackVisualType: AttackVisualType,
	GameTag.CardTextInPlay: Type.LOCSTRING,
	# GameTag.DevState: DevState,
	GameTag.MORPH: Type.BOOL,
	GameTag.COLLECTIBLE: Type.BOOL,
	GameTag.TARGETING_ARROW_TEXT: Type.LOCSTRING,
	GameTag.ENCHANTMENT_BIRTH_VISUAL: EnchantmentVisual,
	GameTag.ENCHANTMENT_IDLE_VISUAL: EnchantmentVisual,
	GameTag.InvisibleDeathrattle: Type.BOOL,
	GameTag.TAG_ONE_TURN_EFFECT: Type.BOOL,
	GameTag.SILENCE: Type.BOOL,
	GameTag.COUNTER: Type.BOOL,
	GameTag.ARTISTNAME: Type.STRING,
	GameTag.LocalizationNotes: Type.STRING,
	GameTag.ImmuneToSpellpower: Type.BOOL,
github HearthSim / python-hsreplay / hsreplay / utils.py View on Github external
except ValueError:
			pass

	for tag_change in root.iter("TagChange"):
		if "entity" in tag_change.attrib and tag_change.attrib["entity"] in entities:
			tag_change.set("EntityCardID", entities[tag_change.attrib["entity"]])
			tag_change.set("EntityCardName", _get_card_name(db, entities[tag_change.attrib["entity"]]))

		if int(tag_change.attrib["tag"]) in entity_ref_tags and tag_change.attrib["value"] in entities:
			tag_change.set("ValueReferenceCardID", entities[tag_change.attrib["value"]])
			tag_change.set(
				"ValueReferenceCardName",
				_get_card_name(db, entities[tag_change.attrib["value"]])
			)

		if tag_change.attrib["tag"] == str(GameTag.STATE.value):
			tag_change.set("StateName", State(int(tag_change.attrib["value"])).name)

		if tag_change.attrib["tag"] == str(GameTag.PLAYSTATE.value):
			tag_change.set("PlayStateName", PlayState(int(tag_change.attrib["value"])).name)

		try:
			name = GameTag(int(tag_change.attrib["tag"])).name
			tag_change.set("GameTagName", name)

			if name == "STEP":
				tag_change.set("StepName", Step(int(tag_change.attrib["value"])).name)

			if name == "NEXT_STEP":
				tag_change.set("StepName", Step(int(tag_change.attrib["value"])).name)

			if name == "ZONE":
github HearthSim / python-hearthstone / hearthstone / hslog / export.py View on Github external
def handle_tag_change(self, packet):
		if packet.tag == GameTag.CONTROLLER:
			self._controller_map[packet.entity] = packet.value
github HearthSim / python-hearthstone / hearthstone / cardxml.py View on Github external
def _make_tag_element(element, tagname, tag, value):
	e = ElementTree.SubElement(element, tagname, enumID=str(int(tag)))
	if not isinstance(tag, GameTag):
		try:
			tag = GameTag(tag)
			name = tag.name
			value = str(int(value))
		except ValueError:
			name = str(value)
			value = str(value)
	else:
		name = tag.name
		value = str(int(value))

	e.attrib["name"] = name
	e.attrib["type"] = "Int"
	e.attrib["value"] = value

	return e
github HearthSim / python-hearthstone / hearthstone / entities.py View on Github external
def can_be_in_deck(self) -> bool:
		card_type = self.type
		if not card_type:
			# If we don't know the card type, assume yes
			return True
		elif card_type == CardType.HERO:
			tags = self.base_tags
			return (
				tags.get(GameTag.CARD_SET, 0) not in INITIAL_HERO_SETS and
				tags.get(GameTag.COLLECTIBLE, 0)
			)

		return card_type in PLAYABLE_CARD_TYPES
github HearthSim / python-hearthstone / hearthstone / enums.py View on Github external
GameTag.MORPH: "Morph",
	GameTag.COLLECTIBLE: "Collectible",
	GameTag.TARGETING_ARROW_TEXT: "TargetingArrowText",
	GameTag.ENCHANTMENT_BIRTH_VISUAL: "EnchantmentBirthVisual",
	GameTag.ENCHANTMENT_IDLE_VISUAL: "EnchantmentIdleVisual",
	GameTag.InvisibleDeathrattle: "InvisibleDeathrattle",
	GameTag.TAG_ONE_TURN_EFFECT: "OneTurnEffect",
	GameTag.SILENCE: "Silence",
	GameTag.COUNTER: "Counter",
	GameTag.ARTISTNAME: "ArtistName",
	GameTag.ImmuneToSpellpower: "ImmuneToSpellpower",
	GameTag.ADJACENT_BUFF: "AdjacentBuff",
	GameTag.FLAVORTEXT: "FlavorText",
	GameTag.HealTarget: "HealTarget",
	GameTag.AURA: "Aura",
	GameTag.POISONOUS: "Poisonous",
	GameTag.HOW_TO_EARN: "HowToGetThisCard",
	GameTag.HOW_TO_EARN_GOLDEN: "HowToGetThisGoldCard",
	GameTag.AI_MUST_PLAY: "AIMustPlay",
	GameTag.AFFECTED_BY_SPELL_POWER: "AffectedBySpellPower",
	GameTag.SPARE_PART: "SparePart",
	GameTag.HIDE_STATS: "HideStats",
	GameTag.DISCOVER: "Treasure",
	GameTag.AUTOATTACK: "AutoAttack",
}


##
# Card enums

class CardClass(IntEnum):
	"""TAG_CLASS"""