Ejemplo n.º 1
0
    public override void UpdateStats(SpellComponent.SubSpellComponentType type, string components)
    {
        ComponentLoader.UnLoadedSpellComponent unloadedComponent;
        unloadedComponent.name = components;
        unloadedComponent.type = type;
        ISpellComponent component = ComponentLoader.GetInstance().LoadComponent(unloadedComponent);

        UpdateBaseStats(component);
    }
Ejemplo n.º 2
0
    void PickItem(Room r)
    {
        if (canHaveComponents || canHaveHealth || canHaveCharges)
        {
            bool haveItem = false;
            while (!haveItem)
            {
                int itemType = Random.Range(0, 3);
                switch (itemType)
                {
                case 0:
                    if (!canHaveComponents)
                    {
                        continue;
                    }
                    price          = componentPrice;
                    giveItem       = GiveSpellComponent;
                    spellComponent = PlayerInventory.instance.AddComponentToStore();
                    ISpellComponent component = ComponentLoader.GetInstance().LoadComponent(new ComponentLoader.UnLoadedSpellComponent(spellComponent, PlayerInventory.instance.componentsInStore[spellComponent]));
                    itemText.text = component.GetTitle() + "\n" + component.GetToolTip();
                    haveItem      = true;
                    break;

                case 1:
                    if (!canHaveHealth)
                    {
                        continue;
                    }
                    price         = fullHealPrice;
                    giveItem      = Heal;
                    itemText.text = "Full Healh";
                    haveItem      = true;
                    break;

                case 2:
                    if (!canHaveCharges)
                    {
                        continue;
                    }
                    price         = fullChargePrice;
                    giveItem      = RechargeSpells;
                    itemText.text = "Recharge Spells";
                    haveItem      = true;
                    break;

                default:
                    break;
                }
            }
            priceText.text = price.ToString();
        }
    }
Ejemplo n.º 3
0
 public void UpdateBaseStats(ISpellComponent component)
 {
     toolTip.text = "" + component.GetToolTip();
     cost.text    = "" + component.GetCost();
     title.text   = "" + component.GetTitle();
 }