Consommation part le consommateur
Pour afficher la fenêtre d'appréciation côté acheteur, et utiliser ses dés
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.23 - Le marché d'Illysis
|
||||
|
||||
- Améliorations
|
||||
- lors de la consoimmation suite à un achat, les jets d'appréciation/éthylisme
|
||||
sont faits par l'acheteur. Du coup, c'est lui qui lance le jet d'appréciation
|
||||
(pour un service ou un plat de qualité), et ses dés sont utilisés avec dice-so-nice
|
||||
|
||||
|
||||
## 13.0.22 - Les reflets d'Illysis
|
||||
|
||||
- Améliorations
|
||||
|
||||
@@ -40,17 +40,21 @@ export class ChatVente {
|
||||
|
||||
static async diminuerQuantiteAchatVente(chatMessageId, quantite) {
|
||||
const chatMessage = game.messages.get(chatMessageId)
|
||||
const vente = ChatVente.getDetailVente(chatMessageId)
|
||||
vente.nbLots = Math.max(0, vente.nbLots - quantite)
|
||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||
chatMessage.update({ content: html });
|
||||
chatMessage.render(true);
|
||||
const vente = ChatVente.getDetailVente(chatMessageId)
|
||||
if (vente.nbLots <= quantite) {
|
||||
ChatUtility.removeChatMessageId(chatMessageIdVente);
|
||||
}
|
||||
else {
|
||||
vente.nbLots = vente.nbLots - quantite
|
||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente)
|
||||
await chatMessage.update({ content: html }, { render: true })
|
||||
}
|
||||
}
|
||||
|
||||
static async displayAchatVente(vente) {
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente)
|
||||
const chatMessage = await ChatMessage.create(RdDUtility.chatDataSetup(html))
|
||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||
await chatMessage.setFlag(SYSTEM_RDD, DETAIL_VENTE, {
|
||||
|
||||
+21
-19
@@ -1092,7 +1092,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
$createSortReserve(sort) {
|
||||
const ptReve = Number.isInteger(sort.system.ptreve) ? Number(sort.system.ptreve) :Number(sort.system.ptreve.match(/\d+/))
|
||||
const ptReve = Number.isInteger(sort.system.ptreve) ? Number(sort.system.ptreve) : Number(sort.system.ptreve.match(/\d+/))
|
||||
this.createEmbeddedDocuments("Item",
|
||||
[{
|
||||
type: ITEM_TYPES.sortreserve,
|
||||
@@ -1316,14 +1316,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerNourritureboisson(itemId, choix = { doses: 1, seForcer: false, supprimerSiZero: false }) {
|
||||
if (!this.isOwner) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'consommerNourritureboisson', args: [itemId, choix]
|
||||
})
|
||||
return
|
||||
}
|
||||
const item = this.getItem(itemId)
|
||||
if (!item.getUtilisationCuisine()) {
|
||||
return
|
||||
@@ -1333,26 +1325,36 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
return
|
||||
}
|
||||
|
||||
const onManger = [
|
||||
async () => await this.manger(item, choix.doses, { diminuerQuantite: false }),
|
||||
async () => await this.boire(item, choix.doses, { diminuerQuantite: false }),
|
||||
async () => await item.diminuerQuantite(choix.doses, choix)
|
||||
]
|
||||
if (!this.isOwner) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'consommerNourritureboisson', args: [itemId, choix]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (await this._surmonterExotisme(item)) {
|
||||
const appreciation = item.system.appreciation;
|
||||
new Apprecier(this, appreciation, item.system.qualite)
|
||||
.apprecier(onManger)
|
||||
if (item.system.qualite > 0) {
|
||||
new Apprecier(this, item.system.appreciation, item.system.qualite).apprecier()
|
||||
}
|
||||
await this.onConsommerNourritureboisson(item, choix)
|
||||
}
|
||||
else if (choix.seForcer) {
|
||||
await this.jetDeMoral(MORAL.MALHEUREUX)
|
||||
await Promise.all(onManger.map(async callback => await callback()))
|
||||
await this.onConsommerNourritureboisson(item, choix)
|
||||
}
|
||||
else {
|
||||
ui.notifications.info(`${this.name} ne n'arrive pas à manger de ${item.name}`)
|
||||
}
|
||||
}
|
||||
|
||||
async onConsommerNourritureboisson(item, choix) {
|
||||
await this.manger(item, choix.doses, { diminuerQuantite: false })
|
||||
await this.boire(item, choix.doses, { diminuerQuantite: false })
|
||||
await item.diminuerQuantite(choix.doses, choix)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _surmonterExotisme(item) {
|
||||
const qualite = Math.min(item.system.qualite, 0)
|
||||
@@ -1363,7 +1365,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const rolled = await this.doRollCaracCompetence(CARACS.VOLONTE, competence, difficulte, { title: `tente de surmonter l'exotisme de ${item.name}` })
|
||||
return rolled.isSuccess
|
||||
}
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
+112
-88
@@ -62,14 +62,14 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
static remoteActorCall(callData) {
|
||||
static remoteActorCall(callData, userId = undefined) {
|
||||
if (game.user.isGM) {
|
||||
RdDBaseActor.onRemoteActorCall(callData, game.user.id)
|
||||
return false
|
||||
}
|
||||
else {
|
||||
const gmUserId = Misc.firstConnectedGMId()
|
||||
if (gmUserId){
|
||||
if (gmUserId) {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_remote_actor_call",
|
||||
data: callData,
|
||||
@@ -417,6 +417,14 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
async depenserSols(sols) {
|
||||
if (!this.isOwner) {
|
||||
return RdDBaseActor.remoteActorCall({
|
||||
userId: Misc.connectedGMOrUser(),
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'depenserSols', args: [sols]
|
||||
})
|
||||
}
|
||||
let reste = this.getFortune() - Number(sols);
|
||||
if (reste >= 0) {
|
||||
await Monnaie.optimiserFortune(this, reste);
|
||||
@@ -425,23 +433,23 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
async ajouterSols(sols, fromActorId = undefined) {
|
||||
sols = Number(sols);
|
||||
sols = Number(sols)
|
||||
if (sols == 0) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
if (sols < 0) {
|
||||
ui.notifications.error(`Impossible d'ajouter un gain de ${sols} <0`);
|
||||
return;
|
||||
ui.notifications.error(`Impossible d'ajouter un gain de ${sols} <0`)
|
||||
return
|
||||
}
|
||||
if (fromActorId && !this.isOwner) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
return RdDBaseActor.remoteActorCall({
|
||||
userId: Misc.connectedGMOrUser(),
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'ajouterSols', args: [sols, fromActorId]
|
||||
});
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
||||
const fromActor = game.actors.get(fromActorId)
|
||||
await Monnaie.optimiserFortune(this, sols + this.getFortune());
|
||||
|
||||
@@ -449,8 +457,7 @@ export class RdDBaseActor extends Actor {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `Vous avez reçu <strong>${sols} Sols</strong> ${fromActor ? " de " + fromActor.name : ''}, qui ont été ajoutés à votre argent.`
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -462,24 +469,28 @@ export class RdDBaseActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async achatVente(achat) {
|
||||
if (achat.vendeurId == achat.acheteurId) {
|
||||
ui.notifications.info("Inutile de se vendre à soi-même");
|
||||
return;
|
||||
ui.notifications.info("Inutile de se vendre à soi-même")
|
||||
return
|
||||
}
|
||||
if (!game.user.isGM) {
|
||||
const cout = Number(achat.prixTotal ?? 0)
|
||||
const acheteur = achat.acheteurId ? game.actors.get(achat.acheteurId) : undefined
|
||||
|
||||
if (acheteur && !acheteur.isOwner) {
|
||||
ui.notifications.warn(`${game.user.id} n'est pas propriétaire de ${this.name} et effectue un achat pour lui!`)
|
||||
RdDBaseActor.remoteActorCall({
|
||||
actorId: achat.vendeurId ?? achat.acheteurId,
|
||||
actorId: achat.acheteurId,
|
||||
method: 'achatVente', args: [achat]
|
||||
});
|
||||
return
|
||||
}
|
||||
const cout = Number(achat.prixTotal ?? 0);
|
||||
const vendeur = achat.vendeurId ? game.actors.get(achat.vendeurId) : undefined;
|
||||
const acheteur = achat.acheteurId ? game.actors.get(achat.acheteurId) : undefined;
|
||||
|
||||
|
||||
const vendeur = achat.vendeurId ? game.actors.get(achat.vendeurId) : undefined
|
||||
const quantite = (achat.choix.nombreLots ?? 1) * (achat.vente.tailleLot);
|
||||
const itemVendu = vendeur?.getItem(achat.vente.item._id) ?? game.items.get(achat.vente.item._id);
|
||||
if (!itemVendu) {
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', vendeur ? `Le vendeur n'a pas plus de ${achat.vente.item.name} !` : `Impossible de retrouver: ${achat.vente.item.name} !`);
|
||||
return;
|
||||
return
|
||||
}
|
||||
if (vendeur && !vendeur.verifierQuantite(itemVendu, quantite)) {
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Le vendeur n'a pas assez de ${itemVendu.name} !`);
|
||||
@@ -487,10 +498,10 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
if (acheteur && !acheteur.verifierFortune(cout)) {
|
||||
ChatUtility.notifyUser(achat.userId, 'warn', `Vous n'avez pas assez d'argent pour payer ${Math.ceil(cout / 100)} sols !`);
|
||||
return;
|
||||
return
|
||||
}
|
||||
await vendeur?.vendre(itemVendu, quantite, cout);
|
||||
await acheteur?.acheter(itemVendu, quantite, cout, achat)
|
||||
await vendeur?.vendre(itemVendu, quantite, cout, acheteur);
|
||||
await acheteur?.acheter(itemVendu, quantite, cout, achat, vendeur)
|
||||
|
||||
if (cout > 0) {
|
||||
RdDAudio.PlayContextAudio("argent");
|
||||
@@ -505,22 +516,32 @@ export class RdDBaseActor extends Actor {
|
||||
});
|
||||
|
||||
if (!achat.vente.quantiteIllimite) {
|
||||
if (achat.vente.nbLots <= achat.choix.nombreLots) {
|
||||
ChatUtility.removeChatMessageId(achat.chatMessageIdVente);
|
||||
}
|
||||
else if (achat.chatMessageIdVente) {
|
||||
await ChatVente.diminuerQuantiteAchatVente(achat.chatMessageIdVente, achat.choix.nombreLots)
|
||||
}
|
||||
await this.updateMessageVente(achat.chatMessageIdVente, achat.choix.nombreLots);
|
||||
}
|
||||
}
|
||||
|
||||
async vendre(item, quantite, cout) {
|
||||
await this.ajouterSols(cout);
|
||||
await this.decrementerQuantiteItem(item, quantite);
|
||||
async updateMessageVente(chatMessageIdVente, nombreLots) {
|
||||
const chatMessage = game.messages.get(chatMessageIdVente)
|
||||
if (!chatMessage.isOwner) {
|
||||
return RdDBaseActor.remoteActorCall({
|
||||
userId: Misc.firstConnectedGMId(),
|
||||
actorId: this.id,
|
||||
method: 'updateMessageVente', args: [chatMessageIdVente, nombreLots]
|
||||
})
|
||||
}
|
||||
await ChatVente.diminuerQuantiteAchatVente(chatMessageIdVente, nombreLots);
|
||||
}
|
||||
|
||||
async vendre(item, quantite, cout, acheteur) {
|
||||
await this.ajouterSols(cout, acheteur?.id)
|
||||
await this.decrementerQuantiteItem(item.id, quantite)
|
||||
}
|
||||
|
||||
async acheter(item, quantite, cout, achat) {
|
||||
await this.depenserSols(cout)
|
||||
if (!this.isOwner) {
|
||||
ui.notifications.warn(`${game.user.id} n'est pas propriétaire de ${this.name} et effectue un achat!`)
|
||||
}
|
||||
const createdItemId = await this.creerQuantiteItem(item, quantite)
|
||||
if (item.type == ITEM_TYPES.nourritureboisson && achat.choix.consommer && createdItemId != undefined) {
|
||||
achat.choix.doses = achat.choix.nombreLots;
|
||||
@@ -542,43 +563,46 @@ export class RdDBaseActor extends Actor {
|
||||
|
||||
async consommerNourritureboisson(itemId, choix, userId) { }
|
||||
|
||||
async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) {
|
||||
async decrementerQuantiteItem(itemId, quantite, options = { supprimerSiZero: true }) {
|
||||
const item = this.items.get(itemId)
|
||||
if (item.isService()) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
const itemId = item.id;
|
||||
let resteQuantite = (item.system.quantite ?? 1) - quantite;
|
||||
if (resteQuantite <= 0) {
|
||||
if (options.supprimerSiZero) {
|
||||
await this.deleteEmbeddedDocuments("Item", [item.id]);
|
||||
|
||||
if (!this.isOwner) {
|
||||
return RdDBaseActor.remoteActorCall({
|
||||
userId: Misc.connectedGMOrUser(),
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'decrementerQuantiteItem', args: [itemId, quantite, options]
|
||||
})
|
||||
}
|
||||
|
||||
const resteQuantite = Math.max((item.system.quantite ?? 1) - quantite, 0)
|
||||
if (resteQuantite <= 0 && options.supprimerSiZero) {
|
||||
await this.deleteEmbeddedDocuments("Item", [itemId]);
|
||||
}
|
||||
else {
|
||||
await this.updateEmbeddedDocuments("Item", [{ _id: itemId, 'system.quantite': 0 }]);
|
||||
}
|
||||
if (resteQuantite < 0) {
|
||||
ui.notifications.warn(`La quantité de ${item.name} était insuffisante, l'objet a donc été supprimé`)
|
||||
}
|
||||
}
|
||||
else if (resteQuantite > 0) {
|
||||
const realItem = this.getItem(item.id)
|
||||
realItem.update({ 'system.quantite': resteQuantite });
|
||||
await this.updateEmbeddedDocuments("Item", [{ _id: item.id, 'system.quantite': resteQuantite }]);
|
||||
await this.updateEmbeddedDocuments("Item", [{ _id: itemId, 'system.quantite': resteQuantite }])
|
||||
}
|
||||
}
|
||||
|
||||
async creerQuantiteItem(item, quantite) {
|
||||
if (this.canReceive(item)) {
|
||||
if (!this.canReceive(item)) {
|
||||
return
|
||||
}
|
||||
|
||||
const isItemEmpilable = "quantite" in item.system;
|
||||
const baseItem = {
|
||||
type: item.type,
|
||||
img: item.img,
|
||||
name: item.name,
|
||||
system: foundry.utils.mergeObject(item.system, { quantite: isItemEmpilable ? quantite : undefined }, { inplace: false })
|
||||
};
|
||||
}
|
||||
|
||||
const newItems = isItemEmpilable ? [baseItem] : Array.from({ length: quantite }, (_, i) => baseItem);
|
||||
const items = await this.createEmbeddedDocuments("Item", newItems);
|
||||
return items.length > 0 ? items[0].id : undefined;
|
||||
}
|
||||
return newItems.length > 0 ? items[0].id : undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -595,22 +619,22 @@ export class RdDBaseActor extends Actor {
|
||||
await this.setEffect(STATUSES.StatusSurEnc, isSurenc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getEncTotal() {
|
||||
getEncTotal() {
|
||||
return Number(this.encTotal?.toFixed(2) ?? 0.00)
|
||||
}
|
||||
}
|
||||
|
||||
async createItem(type, name = undefined) {
|
||||
if (!name) {
|
||||
name = 'Nouveau ' + Misc.typeName('Item', type);
|
||||
}
|
||||
await this.createEmbeddedDocuments('Item', [{ name: name, type: type }], { renderSheet: true });
|
||||
}
|
||||
}
|
||||
|
||||
canReceive(item) {
|
||||
canReceive(item) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async processDropItem(params) {
|
||||
const targetActorId = this.id
|
||||
@@ -651,22 +675,22 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
await this.computeEncTotal()
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
getContenantOrParent(dest) {
|
||||
getContenantOrParent(dest) {
|
||||
if (!dest || dest.isConteneur()) {
|
||||
return dest;
|
||||
}
|
||||
return this.getContenant(dest);
|
||||
}
|
||||
}
|
||||
|
||||
getContenant(item) {
|
||||
getContenant(item) {
|
||||
return this.itemTypes['conteneur'].find(it => it.system.contenu.includes(item.id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
conteneurPeutContenir(dest, moved) {
|
||||
/* -------------------------------------------- */
|
||||
conteneurPeutContenir(dest, moved) {
|
||||
if (!dest) {
|
||||
return true;
|
||||
}
|
||||
@@ -691,7 +715,7 @@ export class RdDBaseActor extends Actor {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** Ajoute un item dans un conteneur, sur la base de leurs ID */
|
||||
@@ -706,7 +730,7 @@ export class RdDBaseActor extends Actor {
|
||||
item.estContenu = false;
|
||||
await conteneur?.update({ 'system.-=contenu': undefined })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** Fonction de remise à plat de l'équipement (ie vide les champs 'contenu') */
|
||||
@@ -736,10 +760,10 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
buildSubConteneurObjetList(conteneurId, deleteList) {
|
||||
/* -------------------------------------------- */
|
||||
buildSubConteneurObjetList(conteneurId, deleteList) {
|
||||
let conteneur = this.getItem(conteneurId);
|
||||
if (conteneur?.type == 'conteneur') { // Si c'est un conteneur
|
||||
for (let subId of conteneur.system.contenu) {
|
||||
@@ -752,7 +776,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async deleteAllConteneur(itemId, options) {
|
||||
@@ -760,7 +784,7 @@ export class RdDBaseActor extends Actor {
|
||||
list.push({ id: itemId, conteneurId: undefined }); // Init list
|
||||
this.buildSubConteneurObjetList(itemId, list);
|
||||
await this.deleteEmbeddedDocuments('Item', list.map(it => it.id), options);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
@@ -778,7 +802,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
item.estContenu = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async moveItemsBetweenActors(itemId, sourceActorId, sourceTokenId) {
|
||||
@@ -807,15 +831,15 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
const deletedItemIds = itemsList.map(it => it.id)
|
||||
await sourceActor.deleteEmbeddedDocuments('Item', deletedItemIds);
|
||||
}
|
||||
}
|
||||
|
||||
_buildMapOldNewId(itemsList, newItems) {
|
||||
_buildMapOldNewId(itemsList, newItems) {
|
||||
let itemMap = {};
|
||||
for (let i = 0; i < itemsList.length; i++) {
|
||||
itemMap[itemsList[i].id] = newItems[i].id; // Pour garder le lien ancien / nouveau
|
||||
}
|
||||
return itemMap;
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async postActorToChat(modeOverride) {
|
||||
@@ -830,32 +854,32 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||
}
|
||||
}
|
||||
|
||||
actionImpossible(action) {
|
||||
actionImpossible(action) {
|
||||
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||
}
|
||||
}
|
||||
|
||||
isAlcoolise() { return false }
|
||||
isAlcoolise() { return false }
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
||||
async resetItemUse() { }
|
||||
async incDecItemUse(itemId, shouldIncrease = true) { }
|
||||
getItemUse(itemId) { return 0; }
|
||||
getItemUse(itemId) { return 0; }
|
||||
|
||||
async finDeRound(options = { terminer: false }) { }
|
||||
isActorCombat() { return false }
|
||||
getCaracInit(competence) { return 0 }
|
||||
isActorCombat() { return false }
|
||||
getCaracInit(competence) { return 0 }
|
||||
|
||||
listAttaques() {
|
||||
listAttaques() {
|
||||
return this.listActions({ isAttaque: true, isEquipe: false })
|
||||
}
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) { return [] }
|
||||
listActions({ isAttaque = false, isEquipe = false }) { return [] }
|
||||
|
||||
listActionsPossessions() {
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
.filter(it => !it.system.possede)
|
||||
.map(p => {
|
||||
@@ -865,5 +889,5 @@ export class RdDBaseActor extends Actor {
|
||||
possessionid: p.system.possessionid,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,11 @@ export class RdDCommerce extends RdDBaseActor {
|
||||
await super.depenserSols(cout)
|
||||
}
|
||||
|
||||
async decrementerQuantiteItem(item, quantite) {
|
||||
async decrementerQuantiteItem(itemId, quantite) {
|
||||
if (this.system.illimite) {
|
||||
return;
|
||||
}
|
||||
await super.decrementerQuantiteItem(item, quantite, { supprimerSiZero: false });
|
||||
await super.decrementerQuantiteItem(itemId, quantite, { supprimerSiZero: false });
|
||||
}
|
||||
|
||||
calculerPrix(item) {
|
||||
|
||||
@@ -104,7 +104,7 @@ export class Apprecier {
|
||||
|
||||
apprecier(callbacks = []) {
|
||||
if (this.qualite <= 0) {
|
||||
this.raisons.push(`la qualité ${this.qualite} est négative.`)
|
||||
this.raisons.push(`la qualité ${this.qualite} est insuffisante.`)
|
||||
}
|
||||
if (this.qualite <= this.actor.getMoralTotal()) {
|
||||
this.raisons.push(`la qualité de ${this.qualite} est inférieure au moral de ${this.actor.getMoralTotal()}.`)
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<hr>
|
||||
<span>
|
||||
{{#if jetVie.rolled.isSuccess}}
|
||||
{{alias}} a réussi son jet d'éthylisme, il a consommé {{doses}} doses sans effet.
|
||||
{{alias}} a réussi son jet d'éthylisme, {{doses}} doses ont été consommées sans effet.
|
||||
{{else}}
|
||||
{{alias}} a échoué son jet d'éthylisme, il est maintenant {{nomEthylisme}} ({{ajustementEthylique}}).
|
||||
{{alias}} a échoué son jet d'éthylisme et est maintenant {{nomEthylisme}} ({{ajustementEthylique}}).
|
||||
{{/if}}
|
||||
</span>
|
||||
{{#if jetVie.rolled.isEchec}}
|
||||
@@ -19,8 +19,8 @@
|
||||
{{alias}} perd {{perteEndurance.perte}} points d'endurance. {{#if perteEndurance.perteVie}}<br/>Il tombe inconscient et perd un point de vie.{{/if}}
|
||||
{{#if jetMoral}}
|
||||
<br/>Jet de moral {{#if jetMoral.succes}}réussi{{else}}manqué{{/if}} en situation heureuse ({{jetMoral.jet}}/{{jetMoral.difficulte}}).
|
||||
{{#if (gt jetMoral.ajustement 0)}}L'alcool met {{alias}} en joie. Il gagne un point de moral.
|
||||
{{else if (lt jetMoral.ajustement 0)}}{{alias}} a l'alcool triste. Il perd un point de moral.
|
||||
{{#if (gt jetMoral.ajustement 0)}}L'alcool met en joie {{alias}} qui gagne un point de moral.
|
||||
{{else if (lt jetMoral.ajustement 0)}}{{alias}} a l'alcool triste et perd un point de moral.
|
||||
{{else}}{{alias}} garde son moral.{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user