Example #1
0
    public RecoveryCooldown(float cooldown, Ability parentAbility, AbilityRecoveryManager manager) : base(parentAbility, manager)
    {
        Stats = new StatCollection(ParentAbility.Source, OnStatChanged);
        Stats.AddStat(BaseStat.StatType.CoolDown, cooldown);

        coolDownTimer = new Timer("Cooldown", cooldown, true, Refresh);
    }
    //private List<StatModifier> maxCapMods = new List<StatModifier>();
    //private StatModifier recoveryMod;

    public AbilityRecoveryManager(Ability parentAbility)
    {
        //maxCapMod = new StatModifier(1, StatModifier.StatModificationType.Additive);
        //recoveryMod = new StatModifier(-1, StatModifier.StatModificationType.Additive);
        //spendMod = new StatModifier(-1)

        this.ParentAbility = parentAbility;
        RecoveryStats      = new StatCollection(parentAbility.Source, OnStatChanged);
        RecoveryStats.AddStat(BaseStat.StatType.AbilityCharge, 1, 1);
    }
Example #3
0
    public void Equip(OnItemEquipEventData e)
    {
        StatCollection stats = e.Equipper
                               .GetComponentInChildren <StatCollection>();

        foreach (StatModifier s in StatBonuses)
        {
            stats.AddStat(s);
        }
    }
Example #4
0
    public void CreateStatsFromData(StatCollection collection)
    {
        int count = stats.Count;

        for (int i = 0; i < count; i++)
        {
            StatDataDisplay currentDisplay = stats[i];

            switch (currentDisplay.variant)
            {
            case BaseStat.StatVariant.Capped:
                collection.AddStat(currentDisplay.statType, currentDisplay.baseValue, currentDisplay.baseValue);
                break;

            case BaseStat.StatVariant.Simple:
                collection.AddStat(currentDisplay.statType, currentDisplay.baseValue);
                break;
            }
        }
    }