本文整理汇总了C#中Hearthstone_Deck_Tracker.Hearthstone.Entities.Entity.GetTag方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.GetTag方法的具体用法?C# Entity.GetTag怎么用?C# Entity.GetTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hearthstone_Deck_Tracker.Hearthstone.Entities.Entity
的用法示例。
在下文中一共展示了Entity.GetTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsHero
public static bool IsHero(Entity e)
{
return e.HasTag(GAME_TAG.CARDTYPE)
&& e.GetTag(GAME_TAG.CARDTYPE) == (int)TAG_CARDTYPE.HERO
&& e.HasTag(GAME_TAG.ZONE)
&& e.GetTag(GAME_TAG.ZONE) == (int)TAG_ZONE.PLAY;
}
示例2: calcHealthArmor
// -----------------------------------------------------------
// CALC HEALTH AND MANA --------------------------------------
// calculate the health of a player with armor
public int calcHealthArmor(Entity ent)
{
var currentHealth = 0;
var maxHealth = 30;
var damageTaken = ent.GetTag(GAME_TAG.DAMAGE);
var currentArmor = ent.GetTag(GAME_TAG.ARMOR);
currentHealth = (maxHealth - damageTaken) + currentArmor;
return currentHealth;
}
示例3: calcHealth
// calculate the health of a player without armor
public int calcHealth(Entity ent)
{
var currentHealth = 0;
var maxHealth = 30;
var damageTaken = ent.GetTag(GAME_TAG.DAMAGE);
currentHealth = maxHealth - damageTaken;
return currentHealth;
}
示例4: BoardHero
public BoardHero(Entity hero, Entity weapon, bool activeTurn)
{
_hero = new BoardCard(hero, activeTurn);
// hero gains windfury with weapon, doubling attack get base attack
_baseAttack = hero.GetTag(GameTag.ATK);
if(weapon != null)
_weapon = new BoardCard(weapon, activeTurn);
Include = activeTurn && _hero.Include;
Attack = AttackWithWeapon();
}
示例5: HandleOpponentGet
public void HandleOpponentGet(Entity entity, int turn, int id)
{
if(!_game.IsMulliganDone && entity.GetTag(ZONE_POSITION) == 5)
entity.CardId = HearthDb.CardIds.NonCollectible.Neutral.TheCoin;
_game.Opponent.CreateInHand(entity, turn);
Core.UpdateOpponentCards();
GameEvents.OnOpponentGet.Execute();
}
示例6: HandleSecretsOnPlay
public async void HandleSecretsOnPlay(Entity entity)
{
if(!Config.Instance.AutoGrayoutSecrets)
return;
if(entity.IsSpell)
{
_game.OpponentSecrets.SetZero(Mage.Counterspell);
if(_game.OpponentMinionCount < 7)
{
//CARD_TARGET is set after ZONE, wait for 50ms gametime before checking
await _game.GameTime.WaitForDuration(50);
if(entity.HasTag(CARD_TARGET) && _game.Entities[entity.GetTag(CARD_TARGET)].IsMinion)
_game.OpponentSecrets.SetZero(Mage.Spellbender);
}
if(Core.MainWindow != null)
Core.Overlay.ShowSecrets();
}
else if(entity.IsMinion && _game.PlayerMinionCount > 3)
{
_game.OpponentSecrets.SetZero(Paladin.SacredTrial);
if(Core.MainWindow != null)
Core.Overlay.ShowSecrets();
}
}
示例7: HandleOpponentSecretPlayed
public void HandleOpponentSecretPlayed(Entity entity, string cardId, int from, int turn, Zone fromZone, int otherId)
{
_game.OpponentSecretCount++;
switch(fromZone)
{
case Zone.DECK:
_game.Opponent.SecretPlayedFromDeck(entity, turn);
break;
case Zone.HAND:
_game.Opponent.SecretPlayedFromHand(entity, turn);
break;
default:
_game.Opponent.CreateInSecret(entity, turn);
break;
}
HeroClass heroClass;
var className = ((CardClass)entity.GetTag(CLASS)).ToString();
if(!string.IsNullOrEmpty(className))
{
className = className.Substring(0, 1).ToUpper() + className.Substring(1, className.Length - 1).ToLower();
if(!Enum.TryParse(className, out heroClass) && !Enum.TryParse(_game.Opponent.Class, out heroClass))
return;
}
else if(!Enum.TryParse(_game.Opponent.Class, out heroClass))
return;
_game.OpponentSecrets.NewSecretPlayed(heroClass, otherId, turn);
if(Core.MainWindow != null)
Core.Overlay.ShowSecrets();
GameEvents.OnOpponentPlay.Execute(Database.GetCardFromId(cardId));
}
示例8: Mulligan
public void Mulligan(Entity entity)
{
var ce = MoveCardEntity(entity, Hand, Deck, 0);
//new cards are drawn first
var newCard = Hand.FirstOrDefault(x => x.Entity.GetTag(GAME_TAG.ZONE_POSITION) == entity.GetTag(GAME_TAG.ZONE_POSITION));
if(newCard != null)
newCard.CardMark = CardMark.Mulliganed;
if(!string.IsNullOrEmpty(entity.CardId) && DrawnCardIds.Contains(entity.CardId))
DrawnCardIds.Remove(entity.CardId);
Log("Mulligan", ce);
}
示例9: Play
public void Play(Entity entity, int turn)
{
var ce = MoveCardEntity(entity, Hand, entity.IsSecret ? Secrets : Board, turn);
if(entity.GetTag(GAME_TAG.CARDTYPE) == (int)TAG_CARDTYPE.TOKEN)
{
ce.CardMark = CardMark.Created;
ce.Created = true;
}
UpdateRevealedEntity(ce, turn);
Log("Play", ce);
}
示例10: IsHero
public static bool IsHero(Entity e) => e.HasTag(CARDTYPE) && e.GetTag(CARDTYPE) == (int)TAG_CARDTYPE.HERO && e.HasTag(ZONE)
&& e.GetTag(ZONE) == (int)TAG_ZONE.PLAY;
示例11: HandleOpponentMinionDeath
public void HandleOpponentMinionDeath(Entity entity, int turn)
{
if(!Config.Instance.AutoGrayoutSecrets)
return;
_game.OpponentSecrets.SetZero(Mage.Duplicate);
var numDeathrattleMinions = 0;
if(entity.IsActiveDeathrattle)
{
if(!CardIds.DeathrattleSummonCardIds.TryGetValue(entity.CardId, out numDeathrattleMinions))
{
if(entity.CardId == HearthDb.CardIds.Collectible.Neutral.Stalagg
&& _game.Opponent.Graveyard.Any(x => x.CardId == HearthDb.CardIds.Collectible.Neutral.Feugen)
|| entity.CardId == HearthDb.CardIds.Collectible.Neutral.Feugen
&& _game.Opponent.Graveyard.Any(x => x.CardId == HearthDb.CardIds.Collectible.Neutral.Stalagg))
numDeathrattleMinions = 1;
}
if(
_game.Entities.Any(
x =>
x.Value.CardId == HearthDb.CardIds.NonCollectible.Druid.SoulOfTheForestEnchantment
&& x.Value.GetTag(ATTACHED) == entity.Id))
numDeathrattleMinions++;
if(
_game.Entities.Any(
x =>
x.Value.CardId == HearthDb.CardIds.NonCollectible.Shaman.AncestralSpiritEnchantment
&& x.Value.GetTag(ATTACHED) == entity.Id))
numDeathrattleMinions++;
}
if(_game.OpponentEntity != null && _game.OpponentEntity.HasTag(EXTRA_DEATHRATTLES))
numDeathrattleMinions *= (_game.OpponentEntity.GetTag(EXTRA_DEATHRATTLES) + 1);
HandleAvengeAsync(numDeathrattleMinions);
// redemption never triggers if a deathrattle effect fills up the board
// effigy can trigger ahead of the deathrattle effect, but only if effigy was played before the deathrattle minion
if(_game.OpponentMinionCount < 7 - numDeathrattleMinions)
{
_game.OpponentSecrets.SetZero(Paladin.Redemption);
_game.OpponentSecrets.SetZero(Mage.Effigy);
}
else
{
// todo: need to properly break ties when effigy + deathrattle played in same turn
var minionTurnPlayed = turn - entity.GetTag(NUM_TURNS_IN_PLAY);
var secret = _game.OpponentSecrets.Secrets.FirstOrDefault(x => x.TurnPlayed >= minionTurnPlayed);
var secretOffset = secret != null ? _game.OpponentSecrets.Secrets.IndexOf(secret) : 0;
_game.OpponentSecrets.SetZeroOlder(Mage.Effigy, secretOffset);
}
if(Core.MainWindow != null)
Core.Overlay.ShowSecrets();
}
示例12: Play
public void Play(Entity entity, int turn)
{
if(!IsLocalPlayer)
UpdateKnownEntitesInDeck(entity.CardId, entity.Info.Turn);
switch(entity.GetTag(GameTag.CARDTYPE))
{
case (int)CardType.TOKEN:
entity.Info.Created = true;
break;
case (int)CardType.SPELL:
SpellsPlayedCount++;
break;
}
entity.Info.Hidden = false;
entity.Info.Turn = turn;
Log(entity);
}
示例13: calcMaxMana
// max mana
public int calcMaxMana(Entity ent)
{
return ent.GetTag(GAME_TAG.RESOURCES);
}
示例14: calcCurrentMana
// calc current mana
public int calcCurrentMana(Entity ent)
{
var mana = ent.GetTag(GAME_TAG.RESOURCES) - ent.GetTag(GAME_TAG.RESOURCES_USED);
return mana;
}
示例15: HandlePlayerStolen
public void HandlePlayerStolen(Entity entity, string cardId, int turn)
{
LogEvent("PlayerStolen");
_game.Player.StolenByOpponent(entity, turn);
_game.Opponent.StolenFromOpponent(entity, turn);
if(entity.IsSecret)
{
HeroClass heroClass;
var className = ((TAG_CLASS)entity.GetTag(CLASS)).ToString();
if(!string.IsNullOrEmpty(className))
{
className = className.Substring(0, 1).ToUpper() + className.Substring(1, className.Length - 1).ToLower();
if(!Enum.TryParse(className, out heroClass))
{
if(!Enum.TryParse(_game.Opponent.Class, out heroClass))
return;
}
}
else
{
if(!Enum.TryParse(_game.Opponent.Class, out heroClass))
return;
}
_game.OpponentSecretCount++;
_game.OpponentSecrets.NewSecretPlayed(heroClass, entity.Id, turn, cardId);
Core.Overlay.ShowSecrets();
}
}