Add support for primary and secondary class.

This commit is contained in:
Andres Gomez, Thomas (ITDV RL) 2024-05-30 14:41:30 +02:00
parent 3b075a05e4
commit b14e836d80
10 changed files with 46 additions and 14 deletions

View file

@ -20,6 +20,7 @@ import com.pixelized.rplexicon.data.repository.character.SpellRepository
import com.pixelized.rplexicon.ui.screens.rolls.composable.RollDiceUio
import com.pixelized.rplexicon.utilitary.extentions.icon
import com.pixelized.rplexicon.utilitary.extentions.local.advantage
import com.pixelized.rplexicon.utilitary.extentions.local.base
import com.pixelized.rplexicon.utilitary.extentions.local.critical
import com.pixelized.rplexicon.utilitary.extentions.local.disadvantage
import com.pixelized.rplexicon.utilitary.extentions.local.emphasis
@ -27,6 +28,8 @@ 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.primary
import com.pixelized.rplexicon.utilitary.extentions.local.secondary
import com.pixelized.rplexicon.utilitary.extentions.local.sum
import com.pixelized.rplexicon.utilitary.extentions.local.toStatus
import com.pixelized.rplexicon.utilitary.extentions.masteryMultiplier
@ -979,7 +982,9 @@ class DiceThrowUseCase @Inject constructor(
Property.WISDOM -> (character.wisdom + this@ThrowScope.status[this].sum).modifier
Property.CHARISMA -> (character.charisma + this@ThrowScope.status[this].sum).modifier
Property.PROFICIENCY -> character.proficiency
Property.LEVEL -> character.level
Property.LEVEL -> character.level.base
Property.LEVEL_PC -> character.level.primary
Property.LEVEL_SC -> character.level.secondary
else -> null
}?.let { value ->
val titleLabel = if (this == Property.PROFICIENCY) {
@ -993,6 +998,8 @@ class DiceThrowUseCase @Inject constructor(
Property.WISDOM -> context.getString(R.string.character_sheet_stat_wisdom)
Property.CHARISMA -> context.getString(R.string.character_sheet_stat_charisma)
Property.LEVEL -> context.getString(R.string.character_sheet_stat_level)
Property.LEVEL_PC -> context.getString(R.string.character_sheet_stat_level_pc)
Property.LEVEL_SC -> context.getString(R.string.character_sheet_stat_level_sc)
else -> ""
}
context.getString(R.string.dice_roll_bonus_detail, label)