Remove initiative from the proficiency page, add the proficiency mastery bonus instead.

This commit is contained in:
Thomas Andres Gomez 2023-12-21 13:52:52 +01:00
parent 0e65bd540e
commit 1e3332b447
6 changed files with 13 additions and 19 deletions

View file

@ -17,8 +17,8 @@ import com.pixelized.rplexicon.ui.screens.character.pages.proficiency.CharacterS
fun rememberCharacterSheetStatePreview() = remember {
mutableStateOf(
CharacterSheetUio(
initiative = LabelPointUio(
label = R.string.character_sheet_title_initiative,
proficiency = LabelPointUio(
label = R.string.character_sheet_title_proficiency_bonus,
value = "+2",
),
stats = listOf(

View file

@ -22,7 +22,7 @@ class CharacterSheetUioFactory @Inject constructor() {
sheet: CharacterSheet,
status: Map<Property, List<Alteration.Status>>,
): CharacterSheetUio {
val proficiency = (sheet.proficiency + status[Property.PROFICIENCY].sum)
val proficiency = sheet.proficiency + status[Property.PROFICIENCY].sum
val strength = sheet.strength + status[Property.STRENGTH].sum
val dexterity = sheet.dexterity + status[Property.DEXTERITY].sum
val constitution = sheet.constitution + status[Property.CONSTITUTION].sum
@ -31,9 +31,9 @@ class CharacterSheetUioFactory @Inject constructor() {
val charisma = sheet.charisma + status[Property.CHARISMA].sum
return CharacterSheetUio(
initiative = LabelPointUio(
label = R.string.character_sheet_title_initiative,
value = (dexterity.modifier + status[Property.INITIATIVE].sum).toLabel(),
proficiency = LabelPointUio(
label = R.string.character_sheet_title_proficiency_bonus,
value = "$proficiency",
max = null,
),
stats = listOf(

View file

@ -52,7 +52,7 @@ import com.pixelized.rplexicon.utilitary.extentions.ddBorder
@Stable
data class CharacterSheetUio(
val initiative: LabelPointUio,
val proficiency: LabelPointUio,
val stats: List<StatUio>,
val savingThrows: List<ProficiencyUio>,
val proficiencies: List<ProficiencyUio>,
@ -70,10 +70,6 @@ fun ProficiencyPage(
ProficiencyPageContent(
modifier = Modifier.fillMaxSize(),
sheet = sheet,
onInitiative = {
overlay.prepareRoll(diceThrow = viewModel.initiativeRoll())
overlay.showOverlay()
},
onStats = { stat ->
overlay.prepareRoll(diceThrow = viewModel.statRoll(stat.id))
overlay.showOverlay()
@ -93,7 +89,6 @@ fun ProficiencyPageContent(
inner: Shape = remember { RoundedCornerShape(size = 8.dp) },
outline: Shape = remember { CutCornerShape(size = 16.dp) },
sheet: CharacterSheetUio,
onInitiative: () -> Unit,
onStats: (StatUio) -> Unit,
onProficiencies: (ProficiencyUio) -> Unit,
) {
@ -110,18 +105,18 @@ fun ProficiencyPageContent(
modifier = Modifier
.sizeIn(minWidth = 100.dp, minHeight = 116.dp)
.ddBorder(outline = outline, inner = inner)
.clickable(onClick = onInitiative)
.padding(all = 8.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
Text(
style = MaterialTheme.typography.labelSmall,
text = sheet.initiative.label?.let { stringResource(id = it) } ?: ""
textAlign = TextAlign.Center,
text = sheet.proficiency.label?.let { stringResource(id = it) } ?: ""
)
Text(
style = MaterialTheme.typography.displayMedium,
text = sheet.initiative.value ?: ""
style = MaterialTheme.typography.displaySmall,
text = sheet.proficiency.value ?: ""
)
}
sheet.stats.forEach {
@ -301,7 +296,6 @@ fun ProficiencyPreview() {
val sheet by rememberCharacterSheetStatePreview()
ProficiencyPageContent(
sheet = sheet,
onInitiative = { },
onStats = { },
onProficiencies = { },
)

View file

@ -57,8 +57,6 @@ class ProficiencyViewModel @Inject constructor(
}
}
fun initiativeRoll(): DiceThrow.Initiative = DiceThrow.Initiative(character)
fun statRoll(id: StatUio.ID): DiceThrow = when (id) {
StatUio.ID.STRENGTH -> DiceThrow.Strength(character)
StatUio.ID.DEXTERITY -> DiceThrow.Dexterity(character)

View file

@ -101,6 +101,7 @@
<string name="character_sheet_title_inspiration">Inspiration</string>
<string name="character_sheet_title_conduit">Conduit Divin</string>
<string name="character_sheet_title_initiative">Initiative</string>
<string name="character_sheet_title_proficiency_bonus">Bonus de maîtrise</string>
<string name="character_sheet_title_characteristic">Caractéristiques</string>
<string name="character_sheet_title_attribute">Attributs</string>
<string name="character_sheet_title_passive">Talents passifs</string>

View file

@ -101,6 +101,7 @@
<string name="character_sheet_title_inspiration">Inspiration</string>
<string name="character_sheet_title_conduit">Divine conduit</string>
<string name="character_sheet_title_initiative">Initiative</string>
<string name="character_sheet_title_proficiency_bonus">Proficiency bonus</string>
<string name="character_sheet_title_saving_throws">Saving Throws</string>
<string name="character_sheet_title_proficiencies">Proficiencies</string>
<string name="character_sheet_title_characteristic">Characteristics</string>