// Use this for initialization void Start() { var dieDic = DieTypes.AttackDie; stats = gameObject.AddComponent <RPGDefaultStats>(); health = stats.GetStat <RPGVital>(RPGStatType.Health); willpower = stats.GetStat <RPGVital>(RPGStatType.Willpower); stamina = stats.GetStat <RPGVital>(RPGStatType.Stamina); dex = stats.GetStat <RPGAttribute>(RPGStatType.Dexterity); attackDie = stats.GetStat <RPGAttribute>(RPGStatType.DieType); level = stats.GetStat <RPGAttribute>(RPGStatType.Level); attack = stats.GetStat <RPGAttribute>(RPGStatType.Attack); will = stats.GetStat <RPGAttribute>(RPGStatType.Will); defense = stats.GetStat <RPGAttribute>(RPGStatType.Defense); alive = stats.GetStat <RPGAttribute>(RPGStatType.Alive); speed = stats.GetStat <RPGAttribute>(RPGStatType.Speed); evasion = stats.GetStat <RPGAttribute>(RPGStatType.Evasion); ///Modifiy base stats /// stamina.StatCurrentValue = 0; health.StatBaseValue = health.StatBaseValue; health.SetCurrentValueToMax(); attackDie.StatBaseValue = DieTypes.GetAttackDie(DieTypes.DieType.D4); dex.StatBaseValue = dex.StatBaseValue + 2; dex.UpdateLinkers(); }
public void Respawn(Vector3 position, Quaternion identity) { this.transform.position = position; this.transform.rotation = identity; this.gameObject.SetActive(true); IsDead = false; if (_health != null) { _health.SetCurrentValueToMax(); } OnRespawn(); if (EventManager.Instance != null) { EventManager.Instance.OnEntityRespawn.Invoke(this); } }
// Use this for initialization void Start() { var dieDic = DieTypes.AttackDie; stats = gameObject.AddComponent <RPGDefaultStats>(); socialStats = gameObject.GetComponent <SocialStats>(); health = stats.GetStat <RPGVital>(RPGStatType.Health); willpower = stats.GetStat <RPGVital>(RPGStatType.Willpower); stamina = stats.GetStat <RPGVital>(RPGStatType.Stamina); dex = stats.GetStat <RPGAttribute>(RPGStatType.Dexterity); attackDie = stats.GetStat <RPGAttribute>(RPGStatType.DieType); level = stats.GetStat <RPGAttribute>(RPGStatType.Level); attack = stats.GetStat <RPGAttribute>(RPGStatType.Attack); will = stats.GetStat <RPGAttribute>(RPGStatType.Will); defense = stats.GetStat <RPGAttribute>(RPGStatType.Defense); alive = stats.GetStat <RPGAttribute>(RPGStatType.Alive); speed = stats.GetStat <RPGAttribute>(RPGStatType.Speed); evasion = stats.GetStat <RPGAttribute>(RPGStatType.Evasion); if (gameObject.GetComponent <CurrentState>().inCombat) { SetPlayerStatusBars(); } ///Modifiy base stats /// health.StatBaseValue += 10; health.SetCurrentValueToMax(); attackDie.StatBaseValue = DieTypes.GetAttackDie(DieTypes.DieType.D4); dex.StatBaseValue = dex.StatBaseValue + 1; dex.UpdateLinkers(); Debug.Log("Player health is: " + health.StatBaseValue); Debug.Log("Extroversion: " + socialStats.GetStat(SocialStats.SocialStatType.Extroversion).StatBaseValue); ///Tests socialStats.SocialStatChange(socialStats.GetStat(SocialStats.SocialStatType.Extroversion)); Debug.Log("Extroversion after increment: " + socialStats.GetStat(SocialStats.SocialStatType.Extroversion).StatValue); }