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.isCritical
|
||||
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.toStatus
|
||||
import com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
|
||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
||||
import javax.inject.Inject
|
||||
|
|
@ -619,7 +619,7 @@ class DiceThrowUseCase @Inject constructor(
|
|||
Property.SURVIVAL -> character.survival
|
||||
else -> null
|
||||
}?.let {
|
||||
val multiplier = max(it, status[ability].mastery)
|
||||
val multiplier = it.masteryMultiplier(status = status[ability])
|
||||
val mastery = character.proficiency * multiplier
|
||||
allValue.add(mastery)
|
||||
listOf(
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ data class Alteration(
|
|||
val emphasis: Boolean = false,
|
||||
val mastery: Boolean = false,
|
||||
val expertise: Boolean = false,
|
||||
val amateurism: Boolean = false,
|
||||
val fail: Boolean = false,
|
||||
val critical: Boolean = false,
|
||||
val dices: List<Roll.Dice> = emptyList(),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.pixelized.rplexicon.data.parser
|
||||
|
||||
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.LexiconDbo
|
||||
import com.pixelized.rplexicon.data.model.Lexicon
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ class AlterationParser @Inject constructor(
|
|||
EMPHASIS -> Alteration.Status(name = name, emphasis = true)
|
||||
MASTERY -> Alteration.Status(name = name, mastery = true)
|
||||
EXPERTISE -> Alteration.Status(name = name, expertise = true)
|
||||
AMATEURISM -> Alteration.Status(name = name, amateurism = true)
|
||||
FAIL -> Alteration.Status(name = name, fail = true)
|
||||
CRITICAL -> Alteration.Status(name = name, critical = true)
|
||||
|
||||
|
|
@ -108,6 +109,7 @@ class AlterationParser @Inject constructor(
|
|||
private const val EMPHASIS = "emp"
|
||||
private const val MASTERY = "mas"
|
||||
private const val EXPERTISE = "exp"
|
||||
private const val AMATEURISM = "ama"
|
||||
private const val FAIL = "fail"
|
||||
private const val CRITICAL = "crit"
|
||||
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.StatUio
|
||||
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.sum
|
||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||
import com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.max
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
),
|
||||
savingThrows = listOf(
|
||||
status[Property.STRENGTH_SAVING_THROW].let {
|
||||
val mastery = max(sheet.strengthSavingThrows, it.mastery)
|
||||
val mastery = sheet.strengthSavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.STRENGTH_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -79,7 +79,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.DEXTERITY_SAVING_THROW].let {
|
||||
val mastery = max(sheet.dexteritySavingThrows, it.mastery)
|
||||
val mastery = sheet.dexteritySavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.DEXTERITY_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -87,7 +87,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
||||
val mastery = sheet.constitutionSavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.CONSTITUTION_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -95,7 +95,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
||||
val mastery = sheet.intelligenceSavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.INTELLIGENCE_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -103,7 +103,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.WISDOM_SAVING_THROW].let {
|
||||
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
||||
val mastery = sheet.wisdomSavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.WISDOM_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -111,7 +111,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.CHARISMA_SAVING_THROW].let {
|
||||
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
||||
val mastery = sheet.charismaSavingThrows.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.CHARISMA_SAVING_THROW,
|
||||
multiplier = mastery,
|
||||
|
|
@ -121,7 +121,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
),
|
||||
proficiencies = listOf(
|
||||
status[Property.ACROBATICS].let {
|
||||
val mastery = max(sheet.acrobatics, it.mastery)
|
||||
val mastery = sheet.acrobatics.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.ACROBATICS,
|
||||
multiplier = mastery,
|
||||
|
|
@ -129,7 +129,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.ARCANA].let {
|
||||
val mastery = max(sheet.arcana, it.mastery)
|
||||
val mastery = sheet.arcana.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.ARCANA,
|
||||
multiplier = mastery,
|
||||
|
|
@ -137,7 +137,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.ATHLETICS].let {
|
||||
val mastery = max(sheet.athletics, it.mastery)
|
||||
val mastery = sheet.athletics.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.ATHLETICS,
|
||||
multiplier = mastery,
|
||||
|
|
@ -145,7 +145,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.STEALTH].let {
|
||||
val mastery = max(sheet.stealth, it.mastery)
|
||||
val mastery = sheet.stealth.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.STEALTH,
|
||||
multiplier = mastery,
|
||||
|
|
@ -153,7 +153,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.ANIMAL_HANDLING].let {
|
||||
val mastery = max(sheet.animalHandling, it.mastery)
|
||||
val mastery = sheet.animalHandling.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.ANIMAL_HANDLING,
|
||||
multiplier = mastery,
|
||||
|
|
@ -161,7 +161,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.SLEIGHT_OF_HAND].let {
|
||||
val mastery = max(sheet.sleightOfHand, it.mastery)
|
||||
val mastery = sheet.sleightOfHand.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.SLEIGHT_OF_HAND,
|
||||
multiplier = mastery,
|
||||
|
|
@ -169,7 +169,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.HISTORY].let {
|
||||
val mastery = max(sheet.history, it.mastery)
|
||||
val mastery = sheet.history.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.HISTORY,
|
||||
multiplier = mastery,
|
||||
|
|
@ -177,7 +177,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.INTIMIDATION].let {
|
||||
val mastery = max(sheet.intimidation, it.mastery)
|
||||
val mastery = sheet.intimidation.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.INTIMIDATION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -185,7 +185,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.INSIGHT].let {
|
||||
val mastery = max(sheet.insight, it.mastery)
|
||||
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.INSIGHT,
|
||||
multiplier = mastery,
|
||||
|
|
@ -193,7 +193,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.INVESTIGATION].let {
|
||||
val mastery = max(sheet.investigation, it.mastery)
|
||||
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.INVESTIGATION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -201,7 +201,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.MEDICINE].let {
|
||||
val mastery = max(sheet.medicine, it.mastery)
|
||||
val mastery = sheet.medicine.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.MEDICINE,
|
||||
multiplier = mastery,
|
||||
|
|
@ -209,7 +209,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.NATURE].let {
|
||||
val mastery = max(sheet.nature, it.mastery)
|
||||
val mastery = sheet.nature.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.NATURE,
|
||||
multiplier = mastery,
|
||||
|
|
@ -217,7 +217,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.PERCEPTION].let {
|
||||
val mastery = max(sheet.perception, it.mastery)
|
||||
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.PERCEPTION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -225,7 +225,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.PERSUASION].let {
|
||||
val mastery = max(sheet.persuasion, it.mastery)
|
||||
val mastery = sheet.persuasion.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.PERSUASION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -233,7 +233,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.RELIGION].let {
|
||||
val mastery = max(sheet.religion, it.mastery)
|
||||
val mastery = sheet.religion.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.RELIGION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -241,7 +241,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.PERFORMANCE].let {
|
||||
val mastery = max(sheet.performance, it.mastery)
|
||||
val mastery = sheet.performance.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.PERFORMANCE,
|
||||
multiplier = mastery,
|
||||
|
|
@ -249,7 +249,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.SURVIVAL].let {
|
||||
val mastery = max(sheet.survival, it.mastery)
|
||||
val mastery = sheet.survival.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.SURVIVAL,
|
||||
multiplier = mastery,
|
||||
|
|
@ -257,7 +257,7 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
)
|
||||
},
|
||||
status[Property.DECEPTION].let {
|
||||
val mastery = max(sheet.deception, it.mastery)
|
||||
val mastery = sheet.deception.masteryMultiplier(status = it)
|
||||
ProficiencyUio(
|
||||
id = ProficiencyUio.ID.DECEPTION,
|
||||
multiplier = mastery,
|
||||
|
|
@ -267,15 +267,15 @@ class CharacterSheetUioFactory @Inject constructor() {
|
|||
),
|
||||
passives = PassivesUio(
|
||||
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
|
||||
},
|
||||
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
|
||||
},
|
||||
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
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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.proficiency
|
||||
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.spell
|
||||
import com.pixelized.rplexicon.utilitary.extentions.local.sum
|
||||
import com.pixelized.rplexicon.utilitary.extentions.modifier
|
||||
import com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
|
||||
import com.pixelized.rplexicon.utilitary.extentions.toLabel
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
|
@ -272,14 +272,14 @@ class SummaryFactory @Inject constructor(
|
|||
val charisma = sheet.charisma + status[Property.CHARISMA].sum
|
||||
|
||||
val strengthSavingThrows = status[Property.STRENGTH_SAVING_THROW].let {
|
||||
val mastery = max(sheet.strengthSavingThrows, it.mastery)
|
||||
val mastery = sheet.strengthSavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val dexteritySavingThrows = status[Property.DEXTERITY_SAVING_THROW].let {
|
||||
val mastery = max(sheet.dexteritySavingThrows, it.mastery)
|
||||
val mastery = sheet.dexteritySavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
|
|
@ -287,7 +287,7 @@ class SummaryFactory @Inject constructor(
|
|||
}
|
||||
val constitutionSavingThrows =
|
||||
status[Property.CONSTITUTION_SAVING_THROW].let {
|
||||
val mastery = max(sheet.constitutionSavingThrows, it.mastery)
|
||||
val mastery = sheet.constitutionSavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (constitution.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
|
|
@ -295,21 +295,21 @@ class SummaryFactory @Inject constructor(
|
|||
}
|
||||
val intelligenceSavingThrows =
|
||||
status[Property.INTELLIGENCE_SAVING_THROW].let {
|
||||
val mastery = max(sheet.intelligenceSavingThrows, it.mastery)
|
||||
val mastery = sheet.intelligenceSavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val wisdomSavingThrows = status[Property.WISDOM_SAVING_THROW].let {
|
||||
val mastery = max(sheet.wisdomSavingThrows, it.mastery)
|
||||
val mastery = sheet.wisdomSavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val charismaSavingThrows = status[Property.CHARISMA_SAVING_THROW].let {
|
||||
val mastery = max(sheet.charismaSavingThrows, it.mastery)
|
||||
val mastery = sheet.charismaSavingThrows.masteryMultiplier(it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
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 acrobatics = status[Property.ACROBATICS].let {
|
||||
val mastery = max(sheet.acrobatics, it.mastery)
|
||||
val mastery = sheet.acrobatics.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val arcana = status[Property.ARCANA].let {
|
||||
val mastery = max(sheet.arcana, it.mastery)
|
||||
val mastery = sheet.arcana.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val athletics = status[Property.ATHLETICS].let {
|
||||
val mastery = max(sheet.athletics, it.mastery)
|
||||
val mastery = sheet.athletics.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (strength.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val stealth = status[Property.STEALTH].let {
|
||||
val mastery = max(sheet.stealth, it.mastery)
|
||||
val mastery = sheet.stealth.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val animalHandling = status[Property.ANIMAL_HANDLING].let {
|
||||
val mastery = max(sheet.animalHandling, it.mastery)
|
||||
val mastery = sheet.animalHandling.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val sleightOfHand = status[Property.SLEIGHT_OF_HAND].let {
|
||||
val mastery = max(sheet.sleightOfHand, it.mastery)
|
||||
val mastery = sheet.sleightOfHand.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (dexterity.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val history = status[Property.HISTORY].let {
|
||||
val mastery = max(sheet.history, it.mastery)
|
||||
val mastery = sheet.history.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val intimidation = status[Property.INTIMIDATION].let {
|
||||
val mastery = max(sheet.intimidation, it.mastery)
|
||||
val mastery = sheet.intimidation.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val insight = status[Property.INSIGHT].let {
|
||||
val mastery = max(sheet.insight, it.mastery)
|
||||
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val investigation = status[Property.INVESTIGATION].let {
|
||||
val mastery = max(sheet.investigation, it.mastery)
|
||||
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val medicine = status[Property.MEDICINE].let {
|
||||
val mastery = max(sheet.medicine, it.mastery)
|
||||
val mastery = sheet.medicine.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val nature = status[Property.NATURE].let {
|
||||
val mastery = max(sheet.nature, it.mastery)
|
||||
val mastery = sheet.nature.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val perception = status[Property.PERCEPTION].let {
|
||||
val mastery = max(sheet.perception, it.mastery)
|
||||
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val persuasion = status[Property.PERSUASION].let {
|
||||
val mastery = max(sheet.persuasion, it.mastery)
|
||||
val mastery = sheet.persuasion.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val religion = status[Property.RELIGION].let {
|
||||
val mastery = max(sheet.religion, it.mastery)
|
||||
val mastery = sheet.religion.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (intelligence.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val performance = status[Property.PERFORMANCE].let {
|
||||
val mastery = max(sheet.performance, it.mastery)
|
||||
val mastery = sheet.performance.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (charisma.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val survival = status[Property.SURVIVAL].let {
|
||||
val mastery = max(sheet.survival, it.mastery)
|
||||
val mastery = sheet.survival.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
label = (wisdom.modifier + it.sum + mastery * proficiency).toLabel(),
|
||||
)
|
||||
}
|
||||
val deception = status[Property.DECEPTION].let {
|
||||
val mastery = max(sheet.deception, it.mastery)
|
||||
val mastery = sheet.deception.masteryMultiplier(status = it)
|
||||
proficiency(
|
||||
multiplier = mastery,
|
||||
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 passiveInsight = status[Property.INSIGHT].let {
|
||||
val mastery = max(sheet.insight, it.mastery)
|
||||
val mastery = sheet.insight.masteryMultiplier(status = it)
|
||||
label(
|
||||
label = "${10 + wisdom.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
||||
)
|
||||
}
|
||||
val passiveInvestigation = status[Property.INVESTIGATION].let {
|
||||
val mastery = max(sheet.investigation, it.mastery)
|
||||
val mastery = sheet.investigation.masteryMultiplier(status = it)
|
||||
label(
|
||||
label = "${10 + intelligence.modifier + it.sum + mastery * proficiency + it.passivesBonus}",
|
||||
)
|
||||
}
|
||||
val passivePerception = status[Property.PERCEPTION].let {
|
||||
val mastery = max(sheet.perception, it.mastery)
|
||||
val mastery = sheet.perception.masteryMultiplier(status = it)
|
||||
label(
|
||||
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 com.pixelized.rplexicon.BuildConfig
|
||||
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.floor
|
||||
import kotlin.math.max
|
||||
|
||||
val Int.icon
|
||||
get() = when (this) {
|
||||
|
|
@ -19,6 +23,13 @@ val Int.icon
|
|||
val Int.modifier: Int
|
||||
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 =
|
||||
"${this.signLabel}${abs(this)}"
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ val List<Alteration.Status>?.disadvantage: Boolean
|
|||
val List<Alteration.Status>?.emphasis: Boolean
|
||||
get() = this?.any { it.emphasis } ?: false
|
||||
|
||||
val List<Alteration.Status>?.amateurism: Boolean
|
||||
get() = this?.any { it.amateurism } ?: false
|
||||
|
||||
val List<Alteration.Status>?.mastery: Int
|
||||
get() = this?.maxOf {
|
||||
when {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue