Example #1
0
    private void SetPassivePerception()
    {
        var sheet  = characterSheetController.Character;
        int result = 10 + CharacterValuesUtility.GetCharacteristicModificator(sheet[CharacteristicType.Wisdom]);

        if ((sheet.PersonalSkills & SkillType.Perception) == SkillType.Perception)
        {
            int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints);
            result += CharacterValuesUtility.GetMasteryBonus(level);
        }

        characterHolder.passivePerceptionValueText.text = result.ToString();
    }
    private void SetSkillModificator(SkillHolder skillHolder)
    {
        var sheet = characterSheetController.Character;

        var  skillCharacteristic = CharacterUtility.GetCharacteristicBySkill(skillHolder.type);
        int  characteristicValue = sheet[skillCharacteristic];
        bool isOwned             = (sheet.PersonalSkills & skillHolder.type) == skillHolder.type;
        int  modificator         = CharacterValuesUtility.GetCharacteristicModificator(characteristicValue);

        if (isOwned)
        {
            int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints);
            modificator += CharacterValuesUtility.GetMasteryBonus(level);
        }

        skillHolder.valueText.text    = TextUtility.GetSignedValueString(modificator);
        skillHolder.toggleButton.isOn = isOwned;
    }
Example #3
0
    private void SetSavingThrowModificator(SavingThrowHolder savingThrow)
    {
        var sheet = characterSheetController.Character;

        int characteristicValue = sheet[savingThrow.characteristic];
        int modificator         = CharacterValuesUtility.GetCharacteristicModificator(characteristicValue);

        var  baseSavingThrows = CharacterUtility.GetSavingThrowsByClass(sheet.Type);
        bool isOwned          = baseSavingThrows.Contains(savingThrow.characteristic);

        if (isOwned)
        {
            int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints);
            modificator += CharacterValuesUtility.GetMasteryBonus(level);
        }

        savingThrow.valueText.text = TextUtility.GetSignedValueString(modificator);
        savingThrow.toggle.isOn    = isOwned;
    }
Example #4
0
    private void SetMasteryBonus(int expPoints)
    {
        int level = CharacterValuesUtility.CalculateLevel(expPoints);

        characterHolder.masteryBonusValueText.text = TextUtility.GetSignedValueString(CharacterValuesUtility.GetMasteryBonus(level));
    }