private void InitPowers() { AllPowers = new List<csMagicPower>(); var fire = new csMagicPower() { Base = 10.0f, CombinedPowers = new System.Collections.Generic.List<csMagicPower>(), Core = csCorePower.Fire, Effects = new System.Collections.Generic.List<csEffect>(), Factor = 0.01f, ManaBase = 10, Name = "Fire", Rarity = 1, CasterLevel = Level, BaseStatus = Intelligence, Level = 1 }; fire.Init(); AllPowers.Add(fire); var energy = new csMagicPower() { Base = 10.0f, CombinedPowers = new System.Collections.Generic.List<csMagicPower>(), Core = csCorePower.Energy, Effects = new System.Collections.Generic.List<csEffect>(), Factor = 0.01f, ManaBase = 10, Name = "Energy", Rarity = 1, CasterLevel = Level, BaseStatus = Intelligence, Level = 1 }; energy.Init(); AllPowers.Add(energy); var ice = new csMagicPower() { Base = 10.0f, CombinedPowers = new System.Collections.Generic.List<csMagicPower>(), Core = csCorePower.Ice, Effects = new System.Collections.Generic.List<csEffect>(), Factor = 0.01f, ManaBase = 10, Name = "Ice", Rarity = 1, CasterLevel = Level, BaseStatus = Intelligence, Level = 1 }; ice.Init(); AllPowers.Add(ice); var water = new csMagicPower() { Base = 10.0f, CombinedPowers = new System.Collections.Generic.List<csMagicPower>(), Core = csCorePower.Water, Effects = new System.Collections.Generic.List<csEffect>(), Factor = 0.01f, ManaBase = 10, Name = "Water", Rarity = 1, CasterLevel = Level, BaseStatus = Intelligence, Level = 1 }; water.Init(); AllPowers.Add(water); var wind = new csMagicPower() { Base = 10.0f, CombinedPowers = new System.Collections.Generic.List<csMagicPower>(), Core = csCorePower.Wind, Effects = new System.Collections.Generic.List<csEffect>(), Factor = 0.01f, ManaBase = 10, Name = "Wind", Rarity = 1, CasterLevel = Level, BaseStatus = Intelligence, Level = 1 }; wind.Init(); AllPowers.Add(wind); }
public void OnCmbPowersChanged(Dropdown dropdown) { var selectedOption = dropdown.options[dropdown.value]; MagicalPower = csGameController.control.Kagotchi.Powers.FirstOrDefault(i => i.Name == selectedOption.text); if (MagicalPower == null) manaSlider.value += lastSelectedPower.Mana; else { manaSlider.value -= MagicalPower.Mana; lastSelectedPower = MagicalPower; } txtMana.text = Mathf.Round(manaSlider.value).ToString() + "%"; }