//chewables //converts chewable to an "effects" and calls the apply effect public void useChewable(ChewableConfig chewable) { foreach (special chew in chewable.chewEffects) { effects newEffect = new effects(chew.type, chew.value); applyEffect(chew.duration, newEffect); } Debug.Log("chewable used"); /* effects newEffect = new effects(); * if (chewable.increaseAttack.yes) * { * newEffect.attackValue = chewable.increaseAttack.value; * //upAttack(chewable.value); * } * if (chewable.increaseDefense.yes) * { * * newEffect.defenseValue = chewable.increaseDefense.value; * //upDefense(chewable.value); * } * if (chewable.increaseSpeed.yes) * { * * newEffect.speedValue = chewable.increaseSpeed.value; * //upSpeed(chewable.value); * } * if (chewable.increasesHealth.yes) * { * * newEffect.healthValue = chewable.increasesHealth.value; * } * applyEffect(chewable.chewableDuration, newEffect); */ }
public void activatePanel(ChewableConfig newChew) { Debug.Log("panel activate called"); activeChewable = newChew; Debug.Log("active chewable set to " + activeChewable); loadInfo(); panel.SetActive(true); }
public void activatePanel(int i) { activeChewable = myCoolPlayer.yourPack[i]; if (activeChewable != null) { loadInfo(); panel.SetActive(true); } }
//check how many you have public int amount(ChewableConfig chewable) { if (inventory.ContainsKey(chewable)) { return(inventory[chewable]); } else { return(0); } }
//pack initializer //adds items to your inventory public void addItems(ChewableConfig key, int value) { if (inventory.ContainsKey(key)) { inventory[key] += value; } else { inventory.Add(key, value); } }
// //can add items to your bag to take into battle public void addToBag(ChewableConfig chewable) { inventory[chewable] -= 1; for (int i = 0; i < yourPack.Length; i++) { if (yourPack[i] == null) { yourPack[i] = chewable; i = 10; } } }