private void getHandcards() { handCards.Clear(); this.anzcards = 0; this.enemyAnzCards = 0; List <HRCard> list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND); list.AddRange(HRCard.GetCards(HRPlayer.GetEnemyPlayer(), HRCardZone.HAND)); foreach (HRCard item in list) { HREntity entitiy = item.GetEntity(); if (entitiy.GetControllerId() == this.ownPlayerController && entitiy.GetZonePosition() >= 1) // own handcard { CardDB.Card c = CardDB.Instance.getCardDataFromID(entitiy.GetCardId()); //c.cost = entitiy.GetCost(); //c.entityID = entitiy.GetEntityId(); Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = c; hc.position = entitiy.GetZonePosition(); hc.entity = entitiy.GetEntityId(); hc.manacost = entitiy.GetCost(); handCards.Add(hc); this.anzcards++; } if (entitiy.GetControllerId() != this.ownPlayerController && entitiy.GetZonePosition() >= 1) // enemy handcard { this.enemyAnzCards++; } } }
private HREngine.API.Actions.ActionBase HandleBattleMulliganPhase() { SmartCc = new Simulation(); SmartCc.CreateLogFolder(); SmartCc.TurnCount = 0; if (HRMulligan.IsMulliganActive()) { List <HRCard> Choices = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND); List <Card> ParsedChoices = new List <Card>(); foreach (HRCard card in Choices) { HREntity entity = card.GetEntity(); Card c = Card.Create(entity.GetCardId(), true, entity.GetEntityId()); c.CurrentCost = entity.GetCost(); ParsedChoices.Add(c); } List <HRCard> CardsToKeep = new List <HRCard>(); foreach (Card c in ProfileInterface.Behavior.HandleMulligan(ParsedChoices)) { foreach (HRCard card in Choices) { if (c.Id == card.GetEntity().GetEntityId()) { CardsToKeep.Add(card); } } } foreach (HRCard card in Choices) { if (!CardsToKeep.Contains(card)) { HRMulligan.ToggleCard(card); } } return(null); } return(null); }
private void getHandcards() { handCards.Clear(); this.anzcards = 0; this.enemyAnzCards = 0; List <HRCard> list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND); foreach (HRCard item in list) { HREntity entitiy = item.GetEntity(); if (entitiy.GetControllerId() == this.ownPlayerController && entitiy.GetZonePosition() >= 1) // own handcard { CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.GetCardId())); //c.cost = entitiy.GetCost(); //c.entityID = entitiy.GetEntityId(); Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = c; hc.position = entitiy.GetZonePosition(); hc.entity = entitiy.GetEntityId(); hc.manacost = entitiy.GetCost(); hc.addattack = 0; if (c.name == CardDB.cardName.bolvarfordragon) { hc.addattack = entitiy.GetATK() - 1; // -1 because it starts with 1, we count only the additional attackvalue } handCards.Add(hc); this.anzcards++; } //maybe check if it has BRM_028e on it? } Dictionary <int, HREntity> allEntitys = HRGame.GetEntityMap(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetControllerId() != this.ownPlayerController && ent.GetZonePosition() >= 1 && ent.GetZone() == HRCardZone.HAND) // enemy handcard { this.enemyAnzCards++; } } }
private void getHandcards() { handCards.Clear(); this.anzcards = 0; this.enemyAnzCards = 0; List <HRCard> list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND); foreach (HRCard item in list) { HREntity entitiy = item.GetEntity(); if (entitiy.GetControllerId() == this.ownPlayerController && entitiy.GetZonePosition() >= 1) // own handcard { CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.GetCardId())); //c.cost = entitiy.GetCost(); //c.entityID = entitiy.GetEntityId(); Handmanager.Handcard hc = new Handmanager.Handcard(); hc.card = c; hc.position = entitiy.GetZonePosition(); hc.entity = entitiy.GetEntityId(); hc.manacost = entitiy.GetCost(); handCards.Add(hc); this.anzcards++; } } Dictionary <int, HREntity> allEntitys = HRGame.GetEntityMap(); foreach (HREntity ent in allEntitys.Values) { if (ent.GetControllerId() != this.ownPlayerController && ent.GetZonePosition() >= 1 && ent.GetZone() == HRCardZone.HAND) // enemy handcard { this.enemyAnzCards++; } } }