public void SetCharacterSkill(CharacterSkill charSkill) { //basic info _name = charSkill.Name(); _effectDescription = charSkill.EffectDescription(); //each level increases 1 point of int based values and 0.1f of float based values _level = charSkill.CurrentLevel(); //exp info currentExp = charSkill.currentExp; expPerLevel = charSkill.expPerLevel; //list of possible things skills might influence statsBase = charSkill.statsBase; statsPerLevel = charSkill.statsPerLevel; statsCurrent = charSkill.statsCurrent; //base stats statsBase.health = charSkill.statsBase.health; statsBase.expPool = charSkill.statsBase.expPool; statsBase.actionPoints = charSkill.statsBase.actionPoints; statsBase.slime = charSkill.statsBase.slime; statsBase.elementSlots = charSkill.statsBase.elementSlots; //passive or active _passive = charSkill._passive; _unlocked = charSkill._unlocked; //cost in case active spCost = charSkill.spCost; //in case of active set element combination comboStr = charSkill.comboStr; //element _element = charSkill._element; }
public void UpdateToolTip() { _name.text = skill.Name(); _description.text = skill.EffectDescription(); _cost.text = string.Format("SP: {0}", skill.spCost); //combo string _comboString.text = ""; if (skill._passive) { _comboString.text = "Passive"; _cost.gameObject.SetActive(false); } else { _cost.gameObject.SetActive(true); for (int i = 0; i < skill.comboStr.Length; i++) { if (i > 0) { _comboString.text += " + "; } switch (skill.comboStr[i]) { case '1': { _comboString.text += "<color=red>Fire</color>"; break; } case '2': { _comboString.text += "<color=blue>Water</color>"; break; } case '3': { _comboString.text += "<color=brown>Earth</color>"; break; } case '4': { _comboString.text += "<color=green>Wind</color>"; break; } case '5': { _comboString.text += "<color=yellow>Light</color>"; break; } case '6': { _comboString.text += "<color=black>Dark</color>"; break; } case '7': { _comboString.text += "<color=gray>Neutral</color>"; break; } } } } //stats _stats.text = ""; #region StatsDisplay if (skill.statsCurrent.expPool > 0) { _stats.text += string.Format("Exp pool + {0}\n", skill.statsCurrent.expPool); } if (skill.statsCurrent.actionPoints > 0) { _stats.text += string.Format("Ap + {0}\n", skill.statsCurrent.actionPoints); } if (skill.statsCurrent.elementSlots > 0) { _stats.text += string.Format("Element slots + {0}\n", skill.statsCurrent.elementSlots); } if (skill.statsCurrent.health > 0) { _stats.text += string.Format("Health + {0}\n", skill.statsCurrent.health); } if (skill.statsCurrent.slime > 0) { _stats.text += string.Format("Slime + {0}\n", skill.statsCurrent.slime); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Fire] > 0) { _stats.text += string.Format("<color=red>Fire</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Fire]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Water] > 0) { _stats.text += string.Format("<color=blue>Water</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Water]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Wind] > 0) { _stats.text += string.Format("<color=green>Wind</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Wind]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Earth] > 0) { _stats.text += string.Format("<color=brown>Earth</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Earth]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Light] > 0) { _stats.text += string.Format("<color=yellow>Light</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Light]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Dark] > 0) { _stats.text += string.Format("<color=black>Dark</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Dark]); } if (skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Neutral] > 0) { _stats.text += string.Format("<color=gray>Neutral</color> damage + {0}\n", skill.statsCurrent.fixedDamageStats[DictionaryHolder.element.Neutral]); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Fire] > 0) { _stats.text += string.Format("<color=red>Fire</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Fire] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Water] > 0) { _stats.text += string.Format("<color=blue>Water</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Water] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Wind] > 0) { _stats.text += string.Format("<color=green>Wind</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Wind] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Earth] > 0) { _stats.text += string.Format("<color=brown>Earth</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Earth] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Light] > 0) { _stats.text += string.Format("<color=yellow>Light</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Light] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Dark] > 0) { _stats.text += string.Format("<color=black>Dark</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Dark] * 100); } if (skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Neutral] > 0) { _stats.text += string.Format("<color=gray>Neutral</color> damage + {0}%\n", skill.statsCurrent.percentDamageStats[DictionaryHolder.element.Neutral] * 100); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Fire] > 0) { _stats.text += string.Format("<color=red>Fire</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Fire]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Water] > 0) { _stats.text += string.Format("<color=blue>Water</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Water]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Earth] > 0) { _stats.text += string.Format("<color=brown>Earth</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Earth]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Wind] > 0) { _stats.text += string.Format("<color=green>Wind</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Wind]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Light] > 0) { _stats.text += string.Format("<color=yellow>Light</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Light]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Dark] > 0) { _stats.text += string.Format("<color=black>Dark</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Dark]); } if (skill.statsCurrent.fixedResStats[DictionaryHolder.element.Neutral] > 0) { _stats.text += string.Format("<color=gray>Neutral</color> resistance + {0}\n", skill.statsCurrent.fixedResStats[DictionaryHolder.element.Neutral]); } #endregion //decrease and increase exp buttons increaseLevel.interactable = (((GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterStats>().expPoolCurrent >= skill.LevelExp()) && (skill.CurrentLevel() < skill.MaxLevel()) && (!skill._alchemy)) ? true : false); //exp _exp.text = (string.Format("{0}", skill.LevelExp().ToString())); }
public void UpdateInfoDisplay() { //if its unlocked if (charSkill._unlocked) { //tooltip update tooltip.GetComponent <ToolTipPanel>().skill = charSkill; //show gameObject.SetActive(true); //show lvl lvl.text = string.Format("Lvl.{0}", charSkill.CurrentLevel().ToString()); //show exp currentExp.text = string.Format("{0}/{1}", charSkill.CurrentExp(), charSkill.LevelExp()); //show passive if (charSkill._passive) { passive.text = "Passive"; //disable excess combo string images for (int i = 0; i < comboStringImageList.Count; i++) { comboStringImageList[i].gameObject.SetActive(false); } } else { passive.text = ""; //temp for cicling through combo string images int combImage = 0; //combo string panel show icons for (int i = 0; i < charSkill.comboStr.Length; i++) { if (charSkill.comboStr[i] == '1') { comboStringImageList[combImage].sprite = elementIcons[0]; } if (charSkill.comboStr[i] == '2') { comboStringImageList[combImage].sprite = elementIcons[1]; } if (charSkill.comboStr[i] == '3') { comboStringImageList[combImage].sprite = elementIcons[2]; } if (charSkill.comboStr[i] == '4') { comboStringImageList[combImage].sprite = elementIcons[3]; } if (charSkill.comboStr[i] == '5') { comboStringImageList[combImage].sprite = elementIcons[4]; } if (charSkill.comboStr[i] == '6') { comboStringImageList[combImage].sprite = elementIcons[5]; } if (charSkill.comboStr[i] == '7') { comboStringImageList[combImage].sprite = elementIcons[6]; } combImage++; } //disable excess images for (int i = 0; i < comboStringImageList.Count; i++) { if (i >= charSkill.comboStr.Length) { comboStringImageList[i].gameObject.SetActive(false); } else { comboStringImageList[i].gameObject.SetActive(true); } } } } else { //hide gameObject.SetActive(false); } }