Fix: ouvrir contenants des véhicules/créatures
This commit is contained in:
parent
2373acc295
commit
862a267683
@ -1,6 +1,7 @@
|
||||
# v11.0
|
||||
## v11.1.1 - Les fumebols de Werther de Zloth
|
||||
- Fix: on peut de nouveau afficher les vues détaillées
|
||||
- Fix: on peut ouvrir les sacs et contenants portés par les véhicules et créatures
|
||||
## v11.1.0 - Les choix de Werther de Zloth
|
||||
- Les options suivantes peuvent être désactivées:
|
||||
- La transformation de stress à Château Dormant
|
||||
|
@ -1204,10 +1204,27 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
||||
}
|
||||
|
||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
||||
let result = await super.actionPrincipale(item, onActionItem)
|
||||
if (result) { return result }
|
||||
|
||||
result = await this.actionNourritureboisson(item, onActionItem)
|
||||
if (result) { return result }
|
||||
|
||||
switch (item.type) {
|
||||
case TYPES.potion: return await this.consommerPotion(item, onActionItem);
|
||||
case TYPES.livre: return await this.actionLire(item);
|
||||
case TYPES.conteneur: return await item.sheet.render(true);
|
||||
case TYPES.herbe: return await this.actionHerbe(item, onActionItem);
|
||||
case TYPES.queue: case TYPES.ombre: return await this.actionRefoulement(item);
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
async actionNourritureboisson(item, onActionItem) {
|
||||
switch (item.getUtilisationCuisine()) {
|
||||
case 'brut': {
|
||||
let d = new Dialog({
|
||||
const utilisation = new Dialog({
|
||||
title: "Nourriture brute",
|
||||
content: `Que faire de votre ${item.name}`,
|
||||
buttons: {
|
||||
@ -1215,17 +1232,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
'manger': { icon: '<i class="fas fa-check"></i>', label: 'Manger cru', callback: async () => await this.mangerNourriture(item, onActionItem) }
|
||||
}
|
||||
});
|
||||
d.render(true);
|
||||
return true;
|
||||
return utilisation.render(true);
|
||||
}
|
||||
case 'pret':
|
||||
await this.mangerNourriture(item, onActionItem);
|
||||
return true;
|
||||
return await this.mangerNourriture(item, onActionItem);
|
||||
}
|
||||
return false;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
async mangerNourriture(item, onActionItem) {
|
||||
return (await DialogConsommer.create(this, item, onActionItem)).render(true);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { ChatUtility } from "../chat-utility.js";
|
||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
@ -687,4 +688,12 @@ export class RdDBaseActor extends Actor {
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
||||
switch (item.type) {
|
||||
case TYPES.conteneur: return await item.sheet.render(true);
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
}
|
@ -498,11 +498,11 @@ export class RdDItem extends Item {
|
||||
if (this.actor?.isPersonnage()) {
|
||||
const warn = options.warnIfNot;
|
||||
if (this.getUtilisationCuisine() == 'brut') {
|
||||
return 'Utiliser';
|
||||
return 'Cuisiner';
|
||||
}
|
||||
switch (this.type) {
|
||||
case TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
|
||||
case TYPES.potion: return this._actionOrWarnQuantiteZero('Boire', warn);
|
||||
case TYPES.potion: return this._actionOrWarnQuantiteZero('Consommer', warn);
|
||||
case TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
|
||||
case TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
||||
case TYPES.queue: case TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
|
||||
@ -513,19 +513,8 @@ export class RdDItem extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionPrincipale(actor, onActionItem = async () => { }) {
|
||||
if (!this.getActionPrincipale()) {
|
||||
return;
|
||||
}
|
||||
if (await actor.actionNourritureboisson(this, onActionItem)) {
|
||||
return;
|
||||
}
|
||||
switch (this.type) {
|
||||
case TYPES.potion: return await actor.consommerPotion(this, onActionItem);
|
||||
case TYPES.livre: return await actor.actionLire(this);
|
||||
case TYPES.conteneur: return await this.sheet.render(true);
|
||||
case TYPES.herbe: return await actor.actionHerbe(this, onActionItem);
|
||||
case TYPES.queue: case TYPES.ombre: return await actor.actionRefoulement(this);
|
||||
}
|
||||
if (!this.getActionPrincipale()) { return }
|
||||
await actor?.actionPrincipale(this, onActionItem);
|
||||
}
|
||||
|
||||
_actionOrWarnQuantiteZero(actionName, warn) {
|
||||
|
Loading…
Reference in New Issue
Block a user