public string GetEffectStat(int i) { float fxValue; string s = effectDB.GetEffectStat(effectDescriptions[i].effectStat, fxName); if (float.TryParse(s, out fxValue)) { if (effectDescriptions[i].effectStat == EffectStat.Duration) { if (fxValue > 60) { fxValue = Mathf.RoundToInt(fxValue / 60); s = effectDescriptions[i].prefix + " " + fxValue + " minutes"; } else { s = effectDescriptions[i].prefix + " " + fxValue + " seconds"; } } else { s = effectDescriptions[i].prefix + " " + fxValue; } } return(s); }
private void RestoreIcons() { if (buffList.Count == 0) { return; } fxIconCount = 0; foreach (string id in buffList.Keys) { EffectName fxName = (EffectName)Enum.Parse(typeof(EffectName), id); fxIconSpawner.Spawn(id, fxIconCount, fxIconDB.GetSprite(fxName)); float fxDuration = float.Parse(effectDB.GetEffectStat(EffectStat.Duration, fxName)); float fillPercent = buffList[id][1] / fxDuration; float timeRemaining = fxDuration - buffList[id][1]; fxIconSpawner.UpdateIconFill(id, fillPercent, timeRemaining); fxIconCount += 1; } }
public void BuffSelf(string ID) { if (!isBattleActive) { return; } fxID = ID; fxName = (EffectName)Enum.Parse(typeof(EffectName), ID); string buffType = effectDB.GetEffectStat(EffectStat.EffectType, fxName); switch (buffType) { case "Stat Over Time": BuffStatOverTime(); break; case "Base Boost": BuffStat(); break; case "Atk Boost": BuffStat(); break; default: Debug.Log("Error with Effect " + fxName + " - ID: " + ID); break; } }