private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name == "HitBox") { Debug.Log("Owww"); if (this.tag == "beam") { player.GetComponent <BasicMovment>().DecreaseHealth(6); Destroy(gameObject); } if (this.tag == "bigbeam") { i = Random.Range(0, 4); if (cm.pHand[i].activeInHierarchy == true) { Card c = cm.pHand[i].GetComponent <CardTemplate>().card; CardProperties cp = cm.pHand[i].GetComponent <CardTemplate>().card.cardProperties; cm.pHand[i].SetActive(false); cm.discardPile.Add(cm.pHand[i].GetComponent <CardTemplate>().card); //cm.usedCardType = c.cardType; // Sets the cardtype in BasicMovement to be accessed later cm.pHand[i].GetComponent <CardTemplate>().card = null; } player.GetComponent <BasicMovment>().DecreaseHealth(20); Destroy(gameObject); } } }
public string GetStateDelta() { // Just return the location/rotation of the players and the cards information List <string> cardStringArray = new List <string>(); for (int i = 0; i < propPlacement.cards.Length; i++) { if (propPlacement.cards[i] != null) { var outline = propPlacement.cards[i].GetComponent <cakeslice.Outline>(); bool notSelected = outline.eraseRenderer; string selectionInfo = notSelected ? "unselected" : "selected"; cardStringArray.Add("\"" + selectionInfo + " " + CardProperties.Stringify(propPlacement.cards[i]) + "\""); } } var cardString = String.Join(", ", cardStringArray.ToArray()); var leaderPosV3 = propPlacement.props[propPlacement.props.Count - 2].transform.position.ToString("f3"); var leaderRotV3 = propPlacement.props[propPlacement.props.Count - 2].transform.rotation.eulerAngles.ToString("f3"); var followerPosV3 = propPlacement.props[propPlacement.props.Count - 1].transform.position.ToString("f3"); var followerRotV3 = propPlacement.props[propPlacement.props.Count - 1].transform.rotation.eulerAngles.ToString("f3"); string finalString = ""; finalString += "{\"leader\": {\"position\": \"" + leaderPosV3 + "\", \"rotation\": \"" + leaderRotV3 + "\"},"; finalString += "\"follower\": {\"position\": \"" + followerPosV3 + "\", \"rotation\": \"" + followerRotV3 + "\"},"; finalString += "\"cards\": [" + cardString + "]}"; return(finalString); }
public void checkCards() { // regenerate card when it is impossible CardProperties heapCardProperties = GameObject.Find("Heap").GetComponentsInChildren <CardProperties>()[0]; int nSymbolsHeap = heapCardProperties.nSymbol; int nColorHeap = heapCardProperties.nColor; int nSymbolTypeHeap = heapCardProperties.nSymbolType; CardProperties[] handCardProperties = GameObject.Find("Hand").GetComponentsInChildren <CardProperties>(); bool ispossible = false; Debug.Log("HEAP nb sym" + nSymbolsHeap + " n color" + nColorHeap + " nSymboltype" + nSymbolTypeHeap); int i = 1; foreach (CardProperties properties in handCardProperties) { int nSymbolsHand = properties.nSymbol; int nColorHand = properties.nColor; int nSymbolTypeHand = properties.nSymbolType; Debug.Log("CARTE " + i + " nb sym" + nSymbolsHand + " n color" + nColorHand + " nSymboltype" + nSymbolTypeHand); if (nSymbolsHand == nSymbolsHeap || nColorHand == nColorHeap || nSymbolTypeHand == nSymbolTypeHeap) { ispossible = true; } i++; } if (!ispossible) { GameObject.Find("Hand").GetComponent <CardHand>().dropCards(); GameObject.Find("Hand").GetComponent <CardHand>().drawCards(); } }
public void SetCard(GameObject c) { card = c; cardProp = card.GetComponent <CardProperties>(); flip = card.GetComponent <CardFlip>(); count = 0; }
public void LoadCard(Card c) { if (c == null) { return; } card = c; CardProperties cp = c.cardProperties; gameObject.name = cp.title; //titleText.text = c.cardProperties.title; //dmgText.text = cp.damage.ToString(); gameObject.GetComponent <Image>().sprite = cp.cardPic; //cardPicture.sprite = c.cardProperties.cardPic; //if (c.cardType is CardTypeSlash) //{ // gameObject.GetComponent<Image>().sprite = slash; // //GameManager.gm.slashCardCountUpdate(1); //} //if (c.cardType is CardTypeBeam) //{ // gameObject.GetComponent<Image>().sprite = beam; // //GameManager.gm.slashCardCountUpdate(1); //} //if (c.cardType is CardTypeDash) //{ // gameObject.GetComponent<Image>().sprite = dash; // //GameManager.gm.slashCardCountUpdate(1); //} if (c.cardType == null) { gameObject.GetComponent <Image>().sprite = null; } }
public static GameObject generateCardWithProperties(CardProperties properties) { //Instantiate prefab card GameObject card = (GameObject)Instantiate(prefabCard); //Instantite prefab symbol for each nb symbol for (int i = 1; i <= properties.nSymbol; i++) { GameObject symbol = (GameObject)Instantiate(prefabSymbol); symbol.transform.parent = card.transform; symbol.transform.position = card.transform.position; symbol.GetComponent <SpriteRenderer>().sprite = listSymbols[properties.nSymbolType - 1]; symbol.GetComponent <SpriteRenderer>().color = listColors[properties.nColor - 1]; } //set properties of this card to allow computation for the gameplay CardProperties cardProperties = card.GetComponent <CardProperties>(); cardProperties.nColor = properties.nColor; cardProperties.nSymbol = properties.nSymbol; cardProperties.nSymbolType = properties.nSymbolType; //Transform symbols on card, depend on the number of symb. dispatchSymbols(card); return(card); }
public override bool IsComplete() { PlayerHolder playerHolder = Settings.gameManager.currentPlayer; PlayerHolder enemyPlayerHolder = Settings.gameManager.GetEnemyOf(playerHolder); if (playerHolder.attackingCards.Count == 0) { return(true); } for (int i = 0; i < playerHolder.attackingCards.Count; i++) { CardInstance cardInst = playerHolder.attackingCards[i]; Card card = cardInst.viz.card; CardProperties attackProperty = card.GetProperty(attackElement); if (attackProperty == null) { Debug.LogError("You are attacking with a card that cant attack"); continue; } playerHolder.DropCard(cardInst, false); playerHolder.currentHolders.SetCardDown(cardInst); cardInst.SetFlatfooted(true); enemyPlayerHolder.DoDamage(attackProperty.intVal); } playerHolder.attackingCards.Clear(); return(true); }
public static GameObject generateCard() { //generate random numbers for type, color and symbol. int nColor = (int)Random.Range(1, listColors.Count + 1); int nSymbol = (int)Random.Range(1, nMaxSymbol + 1); int nSymbolType = (int)Random.Range(1, listSymbols.Count + 1); //Instantiate prefab card GameObject card = (GameObject)Instantiate(prefabCard); //Instantite prefab symbol for each nb symbol for (int i = 1; i <= nSymbol; i++) { GameObject symbol = (GameObject)Instantiate(prefabSymbol); symbol.transform.parent = card.transform; symbol.transform.position = card.transform.position; symbol.GetComponent <SpriteRenderer>().sprite = listSymbols[nSymbolType - 1]; symbol.GetComponent <SpriteRenderer>().color = listColors[nColor - 1]; } //set properties of this card to allow computation for the gameplay CardProperties cardProperties = card.GetComponent <CardProperties>(); cardProperties.nColor = nColor; cardProperties.nSymbol = nSymbol; cardProperties.nSymbolType = nSymbolType; //Transform symbols on card, depend on the number of symb. dispatchSymbols(card); return(card); }
public void LoadCard(Card c) { if (c == null) { return; } card = c; for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementInt) { p.text.text = cp.intValue.ToString(); } else if (cp.element is ElementText) { p.text.text = cp.stringValue; } else if (cp.element is ElementImage) { p.img.sprite = cp.sprite; } } }
public Card(string cardTitle, string cardDescription, int attack) { props = new CardProperties(); cardPrefab = (GameObject)Instantiate(Resources.Load("Card")); //safe way to check cast? cardPrefab.transform.Find("Card Title").GetComponent <Text>().text = cardTitle; cardPrefab.transform.Find("Card Description").GetComponent <Text>().text = cardDescription; props.Attack = attack; }
private void pBoxEnergyCard_Layout(object sender, LayoutEventArgs e) { CardProperties cardprop = new CardProperties(); cardprop = ((CardProperties)this.Tag); pBoxEnergyCard.Image = new Bitmap(Ops.GetEnergyCardImage(cardprop.PokemonType), 221, 341); }
public void UseCard(int i) { if (pHand[i].activeInHierarchy == true) { CardProperties cp = pHand[i].GetComponent <CardTemplate>().card.cardProperties; pHand[i].SetActive(false); discardPile.Add(pHand[i].GetComponent <CardTemplate>().card); pHand[i].GetComponent <CardTemplate>().card = null; switch (cp.title) { case "Slash": player.attacked = true; player.Slash(); incToken(); StartCoroutine(player.AttackRelease(0.8f)); break; case "Dash": player.attacked = true; player.Dash(); incToken(); StartCoroutine(player.AttackRelease(.8f)); break; case "Beam": player.attacked = true; player.Beam(); incToken(); StartCoroutine(player.AttackRelease(0.8f)); break; case "Boomerang Dash": player.attacked = true; player.BoomerangDash(); incToken(); StartCoroutine(player.AttackRelease(0.8f)); break; case "SpinSlash": player.attacked = true; player.SpinSlash(); incToken(); StartCoroutine(player.AttackRelease(0.8f)); break; case "SuperBeam": player.attacked = true; player.SuperBeam(); incToken(); StartCoroutine(player.AttackRelease(0.8f)); break; default: break; } } }
public void ClearDefinitionLists() { CardProperties.Clear(); DeckUrls.Clear(); Enums.Clear(); Extras.Clear(); GameBoardCards.Clear(); GameBoardUrls.Clear(); }
public void LoadCard(Card c) { if (c == null) { return; } card = c; for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVisProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementInt || cp.element is ElementText) { if (cp.element is ElementInt) { if (c.name == "Attack") { p.text.text = KnightControl.knightAttDamLow.ToString() + " - " + KnightControl.knightAttDamHigh.ToString(); } else if (c.name == "Magic") { p.text.text = KnightControl.knightMagDam.ToString(); } else if (c.name == "Light") { p.text.text = KnightControl.lightPower.ToString(); } } else { p.text.text = cp.stringValue; } for (int j = 0; j < c.properties.Length; j++) { CardProperties cp2 = c.properties[j]; if (cp2.element is ElementColor) { p.text.color = cp2.color; } } } else if (cp.element is ElementImage) { p.img.sprite = cp.sprite; } } }
void Update() { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction, Mathf.Infinity); if (hit) { if (hit.transform.parent.name == "Hand") { GameObject card = hit.transform.gameObject; //check color or number or symbol of heap CardProperties cardProperties = card.GetComponent <CardProperties>(); //get properties of the tapped card int nSymbols = cardProperties.nSymbol; int nColor = cardProperties.nColor; int nSymbolType = cardProperties.nSymbolType; //get properties of the heap card CardProperties heapCardProperties = GameObject.Find("Heap").GetComponentsInChildren <CardProperties>()[0]; int nSymbolsHeap = heapCardProperties.nSymbol; int nColorHeap = heapCardProperties.nColor; int nSymbolTypeHeap = heapCardProperties.nSymbolType; if (nSymbols == nSymbolsHeap || nColor == nColorHeap || nSymbolType == nSymbolTypeHeap) { Vector3 transformHandCard = new Vector3(); transformHandCard = card.transform.position; //Change card in heap GameObject.Find("Heap").GetComponent <CardHeap>().changeCard(cardProperties); //drop targeted card GameObject.Find("Hand").GetComponent <CardHand>().dropCard(card); //Draw new card in hand. GameObject.Find("Hand").GetComponent <CardHand>().drawCard(transformHandCard); } else { //Drop life GameObject.Find("GameplayEngine").GetComponent <Live>().dropLife(); } } } } }
public void LoadCard(Card c) { if (c == null) { return; } card = c; c.cardType.OnSetType(this); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementInt) { p.text.text = cp.intValue.ToString(); } else if (cp.element is ElementText) { p.text.text = cp.stringValue; } else if (cp.element is ElementImage) { p.image.sprite = cp.sprite; } } /*title.text = c.cardName; * if (string.IsNullOrEmpty(c.cardText)) * { * cardText.gameObject.SetActive(false); * } * else * { * cardText.gameObject.SetActive(true); * cardText.text = c.cardText; * } * * art.sprite = c.art; * cardOil.text = c.cardOil.ToString(); * cardHearts.text = c.cardHearts.ToString(); * cardHE.text = c.cardHE.ToString(); * cardPierce.text = c.cardPierce.ToString(); */ }
public void changeCard(CardProperties properties) { //delete previous card from heap DestroyImmediate(transform.GetChild(0).gameObject); //put new card in heap GameObject card = CardGenerator.generateCardWithProperties(properties); card.transform.parent = this.transform; card.transform.position = heapCard; card.transform.Rotate(0, 0, 90); }
public void UseCard(int i) { GameObject o = pHand[i]; if (o.activeInHierarchy == true && forgeable == false) { Card c = o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card; CardProperties cp = c.cardProperties; pHand[i].SetActive(false); discardPile.Add(c); switch (cp.title) { case "Slash": gm.actionText.text = cp.title; //enter dmg calculator break; case "Dash": gm.actionText.text = cp.title; break; case "Beam": gm.actionText.text = cp.title; break; case "DashBeam": gm.actionText.text = cp.title; break; default: break; } } if (o.activeInHierarchy == true && forgeable == true) { if (forge1 == null) { forge1 = o; Card c = o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card; forge1Display.GetComponent <CardTemplate>().LoadCard(c); return; } else if (forge1 != null) { forge2 = o; Card c = o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card; forge2Display.GetComponent <CardTemplate>().LoadCard(c); ForgeCard(forge1, forge2); } } }
/// <summary> /// Adds the card element to grid /// </summary> /// <param name="item"> Instance of a FileDetails class </param> public void CreateCard(string name, string fullpath, string activity) { var cardProperties = new CardProperties() { Name = name, Path = fullpath, Activity = activity, UnitofTime = "S", }; switch (ToolBox.DirectoryOrFile(fullpath)) { case FileType.Directory: cardProperties.FileType = FileType.Directory; cardProperties.FileTypeLabel = "Directory: "; cardProperties.IconImage = cardProperties.TypeOfFile[1]; break; case FileType.File: cardProperties.FileType = FileType.File; cardProperties.FileTypeLabel = "File: "; cardProperties.IconImage = cardProperties.TypeOfFile[0]; break; } var awesomeCard = new AwesomeCard { DataContext = cardProperties, CardProperties = cardProperties, _assocFilePath = cardProperties.Path, _filename = Path.GetFileName(cardProperties.Path), Width = 490, Height = 150 }; // register to selected item dictionary for changes ToolBox.SelectedCardCollection.isDictEmpty += SelectedCardCollection_isDictEmpty; //Time = 10; awesomeCard.TimerFinished += awesomeCardTimer_Finished; awesomeCard.Selected += awesomeCard_Selected; awesomeCard.StartTimer(Time); ToolBox.CardCollection.Add(awesomeCard._filename, awesomeCard); mnWindow.TxtDefault.Visibility = Visibility.Hidden; //Update state int elementId = mnWindow.StackMain.Children.Add(awesomeCard); mnWindow.GeneralSettings.ItemsCount++; awesomeCard._elementId = elementId; }
private void OnMouseDown() { if (GetComponent <CardProperties>().pickable) { EndOfTurnCalculation endOfTurnCalculation = GameObject.Find("Game Master").GetComponent <EndOfTurnCalculation>(); if (transform.parent.GetComponent <PlayerController>().playerID == 0) { endOfTurnCalculation.masterCardType = GetComponent <CardProperties>().type; // Marriage initiation if (GetComponent <CardProperties>().possibleMarriage == true) { GameObject[] cards = GameObject.FindGameObjectsWithTag("Card"); foreach (GameObject card in cards) { if (card.GetComponent <CardProperties>().type == GetComponent <CardProperties>().type) { card.GetComponent <CardProperties>().marriage = true; } else { card.GetComponent <CardProperties>().marriage = false; } } transform.parent.gameObject.GetComponent <PlayerController>().score += GetComponent <CardProperties>().type * 20 + 20; } } // Moving the card transform.position = new Vector3(12, transform.position.y, transform.position.z); // Ending the player's move endOfTurnCalculation.masterPlayerID = endOfTurnCalculation.masterPlayerID + 1; // Taging the played card with proper tag gameObject.tag = "CardInPlay"; // Turning of ability to pick a card for this player GetComponent <CardProperties>().pickable = false; foreach (Transform child in transform.parent) { if (child.tag == "Card") { CardProperties cardProperties = child.gameObject.GetComponent <CardProperties>(); cardProperties.pickable = false; cardProperties.possibleMarriage = false; } } } }
public async Task GetCardAsync(bool trim, CardDeny deny, BorderAllow border, Casing casing, FontType font, PaletteType palette, Gamma usernameGamma = Gamma.Max, Gamma activityGamma = Gamma.Max, Gamma borderGamma = Gamma.Max, ImageScale scale = ImageScale.Medium, int padding = 2) { SocketUser user = Context.User; if (!Context.Container.TryGetUser(user.Id, out User account)) { await Context.Channel.ThrowAsync("The specified user does not have an existing account."); return; } try { using var graphics = new GraphicsService(); var d = new CardDetails(account, user); var p = new CardProperties { Trim = trim, Deny = deny, Border = border, Casing = casing, Font = font, Palette = palette, Gamma = new Dictionary <CardComponentType, Gamma?> { [CardComponentType.Username] = usernameGamma, [CardComponentType.Activity] = activityGamma, [CardComponentType.Border] = borderGamma, [CardComponentType.Background] = null, [CardComponentType.Avatar] = Gamma.Max }, Padding = new Padding(padding), Scale = scale }; Bitmap card = graphics.DrawCard(d, p); Logger.Debug("Drawing card..."); await Context.Channel.SendImageAsync(card, $"../tmp/{Context.User.Id}_card.png"); } catch (Exception ex) { await Context.Channel.CatchAsync(ex); } }
private void CardTrainerPanel_Load(object sender, EventArgs e) { CardProperties cardprop = new CardProperties(); cardprop = ((CardProperties)this.Tag); lbCardName.Text = cardprop.CardType.ToString(); Dictionary <string, AttackProperties> .Enumerator AllAttackProps = cardprop.Attacks.First.GetEnumerator(); AllAttackProps.MoveNext(); IEnumerator <AttackDetails> detailsEnum = AllAttackProps.Current.Value.AttackDict.Values.GetEnumerator(); lbCardTitle.Text = AllAttackProps.Current.Value.Title; lbCardBody.Text = AllAttackProps.Current.Value.Body; }
void Marriage() { foreach (Transform child1 in transform) { foreach (Transform child2 in transform) { if (child1.CompareTag("Card") && child2.CompareTag("Card")) { CardProperties cp1 = child1.gameObject.GetComponent <CardProperties>(); CardProperties cp2 = child2.gameObject.GetComponent <CardProperties>(); if (cp1.type == cp2.type && cp1.value == 3 && cp2.value == 4) { cp1.possibleMarriage = true; cp2.possibleMarriage = true; } } } } }
public void UseCard(int i) { GameObject o = pHand[i]; if (o.activeInHierarchy == true && forgeable == false) { //gm.TokenUpdate(1); Card c = o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card; CardProperties cp = c.cardProperties; pHand[i].SetActive(false); discardPile.Add(c); o.transform.GetChild(0).gameObject.GetComponent <CardTemplate>().card = null; switch (cp.title) { case "Slash": // gm.actionText.text = cp.title; player.Slash(); incToken(); break; case "Dash": // gm.actionText.text = cp.title; player.Dash(); incToken(); break; case "Beam": //gm.actionText.text = cp.title; player.Beam(); incToken(); break; case "DashBeam": // gm.actionText.text = cp.title; break; default: break; } } }
public void LoadCard(Card card) { if (card == null) { return; } this.card = card; card.cardType.OnSetType(this); CloseAll(); for (int i = 0; i < card.properties.Length; i++) { CardProperties cardProperties = card.properties[i]; CardVizProperties cardVizProperties = GetProperty(cardProperties.element); if (cardVizProperties == null) { continue; } if (cardProperties.element is ElementInt) { cardVizProperties.text.text = cardProperties.integerValue.ToString(); cardVizProperties.text.gameObject.SetActive(true); } else if (cardProperties.element is ElementText) { cardVizProperties.text.text = cardProperties.stringValue; cardVizProperties.text.gameObject.SetActive(true); } else if (cardProperties.element is ElementImage) { cardVizProperties.img.sprite = cardProperties.sprite; cardVizProperties.img.gameObject.SetActive(true); } } }
/// <summary> /// adds newly selected card to active cards list and if 3 checks if selection is a set /// </summary> /// <param name="card"></param> private void AddCard(GameObject card) { webSocketManager.SendLog("selected " + CardProperties.Stringify(card)); if (!cardsToRemove.Contains(card) && card.activeSelf && !activeCards.Contains(card)) { webSocketManager.SendLog("not about to remove card from board, so will add it to active cards"); activeCards.Add(card); StartCoroutine("CheckSet"); Dictionary <string, string> strData = new Dictionary <string, string>() { { "card", CardProperties.Stringify(card) }, { "result", "ACTIVATED" } }; webSocketManager.Send("result", strData, null); } else { webSocketManager.SendLog("about to remove card from board, not adding to active cards"); } }
public void UseCard(int i) { if (pHand[i].activeInHierarchy == true) { CardProperties cp = pHand[i].GetComponent <CardTemplate>().card.cardProperties; pHand[i].SetActive(false); discardPile.Add(pHand[i].GetComponent <CardTemplate>().card); pHand[i].GetComponent <CardTemplate>().card = null; switch (cp.title) { case "Slash": player.Slash(); incToken(); break; case "Dash": player.Dash(); incToken(); break; case "Beam": player.Beam(); incToken(); break; case "DashBeam": break; default: break; } } }
public void LoadCard(Card c) { if (c == null) { return; } card = c; c.cardType.OnSetType(this); CloseAll(); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementText) { p.text.text = cp.stringVal; p.text.gameObject.SetActive(true); } if (cp.element is ElementImage) { p.img.sprite = cp.sprite; p.img.gameObject.SetActive(true); } if (cp.element is ElementInt) { p.text.text = cp.intVal.ToString(); p.text.gameObject.SetActive(true); } } }
public void OnDrop(PointerEventData eventData) { Debug.Log(eventData.pointerDrag.name + " was dropped on + " + this.gameObject.name); GameObject card = eventData.pointerDrag; Draggable d = eventData.pointerDrag.GetComponent <Draggable>(); d.parentToReturnTo = this.transform; d.isDiscarded = true; //Card action logic if (card.tag == "card") { CardProperties cardProps = card.GetComponent <CardProperties>(); //Attack if (cardProps.Attack > 0) { //apply damage to monster monster.TakeDamage(cardProps.Attack); } } }
private void CardPanel_Load(object sender, EventArgs e) { CardProperties cardprop = new CardProperties(); cardprop = ((CardProperties)this.Tag); lbName.Text = cardprop.Pokemon.Name; lbHP.Text = cardprop.HP.ToString() + " HP"; #region PokemonTYPE switch ((PokemonTYPE)cardprop.PokemonType) { case PokemonTYPE.Colorless: pBoxType.Image = PPokemon.Properties.Resources.colorless; break; case PokemonTYPE.Null: pBoxType.Image = PPokemon.Properties.Resources._null; break; case PokemonTYPE.Fighting: pBoxType.Image = PPokemon.Properties.Resources.fighting; break; case PokemonTYPE.Fire: pBoxType.Image = PPokemon.Properties.Resources.fire; break; case PokemonTYPE.Grass: pBoxType.Image = PPokemon.Properties.Resources.grass; break; case PokemonTYPE.Lightning: pBoxType.Image = PPokemon.Properties.Resources.lightning; break; case PokemonTYPE.Psychic: pBoxType.Image = PPokemon.Properties.Resources.psychic; break; case PokemonTYPE.Water: pBoxType.Image = PPokemon.Properties.Resources.water; break; default: break; } #endregion PokemonTYPE //Draw the image webBCard.Navigate(cardprop.Pokemon.LocalSWF); #region CardType switch (cardprop.CardType) { case Cardtype.Null: lbStage.Text = "Unknown"; break; case Cardtype.Basic: lbStage.Text = "Basic"; break; case Cardtype.Stage1: lbStage.Text = "Stage 1"; break; case Cardtype.Stage2: lbStage.Text = "Stage 2"; break; case Cardtype.LevelUp: lbStage.Text = "Level-Up"; break; default: break; } #endregion CardType //Control what Attack space to write in int spacecount = 0; #region PowerDrawing //If there is a Poke-Power/Body, write it in the first Attack Space if (cardprop.PokePower.Title != "" && cardprop.Attacks.First.Count <= 1) { pBoxAttack1_1.Visible = false; lbAttack1Damage.Visible = false; lbAttack1Title.Text = cardprop.PokePower.Title; lbAttack1Body.Text = cardprop.PokePower.Body; spacecount = 1; } #endregion #region AttackDrawing //Draw each attack //Clear all lbAttack1Body lbAttack1Damage.Text = ""; lbAttack1Title.Text = ""; lbAttack1Body.Text = ""; //Clear all lbAttack2Body lbAttack2Damage.Text = ""; lbAttack2Title.Text = ""; lbAttack2Body.Text = ""; Dictionary <string, AttackProperties> .Enumerator AllAttackProps = cardprop.Attacks.First.GetEnumerator(); while (AllAttackProps.MoveNext())//{[Ram, PPokemon.Cards.AttackProperties]} { if (spacecount == 0) { IEnumerator <AttackDetails> detailsEnum = AllAttackProps.Current.Value.AttackDict.Values.GetEnumerator(); //Draw every energy needed for the attack for (int x = 0; x < AllAttackProps.Current.Value.GetEnergyTotalCount(); x++) //1 { detailsEnum.MoveNext(); //Move to the next AttackDetails switch (x) { case 0: pBoxAttack1_1.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; case 1: pBoxAttack1_2.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; case 2: pBoxAttack1_3.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; default: break; } } lbAttack1Damage.Text = AllAttackProps.Current.Value.Damage.ToString(); lbAttack1Title.Text = AllAttackProps.Current.Value.Title; lbAttack1Body.Text = AllAttackProps.Current.Value.Body; } if (spacecount == 1) { IEnumerator <AttackDetails> detailsEnum = AllAttackProps.Current.Value.AttackDict.Values.GetEnumerator(); //Draw every energy needed for the attack for (int y = 0; y < AllAttackProps.Current.Value.GetEnergyTotalCount(); y++) //1 //NOT TOTALING dict values { detailsEnum.MoveNext(); //Move to the next AttackDetails switch (y) { case 0: pBoxAttack2_1.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); //{PPokemon.Cards.AttackProperties}[0] break; case 1: pBoxAttack2_2.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; case 2: pBoxAttack2_3.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; case 3: pBoxAttack2_4.Image = Ops.GetEnergyTypeImage(detailsEnum.Current.EnergyRequired.First); break; default: break; } } lbAttack2Damage.Text = AllAttackProps.Current.Value.Damage.ToString(); lbAttack2Title.Text = AllAttackProps.Current.Value.Title; lbAttack2Body.Text = AllAttackProps.Current.Value.Body; } spacecount = spacecount + 1; } #endregion AttackDrawing #region Draw bottom of card pBoxWeakness1.Image = Ops.GetEnergyTypeImage(cardprop.Weakness.First); pBoxResistance1.Image = Ops.GetEnergyTypeImage(cardprop.Resistance.First); if (cardprop.RetreatCost.Second == 0) { pBoxRetreat1.Image = null; pBoxRetreat2.Image = null; pBoxRetreat3.Image = null; pBoxRetreat4.Image = null; } else if (cardprop.RetreatCost.Second == 1) { pBoxRetreat1.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat2.Image = null; pBoxRetreat3.Image = null; pBoxRetreat4.Image = null; } else if (cardprop.RetreatCost.Second == 2) { pBoxRetreat1.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat2.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat3.Image = null; pBoxRetreat4.Image = null; } else if (cardprop.RetreatCost.Second == 3) { pBoxRetreat1.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat2.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat3.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat4.Image = null; } else if (cardprop.RetreatCost.Second == 4) { pBoxRetreat1.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat2.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat3.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); pBoxRetreat4.Image = Ops.GetEnergyTypeImage(cardprop.RetreatCost.First); } #endregion Draw bottom of card }