Exemple #1
0
 public ITEMS()
 {
     isBuyable          = true;
     isSellable         = true;
     isConsumable       = true;
     itemName           = "";
     itemDescription    = "";
     canEquip           = true;
     itemType           = Type.Item;
     this.buyPrice      = 0;
     this.sellPrice     = 0;
     isStackable        = true;
     stackLimit         = 0;
     curStack           = 0;
     this.statBoost     = StatBoost.None;
     this.amountToBoost = 0;
     this.timeBoost     = 0;
     typeofItem         = typeOfItem.None;
 }
Exemple #2
0
 public ITEMS(bool buyable, bool sellable, bool consumable, string name, string description, bool equip,
              Type type, int buyPrice, int sellPrice, bool stackable,
              int stackMax, int stack, StatBoost statBoost, int amountToBoost, float timeBoost, typeOfItem TOI)
 {
     isBuyable          = buyable;
     isSellable         = sellable;
     isConsumable       = consumable;
     itemName           = name;
     itemDescription    = description;
     canEquip           = equip;
     itemType           = type;
     this.buyPrice      = buyPrice;
     this.sellPrice     = sellPrice;
     isStackable        = stackable;
     stackLimit         = stackMax;
     curStack           = stack;
     this.statBoost     = statBoost;
     this.amountToBoost = amountToBoost;
     this.timeBoost     = timeBoost;
     //icon = AssetDatabase.LoadAssetAtPath("Assets/Eternal/"+itemName+".png", typeof(Sprite)) as Sprite;
     typeofItem = TOI;
 }
    public void ApplyBoosts(List <StatBoost> statBoosts)
    {
        for (int i = 0; i < statBoosts.Count; i++)
        {
            StatBoost temp  = statBoosts[i];
            var       stat  = temp.stat;
            var       boost = temp.boost;

            StatBoosts[stat] = Mathf.Clamp(StatBoosts[stat] + boost, -6, 6);

            if (boost >= 0)
            {
                statusChanges.Enqueue($"{Base.Name}'s {stat} rose!");
            }
            else
            {
                statusChanges.Enqueue($"{Base.Name}'s {stat} fell!");
            }

            Debug.Log($"{stat} has been boosted to {StatBoosts[stat]}");
        }
    }
Exemple #4
0
 public ItemsV2(bool buyable, bool sellable, bool consumable, string name, string description, bool equip,
                bool isTool, EquipRegion slot, Type type, int buyPrice, int sellPrice, bool stackable,
                ClassRestriction restriction, int stackMax, int stack, StatBoost statBoost, int amountToBoost, float timeBoost)
 {
     isBuyable          = buyable;
     isSellable         = sellable;
     isConsumable       = consumable;
     itemName           = name;
     itemDescription    = description;
     canEquip           = equip;
     isToolItem         = isTool;
     restrict           = restriction;
     itemType           = type;
     this.buyPrice      = buyPrice;
     this.sellPrice     = sellPrice;
     isStackable        = stackable;
     stackLimit         = stackMax;
     curStack           = stack;
     equipSlot          = slot;
     this.statBoost     = statBoost;
     this.amountToBoost = amountToBoost;
     this.timeBoost     = timeBoost;
 }
 public void RemoveStatBoosts(StatBoost statBoost)
 {
     // Remove Stat boost from list of stat boosts, find boost value that matches in passed value and remove it
     this.statBoosts.Remove(statBoosts.Find(x => x.boostValue == statBoost.boostValue));
 }
 public void AddStatBoosts(StatBoost statBoost)
 {
     // Add Stat boost to list of stat boosts
     this.statBoosts.Add(statBoost);
 }