- updated all abilities to scale with new stat system - updated difficulty settings using new stat system - added S+ difficulty as the end game - updated items using new stat system - small re-balance to make things a bit more fun to test
44 lines
1.9 KiB
C#
44 lines
1.9 KiB
C#
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)));
|
|
}
|
|
}
|