public void update(THHPlayer player, TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; Table table = GetComponentInParent <Table>(); if (skin != null) { Image.sprite = skin.image; } AttackText.text = card.getAttack().ToString(); HpText.text = card.getCurrentLife().ToString(); if (table.selectableTargets != null && table.selectableTargets.Contains(this)) { HighlightController = Highlight.Yellow; } else if (table.player == player && table.game.currentPlayer == player && card.canAttack(table.game)) { HighlightController = Highlight.Green; } else { HighlightController = Highlight.None; } getChild("Root").getChild("Taunt").gameObject.SetActive(card.isTaunt()); getChild("Root").getChild("Shield").gameObject.SetActive(card.isShield()); }
public void update(TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; CostPropNumber.asText.text = card.getCost(null).ToString(); if (card.define.type == CardDefineType.SERVANT) { type = CardCategory.SERVANT; // TypeController = Type.Servant; //onTypeControllerServant?.Invoke(); AttackPropNumber.asText.text = card.getAttack(null).ToString(); LifePropNumber.asText.text = card.getLife(null).ToString(); } else if (card.define.type == CardDefineType.SPELL) { // TypeController = Type.Spell; type = CardCategory.SPELL; } if (skin != null) { Image.sprite = skin.image; NameText.text = skin.name; //{card:damage} DescText.text = skin.desc; // IsFaceupController = IsFaceup.True; isFaceup = true; } else { // IsFaceupController = IsFaceup.False; isFaceup = false; } }
protected override void onDisplay() { base.onDisplay(); //目前只有一个卡组 cards = parent.game.getManager <CardManager>().GetCardDefines(d => d.GetType().Assembly == typeof(THHGame).Assembly); int[] deck = parent.game.deck; CardSkinData masterSkin = parent.game.cards.getSkin(deck[0]); MasterButton.setSprite(masterSkin.image); MasterNameText.text = masterSkin.name; BuildDeckList.clearItems(); foreach (var cards in deck.Skip(1).Select(id => cards.FirstOrDefault(c => c.id == id)).Where(c => c != null).GroupBy(c => c.id)) { var item = BuildDeckList.addItem(); var skin = parent.game.cards.getSkin(cards.First().id); item.update(cards.First(), skin, cards.Count()); } reloadCardList(); BuildDeckList.sortItems((a, b) => { if (a.card.getCost() != b.card.getCost()) { return(a.card.getCost() - b.card.getCost()); } else { return(a.card.id - b.card.id); } }); DragCard.hide(); }
public void update(TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; CostPropNumber.asText.text = card.getCost().ToString(); if (card.define.type == CardDefineType.SERVANT) { TypeController = Type.Servant; AttackPropNumber.asText.text = card.getAttack().ToString(); LifePropNumber.asText.text = card.getLife().ToString(); } else { TypeController = Type.Spell; } if (skin != null) { Image.sprite = skin.image; NameText.text = skin.name; DescText.text = skin.desc; IsFaceupController = IsFaceup.True; } else { IsFaceupController = IsFaceup.False; } }
public void update(CardDefine card, CardSkinData skin, int count) { this.card = card; this.count = count; Image.sprite = skin.image; Text.text = skin.name; }
public void update(CardDefine card, CardSkinData skin) { if (skin != null) { Image.sprite = skin.image; } AttackTextPropNumber.asText.text = card.getAttack().ToString(); HpTextPropNumber.asText.text = card.getLife().ToString(); }
public void update(CardDefine card, CardSkinData skin) { CostText.text = card.getCost().ToString(); AttackText.text = card.getAttack().ToString(); LifeText.text = card.getLife().ToString(); Image.sprite = skin.image; NameText.text = skin.name; DescText.text = skin.desc; IsFaceupController = IsFaceup.True; }
public bool cardFilter(CardDefine cd, CardSkinData sd) { // 过滤费用 if (filterCost != 0) { if (filterCost < 8) { if (cd.getCost() != filterCost) { return(false); } } else { if (cd.getCost() < 8) { return(false); } } } // 过滤类型 if (!string.IsNullOrEmpty(filterType)) { if (!string.Equals(filterType, cd.type)) { return(false); } } // 过滤稀有度 if (filterRare != 0) { // todo: 稀有度判断 } // 过滤角色 if (filterCharacter != 0) { // todo: 角色判断 } // 过滤名字 if (!string.IsNullOrEmpty(filterKeyword)) { if (!sd.name.Contains(filterKeyword)) { return(false); } } return(true); }
public void update(TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; Image.sprite = skin.image; if (card.getAttack() > 0) { AttackText.text = card.getAttack().ToString(); AttackImage.gameObject.SetActive(true); } else { AttackImage.gameObject.SetActive(false); } DurabilityText.text = card.getCurrentLife().ToString(); }
public void update(TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; CostText.text = card.getCost().ToString(); AttackText.text = card.getAttack().ToString(); LifeText.text = card.getLife().ToString(); if (skin != null) { Image.sprite = skin.image; NameText.text = skin.name; DescText.text = skin.desc; IsFaceupController = IsFaceup.True; } else { IsFaceupController = IsFaceup.False; } }
public void update(CardDefine card, CardSkinData skin) { this.card = card; Card.update(card, skin); }
public void update(Table table, THHPlayer self, THHPlayer player, TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; Image.sprite = skin.image; CostText.text = card.getCost().ToString(); if (card.isUsed()) { IsUsedController = IsUsed.True; } else { IsUsedController = IsUsed.False; } if (player == self && card.isUsable(table.game, player, out _) &&//技能是可用的 table.selectableTargets == null //没有在选择目标 ) { IsUsableController = IsUsable.True; asButton.interactable = true; } else { IsUsableController = IsUsable.False; asButton.interactable = false; } }
public void update(Table table, THHPlayer player, TouhouCardEngine.Card card, CardSkinData skin) { this.card = card; Image.sprite = skin.image; HpText.text = card.getCurrentLife().ToString(); //if (card.getCurrentLife() == card.getLife()) // HpText.color = Color.white; //else // HpText.color = Color.red; if (card.getAttack() > 0) { AttackText.text = card.getAttack().ToString(); AttackText.enabled = true; } else { AttackText.enabled = false; } if (card.getArmor() > 0) { ArmorText.text = card.getArmor().ToString(); ArmorText.enabled = true; } else { ArmorText.enabled = false; } if (table.selectableTargets != null && table.selectableTargets.Contains(this)) { HighlightController = Highlight.Yellow; } else if (table.player == player && table.game.currentPlayer == player && card.canAttack(table.game, player)) { HighlightController = Highlight.Green; } else { HighlightController = Highlight.None; } }