Skip to content
1 change: 1 addition & 0 deletions src/assets/ui/other-svg/dice-twenty-faces-twenty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,15 @@
"DL.DialogWarningActorsNotSelected": "Actor(s) not selected",
"DL.DialogWarningActorsNotTargeted": "Actor(s) not targeted",
"DL.DialogWarningAfflictionFromEffect": "Affliction is applied from effect. Remove the effect to remove the affliction.",
"DL.DialogWarningAlreadyMadeWILLImmune": "You've already made a Will challenge roll against {creature} and you are immune to its {trait} trait.",
"DL.DialogWarningAlreadyMadeWILL": "You've already made a Will challenge roll against {creature}.",
"DL.DialogWarningAlreadyMadeWILLFrightened": "You've already made a Will challenge roll against {creature} and you are already frightened.",
"DL.DialogWarningBlindedChallengeFailer": "You're blinded and perception challenge rolls result in failure.",
"DL.DialogWarningCannotIncreaseDifficulty": "Cannot increase difficulty by {steps} steps, because difficulty would be greater than maximum allowed {maxAllowed}.",
"DL.DialogWarningCreatureArmor": "You can't add armor to a creature. Change the Defense value manually.",
"DL.DialogWarningDazedFailer": "You're dazed and cannot use actions.",
"DL.DialogWarningDefenselessFailer": "You're defenseless and cannot use actions, and challenge rolls using attributes result in failure.",
"DL.DialogWarningInvalidTarget": "No frightening or horrifying creature targeted or you've already performed a Will challenge roll.",
"DL.DialogWarningInvalidCreatureDifficulty": "Invalid creature difficulty: {difficulty}.",
"DL.DialogWarningStunnedFailer": "You're stunned and cannot use actions or move, and all your challenge rolls result in failure.",
"DL.DialogWarningSurprisedFailer": "You're surprised and cannot use actions or move, and all your challenge rolls result in failure.",
"DL.DialogWarningTargetNotHorrifying": "{target} not horrifying.",
Expand Down Expand Up @@ -405,6 +407,7 @@
"DL.EndRoundDelete": "Delete End of the Round",
"DL.ExtraEffect": "Extra Effect",
"DL.ExtraEffect20": "Extra Effect 20+",
"DL.FearRollAgainst": "Fear Roll against {creature}",
"DL.FeatureAdd": "Add feature",
"DL.FeatureDelete": "Delete feature",
"DL.FeatureEdit": "Edit feature",
Expand All @@ -422,14 +425,14 @@
"DL.GMnoteSave": "Save GM Note",
"DL.HalfSpeed": "Half Speed",
"DL.ImmuneAffliction": "Immune to Affliction",
"DL.ImmuneToTarget": "Immune to {creature}",
"DL.ImmuneToHorrifyingOneMinute": "You become immune to {creature}'s horrifying trait for 1 minute.",
"DL.ImmuneAttribute": "Immune Attribute",
"DL.ImmuneCharacteristic": "Immune Characteristic",
"DL.ImmunityLastsUntilTheEndOfTheRound": "Immunity to target horrifying trait lasts until the end of the round.",
"DL.ImmunityLastsUntilTheEndOfNextRound": "Immunity to target horrifying trait lasts until the end of the next round.",
"DL.ImmunityLastsRounds": "Immunity to target horrifying trait lasts {rounds} more rounds.",
"DL.ImmunityLastsSeconds": "Immunity to target horrifying trait lasts {seconds} seconds.",
"DL.FearRoll": "Fear Roll",
"DL.FearRollLastsUntilTheEndOfTheRound": "Fear Roll against target lasts until the end of the round.",
"DL.FearRollLastsUntilTheEndOfNextRound": "Fear Roll against target lasts until the end of the next round.",
"DL.FearRollLastsRounds": "Fear Roll against target lasts {rounds} more rounds.",
"DL.FearRollLastsSeconds": "Fear Roll against target lasts {seconds} seconds.",
"DL.AfflictionImmunityEffectName": "{affliction} Immunity",
"DL.IsDarkMagic": "Is Dark Magic",
"DL.IsFrightening": "Is Frightening",
Expand Down Expand Up @@ -467,7 +470,6 @@
"DL.LanguagesTitle": "Languages",
"DL.LanguagesWrite": "Write",
"DL.LanguagesWriteShort": "W",
"DL.LookOutCreatures": "Look out creatures!",
"DL.MacroApplyAfflicationTitle": "Apply Afflictions",
"DL.MacroCancel": "Cancel",
"DL.MacroChallengeChoose": "Choose Attribute:",
Expand Down Expand Up @@ -643,6 +645,8 @@
"DL.SettingDSNLabel": "Dice So Nice! Settings",
"DL.SettingDamageScrollText": "Enable Scroll Text for Damage/Health",
"DL.SettingDamageScrollTextHint": "When checked, scrolling text appears above tokens about damage/heal value.",
"DL.SettingEnableItemMacro": "Enable Item Macro",
"DL.SettingEnableItemMacroHint": "When checked item macros will be executed.",
"DL.SettingEnableQuickDraw": "Enable one-click draw for rolltables.",
"DL.SettingEnableQuickDrawHint": "Draw directly form sidebar, compendia or sheets (right-click).",
"DL.SettingFinesseAutoSelect": "Finesse weapon attack attribute auto select",
Expand Down
18 changes: 9 additions & 9 deletions src/lang/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@
"DL.CreatureEditMagic": "Editar Feitiço",
"DL.CreatureEditSpecialActions": "Editar Ação Especial",
"DL.CreatureEditSpecialAttacks": "Editar Ataque Especial",
"DL.CreatureFrightening": "Amedron.",
"DL.CreatureFrightening": "Amedrontador",
"DL.CreatureFrighteningDescription": "Uma criatura sem o traço amedrontador ou horripilante deve fazer uma rolagem de desafio de Vontade ao ver pela primeira vez uma ou mais criaturas com esse traço. A rolagem é feita com 1 revés se houver quatro ou mais criaturas amedrontadoras ao mesmo tempo. Se fracassar, a criatura fica amedrontada por uma quantidade de rodadas igual a 1d3 + seu total de Insanidade ou ganha 1 ponto de Insanidade se já estiver amedrontada. Após fazer essa rolagem, seja qual for o resultado, a criatura não poderá mais ser afetada por esse traço da criatura, ou criaturas, que viu até completar um descanso.",
"DL.CreatureHealth": "Vida",
"DL.CreatureHorrifying": "Horrip.",
"DL.CreatureHorrifying": "Horripilante",
"DL.CreatureHorrifyingDescription": "Uma criatura sem o traço horripilante deve fazer uma rolagem de desafio de Vontade ao ver pela primeira vez uma ou mais criaturas com esse traço. A rolagem é feita com 1 revés se houver quatro ou mais criaturas horripilantes ao mesmo tempo. Se fracassar, a criatura ganha 1 ponto de Insanidade, ou 1d3 se já estiver amedrontada. Após fazer essa rolagem, seja qual for o resultado, a criatura não poderá mais ser afetada por esse traço da criatura, ou criaturas, que viu até completar um descanso. Independentemente do resultado da rolagem de desafio, criaturas que não possuem os traços amedrontadora ou horripilante fazem rolagens de ataque contra criaturas horripilantes com 1 revés.",
"DL.CreatureInsanity": "Insanidade",
"DL.CreatureIntellect": "Intelecto",
Expand Down Expand Up @@ -370,7 +370,7 @@
"DL.DialogWarningActorsNotSelected": "Ator(es) não selecionado(s)",
"DL.DialogWarningActorsNotTargeted": "Ator(es) não é(são) alvo(s)",
"DL.DialogWarningAfflictionFromEffect": "A aflição é aplicada por efeito. Remova o efeito para remover a aflição.",
"DL.DialogWarningAlreadyMadeWILLImmune": "Você já fez uma rolagem de Vontade contra {creature} e está imune ao seu traço {trait}.",
"DL.DialogWarningAlreadyMadeWILL": "Você já fez uma rolagem de Vontade contra {creature}.",
"DL.DialogWarningAlreadyMadeWILLFrightened": "Você já fez uma rolagem de Vontade contra {creature} e já está amedrontado.",
"DL.DialogWarningBlindedChallengeFailer": "Você está cego e rolagens de desafio de Percepção resultam em fracasso.",
"DL.DialogWarningCreatureArmor": "Você não pode adicionar armadura a uma criatura. Altere o valor de Defesa manualmente.",
Expand Down Expand Up @@ -405,6 +405,12 @@
"DL.EndRoundDelete": "Excluir Final da Rodada",
"DL.ExtraEffect": "Efeito Extra",
"DL.ExtraEffect20": "Efeito Extra 20+",
"DL.FearRoll": "Rolagem de Medo",
"DL.FearRollAgainst": "Rolagem de Medo contra {creature}",
"DL.FearRollLastsUntilTheEndOfTheRound": "Rolagem de Medo contra o alvo irá durar até o fim da rodada.",
"DL.FearRollLastsUntilTheEndOfNextRound": "Rolagem de Medo contra o alvo irá durar até o final da próxima rodada.",
"DL.FearRollLastsRounds": "Rolagem de Medo contra o alvo irá durar mais {rounds} rodadas.",
"DL.FearRollLastsSeconds": "Rolagem de Medo contra o alvo irá durar {seconds} segundos.",
"DL.FeatureAdd": "Adicionar Propriedade",
"DL.FeatureDelete": "Excluir Propriedade",
"DL.FeatureEdit": "Editar Propriedade",
Expand All @@ -422,14 +428,9 @@
"DL.GMnoteSave": "Salvar Nota do MJ",
"DL.HalfSpeed": "Metade da Velocidade",
"DL.ImmuneAffliction": "Imune a aflição",
"DL.ImmuneToTarget": "Imune a {creature}",
"DL.ImmuneToHorrifyingOneMinute": "Você se torna imune ao traço horripilante de {creature} por 1 minuto.",
"DL.ImmuneAttribute": "Atributo Imune",
"DL.ImmuneCharacteristic": "Característica Imune",
"DL.ImmunityLastsUntilTheEndOfTheRound": "Imunidade ao traço horripilante do alvo irá durar até o final da rodada.",
"DL.ImmunityLastsUntilTheEndOfNextRound": "Imunidade ao traço horripilante do alvo irá durar até o final da próxima rodada.",
"DL.ImmunityLastsRounds": "Imunidade ao traço horripilante do alvo irá durar mais {rounds} rodadas.",
"DL.ImmunityLastsSeconds": "Imunidade ao traço horripilante do alvo irá durar mais {seconds} segundos.",
"DL.AfflictionImmunityEffectName": "Imunidade a {affliction}",
"DL.IsDarkMagic": "É Magia das Trevas",
"DL.IsFrightening": "É Amedrontador",
Expand Down Expand Up @@ -467,7 +468,6 @@
"DL.LanguagesTitle": "Idiomas",
"DL.LanguagesWrite": "Escrever",
"DL.LanguagesWriteShort": "E",
"DL.LookOutCreatures": "Cuidado, criaturas!",
"DL.MacroApplyAfflicationTitle": "Aplicar Aflições",
"DL.MacroCancel": "Cancelar",
"DL.MacroChallengeChoose": "Selecionar Atributo:",
Expand Down
23 changes: 20 additions & 3 deletions src/module/active-effects/item-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class DLActiveEffects {
effectDataList = DLActiveEffects.generateEffectDataFromArmor(doc, actor)
break
case 'creaturerole':
effectDataList = DLActiveEffects.generateEffectDataFromRole(doc)
effectDataList = DLActiveEffects.generateEffectDataFromRole(doc, actor, operation)
break
default:
return await Promise.resolve(0)
Expand Down Expand Up @@ -302,9 +302,26 @@ export class DLActiveEffects {

/* -------------------------------------------- */

static generateEffectDataFromRole(item) {
static bumpDifficulty(actor, steps, operation) {
const difficultyIndex = (operation === 'update') ? CONFIG.DL.difficultyScale.indexOf(actor.system.difficultyBase) : CONFIG.DL.difficultyScale.indexOf(actor.system.difficulty)
if (difficultyIndex === -1) {
ui.notifications.warn(game.i18n.format('DL.DialogWarningInvalidCreatureDifficulty', {difficulty: actor.system.difficulty}))
return null
}

const calculatedDifficulty = CONFIG.DL.difficultyScale[difficultyIndex + parseInt(steps)]
if (calculatedDifficulty === undefined) {
ui.notifications.warn(game.i18n.format('DL.DialogWarningCannotIncreaseDifficulty', {steps: steps, maxAllowed: CONFIG.DL.difficultyScale[CONFIG.DL.difficultyScale.length-1]}))
return null
}

return (operation === 'update') ? (calculatedDifficulty - actor.system.difficultyBase) : (calculatedDifficulty - actor.system.difficulty)
}

static generateEffectDataFromRole(item, actor, operation) {
const priority = 5
const data = item.system
const calculatedDifficulty = DLActiveEffects.bumpDifficulty(actor, data.characteristics.difficulty, operation)

const effectData = {
name: item.name,
Expand Down Expand Up @@ -344,7 +361,7 @@ export class DLActiveEffects {
// addEffect('system.characteristics.corruption.value', data.characteristics.corruption.value, priority),
// addEffect('system.characteristics.insanity.value', data.characteristics.insanity.value, priority),

addEffect('system.difficulty', data.characteristics.difficulty, priority),
addEffect('system.difficulty', calculatedDifficulty, priority),
overrideEffect('system.characteristics.size', data.characteristics.size, priority),
overrideEffect('system.frightening', data.frightening, priority, true),
overrideEffect('system.horrifying', data.horrifying, priority, true),
Expand Down
Loading
Loading