//Update is called once per frame
void Update()
{
_player.StatUpdate();
if (_player.Exp != jScript.currentEXP)
{
_player.ExpToLvl = jScript.currentNEXT;
Debug.Log(_player.ExpToLvl);
if (addExp)
{
_player.AddExp(10);
addExp = false;
}
Debug.Log(_player.Exp);
_player.CalculateLevel();
if (_player.LevelUp)
{
Debug.Log("inside levelup if");
_player.LevelUp = false;
Debug.Log(_player.LevelUp);
jScript.currentLV++;;
jScript.currentEXP = 0;
jScript.fullHP += jScript.startATK * (Mathf.CeilToInt(jScript.currentLV / 2));
jScript.currentHP = jScript.fullHP;
jScript.fullMP += jScript.startINT * (Mathf.CeilToInt(jScript.currentLV / 2));
jScript.currentMP = jScript.fullMP;
jScript.currentNEXT = (int)(_player.ExpToLvlBase * _player.ExpModifier);
jScript.levelUpATK += (int)(jScript.startATK * _player.StatModifier);
jScript.levelUpINT += (int)(jScript.startINT * _player.StatModifier);
jScript.levelUpAGI += (int)(jScript.startAGI * _player.StatModifier);
if (jScript.currentLV % 5 == 0)
{
jScript.levelUpLCK += 1;
}
_player.ExpToLvl = jScript.currentNEXT;
_player.ExpToLvlBase = _player.ExpToLvl;
}
}
//remove dream special effects once dream sequence is over
if (PlayerPrefs.GetInt("Story Progress") >= 9)
{
foreach (GameObject flare in GameObject.FindGameObjectsWithTag("dreamflare"))
{
Destroy(flare);
}
}
}