本文整理汇总了C#中HREngine.Bots.Minion.loadEnchantments方法的典型用法代码示例。如果您正苦于以下问题:C# Minion.loadEnchantments方法的具体用法?C# Minion.loadEnchantments怎么用?C# Minion.loadEnchantments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.Minion
的用法示例。
在下文中一共展示了Minion.loadEnchantments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getMinions
private void getMinions()
{
// ALL minions on Playfield:
List<HSCard> list = TritonHs.GetCards(CardZone.Battlefield, true);
list.AddRange(TritonHs.GetCards(CardZone.Battlefield, false));
var enchantments = new List<HSCard>();
ownMinions.Clear();
enemyMinions.Clear();
List<HSCard> allcards = TritonHs.GetAllCards();
foreach (HSCard entiti in list)
{
int zp = entiti.GetTag(GAME_TAG.ZONE_POSITION);
if (entiti.IsMinion && zp >= 1)
{
HSCard entitiy = entiti;
foreach (HSCard ent in allcards)
{
if (ent.EntityId == entiti.EntityId)
{
entitiy = ent;
break;
}
}
//Helpfunctions.Instance.ErrorLog("zonepos " + zp);
CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.Id));
Minion m = new Minion();
m.name = c.name;
m.handcard.card = c;
m.Angr = entitiy.GetTag(GAME_TAG.ATK);
m.maxHp = entitiy.GetTag(GAME_TAG.HEALTH);
m.Hp = entitiy.GetTag(GAME_TAG.HEALTH) - entitiy.GetTag(GAME_TAG.DAMAGE);
if (m.Hp <= 0) continue;
m.wounded = false;
if (m.maxHp > m.Hp) m.wounded = true;
m.exhausted = (entitiy.GetTag(GAME_TAG.EXHAUSTED) == 0) ? false : true;
m.taunt = (entitiy.GetTag(GAME_TAG.TAUNT) == 0) ? false : true;
m.numAttacksThisTurn = entitiy.GetTag(GAME_TAG.NUM_ATTACKS_THIS_TURN);
int temp = entitiy.GetTag(GAME_TAG.NUM_TURNS_IN_PLAY);
m.playedThisTurn = (temp == 0) ? true : false;
m.windfury = (entitiy.GetTag(GAME_TAG.WINDFURY) == 0) ? false : true;
m.frozen = (entitiy.GetTag(GAME_TAG.FROZEN) == 0) ? false : true;
m.divineshild = (entitiy.GetTag(GAME_TAG.DIVINE_SHIELD) == 0) ? false : true;
m.stealth = (entitiy.GetTag(GAME_TAG.STEALTH) == 0) ? false : true;
m.poisonous = (entitiy.GetTag(GAME_TAG.POISONOUS) == 0) ? false : true;
m.immune = (entitiy.GetTag(GAME_TAG.IMMUNE_WHILE_ATTACKING) == 0) ? false : true;
m.silenced = (entitiy.GetTag(GAME_TAG.SILENCED) == 0) ? false : true;
// Drew: fixed | is the tag removed when silenced, via Mass Dispel?
m.cantBeTargetedBySpellsOrHeroPowers = (entitiy.GetTag(GAME_TAG.CANT_BE_TARGETED_BY_HERO_POWERS) == 0) ? false : true;
m.charge = 0;
m.spellpower = entitiy.GetTag(GAME_TAG.SPELLPOWER);
if (!m.silenced && m.name == CardDB.cardName.southseadeckhand &&
entitiy.GetTag(GAME_TAG.CHARGE) == 1) m.charge = 1;
if (!m.silenced && m.handcard.card.Charge) m.charge++;
m.zonepos = zp;
m.entitiyID = entitiy.EntityId;
//Helpfunctions.Instance.ErrorLog( m.name + " ready params ex: " + m.exhausted + " charge: " +m.charge + " attcksthisturn: " + m.numAttacksThisTurn + " playedthisturn " + m.playedThisTurn );
List<miniEnch> enchs = new List<miniEnch>();
foreach (HSCard ent in allcards)
{
if (ent.GetTag(GAME_TAG.ATTACHED) == m.entitiyID && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play
{
CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id);
int controler = ent.GetTag(GAME_TAG.CONTROLLER);
int creator = ent.GetTag(GAME_TAG.CREATOR);
enchs.Add(new miniEnch(id, creator, controler));
}
}
m.loadEnchantments(enchs, entitiy.GetTag(GAME_TAG.CONTROLLER));
//.........这里部分代码省略.........
示例2: getMinions
private void getMinions()
{
Dictionary<int, HREntity> allEntitys = HRGame.GetEntityMap();
ownMinions.Clear();
enemyMinions.Clear();
HRPlayer ownPlayer = HRPlayer.GetLocalPlayer();
HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer();
// ALL minions on Playfield:
List<HRCard> list = HRCard.GetCards(ownPlayer, HRCardZone.PLAY);
list.AddRange(HRCard.GetCards(enemyPlayer, HRCardZone.PLAY));
List<HREntity> enchantments = new List<HREntity>();
foreach (HRCard item in list)
{
HREntity entitiy = item.GetEntity();
int zp = entitiy.GetZonePosition();
if (entitiy.GetCardType() == HRCardType.MINION && zp >= 1)
{
//Helpfunctions.Instance.ErrorLog("zonepos " + zp);
CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.GetCardId()));
Minion m = new Minion();
m.name = c.name;
m.handcard.card = c;
m.Angr = entitiy.GetATK();
m.maxHp = entitiy.GetHealth();
m.Hp = m.maxHp - entitiy.GetDamage();
if (m.Hp <= 0) continue;
m.wounded = false;
if (m.maxHp > m.Hp) m.wounded = true;
m.exhausted = entitiy.IsExhausted();
m.taunt = (entitiy.HasTaunt()) ? true : false;
m.numAttacksThisTurn = entitiy.GetNumAttacksThisTurn();
int temp = entitiy.GetNumTurnsInPlay();
m.playedThisTurn = (temp == 0) ? true : false;
m.windfury = (entitiy.HasWindfury()) ? true : false;
m.frozen = (entitiy.IsFrozen()) ? true : false;
m.divineshild = (entitiy.HasDivineShield()) ? true : false;
m.stealth = (entitiy.IsStealthed()) ? true : false;
m.poisonous = (entitiy.IsPoisonous()) ? true : false;
m.immune = (entitiy.IsImmune()) ? true : false;
m.silenced = (entitiy.GetTag(HRGameTag.SILENCED) >= 1) ? true : false;
m.charge = 0;
if (!m.silenced && m.name == CardDB.cardName.southseadeckhand && entitiy.GetTag(HRGameTag.CHARGE) == 1) m.charge = 1;
if (!m.silenced && m.handcard.card.Charge) m.charge = 1;
m.zonepos = zp;
m.entitiyID = entitiy.GetEntityId();
//Helpfunctions.Instance.ErrorLog( m.name + " ready params ex: " + m.exhausted + " charge: " +m.charge + " attcksthisturn: " + m.numAttacksThisTurn + " playedthisturn " + m.playedThisTurn );
List<miniEnch> enchs = new List<miniEnch>();
foreach (HREntity ent in allEntitys.Values)
{
if (ent.GetTag(HRGameTag.ATTACHED) == m.entitiyID && ent.GetZone() == HRCardZone.PLAY)
{
CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.GetCardId());
int creator = ent.GetTag(HRGameTag.CREATOR);
int controler = ent.GetTag(HRGameTag.CONTROLLER);
enchs.Add(new miniEnch(id, creator, controler));
}
}
m.loadEnchantments(enchs, entitiy.GetControllerId());
m.Ready = false; // if exhausted, he is NOT ready
m.updateReadyness();
if (entitiy.GetControllerId() == this.ownPlayerController) // OWN minion
{
m.own = true;
this.ownMinions.Add(m);
}
else
//.........这里部分代码省略.........
示例3: getMinions
//.........这里部分代码省略.........
m.handcard.card = c;
m.Angr = entitiy.GetTag(GAME_TAG.ATK);
m.maxHp = entitiy.GetTag(GAME_TAG.HEALTH);
m.Hp = m.maxHp - entitiy.GetTag(GAME_TAG.DAMAGE);
if (m.Hp <= 0) continue;
m.wounded = false;
if (m.maxHp > m.Hp) m.wounded = true;
m.exhausted = entitiy.IsExhausted;
m.taunt = (entitiy.HasTaunt);
m.numAttacksThisTurn = entitiy.GetTag(GAME_TAG.NUM_ATTACKS_THIS_TURN);
int temp = entitiy.GetTag(GAME_TAG.NUM_TURNS_IN_PLAY);
m.playedThisTurn = (temp == 0) ? true : false;
m.windfury = (entitiy.HasWindfury);
m.frozen = (entitiy.IsFrozen);
m.divineshild = (entitiy.HasDivineShield);
m.stealth = (entitiy.IsStealthed);
m.poisonous = (entitiy.IsPoisonous);
m.immune = (entitiy.IsImmune);
m.silenced = entitiy.IsSilenced;
m.spellpower = entitiy.GetTag(GAME_TAG.SPELLPOWER);
m.charge = 0;
if (!m.silenced && m.name == CardDB.cardName.southseadeckhand && entitiy.HasCharge) m.charge = 1;
if (!m.silenced && m.handcard.card.Charge) m.charge = 1;
if (m.charge == 0 && entitiy.HasCharge) m.charge = 1;
m.zonepos = zp;
m.entitiyID = entitiy.EntityId;
if(m.name == CardDB.cardName.unknown) Helpfunctions.Instance.ErrorLog("unknown card error");
Helpfunctions.Instance.ErrorLog(m.entitiyID + " ." + entitiy.Id + ". " + m.name + " ready params ex: " + m.exhausted + " charge: " + m.charge + " attcksthisturn: " + m.numAttacksThisTurn + " playedthisturn " + m.playedThisTurn);
//Helpfunctions.Instance.ErrorLog("spellpower check " + entitiy.SpellPowerAttack + " " + entitiy.SpellPowerHealing + " " + entitiy.SpellPower);
List<miniEnch> enchs = new List<miniEnch>();
/*foreach (Entity ent in allEntitys.Values)
{
if (ent.Attached == m.entitiyID && ent.Zone == HSRangerLib.TAG_ZONE.PLAY)
{
CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.CardId);
int creator = ent.CreatorId;
int controler = ent.ControllerId;
enchs.Add(new miniEnch(id, creator, controler));
}
}*/
foreach (HSCard ent in item.AttachedCards)
{
CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id);
int creator = ent.CreatorId;
int controler = ent.ControllerId;
enchs.Add(new miniEnch(id, creator, controler));
}
m.loadEnchantments(enchs, entitiy.ControllerId);
m.Ready = false; // if exhausted, he is NOT ready
m.updateReadyness();
if (entitiy.ControllerId == this.ownPlayerController) // OWN minion
{
m.own = true;
this.ownMinions.Add(m);
}
else
{
m.own = false;
this.enemyMinions.Add(m);
}
}
// minions added
}
}