Compare commits

...

6 Commits

Author SHA1 Message Date
6aa63f9a98 Better chat result + hide some compendiums 2023-05-09 21:18:44 +02:00
861aa19637 Update releas 2023-03-14 20:41:31 +01:00
ddb3f9dee1 Various fixes 2023-03-14 18:40:44 +01:00
da074d6ea1 Various fixes 2023-03-14 09:15:08 +01:00
1c0c722bd0 Various fixes 2023-03-14 09:14:59 +01:00
fef42b7093 Various fixes 2023-03-14 09:14:28 +01:00
12 changed files with 173 additions and 39 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.history/

View File

@@ -10,7 +10,7 @@ Books are mandatory to play and are available at : http://www.titam-france.fr
Système non-officiel pour le JDR Mournblade (Titam France).
Ce système a été autorisé par Ludospherik ( http://www.ludospherik.fr/ ), merci à eux !
Ce système a été autorisé par Le Département des Sombres Projets, merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr

27
lang/fr.json Normal file
View File

@@ -0,0 +1,27 @@
{
"ACTOR": {
"TypePersonnage": "Personnage",
"TypePNJ": "PNJ"
},
"ITEM": {
"TypeArme": "Arme",
"TypeCompetence": "Compétence",
"TypeProtection": "Protection",
"TypePacte": "Pacte",
"TypeTraitchaotique": "Trait Chaotique",
"TypeMonnaie": "Monnaie",
"TypeDon": "Don",
"TypeTendance": "Tendance",
"TypeRune": "Rune",
"TypeEquipement": "Equipement",
"TypeCapacite": "Capacité",
"TypeOrigine": "Origine",
"TypeHeritage": "Héritage",
"TypeMetier": "Métier",
"TypeRuneeffect": "Effet de Rune",
"TypeBouclier": "Bouclier"
}
}

View File

@@ -48,11 +48,13 @@ export class MournbladeActorSheet extends ActorSheet {
marge: this.actor.getMarge(),
tendances:duplicate(this.actor.getTendances()),
runes:duplicate(this.actor.getRunes()),
traitsChaotiques:duplicate(this.actor.getTraitsChaotiques()),
origine: duplicate(this.actor.getOrigine() || {}),
heritage: duplicate(this.actor.getHeritage() || {}),
metier: duplicate(this.actor.getMetier() || {}),
combat: this.actor.getCombatValues(),
equipements: duplicate(this.actor.getEquipments()),
monnaies: duplicate(this.actor.getMonnaies()),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
options: this.options,
owner: this.document.isOwner,
@@ -131,6 +133,15 @@ export class MournbladeActorSheet extends ActorSheet {
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity( li.data("item-id"), value );
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {

View File

@@ -96,27 +96,36 @@ export class MournbladeActor extends Actor {
armes.push(this.prepareBouclier(arme))
}
}
MournbladeUtility.sortArrayObjectsByName(armes)
return armes
}
/* -------------------------------------------- */
getDons() {
return this.items.filter(item => item.type == "don")
getItemSorted( types) {
let items = this.items.filter(item => types.includes(item.type )) || []
MournbladeUtility.sortArrayObjectsByName(items)
return items
}
getDons() {
return this.getItemSorted(["don"])
}
/* -------------------------------------------- */
getTendances() {
return this.items.filter(item => item.type == "tendance")
return this.getItemSorted(["tendance"])
}
getRunes() {
return this.items.filter(item => item.type == "rune")
return this.getItemSorted(["rune"])
}
/* -------------------------------------------- */
getEquipments() {
return this.items.filter(item => item.type == "equipement")
return this.getItemSorted(["equipement"])
}
getTraitsChaotiques() {
return this.getItemSorted(["traitchaotique"])
}
getMonnaies() {
return this.getItemSorted(["monnaie"])
}
/* -------------------------------------------- */
getArmors() {
return this.items.filter(item => item.type == "protection")
return this.getItemSorted(["protection"])
}
getOrigine() {
return this.items.find(item => item.type == "origine")
@@ -147,17 +156,8 @@ export class MournbladeActor extends Actor {
comp.push(item)
}
}
return comp.sort(function (a, b) {
let fa = a.name.toLowerCase(),
fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
MournbladeUtility.sortArrayObjectsByName(comp)
return comp
}
/* -------------------------------------------- */
@@ -359,11 +359,10 @@ export class MournbladeActor extends Actor {
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantity + incDec;
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]); // pdates one EmbeddedEntity
let newQ = objetQ.system.quantite + incDec;
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantite': newQ }]); // pdates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getCompetence(compId) {
return this.items.get(compId)

View File

@@ -68,7 +68,8 @@ function welcomeMessage() {
content: `<div id="welcome-message-Mournblade"><span class="rdd-roll-part">
<strong>Bienvenue dans les Jeunes Royaumes de Mournblade !</strong>
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Mournblade est jeude rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.<p>
<p>Mournblade est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
}

View File

@@ -67,6 +67,13 @@ export class MournbladeUtility {
return opt.concat("\n")
}
/* -------------------------------------------- */
static sortArrayObjectsByName(myArray) {
myArray.sort((a, b) => {
return a.name.localeCompare(b.name);
})
}
/* -------------------------------------------- */
static getPointAmeOptions() {
let opt = []
@@ -340,6 +347,7 @@ export class MournbladeUtility {
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
rollData.diceResult = myRoll.terms[0].results[0].result
console.log(">>>> ", myRoll)
rollData.finalResult = myRoll.total

View File

@@ -1,7 +1,7 @@
{
"id": "fvtt-mournblade",
"description": "Mournblade RPG for FoundryVTT",
"version": "10.0.12",
"version": "10.0.17",
"authors": [
{
"name": "Uberwald/LeRatierBretonnien",
@@ -11,11 +11,19 @@
"esmodules": [
"modules/mournblade-main.js"
],
"languages": [
{
"lang": "fr",
"name": "French",
"path": "lang/fr.json",
"flags": {}
}
],
"gridDistance": 5,
"gridUnits": "m",
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-mournblade/raw/branch/v10/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.12.zip",
"download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.17.zip",
"packs": [
{
"type": "Item",
@@ -104,7 +112,7 @@
"name": "traits-chaotiques",
"path": "packs/traits-chaotiques.db",
"system": "fvtt-mournblade",
"private": false,
"private": true,
"flags": {}
},
{
@@ -122,7 +130,7 @@
"name": "tables",
"path": "packs/tables.db",
"system": "fvtt-mournblade",
"private": false,
"private": true,
"flags": {}
}
],
@@ -137,7 +145,6 @@
"background": "systems/fvtt-mournblade/assets/ui/fond_mournblade.webp",
"compatibility": {
"minimum": "10",
"verified": "10.286",
"maximum": "10"
"verified": "10.288"
}
}

View File

@@ -233,6 +233,8 @@
]
},
"monnaie": {
"quantite": 0,
"unite": "",
"templates": [
"base"
]

View File

@@ -277,7 +277,7 @@
<span class="item-name-label-header">
<h3><label class="items-title-text">Runes</label></h3>
</span>
<span class="item-field-label-short">
<span class="item-field-label-long">
<label class="short-label">Haut parler</label>
</span>
<span class="item-field-label-short">
@@ -291,7 +291,7 @@
<li class="item flexrow " data-item-id="{{rune._id}}" data-item-type="rune">
<img class="item-name-img" src="{{rune.img}}" />
<span class="item-name-label competence-name"><a class="roll-rune">{{rune.name}}</a></span>
<span class="item-field-label-short">{{rune.system.formule}}</span>
<span class="item-field-label-long">{{rune.system.formule}}</span>
<span class="item-field-label-short">{{rune.system.seuil}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
@@ -332,6 +332,30 @@
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Traits Chaotiques</label></h3>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
</div>
</li>
{{#each traitsChaotiques as |trait key|}}
<li class="item flexrow " data-item-id="{{trait._id}}" data-item-type="traitchaotique">
<img class="item-name-img" src="{{trait.img}}" />
<span class="item-name-label competence-name">{{trait.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
@@ -342,6 +366,43 @@
<div class="flexcol">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Richesses et Argent</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Quantité</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Unité</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="monnaie" title="Ajouter une monnaie"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each monnaies as |monnaie key|}}
<li class="item flexrow " data-item-id="{{monnaie._id}}" data-item-type="monnaie">
<img class="item-name-img" src="{{monnaie.img}}" />
<span class="item-name-label competence-name">{{monnaie.name}}</span>
<span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.quantite}}
<a class="quantity-modify plus-minus-button" data-quantite-value="-1">-</a>
<a class="quantity-modify plus-minus-button" data-quantite-value="+1">+</a>
</span>
<span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.unite}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
@@ -413,7 +474,7 @@
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
<a class="item-control item-add" data-type="protection" title="Ajouter une protection"><i
class="fas fa-plus"></i></a>
</div>
</li>
@@ -442,7 +503,7 @@
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
<a class="item-control item-add" data-type="equipement" title="Ajouter un équipement"><i
class="fas fa-plus"></i></a>
</div>
</li>

View File

@@ -40,6 +40,13 @@
{{/if}}
<li>Formule : {{diceFormula}}</li>
<li>Dé : {{diceResult}}</li>
{{#if difficulte}}
<li>Difficulté : {{difficulte}}</li>
{{/if}}
<li></li>
<li>Total : {{finalResult}}</li>
{{#if difficulte}}

View File

@@ -11,6 +11,16 @@
<div class="flexcol">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Quantité : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Unité/Monnaie : </label>
<input type="text" class="padd-right color-class-common" name="system.unite" value="{{data.unite}}" data-dtype="String" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>