diff --git a/assets/ui/pc_sheet_bg.webp b/assets/ui/pc_sheet_bg.webp
new file mode 100644
index 0000000..94d7da6
Binary files /dev/null and b/assets/ui/pc_sheet_bg.webp differ
diff --git a/modules/mournblade-actor-sheet.js b/modules/mournblade-actor-sheet.js
index 2ccd701..172f070 100644
--- a/modules/mournblade-actor-sheet.js
+++ b/modules/mournblade-actor-sheet.js
@@ -40,10 +40,9 @@ export class MournbladeActorSheet extends ActorSheet {
data: actorData,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
- weapons: this.actor.checkAndPrepareWeapons( duplicate(this.actor.getWeapons()) ),
- armors: this.actor.checkAndPrepareArmors( duplicate(this.actor.getArmors())),
- shields: duplicate(this.actor.getShields()),
- equipments: duplicate(this.actor.getEquipments()),
+ weapons: duplicate(this.actor.getWeapons()),
+ armors: duplicate(this.actor.getArmors()),
+ //equipments: duplicate(this.actor.getEquipments()),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
diff --git a/modules/mournblade-item-sheet.js b/modules/mournblade-item-sheet.js
index 5fe0761..4c3ca85 100644
--- a/modules/mournblade-item-sheet.js
+++ b/modules/mournblade-item-sheet.js
@@ -59,8 +59,7 @@ export class MournbladeItemSheet extends ItemSheet {
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
- optionsDiceList: MournbladeUtility.getOptionsDiceList(),
- optionsStatusList: MournbladeUtility.getOptionsStatusList(),
+ attributs: MournbladeUtility.getAttributs(),
data: itemData,
limited: this.object.limited,
options: this.options,
@@ -109,45 +108,6 @@ export class MournbladeItemSheet extends ItemSheet {
});
}
- /* -------------------------------------------- */
- async viewSubitem(ev) {
- let field = $(ev.currentTarget).data('type');
- let idx = Number($(ev.currentTarget).data('index'));
- let itemData = this.object.data.data[field][idx];
- if (itemData.name != 'None') {
- let spec = await Item.create(itemData, { temporary: true });
- spec.data.origin = "embeddedItem";
- new MournbladeItemSheet(spec).render(true);
- }
- }
-
- /* -------------------------------------------- */
- async deleteSubitem(ev) {
- let field = $(ev.currentTarget).data('type');
- let idx = Number($(ev.currentTarget).data('index'));
- let oldArray = this.object.data.data[field];
- let itemData = this.object.data.data[field][idx];
- if (itemData.name != 'None') {
- let newArray = [];
- for (var i = 0; i < oldArray.length; i++) {
- if (i != idx) {
- newArray.push(oldArray[i]);
- }
- }
- this.object.update({ [`data.${field}`]: newArray });
- }
- }
-
- /* -------------------------------------------- */
- async manageSpec() {
- let itemData = this.object.data.data.specialisation[0];
- if (itemData.name != 'None') {
- let spec = await Item.create(itemData, { temporary: true });
- spec.data.origin = "embeddedItem";
- new MournbladeItemSheet(spec).render(true);
- }
- }
-
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
@@ -196,308 +156,10 @@ export class MournbladeItemSheet extends ItemSheet {
}
- /* -------------------------------------------- */
- async addAbility(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- console.log("ABB", event, item, dataItem)
- if (event.toElement.className == 'drop-abilities') {
- let abilityArray = duplicate(this.object.data.data.abilities);
- abilityArray.push(newItem);
- await this.object.update({ 'data.abilities': abilityArray });
- }
- if (event.toElement.className == 'drop-optionnal-abilities') {
- let abilityArray = duplicate(this.object.data.data.optionnalabilities);
- abilityArray.push(newItem);
- await this.object.update({ 'data.optionnalabilities': abilityArray });
- }
- }
-
- /* -------------------------------------------- */
- async addRacePerk(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-race-perk') {
- let perkArray = duplicate(this.object.data.data.perks);
- perkArray.push(newItem);
- await this.object.update({ 'data.perks': perkArray });
- }
- }
-
- /* -------------------------------------------- */
- async addSpecialisation(item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- let specArray = [newItem];
- await this.object.update({ 'data.specialisation': specArray });
- }
-
- /* -------------------------------------------- */
- async addRoleSpecialisation(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- console.log("Add spec", event, newItem);
- if (event.toElement.className == 'drop-spec1') {
- let specArray = duplicate(this.object.data.data.specialisationsplus1);
- specArray.push(newItem);
- await this.object.update({ 'data.specialisationsplus1': specArray });
- }
- if (event.toElement.className == 'drop-spec2') {
- let specArray = duplicate(this.object.data.data.specincrease);
- specArray.push(newItem);
- await this.object.update({ 'data.specincrease': specArray });
- }
- }
-
- /* -------------------------------------------- */
- async addRolePerk(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- console.log("Add spec", event, newItem);
- if (event.toElement.className == 'drop-perk2') {
- let perkArray = duplicate(this.object.data.data.perks);
- perkArray.push(newItem);
- await this.object.update({ 'data.perks': perkArray });
- }
- if (event.toElement.className == 'drop-specialperk1') {
- let perkArray = duplicate(this.object.data.data.specialperk);
- perkArray.push(newItem);
- await this.object.update({ 'data.specialperk': perkArray });
- }
- }
-
- /* -------------------------------------------- */
- async addPower(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-spec-power') {
- let powArray = duplicate(this.object.data.data.powers);
- powArray.push(newItem);
- await this.object.update({ 'data.powers': powArray });
- }
- }
-
- /* -------------------------------------------- */
- async addAbilityPower(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-ability-power') {
- let powArray = duplicate(this.object.data.data.powersgained);
- powArray.push(newItem);
- await this.object.update({ 'data.powersgained': powArray });
- }
- }
- /* -------------------------------------------- */
- async addAbilityEffect(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-ability-effect') {
- let powArray = duplicate(this.object.data.data.effectsgained);
- powArray.push(newItem);
- await this.object.update({ 'data.effectsgained': powArray });
- }
- }
-
- /* -------------------------------------------- */
- async addAbilitySpec(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-ability-spec') {
- let powArray = duplicate(this.object.data.data.specialisations);
- powArray.push(newItem);
- await this.object.update({ 'data.specialisations': powArray });
- }
- }
- /* -------------------------------------------- */
- async addAbilityWeaponArmor(event, item, dataItem) {
- let newItem = duplicate(item.data);
- newItem._id = randomID(dataItem.id.length);
- if (event.toElement.className == 'drop-ability-weapon') {
- let weaponArray = duplicate(this.object.data.data.attackgained);
- weaponArray.push(newItem);
- await this.object.update({ 'data.attackgained': weaponArray });
- }
- if (event.toElement.className == 'drop-ability-armor') {
- let armorArray = duplicate(this.object.data.data.armorgained);
- armorArray.push(newItem);
- await this.object.update({ 'data.armorgained': armorArray });
- }
- }
-
- /* -------------------------------------------- */
- async addPerkSpecialisation(event, item, dataItem) {
- let newItem = duplicate(item.data);
- if (event.toElement.className == 'drop-spec-perk') {
- //console.log("PER SPEC", event)
- let key = event.toElement.dataset["key"];
- if (key == 'affectedspec') {
- await this.object.update({ 'data.features.affectedspec.value': newItem.name });
- } else {
- await this.object.update({ 'data.features.gainspecdice.value': newItem.name });
- }
- }
- }
-
- /* -------------------------------------------- */
- async addPerkEffect(event, item, dataItem) {
- let newItem = duplicate(item.data)
- if (event.toElement.className == 'drop-perk-effect') {
- let effectArray = duplicate(this.object.data.data.effectsgained)
- effectArray.push(newItem)
- await this.object.update({ 'data.effectsgained': effectArray })
- }
- }
-
- /* -------------------------------------------- */
- async addEffectPower(event, item, dataItem) {
- let newItem = duplicate(item.data)
- if (event.toElement.className == 'drop-power-effect') {
- let effectArray = duplicate(this.object.data.data.effectsgained)
- effectArray.push(newItem);
- await this.object.update({ 'data.effectsgained': effectArray })
- }
- }
-
- /* -------------------------------------------- */
- async addEffectSpec(event, item, dataItem) {
- let newItem = duplicate(item.data);
- if (event.toElement.className == 'drop-effect-spec') {
- let specArray = duplicate(this.object.data.data.recoveryrollspec);
- specArray.push(newItem);
- await this.object.update({ 'data.recoveryrollspec': specArray });
- }
- if (event.toElement.className == 'drop-effect-specaffected') {
- let specArray = duplicate(this.object.data.data.specaffected);
- specArray.push(newItem);
- await this.object.update({ 'data.specaffected': specArray });
- }
- }
-
- /* -------------------------------------------- */
- async addEffectItem(event, item, dataItem) {
- let newItem = duplicate(item.data);
- if (event.toElement.className == 'drop-equipment-effect') {
- let effectArray = duplicate(this.object.data.data.effects);
- effectArray.push(newItem);
- await this.object.update({ 'data.effects': effectArray });
- }
- }
-
- /* -------------------------------------------- */
- async _onDrop(event) {
-
- if (this.object.type == 'weapon' || this.object.type == 'shield' || this.object.type == 'armor' || this.object.type == 'shield') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'effect') {
- return this.addEffectItem(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'power') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'effect') {
- return this.addEffectPower(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'effect') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'specialisation') {
- return this.addEffectSpec(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'race') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'ability') {
- return this.addAbility(event, item, dataItem);
- }
- if (item.data.type == 'perk') {
- return this.addRacePerk(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'perk') {
- let data = event.dataTransfer.getData('text/plain')
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem)
- if (item.data.type == 'specialisation') {
- return this.addPerkSpecialisation(event, item, dataItem)
- }
- if (item.data.type == 'effect') {
- return this.addPerkEffect(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'specialisation') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'power') {
- return this.addPower(event, item, dataItem);
- }
- }
- }
- if (this.object.type == 'ability') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'effect') {
- return this.addAbilityEffect(event, item, dataItem);
- }
- if (item.data.type == 'power') {
- return this.addAbilityPower(event, item, dataItem);
- }
- if (item.data.type == 'specialisation') {
- return this.addAbilitySpec(event, item, dataItem);
- }
- if (item.data.type == 'weapon' || item.data.type == 'armor') {
- return this.addAbilityWeaponArmor(event, item, dataItem);
- }
- }
- }
-
- if (this.object.type == 'role') {
- let data = event.dataTransfer.getData('text/plain');
- if (data) {
- let dataItem = JSON.parse(data);
- let item = await MournbladeUtility.searchItem(dataItem);
- if (item.data.type == 'specialisation') {
- return this.addRoleSpecialisation(event, item, dataItem);
- }
- if (item.data.type == 'perk') {
- return this.addRolePerk(event, item, dataItem);
- }
- }
- }
-
- ui.notifications.warn("This item can not be dropped over another item");
- }
-
/* -------------------------------------------- */
get template() {
let type = this.item.type;
- return `systems/fvtt-Mournblade-rpg/templates/item-${type}-sheet.html`;
+ return `systems/fvtt-mournblade/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
diff --git a/modules/mournblade-utility.js b/modules/mournblade-utility.js
index 2f9642f..8b0a639 100644
--- a/modules/mournblade-utility.js
+++ b/modules/mournblade-utility.js
@@ -39,6 +39,10 @@ export class MournbladeUtility {
}
+ /* -------------------------------------------- */
+ static getAttributs() {
+ return { adr: "Adresse", pui: "Puissance", cla: "Clairvoyance", pre: "Présence", tre: "Trempe"}
+ }
/* -------------------------------------------- */
static pushInitiativeOptions(html, options) {
}
@@ -82,7 +86,8 @@ export class MournbladeUtility {
static async preloadHandlebarsTemplates() {
const templatePaths = [
- 'systems/fvtt-mournblade/templates/editor-notes-gm.html'
+ 'systems/fvtt-mournblade/templates/editor-notes-gm.html',
+ 'systems/fvtt-mournblade/templates/partial-item-description.html'
]
return loadTemplates(templatePaths);
}
diff --git a/styles/simple.css b/styles/simple.css
index 8e504e8..d8c123b 100644
--- a/styles/simple.css
+++ b/styles/simple.css
@@ -193,7 +193,7 @@ table {border: 1px solid #7a7971;}
/* Styles limited to foundryvtt-vadentis sheets */
-.fvtt-pegasus-rpg .sheet-header {
+.fvtt-mournblade .sheet-header {
-webkit-box-flex: 0;
-ms-flex: 0 0 210px;
flex: 0 0 210px;
@@ -213,7 +213,7 @@ table {border: 1px solid #7a7971;}
margin-bottom: 10px;
}
-.fvtt-pegasus-rpg .sheet-header .profile-img {
+.fvtt-mournblade .sheet-header .profile-img {
-webkit-box-flex: 0;
-ms-flex: 0 0 128px;
flex: 0 0 128px;
@@ -253,34 +253,34 @@ table {border: 1px solid #7a7971;}
vertical-align: bottom;
}
-.fvtt-pegasus-rpg .sheet-header .header-fields {
+.fvtt-mournblade .sheet-header .header-fields {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
}
-.fvtt-pegasus-rpg .sheet-header h1.charname {
+.fvtt-mournblade .sheet-header h1.charname {
height: 50px;
padding: 0px;
margin: 5px 0;
border-bottom: 0;
}
-.fvtt-pegasus-rpg .sheet-header h1.charname input {
+.fvtt-mournblade .sheet-header h1.charname input {
width: 100%;
height: 100%;
margin: 0;
}
-.fvtt-pegasus-rpg .sheet-tabs {
+.fvtt-mournblade .sheet-tabs {
-webkit-box-flex: 0;
-ms-flex: 0;
flex: 0;
}
-.fvtt-pegasus-rpg .sheet-body,
-.fvtt-pegasus-rpg .sheet-body .tab,
-.fvtt-pegasus-rpg .sheet-body .tab .editor {
+.fvtt-mournblade .sheet-body,
+.fvtt-mournblade .sheet-body .tab,
+.fvtt-mournblade .sheet-body .tab .editor {
height: 100%;
font-size: 0.8rem;
}
@@ -303,70 +303,70 @@ table {border: 1px solid #7a7971;}
padding: 0 3px;
}
-.fvtt-pegasus-rpg .tox .tox-editor-container {
+.fvtt-mournblade .tox .tox-editor-container {
background: #fff;
}
-.fvtt-pegasus-rpg .tox .tox-edit-area {
+.fvtt-mournblade .tox .tox-edit-area {
padding: 0 8px;
}
-.fvtt-pegasus-rpg .resource-label {
+.fvtt-mournblade .resource-label {
font-weight: bold;
text-transform: uppercase;
}
-.fvtt-pegasus-rpg .tabs {
+.fvtt-mournblade .tabs {
height: 40px;
border-top: 1px solid #AAA;
border-bottom: 1px solid #AAA;
color: #000000;
}
-.fvtt-pegasus-rpg .tabs .item {
+.fvtt-mournblade .tabs .item {
line-height: 40px;
font-weight: bold;
}
-.fvtt-pegasus-rpg .tabs .item.active {
+.fvtt-mournblade .tabs .item.active {
text-decoration: underline;
text-shadow: none;
}
-.fvtt-pegasus-rpg .items-list {
+.fvtt-mournblade .items-list {
list-style: none;
margin: 1px 0;
padding: 0;
overflow-y: auto;
}
-.fvtt-pegasus-rpg .items-list .item-header {
+.fvtt-mournblade .items-list .item-header {
font-weight: bold;
}
-.fvtt-pegasus-rpg .items-list .item {
+.fvtt-mournblade .items-list .item {
height: 30px;
line-height: 24px;
padding: 1px 0;
border-bottom: 1px solid #BBB;
}
-.fvtt-pegasus-rpg .items-list .item .item-image {
+.fvtt-mournblade .items-list .item .item-image {
-webkit-box-flex: 0;
-ms-flex: 0 0 24px;
flex: 0 0 24px;
margin-right: 5px;
}
-.fvtt-pegasus-rpg .items-list .item img {
+.fvtt-mournblade .items-list .item img {
display: block;
}
-.fvtt-pegasus-rpg .items-list .item-name {
+.fvtt-mournblade .items-list .item-name {
margin: 0;
}
-.fvtt-pegasus-rpg .items-list .item-controls {
+.fvtt-mournblade .items-list .item-controls {
-webkit-box-flex: 0;
-ms-flex: 0 0 86px;
flex: 0 0 86px;
@@ -377,10 +377,10 @@ table {border: 1px solid #7a7971;}
/* ======================================== */
/* Sheet */
.window-app.sheet .window-content .sheet-header{
- background: url("../images/ui/pc_sheet_bg.webp")
+ /*background: #011d33 url("../images/ui/fond1.webp") repeat left top;*/
+ background: url("../assets/ui/pc_sheet_bg.webp")
+ /*color: rgba(168, 139, 139, 0.5);*/
}
-/* background: #011d33 url("../images/ui/fond1.webp") repeat left top;*/
-/*color: rgba(168, 139, 139, 0.5);*/
.window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] {
color: rgba(36, 37, 37, 0.75);
@@ -391,7 +391,7 @@ table {border: 1px solid #7a7971;}
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
font-size: 0.8rem;
- background: url("../images/ui/pc_sheet_bg.webp") repeat left top;
+ background: url("../assets/ui/pc_sheet_bg.webp") repeat left top;
}
/* background: rgba(245,245,240,0.6) url("../images/ui/sheet_background.webp") left top;*/
diff --git a/system.json b/system.json
index a7691e4..cda9f5b 100644
--- a/system.json
+++ b/system.json
@@ -40,9 +40,9 @@
"styles": [
"styles/simple.css"
],
- "templateVersion": 1,
+ "templateVersion": 2,
"title": "Mournblade",
"url": "",
- "version": "0.0.1",
+ "version": "0.0.2",
"background": "./images/ui/mournblade_welcome.webp"
}
\ No newline at end of file
diff --git a/template.json b/template.json
index 2719b4a..1dea424 100644
--- a/template.json
+++ b/template.json
@@ -102,6 +102,17 @@
},
"types": [ "arme", "competence", "protection", "pacte", "traitchaotique", "monnaie", "don", "tendance", "rune"],
"arme": {
+ "typearme": "",
+ "bonusmaniementoff": 0,
+ "bonusmaniementdef": 0,
+ "degats": "",
+ "deuxmains": false,
+ "courte": 0,
+ "moyenne": 0,
+ "longue": 0,
+ "tr": 0,
+ "rarete": 0,
+ "prix": 0,
"templates": [ "base" ]
},
"predilection": {
@@ -110,10 +121,17 @@
},
"competence": {
"niveau": 0,
- "attribut": "",
+ "attribut1": "",
+ "attribut2": "",
+ "attribut3": "",
"templates": [ "base" ]
},
"protection": {
+ "typeprotection": "",
+ "protection": 0,
+ "bonusmaniementdef": 0,
+ "rarete": 0,
+ "prix": 0,
"templates": [ "base" ]
},
"pacte": {
@@ -126,12 +144,19 @@
"templates": [ "base" ]
},
"don": {
+ "allegeance": "",
+ "prerequis": "",
+ "sacrifice": "",
"templates": [ "base" ]
},
"tendance": {
"templates": [ "base" ]
},
"rune": {
+ "formule": "",
+ "seuil": 0,
+ "prononcee": "",
+ "tracee": "",
"templates": [ "base" ]
}
}
diff --git a/templates/actor-partial-ames.html b/templates/actor-partial-ames.html
deleted file mode 100644
index 2250f5d..0000000
--- a/templates/actor-partial-ames.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
- {{typedata.label}}
-