Exemple #1
0
    public void Use()
    {
        int n = UI_CardPanel.slotNum - 1;

        card = UI_CardLoader.slots[n].GetComponentInChildren <Card> ();

        int amount = card.useCost;

        if (GameManager.composure - amount > 1)
        {
            card.AccessAbility();

            if (PlayerController.actionSuccessful)
            {
                hud.RemoveSegment(amount);

                loader.DeactivateCard(card.gameObject, true);

                panel.DisablePanel();
                PlayerController.actionSuccessful = false;
            }
        }
        else
        {
            print("Not Enough Composure");
        }
    }
Exemple #2
0
    public void Carry()
    {
        int amount = card.equipCost;

        int n = UI_CardPanel.slotNum - 1;

        card = UI_CardLoader.slots [n].GetComponentInChildren <Card> ();

        GameObject[] equipSlots = GameObject.FindGameObjectsWithTag("EquipSlot");


        for (int i = equipSlots.Length; i > 0; i--)
        {
            UI_EquipSlot slot = equipSlots [equipSlots.Length - i].GetComponent <UI_EquipSlot> ();

            if (slot.SlotAvailable())
            {
                if (GameManager.composure - amount > 0)
                {
                    hud.RemoveSegment(amount);

                    loader.AddtoCarry(card.gameObject);

                    card.gameObject.transform.SetParent(equipSlots [equipSlots.Length - i].transform, false);

                    card.mySlotState = Card.SlotState.EQUIP_SLOT;
                }
                else
                {
                    print("Not enough composure");
                }

                panel.DisablePanel();
                break;
            }
        }

        if (card.myCardType == Card.CardType.POSSESSION_CARD)
        {
            card.AccessAbility();
        }
    }
Exemple #3
0
    public void ActivateSlotFunction()
    {
        card = GetComponentInChildren <Card> ();
        if (card != null && !coolDown)
        {
            Debug.Log("Card Name is: " + card.gameObject.name);

            if (card.myCardType == Card.CardType.ACTION_CARD)
            {
                int amount = card.useCost;

                if (GameManager.composure - amount > 0)
                {
                    card.AccessAbility();

                    if (PlayerController.actionSuccessful)
                    {
                        hud.RemoveSegment(amount);
                        StartCoroutine(Cooldown());


                        PlayerController.actionSuccessful = false;
                    }
                }
                else
                {
                    print("Not Enough Composure");
                }
            }
            else
            {
                Debug.Log("Not an Action Card");
            }
        }
        else
        {
            Debug.Log("No Card Selected");
        }
    }