using Kryz.CharacterStats.Examples; using Kryz.CharacterStats; using System.Collections; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu(fileName = "UnitDifficultySettings", menuName = "RiftMayhem/Settings/Difficulty/UnitDifficultySettings", order = 0)] public class UnitDifficultySettings : ScriptableObject { [Header("Attack Modifiers:")] public float attackDamangeFlatIncrease; public float attackDamangePercentIncrease; [Header("Spell Modifiers:")] public float spellDamangeFlatIncrease; public float spellDamangePercentIncrease; [Header("Resources Modifiers:")] public float maxHealthFlatIncrease; public float maxHealthPercentIncrease; public float maxManaPercentIncrease; public void SetDifficulty(ref Health health, ref Mana mana, ref CharacterStats stats) { stats.MaxHealth.BaseValue += maxHealthFlatIncrease; stats.MaxHealth.RemoveAllModifiersFromSource(GameConstants.ObjectSources.LevelSource); stats.MaxHealth.AddModifier(new StatModifier(maxHealthPercentIncrease, StatModType.PercentAdd, GameConstants.ObjectSources.LevelSource)); stats.AttackDamage.BaseValue += attackDamangeFlatIncrease; stats.AttackDamage.RemoveAllModifiersFromSource(GameConstants.ObjectSources.LevelSource); stats.AttackDamage.AddModifier(new StatModifier(attackDamangePercentIncrease, StatModType.PercentAdd, GameConstants.ObjectSources.LevelSource)); stats.SpellDamage.BaseValue += spellDamangeFlatIncrease; stats.SpellDamage.RemoveAllModifiersFromSource(GameConstants.ObjectSources.LevelSource); stats.SpellDamage.AddModifier(new StatModifier(spellDamangePercentIncrease, StatModType.PercentAdd, GameConstants.ObjectSources.LevelSource)); stats.onUpdateStatValues.Invoke(); mana.SetMaxValue((mana.GetMaxValue() * (1f + maxManaPercentIncrease))); } }