Compare commits

..

4 Commits

Author SHA1 Message Date
abae85157b Merge pull request 'v13' (#762) from VincentVk/foundryvtt-reve-de-dragon:v13 into v13
Reviewed-on: #762
2025-06-06 20:42:17 +02:00
da2dca1769 Fix: espaces description Grizzal 2025-06-06 00:35:41 +02:00
6e405ea753 Fix: on peut de nouveau acheter aux commerces 2025-06-06 00:34:58 +02:00
a96f4bf641 Fix templates for new appv2
All checks were successful
Release Creation / build (release) Successful in 1m34s
2025-06-02 23:33:41 +02:00
6 changed files with 45 additions and 46 deletions

View File

@@ -64,13 +64,13 @@ jobs:
system.json
api_key: '${{secrets.ALLOW_PUSH_RELEASE}}'
#- name: Publish to Foundry server
# uses: djlechuck/foundryvtt-publish-package-action@v1
# with:
# token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
# id: 'foundryvtt-reve-de-dragon'
# version: ${{github.event.release.tag_name}}
# manifest: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json'
# notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md'
# compatibility-minimum: '13'
# compatibility-verified: '13'
- name: Publish to Foundry server
uses: djlechuck/foundryvtt-publish-package-action@v1
with:
token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
id: 'foundryvtt-reve-de-dragon'
version: ${{github.event.release.tag_name}}
manifest: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json'
notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md'
compatibility-minimum: '13'
compatibility-verified: '13'

View File

@@ -1,5 +1,10 @@
# 13.0
## 13.0.3 - La dernière auberge d'Illysis
- On peut de nouveau acheter aux commerces
- La description des Grizzal a des espaces
## 13.0.0 - Le début de l'errance d'Illysis
- Migration vers la version 13 de Foundry

View File

@@ -1,6 +1,4 @@
import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js";
import { RdDItem } from "../item.js";
import { RdDUtility } from "../rdd-utility.js";
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
/**
@@ -44,13 +42,8 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
activateListeners(html) {
super.activateListeners(html);
this.html.find('a.item-acheter').click(async event => await this.vente(this.getItem(event)));
this.html.find('.service-acheter').click(async event => await this.vente(this.getItem(event)));
if (!this.options.editable) return;
this.html.find('a.item-quantite-moins').click(async event => await this.getItem(event)?.quantiteIncDec(-1, { supprimerSiZero: false }));
this.html.find('a.item-quantite-plus').click(async event => await this.getItem(event)?.quantiteIncDec(1));
this.html.find('input.item-quantite').change(async event => {
const newQuantite = Math.max(0, Number.parseInt(this.html.find(event.currentTarget).val()));
await this.getItem(event)?.update({ "system.quantite": newQuantite });
@@ -64,28 +57,4 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
getTypesInventaire() {
return RdDItem.getItemTypesInventaire('all');
}
async vente(item) {
const acheteur = RdDUtility.getSelectedActor();
if (!acheteur) {
ui.notifications.warn(`Pas d'acheteur sélectionné`);
return;
}
const disponible = this.actor.getQuantiteDisponible(item)
if (disponible == 0) {
ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`);
return;
}
await DialogItemAchat.onAcheter({
item,
vendeur: this.actor,
acheteur,
quantiteIllimite: disponible == undefined,
nbLots: disponible ?? 1,
tailleLot: 1,
prixLot: item.calculerPrixCommercant()
});
}
}

View File

@@ -1,4 +1,6 @@
import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js";
import { Misc } from "../misc.js";
import { RdDUtility } from "../rdd-utility.js";
import { RdDBaseActor } from "./base-actor.js";
export class RdDCommerce extends RdDBaseActor {
@@ -37,4 +39,27 @@ export class RdDCommerce extends RdDBaseActor {
const pourcentage = this.system.pourcentage ?? 100;
return Misc.keepDecimals(Math.ceil(item.system.cout * pourcentage) / 100, 2);
}
async vente(item) {
const acheteur = RdDUtility.getSelectedActor();
if (!acheteur) {
ui.notifications.warn(`Pas d'acheteur sélectionné`);
return;
}
const disponible = this.getQuantiteDisponible(item)
if (disponible == 0) {
ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`);
return;
}
await DialogItemAchat.onAcheter({
item,
vendeur: this,
acheteur,
quantiteIllimite: disponible == undefined,
nbLots: disponible ?? 1,
tailleLot: 1,
prixLot: item.calculerPrixCommercant()
});
}
}

View File

@@ -1,3 +1,4 @@
import { ACTOR_TYPES } from "../constants.js"
import { Misc } from "../misc.js"
import { RdDSheetUtility } from "../rdd-sheet-utility.js"
import { RdDUtility } from "../rdd-utility.js"
@@ -19,9 +20,8 @@ const _VENDRE = {
}
const _ACHAT_SERVICE = {
code: 'item-service-acheter', label: 'Acheter', icon: it => 'fa-regular fa-coins',
//filter: it => Misc.toInt(it.system.quantite) > 0,
//optionsFilter: options => options.editable,
//action: (item, actor) => item.proposerVente()
filter: it => Misc.toInt(it.system.quantite) > 0 && it.parent?.type == ACTOR_TYPES.commerce,
action: (item, actor) => actor.vente(item)
}
const _MONTRER = {
code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment',

View File

@@ -3,8 +3,8 @@ type: faune
img: systems/foundryvtt-reve-de-dragon/icons/faune/ours.webp
system:
description: >-
<p>Ours. For&ecirc;t, montagne, 300 kg, 600 sust.Surtout recherch&eacute;
pour sa peau (voir legrizzal, p405).</p>
<p>Ours. For&ecirc;t, montagne, 300 kg, 600 sust. Surtout recherch&eacute;
pour sa peau (voir le grizzal, p405).</p>
descriptionmj: ''
encombrement: 150
quantite: 1