Example #1
0
    public static float GetBonusForType(PlayerStatTypes type)
    {
        switch (type)
        {
            case PlayerStatTypes.SpellPower:
                return (TalentsSpent[(int)type] * SpellPowerPerTalent);
            case PlayerStatTypes.Haste:
                return (TalentsSpent[(int)type] * HastePerTalent);
            case PlayerStatTypes.ManaRegen:
                return (TalentsSpent[(int)type] * ManaRegenPerTalent);
            case PlayerStatTypes.Mana:
                return (TalentsSpent[(int)type] * ManaPerTalent);
            case PlayerStatTypes.Cooldown:
                return (TalentsSpent[(int)type] * CooldownPerTalent);
            case PlayerStatTypes.PartyHealth:
                return (TalentsSpent[(int)type] * PartyHealthPerTalent);
            case PlayerStatTypes.PartyDR:
                return (TalentsSpent[(int)type] * PartyDRPerTalent);
            case PlayerStatTypes.PartyDPS:
                return (TalentsSpent[(int)type] * PartyDPSPerTalent);
            case PlayerStatTypes.NumTypes:
                break;
            default:
                break;
        }

        return 0;
    }
Example #2
0
    public static void ModTalentPointsInType(PlayerStatTypes type, int amount)
    {
        //Dont spend a talent point if we cant spend any more or refund it if there are no more spent in that slot!
        if ((NumAvailableTalents - amount < 0) || ((TalentsSpent[(int)type] + amount) < 0))
            return;

        TalentsSpent[(int)type] += amount;
        NumAvailableTalents -= amount;

        switch (type)
        {
            case PlayerStatTypes.SpellPower:
                SpellPower = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.SpellPower));
                break;
            case PlayerStatTypes.Haste:
                Haste = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.Haste));
                break;
            case PlayerStatTypes.ManaRegen:
                ManaRegen = BaseAmounts[(int)type] + GetBonusForType(PlayerStatTypes.ManaRegen);
                break;
            case PlayerStatTypes.Mana:
                Mana = (int)(BaseAmounts[(int)type] + GetBonusForType(PlayerStatTypes.Mana));
                break;
            case PlayerStatTypes.Cooldown:
                Cooldown = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.Cooldown));
                break;
            case PlayerStatTypes.PartyHealth:
                PartyHealth = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.PartyHealth));
                break;
            case PlayerStatTypes.PartyDR:
                PartyDR = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.PartyDR));
                break;
            case PlayerStatTypes.PartyDPS:
                PartyDPS = BaseAmounts[(int)type] * (1.0f + GetBonusForType(PlayerStatTypes.PartyDPS));
                break;
            case PlayerStatTypes.NumTypes:
                break;
            default:
                break;
        }

        SpellStats.ApplyTalentsToSpells();
        PartyStats.ApplyTalentsToPartyMembers();
    }
Example #3
0
 public static int GetNumTalentsSpentInType(PlayerStatTypes type)
 {
     return TalentsSpent[(int)type];
 }
Example #4
0
    void UpdateDescription(PlayerStatTypes type)
    {
        switch (type)
        {
            case PlayerStatTypes.SpellPower:
                SpellPowerDescription.text = "Increases healing done by your spells by " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.SpellPower) * 100.0f) + " %";
                SpellPowerTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.SpellPower).ToString();
                break;
            case PlayerStatTypes.Haste:
                HasteDescription.text = "Makes you cast your spells " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.Haste) * 100.0f) + " % faster";
                HasteTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.Haste).ToString();
                break;
            case PlayerStatTypes.ManaRegen:
                ManaRegenDescription.text = "Increases your mana regeneration to " + PlayerStats.GetManaRegen() + " per second";
                ManaRegenTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.ManaRegen).ToString();
                break;
            case PlayerStatTypes.Mana:
                ManaDescription.text = "Increases your maximum mana by " + PlayerStats.GetBonusForType(PlayerStatTypes.Mana) + " to " + PlayerStats.GetMana();
                ManaTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.Mana).ToString();
                break;
            case PlayerStatTypes.Cooldown:
                CooldownDescription.text = "Makes your spells cool down " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.Cooldown) * 100.0f) + "% faster ";
                CooldownTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.Cooldown).ToString();
                break;
            case PlayerStatTypes.PartyHealth:
                PartyHealthDescription.text = "Increases the maximum health of all your party members by " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.PartyHealth) * 100.0f) + "% ";
                PartyHealthTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.PartyHealth).ToString();
                break;
            case PlayerStatTypes.PartyDR:
                PartyDRDescription.text = "Increases the damage reductio of all your party members by " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.PartyDR) * 100.0f) + "% ";
                PartyDRTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.PartyDR).ToString();
                break;
            case PlayerStatTypes.PartyDPS:
                PartyDPSDescription.text = "Increases the damage per second dealth by all your party members by " + Mathf.RoundToInt(PlayerStats.GetBonusForType(PlayerStatTypes.PartyDPS) * 100.0f) + "% ";
                PartyDPSTalentsText.text = PlayerStats.GetNumTalentsSpentInType(PlayerStatTypes.PartyDPS).ToString();
                break;
            case PlayerStatTypes.NumTypes:
                break;
            default:
                break;
        }

        UpdateHeader();
    }
Example #5
0
 void DeductTalentPoint(PlayerStatTypes type)
 {
     PlayerStats.ModTalentPointsInType(type, -1);
     UpdateDescription(type);
 }
Example #6
0
 void AssignTalentPoint(PlayerStatTypes type)
 {
     PlayerStats.ModTalentPointsInType(type, 1);
     UpdateDescription(type);
 }