Add optional tracking of slayer points
This commit is contained in:
parent
8d3e381d56
commit
eb49c15d5f
|
@ -140,11 +140,13 @@
|
|||
"DS4.CharacterBaseInfoHeroClass": "Heldenklasse",
|
||||
"DS4.CharacterBaseInfoCulture": "Kultur",
|
||||
"DS4.CharacterProgressionLevel": "Stufe",
|
||||
"DS4.CharacterProgressionLevelAbbr": "Stufe",
|
||||
"DS4.CharacterProgressionLevelAbbr": "ST",
|
||||
"DS4.CharacterProgressionExperiencePoints": "Erfahrungspunkte",
|
||||
"DS4.CharacterProgressionExperiencePointsAbbr": "EP",
|
||||
"DS4.CharacterProgressionTalentPoints": "Talentpunkte",
|
||||
"DS4.CharacterProgressionProgressPoints": "Lernpunkte",
|
||||
"DS4.CharacterSlayerPoints": "Slayerpunkte",
|
||||
"DS4.CharacterSlayerPointsAbbr": "SP",
|
||||
"DS4.TalentRank": "Rang",
|
||||
"DS4.TalentRankBase": "Erworbener Rang",
|
||||
"DS4.TalentRankMax": "Maximaler Rang",
|
||||
|
@ -240,6 +242,8 @@
|
|||
"DS4.TooltipEffects": "Effekte",
|
||||
"DS4.SettingUseSlayingDiceForAutomatedChecksName": "Slayende Würfel",
|
||||
"DS4.SettingUseSlayingDiceForAutomatedChecksHint": "Benutze Slayende Würfel bei automatisierten Proben.",
|
||||
"DS4.SettingShowSlayerPointsName": "Slayerpunkte",
|
||||
"DS4.SettingShowSlayerPointsHint": "Zeige Slayerpunkte im Charakterbogen an.",
|
||||
"DS4.ChecksAppraise": "Schätzen",
|
||||
"DS4.ChecksChangeSpell": "Zauber Wechseln",
|
||||
"DS4.ChecksClimb": "Klettern",
|
||||
|
|
|
@ -140,11 +140,13 @@
|
|||
"DS4.CharacterBaseInfoHeroClass": "Hero Class",
|
||||
"DS4.CharacterBaseInfoCulture": "Culture",
|
||||
"DS4.CharacterProgressionLevel": "Level",
|
||||
"DS4.CharacterProgressionLevelAbbr": "Level",
|
||||
"DS4.CharacterProgressionLevelAbbr": "LVL",
|
||||
"DS4.CharacterProgressionExperiencePoints": "Experience Points",
|
||||
"DS4.CharacterProgressionExperiencePointsAbbr": "XP",
|
||||
"DS4.CharacterProgressionTalentPoints": "Talent Points",
|
||||
"DS4.CharacterProgressionProgressPoints": "Progress Points",
|
||||
"DS4.CharacterSlayerPoints": "Slayer Points",
|
||||
"DS4.CharacterSlayerPointsAbbr": "SP",
|
||||
"DS4.TalentRank": "Rank",
|
||||
"DS4.TalentRankBase": "Acquired Ranks",
|
||||
"DS4.TalentRankMax": "Maximum Ranks",
|
||||
|
@ -240,6 +242,8 @@
|
|||
"DS4.TooltipEffects": "Effects",
|
||||
"DS4.SettingUseSlayingDiceForAutomatedChecksName": "Slaying Dice",
|
||||
"DS4.SettingUseSlayingDiceForAutomatedChecksHint": "Use Slaying Dice for automated checks.",
|
||||
"DS4.SettingShowSlayerPointsName": "Slayer Points",
|
||||
"DS4.SettingShowSlayerPointsHint": "Show Slayer Points in the character sheet.",
|
||||
"DS4.ChecksAppraise": "Appraise",
|
||||
"DS4.ChecksChangeSpell": "Change Spell",
|
||||
"DS4.ChecksClimb": "Climb",
|
||||
|
|
|
@ -55,6 +55,7 @@ interface DS4CharacterDataData extends DS4ActorDataDataBase {
|
|||
language: DS4CharacterDataDataLanguage;
|
||||
profile: DS4CharacterDataDataProfile;
|
||||
currency: DS4CharacterDataDataCurrency;
|
||||
slayerPoints: DS4CharacterDataDataSlayerPoints;
|
||||
}
|
||||
export interface DS4CharacterDataDataBaseInfo {
|
||||
race: string;
|
||||
|
@ -93,6 +94,10 @@ export interface DS4CharacterDataDataCurrency {
|
|||
copper: number;
|
||||
}
|
||||
|
||||
export interface DS4CharacterDataDataSlayerPoints {
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface DS4CreatureDataData extends DS4ActorDataDataBase {
|
||||
baseInfo: DS4CreatureDataDataBaseInfo;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import {
|
|||
DS4CharacterDataDataLanguage,
|
||||
DS4CharacterDataDataProfile,
|
||||
DS4CharacterDataDataProgression,
|
||||
DS4CharacterDataDataSlayerPoints,
|
||||
DS4CreatureDataDataBaseInfo,
|
||||
} from "./actor-data";
|
||||
|
||||
|
@ -74,6 +75,11 @@ interface DS4CharacterPreparedDataData extends DS4ActorPreparedDataDataBase {
|
|||
language: DS4CharacterDataDataLanguage;
|
||||
profile: DS4CharacterDataDataProfile;
|
||||
currency: DS4CharacterDataDataCurrency;
|
||||
slayerPoints: DS4CharacterPreparedDataDataSlayerPoints;
|
||||
}
|
||||
|
||||
export interface DS4CharacterPreparedDataDataSlayerPoints extends DS4CharacterDataDataSlayerPoints {
|
||||
max: number;
|
||||
}
|
||||
|
||||
interface DS4CreaturePreparedDataData extends DS4ActorPreparedDataDataBase {
|
||||
|
|
|
@ -131,6 +131,9 @@ export class DS4Actor extends Actor<DS4ActorData, DS4Item, DS4ActorPreparedData>
|
|||
prepareFinalDerivedData(): void {
|
||||
this.data.data.combatValues.hitPoints.max = this.data.data.combatValues.hitPoints.total;
|
||||
this.data.data.checks.defend = this.data.data.combatValues.defense.total;
|
||||
if (this.data.type === "character") {
|
||||
this.data.data.slayerPoints.max = 3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +141,9 @@ export class DS4Actor extends Actor<DS4ActorData, DS4Item, DS4ActorPreparedData>
|
|||
* given in dot notation.
|
||||
*/
|
||||
get finalDerivedDataProperties(): string[] {
|
||||
return ["data.combatValues.hitPoints.max", "data.checks.defend"];
|
||||
return ["data.combatValues.hitPoints.max", "data.checks.defend"].concat(
|
||||
this.data.type === "character" ? ["data.slayerPoints.max"] : [],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,7 @@ import { DS4 } from "../../config";
|
|||
import { getCanvas } from "../../helpers";
|
||||
import { DS4Item } from "../../item/item";
|
||||
import { DS4ItemData } from "../../item/item-data";
|
||||
import { getDS4Settings } from "../../settings";
|
||||
import notifications from "../../ui/notifications";
|
||||
import { DS4Actor } from "../actor";
|
||||
import { isCheck } from "../actor-prepared-data";
|
||||
|
@ -61,6 +62,7 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Data<DS4Actor>> {
|
|||
config: DS4,
|
||||
// Add the items explicitly sorted by type to the data:
|
||||
itemsByType,
|
||||
settings: getDS4Settings(),
|
||||
};
|
||||
return data;
|
||||
}
|
||||
|
|
1
src/module/global.d.ts
vendored
1
src/module/global.d.ts
vendored
|
@ -2,5 +2,6 @@ declare namespace ClientSettings {
|
|||
interface Values {
|
||||
"ds4.systemMigrationVersion": number;
|
||||
"ds4.useSlayingDiceForAutomatedChecks": boolean;
|
||||
"ds4.showSlayerPoints": boolean;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,27 @@ export function registerSystemSettings(): void {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
});
|
||||
|
||||
game.settings.register("ds4", "showSlayerPoints", {
|
||||
name: "DS4.SettingShowSlayerPointsName",
|
||||
hint: "DS4.SettingShowSlayerPointsHint",
|
||||
scope: "world",
|
||||
config: true,
|
||||
type: Boolean,
|
||||
default: false,
|
||||
});
|
||||
}
|
||||
|
||||
interface DS4Settings {
|
||||
systemMigrationVersion: number;
|
||||
useSlayingDiceForAutomatedChecks: boolean;
|
||||
showSlayerPoints: boolean;
|
||||
}
|
||||
|
||||
export function getDS4Settings(): DS4Settings {
|
||||
return {
|
||||
systemMigrationVersion: game.settings.get("ds4", "systemMigrationVersion"),
|
||||
useSlayingDiceForAutomatedChecks: game.settings.get("ds4", "useSlayingDiceForAutomatedChecks"),
|
||||
showSlayerPoints: game.settings.get("ds4", "showSlayerPoints"),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
@use "../utils/colors";
|
||||
@use "../utils/typography";
|
||||
@use "../utils/variables";
|
||||
@use "../utils/mixins";
|
||||
|
||||
.progression {
|
||||
.progression-entry {
|
||||
@include mixins.mark-invalid-or-disabled-input;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
@ -26,6 +29,17 @@
|
|||
margin-left: 5px;
|
||||
flex: 0 0 40px;
|
||||
text-align: left;
|
||||
|
||||
&--slayer-points {
|
||||
&::-webkit-inner-spin-button,
|
||||
&::-webkit-outer-spin-button {
|
||||
-webkit-appearance: auto;
|
||||
}
|
||||
&:hover,
|
||||
&:focus {
|
||||
-moz-appearance: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"version": "0.6.0",
|
||||
"minimumCoreVersion": "0.7.9",
|
||||
"compatibleCoreVersion": "0.7.9",
|
||||
"templateVersion": 3,
|
||||
"templateVersion": 4,
|
||||
"author": "Johannes Loher, Gesina Schwalbe, Oliver Rümpelein, Siegfried Krug",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -119,6 +119,9 @@
|
|||
"gold": 0,
|
||||
"silver": 0,
|
||||
"copper": 0
|
||||
},
|
||||
"slayerPoints": {
|
||||
"value": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -8,12 +8,22 @@
|
|||
id="data.combatValues.hitPoints.value" value="{{data.combatValues.hitPoints.value}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{#if (eq actor.type "character")}}
|
||||
{{#if settings.showSlayerPoints}}
|
||||
<div class="progression-entry">
|
||||
<h2 class="progression-label"><label for="data.slayersPoints.value"
|
||||
title="{{localize 'DS4.CharacterSlayerPoints'}}">{{localize "DS4.CharacterSlayerPointsAbbr"}}</label>
|
||||
</h2>
|
||||
<input class="progression-value progression-value--slayer-points" type="number" max="{{data.slayerPoints.max}}"
|
||||
min="0" step="1" name="data.slayerPoints.value" id="data.slayersPoints.value"
|
||||
value="{{data.slayerPoints.value}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="progression-entry">
|
||||
<h2 class="progression-label"><label for="data.progression.level"
|
||||
title="{{localize 'DS4.CharacterProgressionLevel'}}">{{localize
|
||||
"DS4.CharacterProgressionLevelAbbr"}}</label>
|
||||
</h2>
|
||||
<input class="progression-value" type="number" name="data.progression.level" id="data.progression.level"
|
||||
<input class="progression-value" type="number" min="0" name="data.progression.level" id="data.progression.level"
|
||||
value="{{data.progression.level}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="progression-entry">
|
||||
|
@ -21,7 +31,7 @@
|
|||
title="{{localize 'DS4.CharacterProgressionExperiencePoints'}}">{{localize
|
||||
"DS4.CharacterProgressionExperiencePointsAbbr"}}</label>
|
||||
</h2>
|
||||
<input class="progression-value" type="number" name="data.progression.experiencePoints"
|
||||
<input class="progression-value" type="number" min="0" name="data.progression.experiencePoints"
|
||||
id="data.progression.experiencePoints" value="{{data.progression.experiencePoints}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in a new issue