Add an amateurim alteration feature.
This commit is contained in:
parent
f4a381fb02
commit
4a8692cb5a
8 changed files with 75 additions and 59 deletions
|
|
@ -27,9 +27,9 @@ 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.masteryMultiplier
|
||||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||||
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
@ -619,7 +619,7 @@ class DiceThrowUseCase @Inject constructor(
|
||||||
Property.SURVIVAL -> character.survival
|
Property.SURVIVAL -> character.survival
|
||||||
else -> null
|
else -> null
|
||||||
}?.let {
|
}?.let {
|
||||||
val multiplier = max(it, status[ability].mastery)
|
val multiplier = it.masteryMultiplier(status = status[ability])
|
||||||
val mastery = character.proficiency * multiplier
|
val mastery = character.proficiency * multiplier
|
||||||
allValue.add(mastery)
|
allValue.add(mastery)
|
||||||
listOf(
|
listOf(
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ data class Alteration(
|
||||||
val emphasis: Boolean = false,
|
val emphasis: Boolean = false,
|
||||||
val mastery: Boolean = false,
|
val mastery: Boolean = false,
|
||||||
val expertise: Boolean = false,
|
val expertise: Boolean = false,
|
||||||
|
val amateurism: 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(),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.pixelized.rplexicon.data.parser
|
package com.pixelized.rplexicon.data.parser
|
||||||
|
|
||||||
import com.google.api.services.sheets.v4.model.ValueRange
|
import com.google.api.services.sheets.v4.model.ValueRange
|
||||||
import com.pixelized.rplexicon.BuildConfig
|
|
||||||
import com.pixelized.rplexicon.data.database.lexicon.LexiconDataDbo
|
import com.pixelized.rplexicon.data.database.lexicon.LexiconDataDbo
|
||||||
import com.pixelized.rplexicon.data.database.lexicon.LexiconDbo
|
import com.pixelized.rplexicon.data.database.lexicon.LexiconDbo
|
||||||
import com.pixelized.rplexicon.data.model.Lexicon
|
import com.pixelized.rplexicon.data.model.Lexicon
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ class AlterationParser @Inject constructor(
|
||||||
EMPHASIS -> Alteration.Status(name = name, emphasis = true)
|
EMPHASIS -> Alteration.Status(name = name, emphasis = true)
|
||||||
MASTERY -> Alteration.Status(name = name, mastery = true)
|
MASTERY -> Alteration.Status(name = name, mastery = true)
|
||||||
EXPERTISE -> Alteration.Status(name = name, expertise = true)
|
EXPERTISE -> Alteration.Status(name = name, expertise = true)
|
||||||
|
AMATEURISM -> Alteration.Status(name = name, amateurism = true)
|
||||||
FAIL -> Alteration.Status(name = name, fail = true)
|
FAIL -> Alteration.Status(name = name, fail = true)
|
||||||
CRITICAL -> Alteration.Status(name = name, critical = true)
|
CRITICAL -> Alteration.Status(name = name, critical = true)
|
||||||
|
|
||||||
|
|
@ -108,6 +109,7 @@ class AlterationParser @Inject constructor(
|
||||||
private const val EMPHASIS = "emp"
|
private const val EMPHASIS = "emp"
|
||||||
private const val MASTERY = "mas"
|
private const val MASTERY = "mas"
|
||||||
private const val EXPERTISE = "exp"
|
private const val EXPERTISE = "exp"
|
||||||
|
private const val AMATEURISM = "ama"
|
||||||
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,10 @@ 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 com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
),
|
),
|
||||||
savingThrows = listOf(
|
savingThrows = listOf(
|
||||||
status[Property.STRENGTH_SAVING_THROW].let {
|
status[Property.STRENGTH_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.strengthSavingThrows, it.mastery)
|
val mastery = sheet.strengthSavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
|
id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -79,7 +79,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.DEXTERITY_SAVING_THROW].let {
|
status[Property.DEXTERITY_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.dexteritySavingThrows, it.mastery)
|
val mastery = sheet.dexteritySavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
|
id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -87,7 +87,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.CONSTITUTION_SAVING_THROW].let {
|
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
val mastery = sheet.constitutionSavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
|
id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -95,7 +95,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
val mastery = sheet.intelligenceSavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
|
id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -103,7 +103,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.WISDOM_SAVING_THROW].let {
|
status[Property.WISDOM_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
val mastery = sheet.wisdomSavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
|
id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -111,7 +111,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.CHARISMA_SAVING_THROW].let {
|
status[Property.CHARISMA_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
val mastery = sheet.charismaSavingThrows.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
|
id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -121,7 +121,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
),
|
),
|
||||||
proficiencies = listOf(
|
proficiencies = listOf(
|
||||||
status[Property.ACROBATICS].let {
|
status[Property.ACROBATICS].let {
|
||||||
val mastery = max(sheet.acrobatics, it.mastery)
|
val mastery = sheet.acrobatics.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.ACROBATICS,
|
id = ProficiencyUio.ID.ACROBATICS,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -129,7 +129,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.ARCANA].let {
|
status[Property.ARCANA].let {
|
||||||
val mastery = max(sheet.arcana, it.mastery)
|
val mastery = sheet.arcana.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.ARCANA,
|
id = ProficiencyUio.ID.ARCANA,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -137,7 +137,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.ATHLETICS].let {
|
status[Property.ATHLETICS].let {
|
||||||
val mastery = max(sheet.athletics, it.mastery)
|
val mastery = sheet.athletics.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.ATHLETICS,
|
id = ProficiencyUio.ID.ATHLETICS,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -145,7 +145,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.STEALTH].let {
|
status[Property.STEALTH].let {
|
||||||
val mastery = max(sheet.stealth, it.mastery)
|
val mastery = sheet.stealth.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.STEALTH,
|
id = ProficiencyUio.ID.STEALTH,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -153,7 +153,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.ANIMAL_HANDLING].let {
|
status[Property.ANIMAL_HANDLING].let {
|
||||||
val mastery = max(sheet.animalHandling, it.mastery)
|
val mastery = sheet.animalHandling.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.ANIMAL_HANDLING,
|
id = ProficiencyUio.ID.ANIMAL_HANDLING,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -161,7 +161,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.SLEIGHT_OF_HAND].let {
|
status[Property.SLEIGHT_OF_HAND].let {
|
||||||
val mastery = max(sheet.sleightOfHand, it.mastery)
|
val mastery = sheet.sleightOfHand.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
|
id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -169,7 +169,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.HISTORY].let {
|
status[Property.HISTORY].let {
|
||||||
val mastery = max(sheet.history, it.mastery)
|
val mastery = sheet.history.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.HISTORY,
|
id = ProficiencyUio.ID.HISTORY,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -177,7 +177,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.INTIMIDATION].let {
|
status[Property.INTIMIDATION].let {
|
||||||
val mastery = max(sheet.intimidation, it.mastery)
|
val mastery = sheet.intimidation.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.INTIMIDATION,
|
id = ProficiencyUio.ID.INTIMIDATION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -185,7 +185,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.INSIGHT].let {
|
status[Property.INSIGHT].let {
|
||||||
val mastery = max(sheet.insight, it.mastery)
|
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.INSIGHT,
|
id = ProficiencyUio.ID.INSIGHT,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -193,7 +193,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.INVESTIGATION].let {
|
status[Property.INVESTIGATION].let {
|
||||||
val mastery = max(sheet.investigation, it.mastery)
|
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.INVESTIGATION,
|
id = ProficiencyUio.ID.INVESTIGATION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -201,7 +201,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.MEDICINE].let {
|
status[Property.MEDICINE].let {
|
||||||
val mastery = max(sheet.medicine, it.mastery)
|
val mastery = sheet.medicine.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.MEDICINE,
|
id = ProficiencyUio.ID.MEDICINE,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -209,7 +209,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.NATURE].let {
|
status[Property.NATURE].let {
|
||||||
val mastery = max(sheet.nature, it.mastery)
|
val mastery = sheet.nature.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.NATURE,
|
id = ProficiencyUio.ID.NATURE,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -217,7 +217,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.PERCEPTION].let {
|
status[Property.PERCEPTION].let {
|
||||||
val mastery = max(sheet.perception, it.mastery)
|
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.PERCEPTION,
|
id = ProficiencyUio.ID.PERCEPTION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -225,7 +225,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.PERSUASION].let {
|
status[Property.PERSUASION].let {
|
||||||
val mastery = max(sheet.persuasion, it.mastery)
|
val mastery = sheet.persuasion.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.PERSUASION,
|
id = ProficiencyUio.ID.PERSUASION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -233,7 +233,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.RELIGION].let {
|
status[Property.RELIGION].let {
|
||||||
val mastery = max(sheet.religion, it.mastery)
|
val mastery = sheet.religion.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.RELIGION,
|
id = ProficiencyUio.ID.RELIGION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -241,7 +241,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.PERFORMANCE].let {
|
status[Property.PERFORMANCE].let {
|
||||||
val mastery = max(sheet.performance, it.mastery)
|
val mastery = sheet.performance.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.PERFORMANCE,
|
id = ProficiencyUio.ID.PERFORMANCE,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -249,7 +249,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.SURVIVAL].let {
|
status[Property.SURVIVAL].let {
|
||||||
val mastery = max(sheet.survival, it.mastery)
|
val mastery = sheet.survival.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.SURVIVAL,
|
id = ProficiencyUio.ID.SURVIVAL,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -257,7 +257,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status[Property.DECEPTION].let {
|
status[Property.DECEPTION].let {
|
||||||
val mastery = max(sheet.deception, it.mastery)
|
val mastery = sheet.deception.masteryMultiplier(status = it)
|
||||||
ProficiencyUio(
|
ProficiencyUio(
|
||||||
id = ProficiencyUio.ID.DECEPTION,
|
id = ProficiencyUio.ID.DECEPTION,
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
|
|
@ -267,15 +267,15 @@ class CharacterSheetUioFactory @Inject constructor() {
|
||||||
),
|
),
|
||||||
passives = PassivesUio(
|
passives = PassivesUio(
|
||||||
perception = status[Property.PERCEPTION].let {
|
perception = status[Property.PERCEPTION].let {
|
||||||
val mastery = max(sheet.perception, it.mastery)
|
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||||
10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
||||||
},
|
},
|
||||||
investigation = status[Property.INVESTIGATION].let {
|
investigation = status[Property.INVESTIGATION].let {
|
||||||
val mastery = max(sheet.investigation, it.mastery)
|
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||||
10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
||||||
},
|
},
|
||||||
insight = status[Property.INSIGHT].let {
|
insight = status[Property.INSIGHT].let {
|
||||||
val mastery = max(sheet.insight, it.mastery)
|
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||||
10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ 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
|
||||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||||
|
import com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
|
||||||
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
|
@ -272,14 +272,14 @@ class SummaryFactory @Inject constructor(
|
||||||
val charisma = sheet.charisma + status[Property.CHARISMA].sum
|
val charisma = sheet.charisma + status[Property.CHARISMA].sum
|
||||||
|
|
||||||
val strengthSavingThrows = status[Property.STRENGTH_SAVING_THROW].let {
|
val strengthSavingThrows = status[Property.STRENGTH_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.strengthSavingThrows, it.mastery)
|
val mastery = sheet.strengthSavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val dexteritySavingThrows = status[Property.DEXTERITY_SAVING_THROW].let {
|
val dexteritySavingThrows = status[Property.DEXTERITY_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.dexteritySavingThrows, it.mastery)
|
val mastery = sheet.dexteritySavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
|
@ -287,7 +287,7 @@ class SummaryFactory @Inject constructor(
|
||||||
}
|
}
|
||||||
val constitutionSavingThrows =
|
val constitutionSavingThrows =
|
||||||
status[Property.CONSTITUTION_SAVING_THROW].let {
|
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
val mastery = sheet.constitutionSavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (constitution.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (constitution.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
|
@ -295,21 +295,21 @@ class SummaryFactory @Inject constructor(
|
||||||
}
|
}
|
||||||
val intelligenceSavingThrows =
|
val intelligenceSavingThrows =
|
||||||
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
val mastery = sheet.intelligenceSavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val wisdomSavingThrows = status[Property.WISDOM_SAVING_THROW].let {
|
val wisdomSavingThrows = status[Property.WISDOM_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
val mastery = sheet.wisdomSavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val charismaSavingThrows = status[Property.CHARISMA_SAVING_THROW].let {
|
val charismaSavingThrows = status[Property.CHARISMA_SAVING_THROW].let {
|
||||||
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
val mastery = sheet.charismaSavingThrows.masteryMultiplier(it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
|
@ -341,126 +341,126 @@ class SummaryFactory @Inject constructor(
|
||||||
val charisma = sheet.charisma + status[Property.CHARISMA].sum
|
val charisma = sheet.charisma + status[Property.CHARISMA].sum
|
||||||
|
|
||||||
val acrobatics = status[Property.ACROBATICS].let {
|
val acrobatics = status[Property.ACROBATICS].let {
|
||||||
val mastery = max(sheet.acrobatics, it.mastery)
|
val mastery = sheet.acrobatics.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val arcana = status[Property.ARCANA].let {
|
val arcana = status[Property.ARCANA].let {
|
||||||
val mastery = max(sheet.arcana, it.mastery)
|
val mastery = sheet.arcana.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val athletics = status[Property.ATHLETICS].let {
|
val athletics = status[Property.ATHLETICS].let {
|
||||||
val mastery = max(sheet.athletics, it.mastery)
|
val mastery = sheet.athletics.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val stealth = status[Property.STEALTH].let {
|
val stealth = status[Property.STEALTH].let {
|
||||||
val mastery = max(sheet.stealth, it.mastery)
|
val mastery = sheet.stealth.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val animalHandling = status[Property.ANIMAL_HANDLING].let {
|
val animalHandling = status[Property.ANIMAL_HANDLING].let {
|
||||||
val mastery = max(sheet.animalHandling, it.mastery)
|
val mastery = sheet.animalHandling.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val sleightOfHand = status[Property.SLEIGHT_OF_HAND].let {
|
val sleightOfHand = status[Property.SLEIGHT_OF_HAND].let {
|
||||||
val mastery = max(sheet.sleightOfHand, it.mastery)
|
val mastery = sheet.sleightOfHand.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val history = status[Property.HISTORY].let {
|
val history = status[Property.HISTORY].let {
|
||||||
val mastery = max(sheet.history, it.mastery)
|
val mastery = sheet.history.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val intimidation = status[Property.INTIMIDATION].let {
|
val intimidation = status[Property.INTIMIDATION].let {
|
||||||
val mastery = max(sheet.intimidation, it.mastery)
|
val mastery = sheet.intimidation.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val insight = status[Property.INSIGHT].let {
|
val insight = status[Property.INSIGHT].let {
|
||||||
val mastery = max(sheet.insight, it.mastery)
|
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val investigation = status[Property.INVESTIGATION].let {
|
val investigation = status[Property.INVESTIGATION].let {
|
||||||
val mastery = max(sheet.investigation, it.mastery)
|
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val medicine = status[Property.MEDICINE].let {
|
val medicine = status[Property.MEDICINE].let {
|
||||||
val mastery = max(sheet.medicine, it.mastery)
|
val mastery = sheet.medicine.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val nature = status[Property.NATURE].let {
|
val nature = status[Property.NATURE].let {
|
||||||
val mastery = max(sheet.nature, it.mastery)
|
val mastery = sheet.nature.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val perception = status[Property.PERCEPTION].let {
|
val perception = status[Property.PERCEPTION].let {
|
||||||
val mastery = max(sheet.perception, it.mastery)
|
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val persuasion = status[Property.PERSUASION].let {
|
val persuasion = status[Property.PERSUASION].let {
|
||||||
val mastery = max(sheet.persuasion, it.mastery)
|
val mastery = sheet.persuasion.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val religion = status[Property.RELIGION].let {
|
val religion = status[Property.RELIGION].let {
|
||||||
val mastery = max(sheet.religion, it.mastery)
|
val mastery = sheet.religion.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val performance = status[Property.PERFORMANCE].let {
|
val performance = status[Property.PERFORMANCE].let {
|
||||||
val mastery = max(sheet.performance, it.mastery)
|
val mastery = sheet.performance.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val survival = status[Property.SURVIVAL].let {
|
val survival = status[Property.SURVIVAL].let {
|
||||||
val mastery = max(sheet.survival, it.mastery)
|
val mastery = sheet.survival.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val deception = status[Property.DECEPTION].let {
|
val deception = status[Property.DECEPTION].let {
|
||||||
val mastery = max(sheet.deception, it.mastery)
|
val mastery = sheet.deception.masteryMultiplier(status = it)
|
||||||
proficiency(
|
proficiency(
|
||||||
multiplier = mastery,
|
multiplier = mastery,
|
||||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||||
|
|
@ -501,19 +501,19 @@ class SummaryFactory @Inject constructor(
|
||||||
val wisdom = sheet.wisdom + status[Property.WISDOM].sum
|
val wisdom = sheet.wisdom + status[Property.WISDOM].sum
|
||||||
|
|
||||||
val passiveInsight = status[Property.INSIGHT].let {
|
val passiveInsight = status[Property.INSIGHT].let {
|
||||||
val mastery = max(sheet.insight, it.mastery)
|
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||||
label(
|
label(
|
||||||
label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val passiveInvestigation = status[Property.INVESTIGATION].let {
|
val passiveInvestigation = status[Property.INVESTIGATION].let {
|
||||||
val mastery = max(sheet.investigation, it.mastery)
|
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||||
label(
|
label(
|
||||||
label = "${10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
label = "${10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val passivePerception = status[Property.PERCEPTION].let {
|
val passivePerception = status[Property.PERCEPTION].let {
|
||||||
val mastery = max(sheet.perception, it.mastery)
|
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||||
label(
|
label(
|
||||||
label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,12 @@ package com.pixelized.rplexicon.utilitary.extentions
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.pixelized.rplexicon.BuildConfig
|
import com.pixelized.rplexicon.BuildConfig
|
||||||
import com.pixelized.rplexicon.R
|
import com.pixelized.rplexicon.R
|
||||||
|
import com.pixelized.rplexicon.data.model.Alteration
|
||||||
|
import com.pixelized.rplexicon.utilitary.extentions.local.amateurism
|
||||||
|
import com.pixelized.rplexicon.utilitary.extentions.local.mastery
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
val Int.icon
|
val Int.icon
|
||||||
get() = when (this) {
|
get() = when (this) {
|
||||||
|
|
@ -19,6 +23,13 @@ val Int.icon
|
||||||
val Int.modifier: Int
|
val Int.modifier: Int
|
||||||
get() = floor(this / 2 - 5f).toInt()
|
get() = floor(this / 2 - 5f).toInt()
|
||||||
|
|
||||||
|
fun Int?.masteryMultiplier(status: List<Alteration.Status>?): Int {
|
||||||
|
return when {
|
||||||
|
status.amateurism -> 0
|
||||||
|
else -> max(this ?: 0, status.mastery)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun Int.toLabel(): String =
|
fun Int.toLabel(): String =
|
||||||
"${this.signLabel}${abs(this)}"
|
"${this.signLabel}${abs(this)}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ val List<Alteration.Status>?.disadvantage: Boolean
|
||||||
val List<Alteration.Status>?.emphasis: Boolean
|
val List<Alteration.Status>?.emphasis: Boolean
|
||||||
get() = this?.any { it.emphasis } ?: false
|
get() = this?.any { it.emphasis } ?: false
|
||||||
|
|
||||||
|
val List<Alteration.Status>?.amateurism: Boolean
|
||||||
|
get() = this?.any { it.amateurism } ?: false
|
||||||
|
|
||||||
val List<Alteration.Status>?.mastery: Int
|
val List<Alteration.Status>?.mastery: Int
|
||||||
get() = this?.maxOf {
|
get() = this?.maxOf {
|
||||||
when {
|
when {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue