Example #1
0
        // public typelogic logic

        public virtual void OnSetType(CardViz viz)
        {
            Element           t    = Settings.GetResourcesManager().typeElement;
            CardVizProperties type = viz.GetProperty(t);

            type.text.text = typeName;
        }
Example #2
0
        public override void OnSetType(CardViz viz)
        {
            base.OnSetType(viz);

            int qtd = viz.HeroPropertiesHolder.Length;

            for (int i = 0; i < qtd; i++)
            {
                viz.HeroPropertiesHolder[i].SetActive(false);
            }
        }
Example #3
0
 void Start()
 {
     viz = GetComponent <CardViz>();
 }
Example #4
0
        public void RPC_PlayerUsesCard(int instId, int photonId, CardOpertation operation)
        {
            NetworkPrint p    = GetPlayer(photonId);
            Card         card = p.GetCard(instId);

            switch (operation)
            {
            case CardOpertation.dropResourcesCard:
                Settings.SetParentForCard(card.cardPhysicalInst.transform, p.playerHolder.currentHolder.resourcesGrid.value);
                card.cardPhysicalInst.currentLogic = dataHolder.cardDownLogic;
                p.playerHolder.AddResourceCard(card.cardPhysicalInst.gameObject);
                card.cardPhysicalInst.gameObject.SetActive(true);
                break;

            case CardOpertation.pickCardFromDeck:
                GameObject go = Instantiate(dataHolder.cardPrefab) as GameObject;
                CardViz    v  = go.GetComponent <CardViz>();
                v.LoadCard(card);
                card.cardPhysicalInst = go.GetComponent <CardInstance>();
                card.cardPhysicalInst.currentLogic = dataHolder.handCard;
                card.cardPhysicalInst.owner        = p.playerHolder;

                Settings.SetParentForCard(go.transform, p.playerHolder.currentHolder.handGrid.value);
                p.playerHolder.handCards.Add(card.cardPhysicalInst);
                break;

            case CardOpertation.dropCreatureCard:
                bool canUse = p.playerHolder.CanUseCard(card);
                if (canUse)
                {
                    Settings.DropHeroCard(card.cardPhysicalInst.transform, p.playerHolder.currentHolder.downGrid.value, card.cardPhysicalInst);
                    card.cardPhysicalInst.currentLogic = dataHolder.cardDownLogic;
                }
                else
                {
                    Settings.RegisterEvent("Not enough resources to use card", Color.red);
                }
                card.cardPhysicalInst.gameObject.SetActive(true);
                break;

            case CardOpertation.setCardForBattle:
                if (p.playerHolder.attackingCards.Contains(card.cardPhysicalInst))
                {
                    p.playerHolder.attackingCards.Remove(card.cardPhysicalInst);
                    p.playerHolder.currentHolder.SetCardsOffBatlleLine(card.cardPhysicalInst);
                }
                else
                {
                    if (card.cardPhysicalInst.CanAttack())
                    {
                        p.playerHolder.attackingCards.Add(card.cardPhysicalInst);
                        p.playerHolder.currentHolder.SetCardsOnBatlleLine(card.cardPhysicalInst);
                    }
                }
                break;

            case CardOpertation.cardToGraveyard:
                card.cardPhysicalInst.CardInstanceToGraveyard();
                break;

            default:
                break;
            }
        }
Example #5
0
 public override void OnSetType(CardViz viz)
 {
     base.OnSetType(viz);
 }