Skip to content

Commit f6d975e

Browse files
committed
Add wealth to the character sheet : guilders, shillings and pennies
1 parent 1373983 commit f6d975e

File tree

8 files changed

+302
-193
lines changed

8 files changed

+302
-193
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.1.0
2+
- Configure prototype token at character creation
3+
- Add wealth to the character sheet : guilders, shillings and pennies
4+
15
# 2.0.0
26
- Conversion to Into The Odd Remastered version
37
- Complete Rework to full support Foundry V12, DataModels and Application V2

css/intotheodd.css

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,85 +48,112 @@
4848
padding-top: 2px;
4949
padding-bottom: 2px;
5050
}
51-
.intotheodd .character-main {
51+
.intotheodd.actor.character {
52+
min-width: 675px;
53+
}
54+
.intotheodd.actor.character .character-abilities {
5255
display: grid;
5356
margin: 10px 0;
5457
padding: 0;
5558
grid-template-columns: repeat(5, minmax(0, 1fr));
5659
grid-column: span 5 / span 5;
5760
}
58-
.intotheodd .character-main fieldset {
61+
.intotheodd.actor.character .character-abilities fieldset {
5962
border-radius: 5px;
6063
}
61-
.intotheodd .character-main fieldset legend {
64+
.intotheodd.actor.character .character-abilities fieldset legend {
6265
font-weight: bold;
6366
}
64-
.intotheodd .character-main .ability {
67+
.intotheodd.actor.character .character-abilities .ability {
6568
display: flex;
6669
justify-content: space-between;
6770
align-items: center;
6871
margin-top: 5px;
6972
text-align: center;
7073
}
71-
.intotheodd .character-main .ability input {
74+
.intotheodd.actor.character .character-abilities .ability input {
7275
width: 40px;
7376
font-size: 1.2rem;
7477
}
75-
.intotheodd .character-main .ability .divider {
78+
.intotheodd.actor.character .character-abilities .ability .divider {
7679
font-size: x-large;
7780
}
78-
.intotheodd .character-main .armour {
81+
.intotheodd.actor.character .character-abilities .armour {
7982
font-size: 1.5rem;
8083
display: flex;
8184
justify-content: center;
8285
align-items: center;
8386
margin-top: 5px;
8487
}
85-
.intotheodd .character-main .rollable:hover,
86-
.intotheodd .character-main .rollable:focus {
88+
.intotheodd.actor.character .character-abilities .rollable:hover,
89+
.intotheodd.actor.character .character-abilities .rollable:focus {
8790
color: #3f2020;
8891
text-shadow: 0 0 10px var(--color-shadow-primary);
8992
cursor: url("systems/intotheodd/ui/d20-highlight.svg") 32 24, pointer;
9093
}
91-
.intotheodd .character-header {
94+
.intotheodd.actor.character .character-wealth {
95+
display: flex;
96+
}
97+
.intotheodd.actor.character .character-wealth fieldset {
98+
width: 100%;
99+
border-radius: 5px;
100+
}
101+
.intotheodd.actor.character .character-wealth fieldset legend {
102+
font-weight: bold;
103+
}
104+
.intotheodd.actor.character .character-wealth .wealth {
105+
display: flex;
106+
flex-direction: row;
107+
justify-content: space-between;
108+
width: 100%;
109+
}
110+
.intotheodd.actor.character .character-wealth .wealth label {
111+
font-weight: bold;
112+
}
113+
.intotheodd.actor.character .character-wealth .wealth input {
114+
font-size: 1rem;
115+
margin: 0 20px 0 20px;
116+
text-align: center;
117+
}
118+
.intotheodd.actor.character .character-header {
92119
display: flex;
93120
flex-direction: row;
94121
}
95-
.intotheodd .character-header .character-name input {
122+
.intotheodd.actor.character .character-header .character-name input {
96123
font-size: 1.5rem;
97124
}
98-
.intotheodd .character-header .character-img {
125+
.intotheodd.actor.character .character-header .character-img {
99126
width: 100px;
100127
flex: 0 0 25%;
101128
/* Prend 25% de la largeur */
102129
}
103-
.intotheodd .character-header .character-details {
130+
.intotheodd.actor.character .character-header .character-details {
104131
flex: 1;
105132
/* Prend le reste de la largeur */
106133
padding-left: 10px;
107134
flex-direction: column;
108135
}
109-
.intotheodd .character-header .character-details fieldset {
136+
.intotheodd.actor.character .character-header .character-details fieldset {
110137
margin-top: 10px;
111138
border-radius: 5px;
112139
}
113-
.intotheodd .character-header .character-details fieldset legend {
140+
.intotheodd.actor.character .character-header .character-details fieldset legend {
114141
font-weight: bold;
115142
}
116-
.intotheodd .character-items-list .item {
143+
.intotheodd.actor.character .character-items-list .item {
117144
display: flex;
118145
justify-content: space-between;
119146
margin-top: 10px;
120147
}
121-
.intotheodd .character-items-list .item .item-name {
148+
.intotheodd.actor.character .character-items-list .item .item-name {
122149
flex: 1;
123150
font-weight: bold;
124151
}
125-
.intotheodd .character-items-list .item .item-quantity {
152+
.intotheodd.actor.character .character-items-list .item .item-quantity {
126153
width: 40px;
127154
font-size: 1.2rem;
128155
}
129-
.intotheodd .character-items-list .item summary {
156+
.intotheodd.actor.character .character-items-list .item summary {
130157
display: flex;
131158
justify-content: space-between;
132159
align-items: center;

lang/en.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
},
4343
"level": {
4444
"label": "Experience Level"
45+
},
46+
"wealth": {
47+
"guilders": {
48+
"label": "Guilders (G)"
49+
},
50+
"shillings": {
51+
"label": "Shillings (S)"
52+
},
53+
"pennies": {
54+
"label": "Pennies (P)"
55+
}
4556
}
4657
}
4758
},
@@ -139,7 +150,10 @@
139150
"armour": "Armour",
140151
"shortRest": "Short Rest",
141152
"fullRest": "Full Rest",
142-
"damage": "damage"
153+
"damage": "damage",
154+
"guilders": "Guilders (G)",
155+
"shillings": "Shillings (S)",
156+
"pennies": "Pennies (P)"
143157
},
144158
"details": "Details"
145159
},

lang/fr.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
},
4343
"level": {
4444
"label": "Niveau d'Expérience"
45+
},
46+
"wealth": {
47+
"guilders": {
48+
"label": "Guilders (G)"
49+
},
50+
"shillings": {
51+
"label": "Shillings (S)"
52+
},
53+
"pennies": {
54+
"label": "Pennies (P)"
55+
}
4556
}
4657
}
4758
},

module/data/character.mjs

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,81 @@
1-
import { LEVEL } from "../config.mjs";
1+
import { LEVEL } from "../config.mjs"
22

33
export default class IntoTheOddCharacterData extends foundry.abstract.TypeDataModel {
4-
/** @override */
5-
static defineSchema() {
6-
const fields = foundry.data.fields;
4+
/** @override */
5+
static defineSchema() {
6+
const fields = foundry.data.fields
77

8-
return {
9-
biography: new fields.HTMLField({ required: false, blank: true, initial: "", textSearch: true }),
10-
hp: new fields.SchemaField({
11-
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
12-
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
13-
}),
14-
deprived: new fields.BooleanField({ required: true, nullable: false, initial: false }),
15-
critical: new fields.BooleanField({ required: true, nullable: false, initial: false }),
16-
level: new fields.StringField({
17-
required: true, nullable: false, initial: LEVEL.NOVICE, choices: Object.fromEntries(Object.entries(LEVEL).map(([key, value]) =>
18-
[value, { label: `INTOTHEODD.Level.${value}` }]))
19-
}),
20-
abilities: new fields.SchemaField({
21-
str: new fields.SchemaField({
22-
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
23-
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
24-
}),
25-
dex: new fields.SchemaField({
26-
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
27-
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
28-
}),
29-
wil: new fields.SchemaField({
30-
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
31-
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
32-
})
33-
})
34-
};
8+
return {
9+
biography: new fields.HTMLField({ required: false, blank: true, initial: "", textSearch: true }),
10+
hp: new fields.SchemaField({
11+
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
12+
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
13+
}),
14+
deprived: new fields.BooleanField({ required: true, nullable: false, initial: false }),
15+
critical: new fields.BooleanField({ required: true, nullable: false, initial: false }),
16+
level: new fields.StringField({
17+
required: true,
18+
nullable: false,
19+
initial: LEVEL.NOVICE,
20+
choices: Object.fromEntries(Object.entries(LEVEL).map(([key, value]) => [value, { label: `INTOTHEODD.Level.${value}` }])),
21+
}),
22+
abilities: new fields.SchemaField({
23+
str: new fields.SchemaField({
24+
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
25+
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
26+
}),
27+
dex: new fields.SchemaField({
28+
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
29+
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
30+
}),
31+
wil: new fields.SchemaField({
32+
value: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
33+
max: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10, min: 0 }),
34+
}),
35+
}),
36+
wealth: new fields.SchemaField({
37+
guilders: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0, min: 0 }),
38+
shillings: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0, min: 0 }),
39+
pennies: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0, min: 0 }),
40+
}),
3541
}
42+
}
3643

37-
/** @override */
38-
static LOCALIZATION_PREFIXES = ["INTOTHEODD.Character"];
44+
/** @override */
45+
static LOCALIZATION_PREFIXES = ["INTOTHEODD.Character"]
3946

40-
/** @override */
41-
prepareBaseData() {
42-
this.armour = this.parent.items
43-
.filter(item => item.system.subType === "armour" && item.system.equipped)
44-
.map(item => item.system.armour)
45-
.reduce((acc, curr) => acc + curr, 0);
46-
}
47+
/** @override */
48+
prepareBaseData() {
49+
this.armour = this.parent.items
50+
.filter((item) => item.system.subType === "armour" && item.system.equipped)
51+
.map((item) => item.system.armour)
52+
.reduce((acc, curr) => acc + curr, 0)
53+
}
4754

48-
/**
49-
* A few minutes of rest and a swig of water recovers all of a character’s lost hp.
50-
*/
51-
shortRest() {
52-
if (this.deprived) {
53-
ui.notifications.warn(game.i18n.localize('INTOTHEODD.Warns.canNotRest'));
54-
return;
55-
}
56-
return this.parent.update({ "system.hp.value": this.hp.max });
55+
/**
56+
* A few minutes of rest and a swig of water recovers all of a character’s lost hp.
57+
*/
58+
shortRest() {
59+
if (this.deprived) {
60+
ui.notifications.warn(game.i18n.localize("INTOTHEODD.Warns.canNotRest"))
61+
return
5762
}
63+
return this.parent.update({ "system.hp.value": this.hp.max })
64+
}
5865

59-
/**
60-
* A Full Rest requires a week of downtime at a comfortable location. This restores all Ability Scores
61-
*/
62-
fullRest() {
63-
if (this.deprived) {
64-
ui.notifications.warn(game.i18n.localize('INTOTHEODD.Warns.canNotRest'));
65-
return;
66-
}
67-
return this.parent.update({
68-
"system.hp.value": this.hp.max,
69-
"system.abilities.str.value": this.abilities.str.max,
70-
"system.abilities.dex.value": this.abilities.dex.max,
71-
"system.abilities.wil.value": this.abilities.wil.max
72-
});
66+
/**
67+
* A Full Rest requires a week of downtime at a comfortable location. This restores all Ability Scores
68+
*/
69+
fullRest() {
70+
if (this.deprived) {
71+
ui.notifications.warn(game.i18n.localize("INTOTHEODD.Warns.canNotRest"))
72+
return
7373
}
74-
75-
}
74+
return this.parent.update({
75+
"system.hp.value": this.hp.max,
76+
"system.abilities.str.value": this.abilities.str.max,
77+
"system.abilities.dex.value": this.abilities.dex.max,
78+
"system.abilities.wil.value": this.abilities.wil.max,
79+
})
80+
}
81+
}

0 commit comments

Comments
 (0)