Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin development: add status on board to Entity class #927

Closed
yuantliu opened this issue May 2, 2015 · 2 comments
Closed

Plugin development: add status on board to Entity class #927

yuantliu opened this issue May 2, 2015 · 2 comments

Comments

@yuantliu
Copy link

yuantliu commented May 2, 2015

I'm writing a plugin and I'm having trouble determining if an entity is a minion that's on the board or not.

Maybe I'm clueless but when I'm trying to iterate through Hearthstone.Game.Entities dictionary, I can't tell if the values are minions in hand, minions on the board, spell in hand, or even the hero power. It would be nice to have an attribute in the entity class that makes clear whether the card is a spell or a minion or hero power or weapon and whether it's on the board or not.

@azeier
Copy link
Member

azeier commented May 2, 2015

This is how I get that kind of information in replays. But I agree, having those as entity properties would be handy.

You might also want to check out the debug window, found via "options > tracker > logging (turn on in settings) > debugwindow"

This should be easier actually:

public bool IsMinion
{
    get { return HasTag(GAME_TAG.CARDTYPE) && GetTag(GAME_TAG.CARDTYPE) == (int)TAG_CARDTYPE.MINION; }
}

azeier pushed a commit that referenced this issue May 2, 2015
@azeier
Copy link
Member

azeier commented May 2, 2015

I added a few properties now (see c058cd9).

IsOpponent,
IsMinion,
IsWeapon,
IsInHand,
IsInPlay,
IsInGraveyard,
IsInZone(zone)
IsControlledBy(id)

TAG_CARDTYPE.SPELL does apparently not exist, and since my game won't start at the moment apparently, I'm not sure how to deduce that. So IsSpell is missing for now.

Suggestions for any others?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants