forked from public/foundryvtt-reve-de-dragon
Preparation du passage en v12
This commit is contained in:
@ -286,7 +286,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
|
||||
getCarac() {
|
||||
// TODO: le niveau d'une entité de cauchemar devrait être exclu...
|
||||
const carac = foundry.utils.mergeObject(duplicate(this.system.carac),
|
||||
const carac = foundry.utils.mergeObject(foundry.utils.duplicate(this.system.carac),
|
||||
{
|
||||
'reve-actuel': this.getCaracReveActuel(),
|
||||
'chance-actuelle': this.getCaracChanceActuelle()
|
||||
@ -471,7 +471,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
});
|
||||
|
||||
if (!encaissement.hasPlayerOwner && encaissement.endurance != 0) {
|
||||
encaissement = duplicate(encaissement);
|
||||
encaissement = foundry.utils.duplicate(encaissement);
|
||||
encaissement.isGM = true;
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients("GM"),
|
||||
|
@ -89,7 +89,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
/* -------------------------------------------- */
|
||||
|
||||
async onAppliquerJetEncaissement(encaissement, attacker) {
|
||||
const santeOrig = duplicate(this.system.sante);
|
||||
const santeOrig = foundry.utils.duplicate(this.system.sante);
|
||||
const blessure = await this.ajouterBlessure(encaissement, attacker); // Will update the result table
|
||||
const perteVie = await this.santeIncDec("vie", -encaissement.vie);
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, blessure?.isCritique());
|
||||
@ -108,7 +108,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
if (name == 'fatigue' && !ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
return;
|
||||
}
|
||||
const sante = duplicate(this.system.sante)
|
||||
const sante = foundry.utils.duplicate(this.system.sante)
|
||||
let compteur = sante[name];
|
||||
if (!compteur) {
|
||||
return;
|
||||
|
@ -312,7 +312,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
async _onSplitItem(item, split) {
|
||||
if (split >= 1 && split < item.system.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const splitItem = duplicate(item);
|
||||
const splitItem = foundry.utils.duplicate(item);
|
||||
splitItem.system.quantite = split;
|
||||
await this.actor.createEmbeddedDocuments('Item', [splitItem])
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ export class RdDBaseActor extends Actor {
|
||||
if (cout > 0) {
|
||||
RdDAudio.PlayContextAudio("argent");
|
||||
}
|
||||
const chatAchatItem = duplicate(achat.vente);
|
||||
const chatAchatItem = foundry.utils.duplicate(achat.vente);
|
||||
chatAchatItem.quantiteTotal = quantite;
|
||||
ChatMessage.create({
|
||||
user: achat.userId,
|
||||
@ -649,7 +649,7 @@ export class RdDBaseActor extends Actor {
|
||||
sourceActor.buildSubConteneurObjetList(itemId, itemsList); // Get itemId list
|
||||
|
||||
const itemsDataToCreate = itemsList.map(it => sourceActor.getItem(it.id))
|
||||
.map(it => duplicate(it))
|
||||
.map(it => foundry.utils.duplicate(it))
|
||||
.map(it => { it.system.contenu = []; return it; });
|
||||
let newItems = await this.createEmbeddedDocuments('Item', itemsDataToCreate);
|
||||
|
||||
|
@ -48,7 +48,7 @@ export class RdDCreature extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = duplicate(this.system.sante.resonnance);
|
||||
let resonnance = foundry.utils.duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attacker.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
|
@ -93,7 +93,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = duplicate(this.system.sante.resonnance);
|
||||
let resonnance = foundry.utils.duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attacker.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
|
Reference in New Issue
Block a user