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(
|
||||||
ProficiencyUio(
|
status[Property.STRENGTH_SAVING_THROW].let {
|
||||||
id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
|
val mastery = max(sheet.strengthSavingThrows, it.mastery)
|
||||||
multiplier = sheet.strengthSavingThrows,
|
ProficiencyUio(
|
||||||
modifier = strength.modifier + status[Property.STRENGTH_SAVING_THROW].sum + sheet.strengthSavingThrows * proficiency,
|
id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
|
||||||
),
|
multiplier = mastery,
|
||||||
ProficiencyUio(
|
modifier = strength.modifier + it.sum + mastery * proficiency
|
||||||
id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
|
)
|
||||||
multiplier = sheet.dexteritySavingThrows,
|
},
|
||||||
modifier = dexterity.modifier + status[Property.DEXTERITY_SAVING_THROW].sum + sheet.dexteritySavingThrows * proficiency,
|
status[Property.DEXTERITY_SAVING_THROW].let {
|
||||||
),
|
val mastery = max(sheet.dexteritySavingThrows, it.mastery)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
|
id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
|
||||||
multiplier = sheet.constitutionSavingThrows,
|
multiplier = mastery,
|
||||||
modifier = constitution.modifier + status[Property.CONSTITUTION_SAVING_THROW].sum + sheet.constitutionSavingThrows * proficiency,
|
modifier = dexterity.modifier + it.sum + mastery * proficiency
|
||||||
),
|
)
|
||||||
ProficiencyUio(
|
},
|
||||||
id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
|
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||||
multiplier = sheet.intelligenceSavingThrows,
|
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
||||||
modifier = intelligence.modifier + status[Property.INTELLIGENCE_SAVING_THROW].sum + sheet.intelligenceSavingThrows * proficiency,
|
ProficiencyUio(
|
||||||
),
|
id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
|
||||||
ProficiencyUio(
|
multiplier = mastery,
|
||||||
id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
|
modifier = constitution.modifier + it.sum + mastery * proficiency
|
||||||
multiplier = sheet.wisdomSavingThrows,
|
)
|
||||||
modifier = wisdom.modifier + status[Property.WISDOM_SAVING_THROW].sum + sheet.wisdomSavingThrows * proficiency,
|
},
|
||||||
),
|
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||||
ProficiencyUio(
|
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
||||||
id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
|
ProficiencyUio(
|
||||||
multiplier = sheet.charismaSavingThrows,
|
id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
|
||||||
modifier = charisma.modifier + status[Property.CHARISMA_SAVING_THROW].sum + sheet.charismaSavingThrows * proficiency,
|
multiplier = mastery,
|
||||||
),
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.WISDOM_SAVING_THROW].let {
|
||||||
|
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.CHARISMA_SAVING_THROW].let {
|
||||||
|
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = charisma.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
),
|
),
|
||||||
proficiencies = listOf(
|
proficiencies = listOf(
|
||||||
ProficiencyUio(
|
status[Property.ACROBATICS].let {
|
||||||
id = ProficiencyUio.ID.ACROBATICS,
|
val mastery = max(sheet.acrobatics, it.mastery)
|
||||||
multiplier = sheet.acrobatics,
|
ProficiencyUio(
|
||||||
modifier = dexterity.modifier + status[Property.ACROBATICS].sum + sheet.acrobatics * proficiency,
|
id = ProficiencyUio.ID.ACROBATICS,
|
||||||
),
|
multiplier = mastery,
|
||||||
ProficiencyUio(
|
modifier = dexterity.modifier + it.sum + mastery * proficiency
|
||||||
id = ProficiencyUio.ID.ARCANA,
|
)
|
||||||
multiplier = sheet.arcana,
|
},
|
||||||
modifier = intelligence.modifier + status[Property.ARCANA].sum + sheet.arcana * proficiency,
|
status[Property.ARCANA].let {
|
||||||
),
|
val mastery = max(sheet.arcana, it.mastery)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.ATHLETICS,
|
id = ProficiencyUio.ID.ARCANA,
|
||||||
multiplier = sheet.athletics,
|
multiplier = mastery,
|
||||||
modifier = strength.modifier + status[Property.ATHLETICS].sum + sheet.athletics * proficiency,
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
),
|
)
|
||||||
ProficiencyUio(
|
},
|
||||||
id = ProficiencyUio.ID.STEALTH,
|
status[Property.ATHLETICS].let {
|
||||||
multiplier = sheet.stealth,
|
val mastery = max(sheet.athletics, it.mastery)
|
||||||
modifier = dexterity.modifier + status[Property.STEALTH].sum + sheet.stealth * proficiency,
|
ProficiencyUio(
|
||||||
),
|
id = ProficiencyUio.ID.ATHLETICS,
|
||||||
ProficiencyUio(
|
multiplier = mastery,
|
||||||
id = ProficiencyUio.ID.ANIMAL_HANDLING,
|
modifier = strength.modifier + it.sum + mastery * proficiency
|
||||||
multiplier = sheet.animalHandling,
|
)
|
||||||
modifier = wisdom.modifier + status[Property.ANIMAL_HANDLING].sum + sheet.animalHandling * proficiency,
|
},
|
||||||
),
|
status[Property.STEALTH].let {
|
||||||
ProficiencyUio(
|
val mastery = max(sheet.stealth, it.mastery)
|
||||||
id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
|
ProficiencyUio(
|
||||||
multiplier = sheet.sleightOfHand,
|
id = ProficiencyUio.ID.STEALTH,
|
||||||
modifier = dexterity.modifier + status[Property.SLEIGHT_OF_HAND].sum + sheet.sleightOfHand * proficiency,
|
multiplier = mastery,
|
||||||
),
|
modifier = dexterity.modifier + it.sum + mastery * proficiency
|
||||||
ProficiencyUio(
|
)
|
||||||
id = ProficiencyUio.ID.HISTORY,
|
},
|
||||||
multiplier = sheet.history,
|
status[Property.ANIMAL_HANDLING].let {
|
||||||
modifier = intelligence.modifier + status[Property.HISTORY].sum + sheet.history * proficiency,
|
val mastery = max(sheet.animalHandling, it.mastery)
|
||||||
),
|
ProficiencyUio(
|
||||||
ProficiencyUio(
|
id = ProficiencyUio.ID.ANIMAL_HANDLING,
|
||||||
id = ProficiencyUio.ID.INTIMIDATION,
|
multiplier = mastery,
|
||||||
multiplier = sheet.intimidation,
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
modifier = charisma.modifier + status[Property.INTIMIDATION].sum + sheet.intimidation * proficiency,
|
)
|
||||||
),
|
},
|
||||||
ProficiencyUio(
|
status[Property.SLEIGHT_OF_HAND].let {
|
||||||
id = ProficiencyUio.ID.INSIGHT,
|
val mastery = max(sheet.sleightOfHand, it.mastery)
|
||||||
multiplier = sheet.insight,
|
ProficiencyUio(
|
||||||
modifier = wisdom.modifier + status[Property.INSIGHT].sum + sheet.insight * proficiency,
|
id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
|
||||||
),
|
multiplier = mastery,
|
||||||
ProficiencyUio(
|
modifier = dexterity.modifier + it.sum + mastery * proficiency
|
||||||
id = ProficiencyUio.ID.INVESTIGATION,
|
)
|
||||||
multiplier = sheet.investigation,
|
},
|
||||||
modifier = intelligence.modifier + status[Property.INVESTIGATION].sum + sheet.investigation * proficiency,
|
status[Property.HISTORY].let {
|
||||||
),
|
val mastery = max(sheet.history, it.mastery)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.MEDICINE,
|
id = ProficiencyUio.ID.HISTORY,
|
||||||
multiplier = sheet.medicine,
|
multiplier = mastery,
|
||||||
modifier = wisdom.modifier + status[Property.MEDICINE].sum + sheet.medicine * proficiency,
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
),
|
)
|
||||||
ProficiencyUio(
|
},
|
||||||
id = ProficiencyUio.ID.NATURE,
|
status[Property.INTIMIDATION].let {
|
||||||
multiplier = sheet.nature,
|
val mastery = max(sheet.intimidation, it.mastery)
|
||||||
modifier = intelligence.modifier + status[Property.NATURE].sum + sheet.nature * proficiency,
|
ProficiencyUio(
|
||||||
),
|
id = ProficiencyUio.ID.INTIMIDATION,
|
||||||
ProficiencyUio(
|
multiplier = mastery,
|
||||||
id = ProficiencyUio.ID.PERCEPTION,
|
modifier = charisma.modifier + it.sum + mastery * proficiency
|
||||||
multiplier = sheet.perception,
|
)
|
||||||
modifier = wisdom.modifier + status[Property.PERCEPTION].sum + sheet.perception * proficiency,
|
},
|
||||||
),
|
status[Property.INSIGHT].let {
|
||||||
ProficiencyUio(
|
val mastery = max(sheet.insight, it.mastery)
|
||||||
id = ProficiencyUio.ID.PERSUASION,
|
ProficiencyUio(
|
||||||
multiplier = sheet.persuasion,
|
id = ProficiencyUio.ID.INSIGHT,
|
||||||
modifier = charisma.modifier + status[Property.PERSUASION].sum + sheet.persuasion * proficiency,
|
multiplier = mastery,
|
||||||
),
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
ProficiencyUio(
|
)
|
||||||
id = ProficiencyUio.ID.RELIGION,
|
},
|
||||||
multiplier = sheet.religion,
|
status[Property.INVESTIGATION].let {
|
||||||
modifier = intelligence.modifier + status[Property.RELIGION].sum + sheet.religion * proficiency,
|
val mastery = max(sheet.investigation, it.mastery)
|
||||||
),
|
ProficiencyUio(
|
||||||
ProficiencyUio(
|
id = ProficiencyUio.ID.INVESTIGATION,
|
||||||
id = ProficiencyUio.ID.PERFORMANCE,
|
multiplier = mastery,
|
||||||
multiplier = sheet.performance,
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
modifier = charisma.modifier + status[Property.PERFORMANCE].sum + sheet.performance * proficiency,
|
)
|
||||||
),
|
},
|
||||||
ProficiencyUio(
|
status[Property.MEDICINE].let {
|
||||||
id = ProficiencyUio.ID.SURVIVAL,
|
val mastery = max(sheet.medicine, it.mastery)
|
||||||
multiplier = sheet.survival,
|
ProficiencyUio(
|
||||||
modifier = wisdom.modifier + status[Property.SURVIVAL].sum + sheet.survival * proficiency,
|
id = ProficiencyUio.ID.MEDICINE,
|
||||||
),
|
multiplier = mastery,
|
||||||
ProficiencyUio(
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
id = ProficiencyUio.ID.DECEPTION,
|
)
|
||||||
multiplier = sheet.deception,
|
},
|
||||||
modifier = charisma.modifier + status[Property.DECEPTION].sum + sheet.deception * proficiency,
|
status[Property.NATURE].let {
|
||||||
),
|
val mastery = max(sheet.nature, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.NATURE,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.PERCEPTION].let {
|
||||||
|
val mastery = max(sheet.perception, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.PERCEPTION,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.PERSUASION].let {
|
||||||
|
val mastery = max(sheet.persuasion, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.PERSUASION,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = charisma.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.RELIGION].let {
|
||||||
|
val mastery = max(sheet.religion, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.RELIGION,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = intelligence.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.PERFORMANCE].let {
|
||||||
|
val mastery = max(sheet.performance, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.PERFORMANCE,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = charisma.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.SURVIVAL].let {
|
||||||
|
val mastery = max(sheet.survival, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.SURVIVAL,
|
||||||
|
multiplier = mastery,
|
||||||
|
modifier = wisdom.modifier + it.sum + mastery * proficiency
|
||||||
|
)
|
||||||
|
},
|
||||||
|
status[Property.DECEPTION].let {
|
||||||
|
val mastery = max(sheet.deception, it.mastery)
|
||||||
|
ProficiencyUio(
|
||||||
|
id = ProficiencyUio.ID.DECEPTION,
|
||||||
|
multiplier = mastery,
|
||||||
|
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,
|
}
|
||||||
label = status[Property.CONSTITUTION_SAVING_THROW].let {
|
val constitutionSavingThrows =
|
||||||
constitution.modifier + it.sum + sheet.constitutionSavingThrows * proficiency
|
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||||
}.toLabel(),
|
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
||||||
)
|
proficiency(
|
||||||
val intelligenceSavingThrows = proficiency(
|
multiplier = mastery,
|
||||||
multiplier = sheet.intelligenceSavingThrows,
|
label = (constitution.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
label = status[Property.INTELLIGENCE_SAVING_THROW].let {
|
)
|
||||||
intelligence.modifier + it.sum + sheet.intelligenceSavingThrows * proficiency
|
}
|
||||||
}.toLabel(),
|
val intelligenceSavingThrows =
|
||||||
)
|
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||||
val wisdomSavingThrows = proficiency(
|
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
||||||
multiplier = sheet.wisdomSavingThrows,
|
proficiency(
|
||||||
label = status[Property.WISDOM_SAVING_THROW].let {
|
multiplier = mastery,
|
||||||
wisdom.modifier + it.sum + sheet.wisdomSavingThrows * proficiency
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
}.toLabel(),
|
)
|
||||||
)
|
}
|
||||||
val charismaSavingThrows = proficiency(
|
val wisdomSavingThrows = status[Property.WISDOM_SAVING_THROW].let {
|
||||||
multiplier = sheet.charismaSavingThrows,
|
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
||||||
label = status[Property.CHARISMA_SAVING_THROW].let {
|
proficiency(
|
||||||
charisma.modifier + it.sum + sheet.charismaSavingThrows * proficiency
|
multiplier = mastery,
|
||||||
}.toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
val charismaSavingThrows = status[Property.CHARISMA_SAVING_THROW].let {
|
||||||
|
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
||||||
|
proficiency(
|
||||||
|
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,
|
}
|
||||||
label = status[Property.ATHLETICS].let {
|
val athletics = status[Property.ATHLETICS].let {
|
||||||
strength.modifier + it.sum + sheet.athletics * proficiency
|
val mastery = max(sheet.athletics, it.mastery)
|
||||||
}.toLabel(),
|
proficiency(
|
||||||
)
|
multiplier = mastery,
|
||||||
val stealth = proficiency(
|
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
multiplier = sheet.stealth,
|
)
|
||||||
label = status[Property.STEALTH].let {
|
}
|
||||||
dexterity.modifier + it.sum + sheet.stealth * proficiency
|
val stealth = status[Property.STEALTH].let {
|
||||||
}.toLabel(),
|
val mastery = max(sheet.stealth, it.mastery)
|
||||||
)
|
proficiency(
|
||||||
val animalHandling = proficiency(
|
multiplier = mastery,
|
||||||
multiplier = sheet.animalHandling,
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
label = status[Property.ANIMAL_HANDLING].let {
|
)
|
||||||
wisdom.modifier + it.sum + sheet.animalHandling * proficiency
|
}
|
||||||
}.toLabel(),
|
val animalHandling = status[Property.ANIMAL_HANDLING].let {
|
||||||
)
|
val mastery = max(sheet.animalHandling, it.mastery)
|
||||||
val sleightOfHand = proficiency(
|
proficiency(
|
||||||
multiplier = sheet.sleightOfHand,
|
multiplier = mastery,
|
||||||
label = status[Property.SLEIGHT_OF_HAND].let {
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
dexterity.modifier + it.sum + sheet.sleightOfHand * proficiency
|
)
|
||||||
}.toLabel(),
|
}
|
||||||
)
|
val sleightOfHand = status[Property.SLEIGHT_OF_HAND].let {
|
||||||
val history = proficiency(
|
val mastery = max(sheet.sleightOfHand, it.mastery)
|
||||||
multiplier = sheet.history,
|
proficiency(
|
||||||
label = status[Property.HISTORY].let {
|
multiplier = mastery,
|
||||||
intelligence.modifier + it.sum + sheet.history * proficiency
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
}.toLabel(),
|
)
|
||||||
)
|
}
|
||||||
val intimidation = proficiency(
|
val history = status[Property.HISTORY].let {
|
||||||
multiplier = sheet.intimidation,
|
val mastery = max(sheet.history, it.mastery)
|
||||||
label = status[Property.INTIMIDATION].let {
|
proficiency(
|
||||||
charisma.modifier + it.sum + sheet.intimidation * proficiency
|
multiplier = mastery,
|
||||||
}.toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
val insight = proficiency(
|
}
|
||||||
multiplier = sheet.insight,
|
val intimidation = status[Property.INTIMIDATION].let {
|
||||||
label = status[Property.INSIGHT].let {
|
val mastery = max(sheet.intimidation, it.mastery)
|
||||||
wisdom.modifier + it.sum + sheet.insight * proficiency
|
proficiency(
|
||||||
}.toLabel(),
|
multiplier = mastery,
|
||||||
)
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
val investigation = proficiency(
|
)
|
||||||
multiplier = sheet.investigation,
|
}
|
||||||
label = status[Property.INVESTIGATION].let {
|
val insight = status[Property.INSIGHT].let {
|
||||||
intelligence.modifier + it.sum + sheet.investigation * proficiency
|
val mastery = max(sheet.insight, it.mastery)
|
||||||
}.toLabel(),
|
proficiency(
|
||||||
)
|
multiplier = mastery,
|
||||||
val medicine = proficiency(
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
multiplier = sheet.medicine,
|
)
|
||||||
label = status[Property.MEDICINE].let {
|
}
|
||||||
wisdom.modifier + it.sum + sheet.medicine * proficiency
|
val investigation = status[Property.INVESTIGATION].let {
|
||||||
}.toLabel(),
|
val mastery = max(sheet.investigation, it.mastery)
|
||||||
)
|
proficiency(
|
||||||
val nature = proficiency(
|
multiplier = mastery,
|
||||||
multiplier = sheet.nature,
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
label = status[Property.NATURE].let {
|
)
|
||||||
intelligence.modifier + it.sum + sheet.nature * proficiency
|
}
|
||||||
}.toLabel(),
|
val medicine = status[Property.MEDICINE].let {
|
||||||
)
|
val mastery = max(sheet.medicine, it.mastery)
|
||||||
val perception = proficiency(
|
proficiency(
|
||||||
multiplier = sheet.perception,
|
multiplier = mastery,
|
||||||
label = status[Property.PERCEPTION].let {
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
wisdom.modifier + it.sum + sheet.perception * proficiency
|
)
|
||||||
}.toLabel(),
|
}
|
||||||
)
|
val nature = status[Property.NATURE].let {
|
||||||
val persuasion = proficiency(
|
val mastery = max(sheet.nature, it.mastery)
|
||||||
multiplier = sheet.persuasion,
|
proficiency(
|
||||||
label = status[Property.PERSUASION].let {
|
multiplier = mastery,
|
||||||
charisma.modifier + it.sum + sheet.persuasion * proficiency
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
}.toLabel(),
|
)
|
||||||
)
|
}
|
||||||
val religion = proficiency(
|
val perception = status[Property.PERCEPTION].let {
|
||||||
multiplier = sheet.religion,
|
val mastery = max(sheet.perception, it.mastery)
|
||||||
label = status[Property.RELIGION].let {
|
proficiency(
|
||||||
intelligence.modifier + it.sum + sheet.religion * proficiency
|
multiplier = mastery,
|
||||||
}.toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
val performance = proficiency(
|
}
|
||||||
multiplier = sheet.performance,
|
val persuasion = status[Property.PERSUASION].let {
|
||||||
label = status[Property.PERFORMANCE].let {
|
val mastery = max(sheet.persuasion, 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,
|
}
|
||||||
label = status[Property.SURVIVAL].let {
|
val religion = status[Property.RELIGION].let {
|
||||||
wisdom.modifier + it.sum + sheet.survival * proficiency
|
val mastery = max(sheet.religion, it.mastery)
|
||||||
}.toLabel(),
|
proficiency(
|
||||||
)
|
multiplier = mastery,
|
||||||
val deception = proficiency(
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
multiplier = sheet.deception,
|
)
|
||||||
label = status[Property.DECEPTION].let {
|
}
|
||||||
charisma.modifier + it.sum + sheet.deception * proficiency
|
val performance = status[Property.PERFORMANCE].let {
|
||||||
}.toLabel(),
|
val mastery = max(sheet.performance, it.mastery)
|
||||||
)
|
proficiency(
|
||||||
|
multiplier = mastery,
|
||||||
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val survival = status[Property.SURVIVAL].let {
|
||||||
|
val mastery = max(sheet.survival, it.mastery)
|
||||||
|
proficiency(
|
||||||
|
multiplier = mastery,
|
||||||
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val deception = status[Property.DECEPTION].let {
|
||||||
|
val mastery = max(sheet.deception, it.mastery)
|
||||||
|
proficiency(
|
||||||
|
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 {
|
}
|
||||||
wisdom.modifier + it.sum + sheet.perception * proficiency + it.passivesBonus
|
val passivePerception = status[Property.PERCEPTION].let {
|
||||||
}.let { "${10 + it}" }
|
val mastery = max(sheet.perception, it.mastery)
|
||||||
)
|
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