Skip to content

Commit 04ad3b4

Browse files
committed
feat: add Fist & cie weapon on actor creation
1 parent 5af5ae1 commit 04ad3b4

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

lang/ca.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"Medium": "Mitjana",
6060
"Heavy": "Pesada"
6161
},
62-
"RerollHint": "Una arma que no és almenys una categoria \"Mitjana\" no pot tenir més d'una tornar a tirar."
62+
"RerollHint": "Una arma que no és almenys una categoria \"Mitjana\" no pot tenir més d'una tornar a tirar.",
63+
"FistAndCie": "Fist & cie"
6364
},
6465
"CharacterSheet": {
6566
"Yno": "Un {serial} creat per Anthony “Yno” Combrexelle",

lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"Medium": "Medium",
6060
"Heavy": "Heavy"
6161
},
62-
"RerollHint": "A weapon that is not at least of \"Medium\" category cannot have more than one reroll."
62+
"RerollHint": "A weapon that is not at least of \"Medium\" category cannot have more than one reroll.",
63+
"FistAndCie": "Fist & cie"
6364
},
6465
"CharacterSheet": {
6566
"Yno": "A {serial} created by Anthony “Yno” Combrexelle",

lang/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"Medium": "Moyenne",
6060
"Heavy": "Lourde"
6161
},
62-
"RerollHint": "Une arme qui n’est pas au moins de catégorie « Moyenne » ne peut pas avoir plus d’une relance."
62+
"RerollHint": "Une arme qui n’est pas au moins de catégorie « Moyenne » ne peut pas avoir plus d’une relance.",
63+
"FistAndCie": "Poing & cie"
6364
},
6465
"CharacterSheet": {
6566
"Yno": "Un {serial} créé par Anthony « Yno » Combrexelle",

module/actor/sheets/base-actor-sheet.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class BaseActorSheet extends api.HandlebarsApplicationMixin(sheet
9595
context = await super._preparePartContext(partId, context, options);
9696

9797
if ('bio' === partId) {
98-
context.enrichedBiography = await ux.TextEditor.enrichHTML(this.actor.system.biography, {
98+
context.enrichedBiography = await ux.TextEditor.implementation.enrichHTML(this.actor.system.biography, {
9999
secrets: this.document.isOwner,
100100
relativeTo: this.actor,
101101
});

module/actor/sheets/character-actor-sheet.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class CharacterActorSheet extends BaseActorSheet {
3737
context = await super._preparePartContext(partId, context);
3838

3939
if ('notes' === partId) {
40-
context.enrichedNotes = await ux.TextEditor.enrichHTML(this.actor.system.notes, {
40+
context.enrichedNotes = await ux.TextEditor.implementation.enrichHTML(this.actor.system.notes, {
4141
secrets: this.document.isOwner,
4242
relativeTo: this.actor,
4343
});

module/documents/actor.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
export default class ChannelFearActor extends foundry.documents.Actor {
2+
async _onCreate(data, options, userId) {
3+
super._onCreate(data, options, userId);
4+
5+
if (userId !== game.user.id) {
6+
return;
7+
}
8+
9+
await this.#addBareHandsWeapon();
10+
}
11+
212
getRollData() {
313
const data = foundry.utils.deepClone(super.getRollData());
414

@@ -24,4 +34,16 @@ export default class ChannelFearActor extends foundry.documents.Actor {
2434
}
2535
}
2636
}
37+
38+
async #addBareHandsWeapon() {
39+
this.createEmbeddedDocuments('Item', [{
40+
name: game.i18n.localize('CF.Weapons.FistAndCie'),
41+
type: 'weapon',
42+
system: {
43+
ability: 'fig',
44+
reroll: 0,
45+
category: 1,
46+
},
47+
}]);
48+
}
2749
}

module/item/sheets/base-item-sheet.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { api, sheets, ux } = foundry.applications;
1+
const { api, sheets } = foundry.applications;
22

33
export default class BaseItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheetV2) {
44
static DEFAULT_OPTIONS = {

0 commit comments

Comments
 (0)