Standardisation inventaire et prix
Les objets d'inventaire ont maintenant tous: coût, encombrement, qualité, quantité Le coût est toujours exprimé en sols, y compris pour les monnaies. Les paiements et achat-ventes sont fait en sols.
This commit is contained in:
parent
7557d33c73
commit
b7a8b0c08d
@ -1359,10 +1359,10 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computePrixTotalEquipement() {
|
||||
const deniers = this.items.filter(it => it.isEquipement())
|
||||
.map(it => it.prixTotalDeniers())
|
||||
const valeur = this.items.filter(it => it.isEquipement())
|
||||
.map(it => it.valeurTotale())
|
||||
.reduce(Misc.sum(), 0);
|
||||
return deniers / 100;
|
||||
return valeur / 100;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3586,36 +3586,20 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async depenserDeniers(depense, dataObj = undefined, quantite = 1, toActorId) {
|
||||
async payerSols(depense) {
|
||||
depense = Number(depense);
|
||||
let fortune = this.getFortune();
|
||||
console.log("depenserDeniers", game.user.character, depense, fortune);
|
||||
let msg = "";
|
||||
if (depense == 0) {
|
||||
if (dataObj) {
|
||||
dataObj.payload.system.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
||||
dataObj.payload.system.quantite = quantite;
|
||||
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
||||
msg += `<br>L'objet <strong>${dataObj.payload.name}</strong> a été ajouté gratuitement à votre inventaire.`;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (fortune >= depense) {
|
||||
const toActor = game.actors.get(toActorId)
|
||||
await toActor?.ajouterDeniers(depense, this.id);
|
||||
await Monnaie.optimiser(this, fortune - depense);
|
||||
msg = `Vous avez payé <strong>${depense} Deniers</strong>${toActor ? " à " + toActor.name : ''}, qui ont été soustraits de votre argent.`;
|
||||
RdDAudio.PlayContextAudio("argent"); // Petit son
|
||||
|
||||
if (dataObj) {
|
||||
dataObj.payload.system.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
||||
dataObj.payload.system.quantite = quantite;
|
||||
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
||||
msg += `<br>Et l'objet <strong>${dataObj.payload.name}</strong> a été ajouté à votre inventaire.`;
|
||||
}
|
||||
} else {
|
||||
msg = "Vous n'avez pas assez d'argent pour payer cette somme !";
|
||||
}
|
||||
let fortune = this.getFortune();
|
||||
console.log("payer", game.user.character, depense, fortune);
|
||||
let msg = "";
|
||||
if (fortune >= depense) {
|
||||
await Monnaie.optimiserFortune(this, fortune - depense);
|
||||
msg = `Vous avez payé <strong>${depense} Sols</strong>, qui ont été soustraits de votre argent.`;
|
||||
RdDAudio.PlayContextAudio("argent"); // Petit son
|
||||
} else {
|
||||
msg = "Vous n'avez pas assez d'argent pour payer cette somme !";
|
||||
}
|
||||
|
||||
let message = {
|
||||
@ -3625,38 +3609,38 @@ export class RdDActor extends Actor {
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
|
||||
async depenser(depense) {
|
||||
let reste = this.getFortune() - Number.parseInt(depense);
|
||||
async depenserSols(sols) {
|
||||
let reste = this.getFortune() - Number(sols);
|
||||
if (reste >= 0) {
|
||||
await Monnaie.optimiser(this, reste);
|
||||
await Monnaie.optimiserFortune(this, reste);
|
||||
}
|
||||
return reste;
|
||||
}
|
||||
|
||||
async ajouterDeniers(gain, fromActorId = undefined) {
|
||||
gain = Number.parseInt(gain);
|
||||
if (gain < 0) {
|
||||
ui.notifications.error(`Impossible d'ajouter un gain de ${gain} <0`);
|
||||
async ajouterSols(sols, fromActorId = undefined) {
|
||||
sols = Number(sols);
|
||||
if (sols == 0) {
|
||||
return;
|
||||
}
|
||||
if (gain == 0) {
|
||||
if (sols < 0) {
|
||||
ui.notifications.error(`Impossible d'ajouter un gain de ${sols} <0`);
|
||||
return;
|
||||
}
|
||||
if (fromActorId && !game.user.isGM) {
|
||||
RdDActor.remoteActorCall({
|
||||
userId: Misc.connectedGMOrUser(),
|
||||
actorId: this.id,
|
||||
method: 'ajouterDeniers', args: [gain, fromActorId]
|
||||
method: 'ajouterSols', args: [sols, fromActorId]
|
||||
});
|
||||
}
|
||||
else {
|
||||
const fromActor = game.actors.get(fromActorId)
|
||||
await Monnaie.optimiser(this, gain + this.getFortune());
|
||||
await Monnaie.optimiserFortune(this, sols + this.getFortune());
|
||||
|
||||
RdDAudio.PlayContextAudio("argent"); // Petit son
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `Vous avez reçu <strong>${gain} Deniers</strong> ${fromActor ? " de " + fromActor.name : ''}, qui ont été ajoutés à votre argent.`
|
||||
content: `Vous avez reçu <strong>${sols} Sols</strong> ${fromActor ? " de " + fromActor.name : ''}, qui ont été ajoutés à votre argent.`
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -3690,23 +3674,23 @@ export class RdDActor extends Actor {
|
||||
const itemId = vente.item._id;
|
||||
const isItemEmpilable = "quantite" in vente.item.system;
|
||||
|
||||
const coutDeniers = Math.floor((achat.prixTotal ?? 0) * 100);
|
||||
const cout = Number(achat.prixTotal ?? 0);
|
||||
achat.quantiteTotal = (achat.choix.nombreLots ?? 1) * (vente.tailleLot);
|
||||
if (acheteur) {
|
||||
let resteAcheteur = await acheteur.depenser(coutDeniers);
|
||||
let resteAcheteur = await acheteur.depenserSols(cout);
|
||||
if (resteAcheteur < 0) {
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(coutDeniers / 100)} sols !`);
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(cout / 100)} sols !`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const itemVendu = vendeur?.getObjet(itemId);
|
||||
if (itemVendu) {
|
||||
if (isItemEmpilable ? (itemVendu.system.quantite < achat.quantiteTotal) : (achat.choix.nombreLots != 1)) {
|
||||
await acheteur?.ajouterDeniers(coutDeniers);
|
||||
await acheteur?.ajouterSols(cout);
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Le vendeur n'a plus assez de ${vente.item.name} !`);
|
||||
return;
|
||||
}
|
||||
vendeur.ajouterDeniers(coutDeniers);
|
||||
vendeur.ajouterSols(cout);
|
||||
let resteQuantite = (itemVendu.system.quantite ?? 1) - achat.quantiteTotal;
|
||||
if (resteQuantite == 0) {
|
||||
vendeur.deleteEmbeddedDocuments("Item", [itemId])
|
||||
@ -3729,7 +3713,7 @@ export class RdDActor extends Actor {
|
||||
await acheteur.consommerNourritureboisson(items[0].id, achat.choix, vente.actingUserId);
|
||||
}
|
||||
}
|
||||
if (coutDeniers > 0) {
|
||||
if (cout > 0) {
|
||||
RdDAudio.PlayContextAudio("argent");
|
||||
}
|
||||
const chatAchatItem = duplicate(vente);
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
import { Monnaie } from "./item-monnaie.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
export class DialogItemAchat extends Dialog {
|
||||
@ -19,7 +18,7 @@ export class DialogItemAchat extends Dialog {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const prixLot = Monnaie.arrondiDeniers(button.attributes['data-prixLot']?.value ?? 0);
|
||||
const prixLot = Number(button.attributes['data-prixLot']?.value ?? 0);
|
||||
return {
|
||||
item: json ? JSON.parse(json) : undefined,
|
||||
actingUserId: game.user.id,
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
export class DialogItemVente extends Dialog {
|
||||
|
||||
|
@ -4,22 +4,22 @@ import { LOG_HEAD } from "./constants.js";
|
||||
const MONNAIE_ETAIN = {
|
||||
name: "Etain (1 denier)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
|
||||
system: { quantite: 0, cout: 1, encombrement: 0.001, description: "" }
|
||||
system: { quantite: 0, cout: 0.01, encombrement: 0.001, description: "" }
|
||||
};
|
||||
const MONNAIE_BRONZE = {
|
||||
name: "Bronze (10 deniers)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp",
|
||||
system: { quantite: 0, cout: 10, encombrement: 0.002, description: "" }
|
||||
system: { quantite: 0, cout: 0.10, encombrement: 0.002, description: "" }
|
||||
};
|
||||
const MONNAIE_ARGENT = {
|
||||
name: "Argent (1 sol)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_argent_sol.webp",
|
||||
system: { quantite: 0, cout: 100, encombrement: 0.003, description: "" }
|
||||
system: { quantite: 0, cout: 1, encombrement: 0.003, description: "" }
|
||||
};
|
||||
const MONNAIE_OR = {
|
||||
name: "Or (10 sols)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_or_sol.webp",
|
||||
system: { quantite: 0, cout: 1000, encombrement: 0.004, description: "" }
|
||||
system: { quantite: 0, cout: 10, encombrement: 0.004, description: "" }
|
||||
};
|
||||
|
||||
const MONNAIES_STANDARD = [MONNAIE_ETAIN, MONNAIE_BRONZE, MONNAIE_ARGENT, MONNAIE_OR];
|
||||
@ -40,15 +40,15 @@ export class Monnaie {
|
||||
}
|
||||
|
||||
static deValeur(monnaie, valeur) {
|
||||
return valeur == monnaie.system.cout
|
||||
return Monnaie.valEntiere(valeur) == Monnaie.valEntiere(monnaie.system.cout)
|
||||
}
|
||||
|
||||
static arrondiDeniers(sols) {
|
||||
return Number(sols).toFixed(2);
|
||||
static valEntiere(sols) {
|
||||
return Math.max(Math.floor((sols??0)*100), 0);
|
||||
}
|
||||
|
||||
static triValeurDenier() {
|
||||
return Misc.ascending(item => item.system.cout)
|
||||
static triValeurEntiere() {
|
||||
return Misc.ascending(item => Monnaie.valEntiere(item.system.cout))
|
||||
}
|
||||
|
||||
static async creerMonnaiesStandard(actor) {
|
||||
@ -65,28 +65,28 @@ export class Monnaie {
|
||||
return deniers;
|
||||
}
|
||||
|
||||
static async optimiser(actor, fortune) {
|
||||
let reste = fortune;
|
||||
static async optimiserFortune(actor, fortune) {
|
||||
let resteEnDeniers = Math.round(fortune*100);
|
||||
let monnaies = actor.itemTypes['monnaie'];
|
||||
let updates = [];
|
||||
let parValeur = Misc.classifyFirst(monnaies, it => it.system.cout);
|
||||
for (let valeur of [1000, 100, 10, 1]) {
|
||||
const itemPiece = parValeur[valeur];
|
||||
let parValeur = Misc.classifyFirst(monnaies, it => Monnaie.valEntiere(it.system.cout));
|
||||
for (let valeurDeniers of [1000, 100, 10, 1]) {
|
||||
const itemPiece = parValeur[valeurDeniers];
|
||||
if (itemPiece) {
|
||||
const quantite = Math.floor(reste / valeur);
|
||||
const quantite = Math.floor(resteEnDeniers / valeurDeniers);
|
||||
if (quantite != itemPiece.system.quantite) {
|
||||
updates.push({ _id: parValeur[valeur].id, 'system.quantite': quantite });
|
||||
updates.push({ _id: parValeur[valeurDeniers].id, 'system.quantite': quantite });
|
||||
}
|
||||
reste -= quantite*valeur;
|
||||
resteEnDeniers -= quantite*valeurDeniers;
|
||||
}
|
||||
}
|
||||
console.log('Monnaie.optimiser', actor.name, 'total', fortune, 'parValeur', parValeur, 'updates', updates, 'reste', reste);
|
||||
console.log('Monnaie.optimiserFortune', actor.name, 'total', fortune, 'parValeur', parValeur, 'updates', updates, 'reste', resteEnDeniers);
|
||||
if (updates.length > 0) {
|
||||
await actor.updateEmbeddedDocuments('Item', updates);
|
||||
}
|
||||
if (reste > 0){
|
||||
if (resteEnDeniers > 0){
|
||||
// créer le reste en deniers fortune en deniers
|
||||
await Monnaie.creerMonnaiesDeniers(actor, reste);
|
||||
await Monnaie.creerMonnaiesDeniers(actor, resteEnDeniers);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { DialogItemVente } from "./dialog-item-vente.js";
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { Monnaie } from "./item-monnaie.js";
|
||||
import { RdDHerbes } from "./rdd-herbes.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
@ -69,6 +70,30 @@ export class RdDItem extends Item {
|
||||
return defaultItemImg[itemType];
|
||||
}
|
||||
|
||||
static isEquipementFieldEditable(type, field) {
|
||||
switch (field) {
|
||||
case 'quantite':
|
||||
if (['conteneur'].includes(type)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'cout':
|
||||
if(['monnaie'].includes(type)){
|
||||
return game.user.isGM;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static getUniteQuantite(type) {
|
||||
switch (type) {
|
||||
case "monnaie": return "(Pièces)"
|
||||
case "herbe": return "(Brins)"
|
||||
case "ingredient": return "(Pépins ou Brins)"
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
constructor(itemData, context) {
|
||||
if (!itemData.img) {
|
||||
@ -167,12 +192,12 @@ export class RdDItem extends Item {
|
||||
return Math.max(this.system.encombrement ?? 0, 0);
|
||||
}
|
||||
|
||||
prixTotalDeniers() {
|
||||
return this.getQuantite() * this.valeurDeniers()
|
||||
valeurTotale() {
|
||||
return this.getQuantite() * this.valeur()
|
||||
}
|
||||
|
||||
valeurDeniers() {
|
||||
return Math.max(Math.round(this.system.cout ? (this.system.cout * 100) : (this.system.cout ?? 0)), 0)
|
||||
valeur() {
|
||||
return this.system.cout ?? 0
|
||||
}
|
||||
|
||||
prepareDerivedData() {
|
||||
@ -494,7 +519,7 @@ export class RdDItem extends Item {
|
||||
/* -------------------------------------------- */
|
||||
_monnaieChatData() {
|
||||
return [
|
||||
`<b>Valeur en Deniers</b>: ${this.system.cout}`,
|
||||
`<b>Valeur en Sols</b>: ${this.system.cout}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
}
|
||||
@ -564,5 +589,4 @@ export class RdDItem extends Item {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -235,8 +235,8 @@ class _10_3_0_Inventaire extends Migration {
|
||||
}
|
||||
_updatesMonnaies(items) {
|
||||
return items
|
||||
.filter(it => ['monnaie'].includes(it.type))
|
||||
.map(it => { return { _id: it.id, 'system.cout': it.system.valeur_deniers, 'system.valeur_deniers': undefined } });
|
||||
.filter(it => ['monnaie'].includes(it.type) && it.system.cout == undefined)
|
||||
.map(it => { return { _id: it.id, 'system.cout': it.system.valeur_deniers / 100, 'system.valeur_deniers': undefined } });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,6 +169,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-suivants.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.html',
|
||||
//Items
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/header-item.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',
|
||||
@ -323,6 +324,8 @@ export class RdDUtility {
|
||||
})
|
||||
);
|
||||
Handlebars.registerHelper('linkCompendium', (compendium, id, name) => `@Compendium[${compendium}.${id}]{${name}}`);
|
||||
Handlebars.registerHelper('uniteQuantite', (type) => RdDItem.getUniteQuantite(type));
|
||||
Handlebars.registerHelper('isEquipementFieldEditable', (type, field) => RdDItem.isEquipementFieldEditable(type, field));
|
||||
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
@ -459,7 +462,7 @@ export class RdDUtility {
|
||||
formData.ingredients = this.arrayOrEmpty(itemTypes['ingredient']);
|
||||
formData.herbes = this.arrayOrEmpty(itemTypes['herbe']);
|
||||
formData.monnaie = this.arrayOrEmpty(itemTypes['monnaie']);
|
||||
formData.monnaie.sort(Monnaie.triValeurDenier());
|
||||
formData.monnaie.sort(Monnaie.triValeurEntiere());
|
||||
formData.nourritureboissons = this.arrayOrEmpty(itemTypes['nourritureboisson']);
|
||||
formData.gemmes = this.arrayOrEmpty(itemTypes['gemme']);
|
||||
|
||||
@ -828,17 +831,10 @@ export class RdDUtility {
|
||||
|
||||
// Gestion du bouton payer
|
||||
html.on("click", '.payer-button', event => {
|
||||
let sumdenier = event.currentTarget.attributes['data-somme-denier']?.value ?? 0;
|
||||
let quantite = event.currentTarget.attributes['data-quantite']?.value ?? 1;
|
||||
let fromActorId = event.currentTarget.attributes['data-actor-id']?.value;
|
||||
let jsondata = event.currentTarget.attributes['data-jsondata']
|
||||
let objData
|
||||
if (jsondata) {
|
||||
objData = JSON.parse(jsondata.value)
|
||||
}
|
||||
let sommeAPayer = Number(event.currentTarget.attributes['data-somme-a-payer']?.value ?? 0);
|
||||
let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:");
|
||||
if (actor) {
|
||||
actor.depenserDeniers(sumdenier, objData, quantite, fromActorId);
|
||||
actor.payerSols(sommeAPayer);
|
||||
ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget));
|
||||
}
|
||||
});
|
||||
@ -906,20 +902,20 @@ export class RdDUtility {
|
||||
static afficherDemandePayer(som1, som2) {
|
||||
som1 = (som1) ? som1.toLowerCase() : "0d";
|
||||
som2 = (som2) ? som2.toLowerCase() : "0d";
|
||||
let regExp = /(\d+)(\w+)/g;
|
||||
let p1 = regExp.exec(som1);
|
||||
regExp = /(\d+)(\w+)/g;
|
||||
let p2 = regExp.exec(som2);
|
||||
let sumd = 0;
|
||||
let sums = 0;
|
||||
if (p1[2] == 'd') sumd += Number(p1[1]);
|
||||
if (p1[2] == 's') sums += Number(p1[1]);
|
||||
if (p2[2] == 'd') sumd += Number(p2[1]);
|
||||
if (p2[2] == 's') sums += Number(p2[1]);
|
||||
let regExp1 = /(\d+)(\w+)/g;
|
||||
let p1 = regExp1.exec(som1);
|
||||
let regExp2 = /(\d+)(\w+)/g;
|
||||
let p2 = regExp2.exec(som2);
|
||||
let deniers = 0;
|
||||
let sols = 0;
|
||||
if (p1[2] == 'd') deniers += Number(p1[1]);
|
||||
if (p1[2] == 's') sols += Number(p1[1]);
|
||||
if (p2[2] == 'd') deniers += Number(p2[1]);
|
||||
if (p2[2] == 's') sols += Number(p2[1]);
|
||||
|
||||
let sumtotald = sumd + (sums * 100);
|
||||
let msgPayer = "La somme de " + sums + " Sols et " + sumd + " Deniers est à payer, cliquer sur le lien ci-dessous si besoin.<br>";
|
||||
msgPayer += "<a class='payer-button chat-card-button' data-somme-denier='" + sumtotald + "'>Payer</a>"
|
||||
let sommeAPayer = sols + deniers/100;
|
||||
let msgPayer = `La somme de ${sols} Sols et ${deniers} Deniers est à payer<br>
|
||||
<a class='payer-button chat-card-button' data-somme-a-payer='${sommeAPayer}'>Payer</a>`
|
||||
ChatMessage.create({ content: msgPayer });
|
||||
}
|
||||
|
||||
|
@ -552,18 +552,6 @@
|
||||
"label": "Experience",
|
||||
"isInput": true
|
||||
}
|
||||
},
|
||||
"argent": {
|
||||
"deniers": {
|
||||
"label": "Denier",
|
||||
"value": 0,
|
||||
"enc": 0
|
||||
},
|
||||
"sols": {
|
||||
"label": "Sol",
|
||||
"value": 0,
|
||||
"enc": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -46,10 +46,7 @@
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.encombrement">Encombrement </label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="system.force">Force min. </label>
|
||||
<input class="attribute-value" type="text" name="system.force" value="{{system.force}}" data-dtype="String"/>
|
||||
@ -82,10 +79,6 @@
|
||||
<label for="system.penetration">Pénétration </label>
|
||||
<input class="attribute-value" type="text" name="system.penetration" value="{{system.penetration}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="system.cout">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.magique">Magique ? </label>
|
||||
<input class="attribute-value" type="checkbox" name="system.magique" {{#if system.magique}}checked{{/if}}/>
|
||||
@ -107,8 +100,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
@ -4,26 +4,18 @@
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Protection</label>
|
||||
<label for="system.protection">Protection</label>
|
||||
<input class="attribute-value" type="text" name="system.protection" value="{{system.protection}}" data-dtype="String"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement </label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Détérioration</label>
|
||||
<label for="system.deterioration">Détérioration</label>
|
||||
<input class="attribute-value" type="text" name="system.deterioration" value="{{system.deterioration}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Malus Armure </label>
|
||||
<label for="system.malus">Malus Armure </label>
|
||||
<input class="attribute-value" type="text" name="system.malus" value="{{system.malus}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
||||
|
@ -3,21 +3,11 @@
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement </label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Capacite (points d'Encombrement portable)</label>
|
||||
<label for="xp">Capacite (points d'Enc.)</label>
|
||||
<input class="attribute-value" type="text" name="system.capacite" value="{{system.capacite}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Qualité</label>
|
||||
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
|
||||
{{#if isOwned}}
|
||||
<div class="flexcol">
|
||||
<span><label>Contenu : </label></span>
|
||||
@ -33,7 +23,6 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
||||
|
@ -18,18 +18,6 @@
|
||||
<label>Pureté</label>
|
||||
<input class="attribute-value" type="text" name="system.purete" value="{{system.purete}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Qualité</label>
|
||||
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Inertie</label>
|
||||
<input class="attribute-value" type="text" name="system.inertie" value="{{system.inertie}}" data-dtype="Number" disabled/>
|
||||
@ -38,11 +26,7 @@
|
||||
<label>Enchantabilité</label>
|
||||
<input class="attribute-value" type="text" name="system.enchantabilite" value="{{system.enchantabilite}}" data-dtype="Number" disabled/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Prix</label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" disabled/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
@ -18,14 +18,6 @@
|
||||
<label>Niveau (si applicable)</label>
|
||||
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité (Pépins ou Brins)</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label>Prix (sols)</label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Milieu</label>
|
||||
<input class="attribute-value" type="text" name="system.milieu" value="{{system.milieu}}" data-dtype="String" />
|
||||
@ -47,6 +39,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
|
||||
</div>
|
||||
|
@ -3,23 +3,9 @@
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="flexcol">
|
||||
<div class="form-group">
|
||||
<label>Niveau (si applicable) </label>
|
||||
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité (Pépins ou Brins)</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label>Prix (sols)</label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Niveau (si applicable) </label>
|
||||
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Milieu</label>
|
||||
@ -42,6 +28,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
@ -45,21 +45,8 @@
|
||||
<label for="xp">Niveau maximum</label>
|
||||
<input class="attribute-value" type="text" name="system.niveau_maximum" value="{{system.niveau_maximum}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement </label>
|
||||
<input class="attribute-value" type="number" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité </label>
|
||||
<input class="attribute-value" type="number" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="number" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
@ -1,24 +1,7 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Quantité</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Valeur en Deniers</label>
|
||||
{{#if isGM}}
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
{{else}}
|
||||
<label for="xp">{{system.cout}}</label>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
||||
|
@ -2,23 +2,7 @@
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement </label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité </label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Qualité</label>
|
||||
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
||||
|
@ -26,28 +26,11 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
<label for="system.qualite">Qualité</label>
|
||||
<input class="attribute-value" type="text" name="dasystemta.qualite" value="{{system.qualite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.exotisme">Exotisme</label>
|
||||
<input class="attribute-value" type="text" name="system.exotisme" value="{{system.exotisme}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.encombrement">Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.quantite">Quantité</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="system.cout">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
@ -2,23 +2,7 @@
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Encombrement </label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité </label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Qualité</label>
|
||||
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="xp">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
</section>
|
||||
</form>
|
||||
|
@ -13,18 +13,6 @@
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label>Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Quantité </label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label>Prix (sols)</label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Fréquence</label>
|
||||
<select name="system.rarete" class="rarete" data-dtype="String">
|
||||
@ -111,8 +99,8 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}
|
||||
|
||||
</section>
|
||||
|
||||
</form>
|
20
templates/item/partial-inventaire.html
Normal file
20
templates/item/partial-inventaire.html
Normal file
@ -0,0 +1,20 @@
|
||||
<div class="form-group">
|
||||
<label for="system.qualite">Qualité</label>
|
||||
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"
|
||||
{{#unless (isEquipementFieldEditable type 'qualite')}}disabled{{/unless}}/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.encombrement">Encombrement</label>
|
||||
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"
|
||||
{{#unless (isEquipementFieldEditable type 'encombrement')}}disabled{{/unless}}/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.quantite">Quantité {{uniteQuantite type}}</label>
|
||||
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number"
|
||||
{{#unless (isEquipementFieldEditable type 'quantite')}}disabled{{/unless}}/>
|
||||
</div>
|
||||
<div class="form-group item-cout">
|
||||
<label for="system.cout">Prix (sols) </label>
|
||||
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"
|
||||
{{#unless (isEquipementFieldEditable type 'cout')}}disabled{{/unless}}/>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user