Add mastery and expertise to alteration
This commit is contained in:
		
							parent
							
								
									cc9c0460f0
								
							
						
					
					
						commit
						1a07f5287f
					
				
					 6 changed files with 412 additions and 302 deletions
				
			
		| 
						 | 
					@ -26,6 +26,7 @@ import com.pixelized.rplexicon.utilitary.extentions.local.fail
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.isBrutalCritical
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.isBrutalCritical
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.isCritical
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.isCritical
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.isSavageAttacks
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.isSavageAttacks
 | 
				
			||||||
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.mastery
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.toStatus
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.toStatus
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
 | 
					import com.pixelized.rplexicon.utilitary.extentions.modifier
 | 
				
			||||||
| 
						 | 
					@ -612,7 +613,8 @@ class DiceThrowUseCase @Inject constructor(
 | 
				
			||||||
                Property.STEALTH -> character.stealth
 | 
					                Property.STEALTH -> character.stealth
 | 
				
			||||||
                Property.SURVIVAL -> character.survival
 | 
					                Property.SURVIVAL -> character.survival
 | 
				
			||||||
                else -> null
 | 
					                else -> null
 | 
				
			||||||
            }?.let { multiplier ->
 | 
					            }?.let {
 | 
				
			||||||
 | 
					                val multiplier = max(it, status[ability].mastery)
 | 
				
			||||||
                val mastery = character.proficiency * multiplier
 | 
					                val mastery = character.proficiency * multiplier
 | 
				
			||||||
                allValue.add(mastery)
 | 
					                allValue.add(mastery)
 | 
				
			||||||
                listOf(
 | 
					                listOf(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,8 @@ data class Alteration(
 | 
				
			||||||
        val name: String,
 | 
					        val name: String,
 | 
				
			||||||
        val advantage: Boolean = false,
 | 
					        val advantage: Boolean = false,
 | 
				
			||||||
        val disadvantage: Boolean = false,
 | 
					        val disadvantage: Boolean = false,
 | 
				
			||||||
 | 
					        val mastery: Boolean = false,
 | 
				
			||||||
 | 
					        val expertise: Boolean = false,
 | 
				
			||||||
        val fail: Boolean = false,
 | 
					        val fail: Boolean = false,
 | 
				
			||||||
        val critical: Boolean = false,
 | 
					        val critical: Boolean = false,
 | 
				
			||||||
        val dices: List<Roll.Dice> = emptyList(),
 | 
					        val dices: List<Roll.Dice> = emptyList(),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,25 +84,12 @@ class AlterationParser @Inject constructor(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private fun parseAlterationStatus(name: String, value: String): Alteration.Status =
 | 
					    private fun parseAlterationStatus(name: String, value: String): Alteration.Status =
 | 
				
			||||||
        when (value) {
 | 
					        when (value) {
 | 
				
			||||||
            ADVANTAGE -> Alteration.Status(
 | 
					            ADVANTAGE -> Alteration.Status(name = name, advantage = true)
 | 
				
			||||||
                name = name,
 | 
					            DISADVANTAGE -> Alteration.Status(name = name, disadvantage = true)
 | 
				
			||||||
                advantage = true,
 | 
					            MASTERY -> Alteration.Status(name = name, mastery = true)
 | 
				
			||||||
            )
 | 
					            EXPERTISE -> Alteration.Status(name = name, expertise = true)
 | 
				
			||||||
 | 
					            FAIL -> Alteration.Status(name = name, fail = true)
 | 
				
			||||||
            DISADVANTAGE -> Alteration.Status(
 | 
					            CRITICAL -> Alteration.Status(name = name, critical = true)
 | 
				
			||||||
                name = name,
 | 
					 | 
				
			||||||
                disadvantage = true,
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            FAIL -> Alteration.Status(
 | 
					 | 
				
			||||||
                name = name,
 | 
					 | 
				
			||||||
                fail = true,
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            CRITICAL -> Alteration.Status(
 | 
					 | 
				
			||||||
                name = name,
 | 
					 | 
				
			||||||
                critical = true,
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            else -> {
 | 
					            else -> {
 | 
				
			||||||
                Alteration.Status(
 | 
					                Alteration.Status(
 | 
				
			||||||
| 
						 | 
					@ -117,6 +104,8 @@ class AlterationParser @Inject constructor(
 | 
				
			||||||
        private const val ALL = "Tous"
 | 
					        private const val ALL = "Tous"
 | 
				
			||||||
        private const val ADVANTAGE = "adv"
 | 
					        private const val ADVANTAGE = "adv"
 | 
				
			||||||
        private const val DISADVANTAGE = "dis"
 | 
					        private const val DISADVANTAGE = "dis"
 | 
				
			||||||
 | 
					        private const val MASTERY = "mas"
 | 
				
			||||||
 | 
					        private const val EXPERTISE = "exp"
 | 
				
			||||||
        private const val FAIL = "fail"
 | 
					        private const val FAIL = "fail"
 | 
				
			||||||
        private const val CRITICAL = "crit"
 | 
					        private const val CRITICAL = "crit"
 | 
				
			||||||
        private const val EFFECT = "Effet"
 | 
					        private const val EFFECT = "Effet"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,10 +10,12 @@ import com.pixelized.rplexicon.ui.screens.character.composable.character.Passive
 | 
				
			||||||
import com.pixelized.rplexicon.ui.screens.character.composable.character.ProficiencyUio
 | 
					import com.pixelized.rplexicon.ui.screens.character.composable.character.ProficiencyUio
 | 
				
			||||||
import com.pixelized.rplexicon.ui.screens.character.composable.character.StatUio
 | 
					import com.pixelized.rplexicon.ui.screens.character.composable.character.StatUio
 | 
				
			||||||
import com.pixelized.rplexicon.ui.screens.character.pages.proficiency.CharacterSheetUio
 | 
					import com.pixelized.rplexicon.ui.screens.character.pages.proficiency.CharacterSheetUio
 | 
				
			||||||
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.mastery
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.passivesBonus
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.passivesBonus
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
 | 
					import com.pixelized.rplexicon.utilitary.extentions.modifier
 | 
				
			||||||
import javax.inject.Inject
 | 
					import javax.inject.Inject
 | 
				
			||||||
 | 
					import kotlin.math.max
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CharacterSheetUioFactory @Inject constructor() {
 | 
					class CharacterSheetUioFactory @Inject constructor() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -68,138 +70,213 @@ class CharacterSheetUioFactory @Inject constructor() {
 | 
				
			||||||
                ),
 | 
					                ),
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            savingThrows = listOf(
 | 
					            savingThrows = listOf(
 | 
				
			||||||
 | 
					                status[Property.STRENGTH_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.strengthSavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.strengthSavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = strength.modifier + status[Property.STRENGTH_SAVING_THROW].sum + sheet.strengthSavingThrows * proficiency,
 | 
					                        modifier = strength.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.DEXTERITY_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.dexteritySavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.dexteritySavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = dexterity.modifier + status[Property.DEXTERITY_SAVING_THROW].sum + sheet.dexteritySavingThrows * proficiency,
 | 
					                        modifier = dexterity.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.CONSTITUTION_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.constitutionSavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.constitutionSavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = constitution.modifier + status[Property.CONSTITUTION_SAVING_THROW].sum + sheet.constitutionSavingThrows * proficiency,
 | 
					                        modifier = constitution.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.INTELLIGENCE_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.intelligenceSavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.INTELLIGENCE_SAVING_THROW].sum + sheet.intelligenceSavingThrows * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.WISDOM_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.wisdomSavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.wisdomSavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.WISDOM_SAVING_THROW].sum + sheet.wisdomSavingThrows * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.CHARISMA_SAVING_THROW].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.charismaSavingThrows, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
 | 
					                        id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
 | 
				
			||||||
                    multiplier = sheet.charismaSavingThrows,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = charisma.modifier + status[Property.CHARISMA_SAVING_THROW].sum + sheet.charismaSavingThrows * proficiency,
 | 
					                        modifier = charisma.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            proficiencies = listOf(
 | 
					            proficiencies = listOf(
 | 
				
			||||||
 | 
					                status[Property.ACROBATICS].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.acrobatics, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.ACROBATICS,
 | 
					                        id = ProficiencyUio.ID.ACROBATICS,
 | 
				
			||||||
                    multiplier = sheet.acrobatics,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = dexterity.modifier + status[Property.ACROBATICS].sum + sheet.acrobatics * proficiency,
 | 
					                        modifier = dexterity.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.ARCANA].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.arcana, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.ARCANA,
 | 
					                        id = ProficiencyUio.ID.ARCANA,
 | 
				
			||||||
                    multiplier = sheet.arcana,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.ARCANA].sum + sheet.arcana * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.ATHLETICS].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.athletics, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.ATHLETICS,
 | 
					                        id = ProficiencyUio.ID.ATHLETICS,
 | 
				
			||||||
                    multiplier = sheet.athletics,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = strength.modifier + status[Property.ATHLETICS].sum + sheet.athletics * proficiency,
 | 
					                        modifier = strength.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.STEALTH].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.stealth, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.STEALTH,
 | 
					                        id = ProficiencyUio.ID.STEALTH,
 | 
				
			||||||
                    multiplier = sheet.stealth,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = dexterity.modifier + status[Property.STEALTH].sum + sheet.stealth * proficiency,
 | 
					                        modifier = dexterity.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.ANIMAL_HANDLING].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.animalHandling, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.ANIMAL_HANDLING,
 | 
					                        id = ProficiencyUio.ID.ANIMAL_HANDLING,
 | 
				
			||||||
                    multiplier = sheet.animalHandling,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.ANIMAL_HANDLING].sum + sheet.animalHandling * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.SLEIGHT_OF_HAND].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.sleightOfHand, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
 | 
					                        id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
 | 
				
			||||||
                    multiplier = sheet.sleightOfHand,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = dexterity.modifier + status[Property.SLEIGHT_OF_HAND].sum + sheet.sleightOfHand * proficiency,
 | 
					                        modifier = dexterity.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.HISTORY].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.history, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.HISTORY,
 | 
					                        id = ProficiencyUio.ID.HISTORY,
 | 
				
			||||||
                    multiplier = sheet.history,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.HISTORY].sum + sheet.history * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.INTIMIDATION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.intimidation, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.INTIMIDATION,
 | 
					                        id = ProficiencyUio.ID.INTIMIDATION,
 | 
				
			||||||
                    multiplier = sheet.intimidation,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = charisma.modifier + status[Property.INTIMIDATION].sum + sheet.intimidation * proficiency,
 | 
					                        modifier = charisma.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.INSIGHT].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.insight, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.INSIGHT,
 | 
					                        id = ProficiencyUio.ID.INSIGHT,
 | 
				
			||||||
                    multiplier = sheet.insight,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.INSIGHT].sum + sheet.insight * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.INVESTIGATION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.investigation, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.INVESTIGATION,
 | 
					                        id = ProficiencyUio.ID.INVESTIGATION,
 | 
				
			||||||
                    multiplier = sheet.investigation,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.INVESTIGATION].sum + sheet.investigation * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.MEDICINE].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.medicine, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.MEDICINE,
 | 
					                        id = ProficiencyUio.ID.MEDICINE,
 | 
				
			||||||
                    multiplier = sheet.medicine,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.MEDICINE].sum + sheet.medicine * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.NATURE].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.nature, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.NATURE,
 | 
					                        id = ProficiencyUio.ID.NATURE,
 | 
				
			||||||
                    multiplier = sheet.nature,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.NATURE].sum + sheet.nature * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.PERCEPTION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.perception, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.PERCEPTION,
 | 
					                        id = ProficiencyUio.ID.PERCEPTION,
 | 
				
			||||||
                    multiplier = sheet.perception,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.PERCEPTION].sum + sheet.perception * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.PERSUASION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.persuasion, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.PERSUASION,
 | 
					                        id = ProficiencyUio.ID.PERSUASION,
 | 
				
			||||||
                    multiplier = sheet.persuasion,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = charisma.modifier + status[Property.PERSUASION].sum + sheet.persuasion * proficiency,
 | 
					                        modifier = charisma.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.RELIGION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.religion, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.RELIGION,
 | 
					                        id = ProficiencyUio.ID.RELIGION,
 | 
				
			||||||
                    multiplier = sheet.religion,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = intelligence.modifier + status[Property.RELIGION].sum + sheet.religion * proficiency,
 | 
					                        modifier = intelligence.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.PERFORMANCE].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.performance, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.PERFORMANCE,
 | 
					                        id = ProficiencyUio.ID.PERFORMANCE,
 | 
				
			||||||
                    multiplier = sheet.performance,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = charisma.modifier + status[Property.PERFORMANCE].sum + sheet.performance * proficiency,
 | 
					                        modifier = charisma.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.SURVIVAL].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.survival, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.SURVIVAL,
 | 
					                        id = ProficiencyUio.ID.SURVIVAL,
 | 
				
			||||||
                    multiplier = sheet.survival,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = wisdom.modifier + status[Property.SURVIVAL].sum + sheet.survival * proficiency,
 | 
					                        modifier = wisdom.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status[Property.DECEPTION].let {
 | 
				
			||||||
 | 
					                    val mastery = max(sheet.deception, it.mastery)
 | 
				
			||||||
                    ProficiencyUio(
 | 
					                    ProficiencyUio(
 | 
				
			||||||
                        id = ProficiencyUio.ID.DECEPTION,
 | 
					                        id = ProficiencyUio.ID.DECEPTION,
 | 
				
			||||||
                    multiplier = sheet.deception,
 | 
					                        multiplier = mastery,
 | 
				
			||||||
                    modifier = charisma.modifier + status[Property.DECEPTION].sum + sheet.deception * proficiency,
 | 
					                        modifier = charisma.modifier + it.sum + mastery * proficiency
 | 
				
			||||||
                ),
 | 
					                    )
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            passives = PassivesUio(
 | 
					            passives = PassivesUio(
 | 
				
			||||||
                perception = status[Property.PERCEPTION].let {
 | 
					                perception = status[Property.PERCEPTION].let {
 | 
				
			||||||
                    10 + wisdom.modifier + it.sum + sheet.perception * proficiency + it.passivesBonus
 | 
					                    val mastery = max(sheet.perception, it.mastery)
 | 
				
			||||||
 | 
					                    10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                investigation = status[Property.INVESTIGATION].let {
 | 
					                investigation = status[Property.INVESTIGATION].let {
 | 
				
			||||||
                    10 + intelligence.modifier + it.sum + sheet.investigation * proficiency + it.passivesBonus
 | 
					                    val mastery = max(sheet.investigation, it.mastery)
 | 
				
			||||||
 | 
					                    10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                insight = status[Property.INSIGHT].let {
 | 
					                insight = status[Property.INSIGHT].let {
 | 
				
			||||||
                    10 + wisdom.modifier + it.sum + sheet.insight * proficiency + it.passivesBonus
 | 
					                    val mastery = max(sheet.insight, it.mastery)
 | 
				
			||||||
 | 
					                    10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            speed = LabelPointUio(
 | 
					            speed = LabelPointUio(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,7 @@ import com.pixelized.rplexicon.ui.screens.summary.composable.common.maxLabel
 | 
				
			||||||
import com.pixelized.rplexicon.ui.screens.summary.composable.common.none
 | 
					import com.pixelized.rplexicon.ui.screens.summary.composable.common.none
 | 
				
			||||||
import com.pixelized.rplexicon.ui.screens.summary.composable.common.proficiency
 | 
					import com.pixelized.rplexicon.ui.screens.summary.composable.common.proficiency
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.highestSpellLevel
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.highestSpellLevel
 | 
				
			||||||
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.mastery
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.passivesBonus
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.passivesBonus
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.spell
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.spell
 | 
				
			||||||
import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
					import com.pixelized.rplexicon.utilitary.extentions.local.sum
 | 
				
			||||||
| 
						 | 
					@ -34,6 +35,7 @@ import kotlinx.coroutines.flow.combine
 | 
				
			||||||
import kotlinx.coroutines.launch
 | 
					import kotlinx.coroutines.launch
 | 
				
			||||||
import kotlinx.coroutines.withContext
 | 
					import kotlinx.coroutines.withContext
 | 
				
			||||||
import javax.inject.Inject
 | 
					import javax.inject.Inject
 | 
				
			||||||
 | 
					import kotlin.math.max
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private const val ENTER_ANIMATION_INITIAL_DELAY = 250L
 | 
					private const val ENTER_ANIMATION_INITIAL_DELAY = 250L
 | 
				
			||||||
private const val ENTER_ANIMATION_DELAY = 100L
 | 
					private const val ENTER_ANIMATION_DELAY = 100L
 | 
				
			||||||
| 
						 | 
					@ -263,42 +265,50 @@ class SummaryFactory @Inject constructor(
 | 
				
			||||||
                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
					                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
				
			||||||
                        val charisma = sheet.charisma + status[Property.CHARISMA].sum
 | 
					                        val charisma = sheet.charisma + status[Property.CHARISMA].sum
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        val strengthSavingThrows = proficiency(
 | 
					                        val strengthSavingThrows = status[Property.STRENGTH_SAVING_THROW].let {
 | 
				
			||||||
                            multiplier = sheet.strengthSavingThrows,
 | 
					                            val mastery = max(sheet.strengthSavingThrows, it.mastery)
 | 
				
			||||||
                            label = status[Property.STRENGTH_SAVING_THROW].let {
 | 
					                            proficiency(
 | 
				
			||||||
                                strength.modifier + it.sum + sheet.strengthSavingThrows * proficiency
 | 
					                                multiplier = mastery,
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val dexteritySavingThrows = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.dexteritySavingThrows,
 | 
					                        val dexteritySavingThrows = status[Property.DEXTERITY_SAVING_THROW].let {
 | 
				
			||||||
                            label = status[Property.DEXTERITY_SAVING_THROW].let {
 | 
					                            val mastery = max(sheet.dexteritySavingThrows, it.mastery)
 | 
				
			||||||
                                dexterity.modifier + it.sum + sheet.dexteritySavingThrows * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val constitutionSavingThrows = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.constitutionSavingThrows,
 | 
					                        val constitutionSavingThrows =
 | 
				
			||||||
                            label = status[Property.CONSTITUTION_SAVING_THROW].let {
 | 
					                            status[Property.CONSTITUTION_SAVING_THROW].let {
 | 
				
			||||||
                                constitution.modifier + it.sum + sheet.constitutionSavingThrows * proficiency
 | 
					                                val mastery = max(sheet.constitutionSavingThrows, it.mastery)
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                proficiency(
 | 
				
			||||||
 | 
					                                    multiplier = mastery,
 | 
				
			||||||
 | 
					                                    label = (constitution.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                                )
 | 
					                                )
 | 
				
			||||||
                        val intelligenceSavingThrows = proficiency(
 | 
					                            }
 | 
				
			||||||
                            multiplier = sheet.intelligenceSavingThrows,
 | 
					                        val intelligenceSavingThrows =
 | 
				
			||||||
                            label = status[Property.INTELLIGENCE_SAVING_THROW].let {
 | 
					                            status[Property.INTELLIGENCE_SAVING_THROW].let {
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.intelligenceSavingThrows * proficiency
 | 
					                                val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                proficiency(
 | 
				
			||||||
 | 
					                                    multiplier = mastery,
 | 
				
			||||||
 | 
					                                    label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                                )
 | 
					                                )
 | 
				
			||||||
                        val wisdomSavingThrows = proficiency(
 | 
					                            }
 | 
				
			||||||
                            multiplier = sheet.wisdomSavingThrows,
 | 
					                        val wisdomSavingThrows = status[Property.WISDOM_SAVING_THROW].let {
 | 
				
			||||||
                            label = status[Property.WISDOM_SAVING_THROW].let {
 | 
					                            val mastery = max(sheet.wisdomSavingThrows, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.wisdomSavingThrows * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val charismaSavingThrows = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.charismaSavingThrows,
 | 
					                        val charismaSavingThrows = status[Property.CHARISMA_SAVING_THROW].let {
 | 
				
			||||||
                            label = status[Property.CHARISMA_SAVING_THROW].let {
 | 
					                            val mastery = max(sheet.charismaSavingThrows, it.mastery)
 | 
				
			||||||
                                charisma.modifier + it.sum + sheet.charismaSavingThrows * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                        withContext(Dispatchers.Main) {
 | 
					                        withContext(Dispatchers.Main) {
 | 
				
			||||||
                            savingThrows.strength.get(sheet)?.value = strengthSavingThrows
 | 
					                            savingThrows.strength.get(sheet)?.value = strengthSavingThrows
 | 
				
			||||||
                            savingThrows.dexterity.get(sheet)?.value = dexteritySavingThrows
 | 
					                            savingThrows.dexterity.get(sheet)?.value = dexteritySavingThrows
 | 
				
			||||||
| 
						 | 
					@ -324,114 +334,132 @@ class SummaryFactory @Inject constructor(
 | 
				
			||||||
                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
					                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
				
			||||||
                        val charisma = sheet.charisma + status[Property.CHARISMA].sum
 | 
					                        val charisma = sheet.charisma + status[Property.CHARISMA].sum
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        val acrobatics = proficiency(
 | 
					                        val acrobatics = status[Property.ACROBATICS].let {
 | 
				
			||||||
                            multiplier = sheet.acrobatics,
 | 
					                            val mastery = max(sheet.acrobatics, it.mastery)
 | 
				
			||||||
                            label = status[Property.ACROBATICS].let {
 | 
					                            proficiency(
 | 
				
			||||||
                                dexterity.modifier + it.sum + sheet.acrobatics * proficiency
 | 
					                                multiplier = mastery,
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val arcana = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.arcana,
 | 
					                        val arcana = status[Property.ARCANA].let {
 | 
				
			||||||
                            label = status[Property.ARCANA].let {
 | 
					                            val mastery = max(sheet.arcana, it.mastery)
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.arcana * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val athletics = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.athletics,
 | 
					                        val athletics = status[Property.ATHLETICS].let {
 | 
				
			||||||
                            label = status[Property.ATHLETICS].let {
 | 
					                            val mastery = max(sheet.athletics, it.mastery)
 | 
				
			||||||
                                strength.modifier + it.sum + sheet.athletics * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val stealth = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.stealth,
 | 
					                        val stealth = status[Property.STEALTH].let {
 | 
				
			||||||
                            label = status[Property.STEALTH].let {
 | 
					                            val mastery = max(sheet.stealth, it.mastery)
 | 
				
			||||||
                                dexterity.modifier + it.sum + sheet.stealth * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val animalHandling = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.animalHandling,
 | 
					                        val animalHandling = status[Property.ANIMAL_HANDLING].let {
 | 
				
			||||||
                            label = status[Property.ANIMAL_HANDLING].let {
 | 
					                            val mastery = max(sheet.animalHandling, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.animalHandling * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val sleightOfHand = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.sleightOfHand,
 | 
					                        val sleightOfHand = status[Property.SLEIGHT_OF_HAND].let {
 | 
				
			||||||
                            label = status[Property.SLEIGHT_OF_HAND].let {
 | 
					                            val mastery = max(sheet.sleightOfHand, it.mastery)
 | 
				
			||||||
                                dexterity.modifier + it.sum + sheet.sleightOfHand * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val history = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.history,
 | 
					                        val history = status[Property.HISTORY].let {
 | 
				
			||||||
                            label = status[Property.HISTORY].let {
 | 
					                            val mastery = max(sheet.history, it.mastery)
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.history * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val intimidation = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.intimidation,
 | 
					                        val intimidation = status[Property.INTIMIDATION].let {
 | 
				
			||||||
                            label = status[Property.INTIMIDATION].let {
 | 
					                            val mastery = max(sheet.intimidation, it.mastery)
 | 
				
			||||||
                                charisma.modifier + it.sum + sheet.intimidation * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val insight = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.insight,
 | 
					                        val insight = status[Property.INSIGHT].let {
 | 
				
			||||||
                            label = status[Property.INSIGHT].let {
 | 
					                            val mastery = max(sheet.insight, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.insight * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val investigation = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.investigation,
 | 
					                        val investigation = status[Property.INVESTIGATION].let {
 | 
				
			||||||
                            label = status[Property.INVESTIGATION].let {
 | 
					                            val mastery = max(sheet.investigation, it.mastery)
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.investigation * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val medicine = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.medicine,
 | 
					                        val medicine = status[Property.MEDICINE].let {
 | 
				
			||||||
                            label = status[Property.MEDICINE].let {
 | 
					                            val mastery = max(sheet.medicine, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.medicine * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val nature = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.nature,
 | 
					                        val nature = status[Property.NATURE].let {
 | 
				
			||||||
                            label = status[Property.NATURE].let {
 | 
					                            val mastery = max(sheet.nature, it.mastery)
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.nature * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val perception = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.perception,
 | 
					                        val perception = status[Property.PERCEPTION].let {
 | 
				
			||||||
                            label = status[Property.PERCEPTION].let {
 | 
					                            val mastery = max(sheet.perception, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.perception * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val persuasion = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.persuasion,
 | 
					                        val persuasion = status[Property.PERSUASION].let {
 | 
				
			||||||
                            label = status[Property.PERSUASION].let {
 | 
					                            val mastery = max(sheet.persuasion, it.mastery)
 | 
				
			||||||
                                charisma.modifier + it.sum + sheet.persuasion * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val religion = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.religion,
 | 
					                        val religion = status[Property.RELIGION].let {
 | 
				
			||||||
                            label = status[Property.RELIGION].let {
 | 
					                            val mastery = max(sheet.religion, it.mastery)
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.religion * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val performance = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.performance,
 | 
					                        val performance = status[Property.PERFORMANCE].let {
 | 
				
			||||||
                            label = status[Property.PERFORMANCE].let {
 | 
					                            val mastery = max(sheet.performance, it.mastery)
 | 
				
			||||||
                                charisma.modifier + it.sum + sheet.performance * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val survival = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.survival,
 | 
					                        val survival = status[Property.SURVIVAL].let {
 | 
				
			||||||
                            label = status[Property.SURVIVAL].let {
 | 
					                            val mastery = max(sheet.survival, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.survival * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val deception = proficiency(
 | 
					                        }
 | 
				
			||||||
                            multiplier = sheet.deception,
 | 
					                        val deception = status[Property.DECEPTION].let {
 | 
				
			||||||
                            label = status[Property.DECEPTION].let {
 | 
					                            val mastery = max(sheet.deception, it.mastery)
 | 
				
			||||||
                                charisma.modifier + it.sum + sheet.deception * proficiency
 | 
					                            proficiency(
 | 
				
			||||||
                            }.toLabel(),
 | 
					                                multiplier = mastery,
 | 
				
			||||||
 | 
					                                label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                        withContext(Dispatchers.Main) {
 | 
					                        withContext(Dispatchers.Main) {
 | 
				
			||||||
                            proficiencies.acrobatics.get(sheet)?.value = acrobatics
 | 
					                            proficiencies.acrobatics.get(sheet)?.value = acrobatics
 | 
				
			||||||
                            proficiencies.arcana.get(sheet)?.value = arcana
 | 
					                            proficiencies.arcana.get(sheet)?.value = arcana
 | 
				
			||||||
| 
						 | 
					@ -466,21 +494,24 @@ class SummaryFactory @Inject constructor(
 | 
				
			||||||
                        val intelligence = sheet.intelligence + status[Property.INTELLIGENCE].sum
 | 
					                        val intelligence = sheet.intelligence + status[Property.INTELLIGENCE].sum
 | 
				
			||||||
                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
					                        val wisdom = sheet.wisdom + status[Property.WISDOM].sum
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        val passiveInsight = label(
 | 
					                        val passiveInsight = status[Property.INSIGHT].let {
 | 
				
			||||||
                            label = status[Property.INSIGHT].let {
 | 
					                            val mastery = max(sheet.insight, it.mastery)
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.insight * proficiency + it.passivesBonus
 | 
					                            label(
 | 
				
			||||||
                            }.let { "${10 + it}" },
 | 
					                                label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val passiveInvestigation = label(
 | 
					                        }
 | 
				
			||||||
                            label = status[Property.INVESTIGATION].let {
 | 
					                        val passiveInvestigation = status[Property.INVESTIGATION].let {
 | 
				
			||||||
                                intelligence.modifier + it.sum + sheet.investigation * proficiency + it.passivesBonus
 | 
					                            val mastery = max(sheet.investigation, it.mastery)
 | 
				
			||||||
                            }.let { "${10 + it}" },
 | 
					                            label(
 | 
				
			||||||
 | 
					                                label = "${10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
                        val passivePerception = label(
 | 
					                        }
 | 
				
			||||||
                            label = status[Property.PERCEPTION].let {
 | 
					                        val passivePerception = status[Property.PERCEPTION].let {
 | 
				
			||||||
                                wisdom.modifier + it.sum + sheet.perception * proficiency + it.passivesBonus
 | 
					                            val mastery = max(sheet.perception, it.mastery)
 | 
				
			||||||
                            }.let { "${10 + it}" }
 | 
					                            label(
 | 
				
			||||||
 | 
					                                label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
 | 
				
			||||||
                            )
 | 
					                            )
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                        withContext(Dispatchers.Main) {
 | 
					                        withContext(Dispatchers.Main) {
 | 
				
			||||||
                            passives.insight.get(sheet)?.value = passiveInsight
 | 
					                            passives.insight.get(sheet)?.value = passiveInsight
 | 
				
			||||||
                            passives.investigation.get(sheet)?.value = passiveInvestigation
 | 
					                            passives.investigation.get(sheet)?.value = passiveInvestigation
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,15 @@ val List<Alteration.Status>?.advantage: Boolean
 | 
				
			||||||
val List<Alteration.Status>?.disadvantage: Boolean
 | 
					val List<Alteration.Status>?.disadvantage: Boolean
 | 
				
			||||||
    get() = this?.any { it.disadvantage } ?: false
 | 
					    get() = this?.any { it.disadvantage } ?: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					val List<Alteration.Status>?.mastery: Int
 | 
				
			||||||
 | 
					    get() = this?.maxOf {
 | 
				
			||||||
 | 
					        when {
 | 
				
			||||||
 | 
					            it.mastery -> 1
 | 
				
			||||||
 | 
					            it.expertise -> 2
 | 
				
			||||||
 | 
					            else -> 0
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    } ?: 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
val List<Alteration.Status>?.fail: Boolean
 | 
					val List<Alteration.Status>?.fail: Boolean
 | 
				
			||||||
    get() = this?.any { it.fail } ?: false
 | 
					    get() = this?.any { it.fail } ?: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue