Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hardcoded resilience #68

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ AC2D20.RESISTANCE.fatigue: Fatigue
AC2D20.RESISTANCE.resistance: Resistance
AC2D20.SETTINGS.compendiumHint: Each time a new character is created it will include this set of skills.
AC2D20.SETTINGS.compendiumName: Skills Compendium
AC2D20.SETTINGS.resilienceHint: Name of the Resilience skill in your skill compendium, used for autocalculate stress.
AC2D20.SETTINGS.resilienceName: Resilience skill
AC2D20.SETTINGS.ctHint: If enabled the Combat Tracker will decrement the Momentum Pool when a new Combat Round starts, or when Combat ends.
AC2D20.SETTINGS.ctName: Combat Tracker Updates Momentum?
AC2D20.SETTINGS.debugEnabled.hint: Enable or Disable additional debug features
Expand Down
2 changes: 2 additions & 0 deletions i18n/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ AC2D20.RESISTANCE.fatigue: Fatiga
AC2D20.RESISTANCE.resistance: Resistencia
AC2D20.SETTINGS.compendiumHint: Cuando se crea un nuevo personaje incluirá las habilidades contenidas en este compendio.
AC2D20.SETTINGS.compendiumName: Compendio de habilidades
AC2D20.SETTINGS.resilienceHint: Nombre de la habilidad Fortaleza tal y como aparece en el compendio de habilidades, se usa para calcular automáticamente el estrés.
AC2D20.SETTINGS.resilienceName: Habilidad Fortaleza
AC2D20.SETTINGS.ctHint: Si se activa, el asistente de combate reducirá la reserva de momentum cuando empiece un nuevo asalto, o cuando el combate finalice.
AC2D20.SETTINGS.ctName: Asistente de combate actualiza el momentum
AC2D20.SETTINGS.debugEnabled.hint: Enable or Disable additional debug features
Expand Down
5 changes: 3 additions & 2 deletions system/src/documents/ACActor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ export default class ACActor extends Actor {
const fatigue = this.system.fatigue ?? 0;

const mod = this.system.stress?.mod ?? 0;
const resilienceSkillName = game.settings.get("ac2d20", "resilience-skill");

const resilienceSkill = this.items.find(
i => i.type === "skill" && i.name === "Resilience"
i => i.type === "skill" && i.name === resilienceSkillName
);

if (!resilienceSkill) {
return ac2d20.logger.error(
`Unable to locate 'Resilience' skill on character ${this.name}`
`Unable to locate '${resilienceSkillName}' skill on character ${this.name}`
);
}

Expand Down
10 changes: 10 additions & 0 deletions system/src/settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ export default async function registerSettings() {
requiresReload: true,
});

game.settings.register(SYSTEM_ID, "resilience-skill", {
name: game.i18n.localize("AC2D20.SETTINGS.resilienceName"),
hint: game.i18n.localize("AC2D20.SETTINGS.resilienceHint"),
type: String,
default: "Resilience",
scope: "world",
config: true,
requiresReload: true,
});

game.settings.register(SYSTEM_ID, "hoversJsonLocation", {
name: game.i18n.localize("AC2D20.SETTINGS.hoverName"),
hint: game.i18n.localize("AC2D20.SETTINGS.hoverHint"),
Expand Down
Loading