Rename TYPES en ITEM_TYPES
Pour ajouter les ACTOR_TYPES
This commit is contained in:
parent
c586a90690
commit
52e1f9dfbf
@ -32,7 +32,7 @@ import { RdDItemBlessure } from "./item/blessure.js";
|
|||||||
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||||
import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js";
|
import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
||||||
@ -92,7 +92,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
canReceive(item) {
|
canReceive(item) {
|
||||||
return ![TYPES.competencecreature, TYPES.tarot, TYPES.service].includes(item.type)
|
return ![ITEM_TYPES.competencecreature, ITEM_TYPES.tarot, ITEM_TYPES.service].includes(item.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
isPersonnageJoueur() {
|
isPersonnageJoueur() {
|
||||||
@ -125,7 +125,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getMalusArmure() {
|
getMalusArmure() {
|
||||||
return this.itemTypes[TYPES.armure].filter(it => it.system.equipe)
|
return this.itemTypes[ITEM_TYPES.armure].filter(it => it.system.equipe)
|
||||||
.map(it => it.system.malus)
|
.map(it => it.system.malus)
|
||||||
.reduce(Misc.sum(), 0);
|
.reduce(Misc.sum(), 0);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getDemiReve() { return this.system.reve.tmrpos.coord }
|
getDemiReve() { return this.system.reve.tmrpos.coord }
|
||||||
getDraconicList() { return this.itemTypes[TYPES.competence].filter(it => it.system.categorie == 'draconic') }
|
getDraconicList() { return this.itemTypes[ITEM_TYPES.competence].filter(it => it.system.categorie == 'draconic') }
|
||||||
getBestDraconic() { return foundry.utils.duplicate(this.getDraconicList().sort(Misc.descending(it => it.system.niveau)).find(it => true)) }
|
getBestDraconic() { return foundry.utils.duplicate(this.getDraconicList().sort(Misc.descending(it => it.system.niveau)).find(it => true)) }
|
||||||
getDraconicOuPossession() {
|
getDraconicOuPossession() {
|
||||||
return [...this.getDraconicList().filter(it => it.system.niveau >= 0),
|
return [...this.getDraconicList().filter(it => it.system.niveau >= 0),
|
||||||
@ -153,7 +153,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $perteRevePotionsEnchantees() {
|
async $perteRevePotionsEnchantees() {
|
||||||
let potions = this.itemTypes[TYPES.potion]
|
let potions = this.itemTypes[ITEM_TYPES.potion]
|
||||||
.filter(it => Grammar.includesLowerCaseNoAccent(it.system.categorie, 'enchanté') && !it.system.prpermanent)
|
.filter(it => Grammar.includesLowerCaseNoAccent(it.system.categorie, 'enchanté') && !it.system.prpermanent)
|
||||||
|
|
||||||
const potionUpdates = await Promise.all(potions.map(async it => {
|
const potionUpdates = await Promise.all(potions.map(async it => {
|
||||||
@ -345,7 +345,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _recupererBlessures(message, isMaladeEmpoisonne) {
|
async _recupererBlessures(message, isMaladeEmpoisonne) {
|
||||||
const timestamp = game.system.rdd.calendrier.getTimestamp()
|
const timestamp = game.system.rdd.calendrier.getTimestamp()
|
||||||
const blessures = this.filterItems(it => it.system.gravite > 0, TYPES.blessure).sort(Misc.ascending(it => it.system.gravite))
|
const blessures = this.filterItems(it => it.system.gravite > 0, ITEM_TYPES.blessure).sort(Misc.ascending(it => it.system.gravite))
|
||||||
|
|
||||||
await Promise.all(blessures.map(async b => b.recuperationBlessure({
|
await Promise.all(blessures.map(async b => b.recuperationBlessure({
|
||||||
actor: this,
|
actor: this,
|
||||||
@ -361,7 +361,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _recupererVie(message, isMaladeEmpoisonne) {
|
async _recupererVie(message, isMaladeEmpoisonne) {
|
||||||
const tData = this.system
|
const tData = this.system
|
||||||
let blessures = this.filterItems(it => it.system.gravite > 0, TYPES.blessure);
|
let blessures = this.filterItems(it => it.system.gravite > 0, ITEM_TYPES.blessure);
|
||||||
if (blessures.length > 0) {
|
if (blessures.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async sortMisEnReserve(sort, draconic, coord, ptreve) {
|
async sortMisEnReserve(sort, draconic, coord, ptreve) {
|
||||||
await this.createEmbeddedDocuments("Item", [{
|
await this.createEmbeddedDocuments("Item", [{
|
||||||
type: TYPES.sortreserve,
|
type: ITEM_TYPES.sortreserve,
|
||||||
name: sort.name,
|
name: sort.name,
|
||||||
img: sort.img,
|
img: sort.img,
|
||||||
system: { sortid: sort._id, draconic: (draconic?.name ?? sort.system.draconic), ptreve: ptreve, coord: coord, heurecible: 'Vaisseau' }
|
system: { sortid: sort._id, draconic: (draconic?.name ?? sort.system.draconic), ptreve: ptreve, coord: coord, heurecible: 'Vaisseau' }
|
||||||
@ -991,24 +991,24 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
buildTMRInnaccessible() {
|
buildTMRInnaccessible() {
|
||||||
return this.items.filter(it => it.type == TYPES.casetmr).filter(it => EffetsDraconiques.isInnaccessible(it)).map(it => it.system.coord)
|
return this.items.filter(it => it.type == ITEM_TYPES.casetmr).filter(it => EffetsDraconiques.isInnaccessible(it)).map(it => it.system.coord)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getRencontresTMR() {
|
getRencontresTMR() {
|
||||||
return this.itemTypes[TYPES.rencontre];
|
return this.itemTypes[ITEM_TYPES.rencontre];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async deleteRencontreTMRAtPosition() {
|
async deleteRencontreTMRAtPosition() {
|
||||||
const rencontreIds = this.itemTypes[TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id)
|
const rencontreIds = this.itemTypes[ITEM_TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id)
|
||||||
if (rencontreIds.length > 0) {
|
if (rencontreIds.length > 0) {
|
||||||
await this.deleteEmbeddedDocuments('Item', rencontreIds)
|
await this.deleteEmbeddedDocuments('Item', rencontreIds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getRencontreTMREnAttente() {
|
getRencontreTMREnAttente() {
|
||||||
return this.itemTypes[TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
|
return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
|
||||||
}
|
}
|
||||||
|
|
||||||
filterRencontreTMRDemiReve() {
|
filterRencontreTMRDemiReve() {
|
||||||
@ -1160,11 +1160,11 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (result) { return result }
|
if (result) { return result }
|
||||||
|
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case TYPES.potion: return await this.consommerPotion(item, onActionItem);
|
case ITEM_TYPES.potion: return await this.consommerPotion(item, onActionItem);
|
||||||
case TYPES.livre: return await this.actionLire(item);
|
case ITEM_TYPES.livre: return await this.actionLire(item);
|
||||||
case TYPES.conteneur: return await item.sheet.render(true);
|
case ITEM_TYPES.conteneur: return await item.sheet.render(true);
|
||||||
case TYPES.herbe: return await this.actionHerbe(item, onActionItem);
|
case ITEM_TYPES.herbe: return await this.actionHerbe(item, onActionItem);
|
||||||
case TYPES.queue: case TYPES.ombre: return await this.actionRefoulement(item);
|
case ITEM_TYPES.queue: case ITEM_TYPES.ombre: return await this.actionRefoulement(item);
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
@ -1559,7 +1559,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
xpData
|
xpData
|
||||||
})
|
})
|
||||||
if (hideChatMessage) {
|
if (hideChatMessage) {
|
||||||
ChatUtility.blindMessageToGM({ content: content });
|
ChatUtility.blindMessageToGM({ content: content })
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
@ -1826,7 +1826,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
blessuresASoigner() {
|
blessuresASoigner() {
|
||||||
return (this.itemTypes[TYPES.blessure])
|
return (this.itemTypes[ITEM_TYPES.blessure])
|
||||||
.filter(it => it.system.gravite > 0 && it.system.gravite <= 6)
|
.filter(it => it.system.gravite > 0 && it.system.gravite <= 6)
|
||||||
.filter(it => !(it.system.premierssoins.done && it.system.soinscomplets.done))
|
.filter(it => !(it.system.premierssoins.done && it.system.soinscomplets.done))
|
||||||
.sort(Misc.descending(b => (b.system.premierssoins.done ? "A" : "B") + b.system.gravite))
|
.sort(Misc.descending(b => (b.system.premierssoins.done ? "A" : "B") + b.system.gravite))
|
||||||
@ -3065,7 +3065,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
async nouvelleIncarnation() {
|
async nouvelleIncarnation() {
|
||||||
let incarnation = this.toObject();
|
let incarnation = this.toObject();
|
||||||
|
|
||||||
incarnation.items = Array.from(this.items.filter(it => it.type == TYPES.competence),
|
incarnation.items = Array.from(this.items.filter(it => it.type == ITEM_TYPES.competence),
|
||||||
it => {
|
it => {
|
||||||
it = it.toObject();
|
it = it.toObject();
|
||||||
it.id = undefined;
|
it.id = undefined;
|
||||||
|
@ -12,7 +12,7 @@ import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
|||||||
import { RdDBaseActor } from "./base-actor.js";
|
import { RdDBaseActor } from "./base-actor.js";
|
||||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||||
import { StatusEffects } from "../settings/status-effects.js";
|
import { StatusEffects } from "../settings/status-effects.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { Targets } from "../targets.js";
|
import { Targets } from "../targets.js";
|
||||||
import { RdDPossession } from "../rdd-possession.js";
|
import { RdDPossession } from "../rdd-possession.js";
|
||||||
import { RdDCombat } from "../rdd-combat.js";
|
import { RdDCombat } from "../rdd-combat.js";
|
||||||
@ -108,14 +108,14 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
|
|
||||||
async $finDeRoundSupprimerObsoletes() {
|
async $finDeRoundSupprimerObsoletes() {
|
||||||
const obsoletes = []
|
const obsoletes = []
|
||||||
.concat(this.itemTypes[TYPES.empoignade].filter(it => it.system.pointsemp <= 0))
|
.concat(this.itemTypes[ITEM_TYPES.empoignade].filter(it => it.system.pointsemp <= 0))
|
||||||
.concat(this.itemTypes[TYPES.possession].filter(it => it.system.compteur < -2 || it.system.compteur > 2))
|
.concat(this.itemTypes[ITEM_TYPES.possession].filter(it => it.system.compteur < -2 || it.system.compteur > 2))
|
||||||
.map(it => it.id);
|
.map(it => it.id);
|
||||||
await this.deleteEmbeddedDocuments('Item', obsoletes);
|
await this.deleteEmbeddedDocuments('Item', obsoletes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async $finDeRoundEmpoignade() {
|
async $finDeRoundEmpoignade() {
|
||||||
const immobilisations = this.itemTypes[TYPES.empoignade].filter(it => it.system.pointsemp >= 2 && it.system.empoigneurid == this.id);
|
const immobilisations = this.itemTypes[ITEM_TYPES.empoignade].filter(it => it.system.pointsemp >= 2 && it.system.empoigneurid == this.id);
|
||||||
immobilisations.forEach(emp => RdDEmpoignade.onImmobilisation(this,
|
immobilisations.forEach(emp => RdDEmpoignade.onImmobilisation(this,
|
||||||
game.actors.get(emp.system.empoigneid),
|
game.actors.get(emp.system.empoigneid),
|
||||||
emp
|
emp
|
||||||
@ -151,13 +151,13 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPossession(possessionId) {
|
getPossession(possessionId) {
|
||||||
return this.itemTypes[TYPES.possession].find(it => it.system.possessionid == possessionId);
|
return this.itemTypes[ITEM_TYPES.possession].find(it => it.system.possessionid == possessionId);
|
||||||
}
|
}
|
||||||
getPossessions() {
|
getPossessions() {
|
||||||
return this.itemTypes[TYPES.possession];
|
return this.itemTypes[ITEM_TYPES.possession];
|
||||||
}
|
}
|
||||||
getEmpoignades() {
|
getEmpoignades() {
|
||||||
return this.itemTypes[TYPES.empoignade];
|
return this.itemTypes[ITEM_TYPES.empoignade];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -322,7 +322,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
const competence = this.getCompetence(idOrName);
|
const competence = this.getCompetence(idOrName);
|
||||||
let rollData = { carac: this.system.carac, competence: competence, arme: options.arme }
|
let rollData = { carac: this.system.carac, competence: competence, arme: options.arme }
|
||||||
if (competence.type == TYPES.competencecreature) {
|
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||||
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
||||||
if (arme && options.tryTarget && Targets.hasTargets()) {
|
if (arme && options.tryTarget && Targets.hasTargets()) {
|
||||||
Targets.selectOneToken(target => {
|
Targets.selectOneToken(target => {
|
||||||
@ -396,19 +396,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$getCompetenceArme(arme, competenceName) {
|
$getCompetenceArme(arme, competenceName) {
|
||||||
switch (arme.type) {
|
return RdDItemArme.getCompetenceArme(arme, competenceName)
|
||||||
case TYPES.competencecreature:
|
|
||||||
return arme.name
|
|
||||||
case TYPES.arme:
|
|
||||||
switch (competenceName) {
|
|
||||||
case 'competence': return arme.system.competence;
|
|
||||||
case 'unemain': return RdDItemArme.competence1Mains(arme);
|
|
||||||
case 'deuxmains': return RdDItemArme.competence2Mains(arme);
|
|
||||||
case 'tir': return arme.system.tir;
|
|
||||||
case 'lancer': return arme.system.lancer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
verifierForceMin(item) {
|
verifierForceMin(item) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { MAX_ENDURANCE_FATIGUE, RdDUtility } from "../rdd-utility.js";
|
import { MAX_ENDURANCE_FATIGUE, RdDUtility } from "../rdd-utility.js";
|
||||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||||
import { STATUSES } from "../settings/status-effects.js";
|
import { STATUSES } from "../settings/status-effects.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||||
import { RdDDice } from "../rdd-dice.js";
|
import { RdDDice } from "../rdd-dice.js";
|
||||||
import { RdDItemBlessure } from "../item/blessure.js";
|
import { RdDItemBlessure } from "../item/blessure.js";
|
||||||
@ -50,9 +50,9 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
|
|
||||||
isDead() { return this.system.sante.vie.value < -this.getSConst() }
|
isDead() { return this.system.sante.vie.value < -this.getSConst() }
|
||||||
|
|
||||||
nbBlessuresLegeres() { return this.itemTypes[TYPES.blessure].filter(it => it.isLegere()).length }
|
nbBlessuresLegeres() { return this.itemTypes[ITEM_TYPES.blessure].filter(it => it.isLegere()).length }
|
||||||
nbBlessuresGraves() { return this.itemTypes[TYPES.blessure].filter(it => it.isGrave()).length }
|
nbBlessuresGraves() { return this.itemTypes[ITEM_TYPES.blessure].filter(it => it.isGrave()).length }
|
||||||
nbBlessuresCritiques() { return this.itemTypes[TYPES.blessure].filter(it => it.isCritique()).length }
|
nbBlessuresCritiques() { return this.itemTypes[ITEM_TYPES.blessure].filter(it => it.isCritique()).length }
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
computeResumeBlessure() {
|
computeResumeBlessure() {
|
||||||
@ -197,7 +197,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async supprimerBlessures(filterToDelete) {
|
async supprimerBlessures(filterToDelete) {
|
||||||
const toDelete = this.filterItems(filterToDelete, TYPES.blessure)
|
const toDelete = this.filterItems(filterToDelete, ITEM_TYPES.blessure)
|
||||||
.map(it => it.id);
|
.map(it => it.id);
|
||||||
await this.deleteEmbeddedDocuments('Item', toDelete);
|
await this.deleteEmbeddedDocuments('Item', toDelete);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import { Misc } from "../misc.js";
|
|||||||
import { DialogSplitItem } from "../dialog-split-item.js";
|
import { DialogSplitItem } from "../dialog-split-item.js";
|
||||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||||
import { Monnaie } from "../item-monnaie.js";
|
import { Monnaie } from "../item-monnaie.js";
|
||||||
import { RdDItem, TYPES } from "../item.js";
|
import { RdDItem, ITEM_TYPES } from "../item.js";
|
||||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -51,7 +51,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
||||||
this._appliquerRechercheObjets(formData.conteneurs, formData.inventaires);
|
this._appliquerRechercheObjets(formData.conteneurs, formData.inventaires);
|
||||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||||
formData.competences.filter(it => it.type == TYPES.competencecreature)
|
formData.competences.filter(it => it.type == ITEM_TYPES.competencecreature)
|
||||||
.forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it))
|
.forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it))
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import { ChatUtility } from "../chat-utility.js";
|
|||||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { Monnaie } from "../item-monnaie.js";
|
import { Monnaie } from "../item-monnaie.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { RdDAudio } from "../rdd-audio.js";
|
import { RdDAudio } from "../rdd-audio.js";
|
||||||
import { RdDConfirm } from "../rdd-confirm.js";
|
import { RdDConfirm } from "../rdd-confirm.js";
|
||||||
@ -704,7 +704,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
|
|
||||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
async actionPrincipale(item, onActionItem = async () => { }) {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case TYPES.conteneur: return await item.sheet.render(true);
|
case ITEM_TYPES.conteneur: return await item.sheet.render(true);
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ENTITE_INCARNE } from "../constants.js";
|
import { ENTITE_INCARNE } from "../constants.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { STATUSES } from "../settings/status-effects.js";
|
import { STATUSES } from "../settings/status-effects.js";
|
||||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ export class RdDCreature extends RdDBaseActorSang {
|
|||||||
isCreature() { return true }
|
isCreature() { return true }
|
||||||
|
|
||||||
canReceive(item) {
|
canReceive(item) {
|
||||||
return item.type == TYPES.competencecreature || item.isInventaire();
|
return item.type == ITEM_TYPES.competencecreature || item.isInventaire();
|
||||||
}
|
}
|
||||||
|
|
||||||
async remiseANeuf() {
|
async remiseANeuf() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { Misc } from "../misc.js";
|
import { Misc } from "../misc.js";
|
||||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||||
import { STATUSES } from "../settings/status-effects.js";
|
import { STATUSES } from "../settings/status-effects.js";
|
||||||
@ -12,7 +12,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canReceive(item) {
|
canReceive(item) {
|
||||||
return item.type == TYPES.competencecreature
|
return item.type == ITEM_TYPES.competencecreature
|
||||||
}
|
}
|
||||||
|
|
||||||
isEntite(typeentite = []) {
|
isEntite(typeentite = []) {
|
||||||
@ -29,7 +29,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
|||||||
getChance() { return this.getReve() }
|
getChance() { return this.getReve() }
|
||||||
|
|
||||||
getDraconicOuPossession() {
|
getDraconicOuPossession() {
|
||||||
return this.itemTypes[TYPES.competencecreature]
|
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||||
.filter(it => it.system.categorie == 'possession')
|
.filter(it => it.system.categorie == 'possession')
|
||||||
.sort(Misc.descending(it => it.system.niveau))
|
.sort(Misc.descending(it => it.system.niveau))
|
||||||
.find(it => true);
|
.find(it => true);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
const nomCategorieParade = {
|
const nomCategorieParade = {
|
||||||
@ -20,19 +20,35 @@ const nomCategorieParade = {
|
|||||||
export class RdDItemArme extends Item {
|
export class RdDItemArme extends Item {
|
||||||
|
|
||||||
static isArme(item) {
|
static isArme(item) {
|
||||||
return item.type == TYPES.arme || RdDItemCompetenceCreature.getCategorieAttaque(item);
|
return item.type == ITEM_TYPES.arme || RdDItemCompetenceCreature.getCategorieAttaque(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getArme(arme) {
|
static getArme(arme) {
|
||||||
switch (arme ? arme.type : '') {
|
switch (arme ? arme.type : '') {
|
||||||
case TYPES.arme: return arme;
|
case ITEM_TYPES.arme: return arme;
|
||||||
case TYPES.competencecreature:
|
case ITEM_TYPES.competencecreature:
|
||||||
return RdDItemCompetenceCreature.armeCreature(arme);
|
return RdDItemCompetenceCreature.armeCreature(arme);
|
||||||
}
|
}
|
||||||
return RdDItemArme.mainsNues();
|
return RdDItemArme.mainsNues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getCompetenceArme(arme, competenceName) {
|
||||||
|
switch (arme.type) {
|
||||||
|
case ITEM_TYPES.competencecreature:
|
||||||
|
return arme.name
|
||||||
|
case ITEM_TYPES.arme:
|
||||||
|
switch (competenceName) {
|
||||||
|
case 'competence': return arme.system.competence;
|
||||||
|
case 'unemain': return RdDItemArme.competence1Mains(arme);
|
||||||
|
case 'deuxmains': return RdDItemArme.competence2Mains(arme);
|
||||||
|
case 'tir': return arme.system.tir;
|
||||||
|
case 'lancer': return arme.system.lancer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
static computeNiveauArmes(armes, competences) {
|
static computeNiveauArmes(armes, competences) {
|
||||||
for (const arme of armes) {
|
for (const arme of armes) {
|
||||||
arme.system.niveau = RdDItemArme.niveauCompetenceArme(arme, competences);
|
arme.system.niveau = RdDItemArme.niveauCompetenceArme(arme, competences);
|
||||||
@ -68,14 +84,14 @@ export class RdDItemArme extends Item {
|
|||||||
return armeData.system.categorie_parade;
|
return armeData.system.categorie_parade;
|
||||||
}
|
}
|
||||||
// pour compatibilité avec des personnages existants
|
// pour compatibilité avec des personnages existants
|
||||||
if (armeData.type == TYPES.competencecreature || armeData.system.categorie == 'creature') {
|
if (armeData.type == ITEM_TYPES.competencecreature || armeData.system.categorie == 'creature') {
|
||||||
return armeData.system.categorie_parade || (armeData.system.isparade ? 'armes-naturelles' : '');
|
return armeData.system.categorie_parade || (armeData.system.isparade ? 'armes-naturelles' : '');
|
||||||
}
|
}
|
||||||
if (!armeData.type.match(/arme|competencecreature/)) {
|
if (!armeData.type.match(/arme|competencecreature/)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (armeData.system.competence == undefined) {
|
if (armeData.system.competence == undefined) {
|
||||||
return TYPES.competencecreature;
|
return ITEM_TYPES.competencecreature;
|
||||||
}
|
}
|
||||||
let compname = armeData.system.competence.toLowerCase();
|
let compname = armeData.system.competence.toLowerCase();
|
||||||
if (compname.match(/^(dague de jet|javelot|fouet|arc|arbalête|fronde|hache de jet|fléau)$/)) return '';
|
if (compname.match(/^(dague de jet|javelot|fouet|arc|arbalête|fronde|hache de jet|fléau)$/)) return '';
|
||||||
@ -157,18 +173,19 @@ export class RdDItemArme extends Item {
|
|||||||
}
|
}
|
||||||
return armeData;
|
return armeData;
|
||||||
}
|
}
|
||||||
static competence2Mains(arme) {
|
|
||||||
return arme.system.competence.replace(" 1 main", " 2 mains");
|
|
||||||
}
|
|
||||||
|
|
||||||
static competence1Mains(arme) {
|
static competence1Mains(arme) {
|
||||||
return arme.system.competence.replace(" 2 mains", " 1 main");
|
return arme.system.competence.replace(" 2 mains", " 1 main");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static competence2Mains(arme) {
|
||||||
|
return arme.system.competence.replace(" 1 main", " 2 mains");
|
||||||
|
}
|
||||||
|
|
||||||
static isArmeUtilisable(arme) {
|
static isArmeUtilisable(arme) {
|
||||||
switch (arme.type) {
|
switch (arme.type) {
|
||||||
case TYPES.arme: return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0)
|
case ITEM_TYPES.arme: return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0)
|
||||||
case TYPES.competencecreature: return true
|
case ITEM_TYPES.competencecreature: return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -184,7 +201,7 @@ export class RdDItemArme extends Item {
|
|||||||
return {
|
return {
|
||||||
_id: competence?.id,
|
_id: competence?.id,
|
||||||
name: 'Corps à corps',
|
name: 'Corps à corps',
|
||||||
type: TYPES.arme,
|
type: ITEM_TYPES.arme,
|
||||||
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.webp',
|
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.webp',
|
||||||
system: {
|
system: {
|
||||||
initiative: RdDCombatManager.calculInitiative(competence.system.niveau, melee),
|
initiative: RdDCombatManager.calculInitiative(competence.system.niveau, melee),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
const categories = {
|
const categories = {
|
||||||
@ -54,7 +54,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCompetenceAttaque(item) {
|
static isCompetenceAttaque(item) {
|
||||||
if (item.type == TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
switch (item.system.categorie) {
|
||||||
case "melee":
|
case "melee":
|
||||||
case "tir":
|
case "tir":
|
||||||
@ -68,7 +68,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getCategorieAttaque(item) {
|
static getCategorieAttaque(item) {
|
||||||
if (item.type == TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
switch (item.system.categorie) {
|
||||||
case "melee":
|
case "melee":
|
||||||
case "tir":
|
case "tir":
|
||||||
@ -82,7 +82,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
static isDommages(item) {
|
static isDommages(item) {
|
||||||
if (item.type == TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
switch (item.system.categorie) {
|
||||||
case "melee":
|
case "melee":
|
||||||
case "tir":
|
case "tir":
|
||||||
@ -94,7 +94,7 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
static isParade(item) {
|
static isParade(item) {
|
||||||
if (item.type == TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
switch (item.system.categorie) {
|
||||||
case "melee":
|
case "melee":
|
||||||
case "naturelle":
|
case "naturelle":
|
||||||
|
@ -12,7 +12,7 @@ import { SystemCompendiums } from "./settings/system-compendiums.js";
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet for RdD specific items
|
* Extend the basic ItemSheet for RdD specific items
|
||||||
@ -101,7 +101,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
isComestible: this.item.getUtilisationCuisine(),
|
isComestible: this.item.getUtilisationCuisine(),
|
||||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||||
}
|
}
|
||||||
if (this.item.type == TYPES.competencecreature) {
|
if (this.item.type == ITEM_TYPES.competencecreature) {
|
||||||
formData.isparade = RdDItemCompetenceCreature.isParade(this.item)
|
formData.isparade = RdDItemCompetenceCreature.isParade(this.item)
|
||||||
formData.isdommages = RdDItemCompetenceCreature.isDommages(this.item)
|
formData.isdommages = RdDItemCompetenceCreature.isDommages(this.item)
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { TMRUtility } from "./tmr-utility.js";
|
import { TMRUtility } from "./tmr-utility.js";
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ export class RdDItemSort extends Item {
|
|||||||
*/
|
*/
|
||||||
static getBonusCaseList(item, newCase = false) {
|
static getBonusCaseList(item, newCase = false) {
|
||||||
// Gestion spéciale case bonus
|
// Gestion spéciale case bonus
|
||||||
if (item.type == 'sort') {
|
if (item.type == ITEM_TYPES.sort) {
|
||||||
return RdDItemSort.buildBonusCaseList(item.system.bonuscase, newCase);
|
return RdDItemSort.buildBonusCaseList(item.system.bonuscase, newCase);
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
118
module/item.js
118
module/item.js
@ -9,7 +9,15 @@ import { RdDRaretes } from "./item/raretes.js";
|
|||||||
import { RdDItemCompetence } from "./item-competence.js";
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
|
|
||||||
export const TYPES = {
|
export const ACTOR_TYPES = {
|
||||||
|
personnage: 'personnage',
|
||||||
|
creature: 'creature',
|
||||||
|
entite: 'entite',
|
||||||
|
commerce: 'commerce',
|
||||||
|
vehicule: 'vehicule'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ITEM_TYPES = {
|
||||||
competence: 'competence',
|
competence: 'competence',
|
||||||
competencecreature: 'competencecreature',
|
competencecreature: 'competencecreature',
|
||||||
empoignade: 'empoignade',
|
empoignade: 'empoignade',
|
||||||
@ -56,33 +64,33 @@ export const TYPES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typesInventaireMateriel = [
|
const typesInventaireMateriel = [
|
||||||
TYPES.arme,
|
ITEM_TYPES.arme,
|
||||||
TYPES.armure,
|
ITEM_TYPES.armure,
|
||||||
TYPES.conteneur,
|
ITEM_TYPES.conteneur,
|
||||||
TYPES.faune,
|
ITEM_TYPES.faune,
|
||||||
TYPES.gemme,
|
ITEM_TYPES.gemme,
|
||||||
TYPES.herbe,
|
ITEM_TYPES.herbe,
|
||||||
TYPES.plante,
|
ITEM_TYPES.plante,
|
||||||
TYPES.ingredient,
|
ITEM_TYPES.ingredient,
|
||||||
TYPES.livre,
|
ITEM_TYPES.livre,
|
||||||
TYPES.monnaie,
|
ITEM_TYPES.monnaie,
|
||||||
TYPES.munition,
|
ITEM_TYPES.munition,
|
||||||
TYPES.nourritureboisson,
|
ITEM_TYPES.nourritureboisson,
|
||||||
TYPES.objet,
|
ITEM_TYPES.objet,
|
||||||
TYPES.potion,
|
ITEM_TYPES.potion,
|
||||||
]
|
]
|
||||||
const typesInventaire = {
|
const typesInventaire = {
|
||||||
materiel: typesInventaireMateriel,
|
materiel: typesInventaireMateriel,
|
||||||
all: ['service'].concat(typesInventaireMateriel),
|
all: ['service'].concat(typesInventaireMateriel),
|
||||||
}
|
}
|
||||||
|
|
||||||
const typesObjetsOeuvres = [TYPES.oeuvre, TYPES.recettecuisine, TYPES.musique, TYPES.chant, TYPES.danse, TYPES.jeu]
|
const typesObjetsOeuvres = [ITEM_TYPES.oeuvre, ITEM_TYPES.recettecuisine, ITEM_TYPES.musique, ITEM_TYPES.chant, ITEM_TYPES.danse, ITEM_TYPES.jeu]
|
||||||
const typesObjetsDraconiques = [TYPES.queue, TYPES.ombre, TYPES.souffle, TYPES.tete, TYPES.signedraconique, TYPES.sortreserve, TYPES.rencontre]
|
const typesObjetsDraconiques = [ITEM_TYPES.queue, ITEM_TYPES.ombre, ITEM_TYPES.souffle, ITEM_TYPES.tete, ITEM_TYPES.signedraconique, ITEM_TYPES.sortreserve, ITEM_TYPES.rencontre]
|
||||||
const typesObjetsConnaissance = [TYPES.meditation, TYPES.recettealchimique, TYPES.sort]
|
const typesObjetsConnaissance = [ITEM_TYPES.meditation, ITEM_TYPES.recettealchimique, ITEM_TYPES.sort]
|
||||||
const typesObjetsEffet = [TYPES.possession, TYPES.poison, TYPES.maladie, TYPES.blessure]
|
const typesObjetsEffet = [ITEM_TYPES.possession, ITEM_TYPES.poison, ITEM_TYPES.maladie, ITEM_TYPES.blessure]
|
||||||
const typesObjetsCompetence = [TYPES.competence, TYPES.competencecreature]
|
const typesObjetsCompetence = [ITEM_TYPES.competence, ITEM_TYPES.competencecreature]
|
||||||
const typesObjetsTemporels = [TYPES.blessure, TYPES.poison, TYPES.maladie, TYPES.queue, TYPES.ombre, TYPES.souffle, TYPES.signedraconique, TYPES.rencontre]
|
const typesObjetsTemporels = [ITEM_TYPES.blessure, ITEM_TYPES.poison, ITEM_TYPES.maladie, ITEM_TYPES.queue, ITEM_TYPES.ombre, ITEM_TYPES.souffle, ITEM_TYPES.signedraconique, ITEM_TYPES.rencontre]
|
||||||
const typesObjetsEquipable = [TYPES.arme, TYPES.armure, TYPES.objet];
|
const typesObjetsEquipable = [ITEM_TYPES.arme, ITEM_TYPES.armure, ITEM_TYPES.objet];
|
||||||
const typesEnvironnement = typesInventaireMateriel;
|
const typesEnvironnement = typesInventaireMateriel;
|
||||||
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
||||||
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
||||||
@ -141,12 +149,12 @@ export class RdDItem extends Item {
|
|||||||
static isFieldInventaireModifiable(type, field) {
|
static isFieldInventaireModifiable(type, field) {
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case 'quantite':
|
case 'quantite':
|
||||||
if ([TYPES.conteneur].includes(type)) {
|
if ([ITEM_TYPES.conteneur].includes(type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cout':
|
case 'cout':
|
||||||
if ([TYPES.monnaie].includes(type)) {
|
if ([ITEM_TYPES.monnaie].includes(type)) {
|
||||||
return game.user.isGM;
|
return game.user.isGM;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -195,15 +203,15 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
getUniteQuantite() {
|
getUniteQuantite() {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.monnaie: return "(Pièces)"
|
case ITEM_TYPES.monnaie: return "(Pièces)"
|
||||||
case TYPES.herbe:
|
case ITEM_TYPES.herbe:
|
||||||
switch (this.system.categorie) {
|
switch (this.system.categorie) {
|
||||||
case 'Alchimie': case 'Repos': case 'Soin':
|
case 'Alchimie': case 'Repos': case 'Soin':
|
||||||
return "(Brins)"
|
return "(Brins)"
|
||||||
case 'Cuisine': return '';
|
case 'Cuisine': return '';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
case TYPES.ingredient: return "(Pépins ou Brins)"
|
case ITEM_TYPES.ingredient: return "(Pépins ou Brins)"
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -212,13 +220,13 @@ export class RdDItem extends Item {
|
|||||||
return typesObjetsEquipable.includes(this.type)
|
return typesObjetsEquipable.includes(this.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
isCompetencePersonnage() { return this.type == TYPES.competence }
|
isCompetencePersonnage() { return this.type == ITEM_TYPES.competence }
|
||||||
isCompetenceCreature() { return this.type == TYPES.competencecreature }
|
isCompetenceCreature() { return this.type == ITEM_TYPES.competencecreature }
|
||||||
isConteneur() { return this.type == TYPES.conteneur; }
|
isConteneur() { return this.type == ITEM_TYPES.conteneur; }
|
||||||
isMonnaie() { return this.type == TYPES.monnaie; }
|
isMonnaie() { return this.type == ITEM_TYPES.monnaie; }
|
||||||
isPotion() { return this.type == TYPES.potion; }
|
isPotion() { return this.type == ITEM_TYPES.potion; }
|
||||||
isNourritureBoisson() { return this.type == TYPES.nourritureboisson; }
|
isNourritureBoisson() { return this.type == ITEM_TYPES.nourritureboisson; }
|
||||||
isService() { return this.type == TYPES.service; }
|
isService() { return this.type == ITEM_TYPES.service; }
|
||||||
|
|
||||||
isCompetence() { return typesObjetsCompetence.includes(this.type) }
|
isCompetence() { return typesObjetsCompetence.includes(this.type) }
|
||||||
isEsquive() {
|
isEsquive() {
|
||||||
@ -237,27 +245,27 @@ export class RdDItem extends Item {
|
|||||||
return this.isCompetence() && ['melee', 'tir', 'lancer'].includes(this.system.categorie)
|
return this.isCompetence() && ['melee', 'tir', 'lancer'].includes(this.system.categorie)
|
||||||
}
|
}
|
||||||
|
|
||||||
isCompetencePossession() { return TYPES.competencecreature == this.type && this.system.categorie == "possession" }
|
isCompetencePossession() { return ITEM_TYPES.competencecreature == this.type && this.system.categorie == "possession" }
|
||||||
isTemporel() { return typesObjetsTemporels.includes(this.type) }
|
isTemporel() { return typesObjetsTemporels.includes(this.type) }
|
||||||
isOeuvre() { return typesObjetsOeuvres.includes(this.type) }
|
isOeuvre() { return typesObjetsOeuvres.includes(this.type) }
|
||||||
isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) }
|
isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) }
|
||||||
isQueueDragon() { return [TYPES.queue, TYPES.ombre].includes(this.type) }
|
isQueueDragon() { return [ITEM_TYPES.queue, ITEM_TYPES.ombre].includes(this.type) }
|
||||||
isEffet() { return typesObjetsEffet.includes(this.type) }
|
isEffet() { return typesObjetsEffet.includes(this.type) }
|
||||||
isConnaissance() { return typesObjetsConnaissance.includes(this.type) }
|
isConnaissance() { return typesObjetsConnaissance.includes(this.type) }
|
||||||
|
|
||||||
isInventaire(mode = 'materiel') { return RdDItem.getItemTypesInventaire(mode).includes(this.type); }
|
isInventaire(mode = 'materiel') { return RdDItem.getItemTypesInventaire(mode).includes(this.type); }
|
||||||
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
|
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
|
||||||
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
|
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
|
||||||
isHerbeAPotion() { return this.type == TYPES.herbe && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
|
isHerbeAPotion() { return this.type == ITEM_TYPES.herbe && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
|
||||||
isBlessure() { return this.type == TYPES.blessure }
|
isBlessure() { return this.type == ITEM_TYPES.blessure }
|
||||||
|
|
||||||
isPresentDansMilieux(milieux) {
|
isPresentDansMilieux(milieux) {
|
||||||
return this.getEnvironnements(milieux).length > 0
|
return this.getEnvironnements(milieux).length > 0
|
||||||
}
|
}
|
||||||
getCategories() {
|
getCategories() {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.competence: return RdDItemCompetence.getCategories()
|
case ITEM_TYPES.competence: return RdDItemCompetence.getCategories()
|
||||||
case TYPES.competencecreature: return RdDItemCompetenceCreature.getCategories()
|
case ITEM_TYPES.competencecreature: return RdDItemCompetenceCreature.getCategories()
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
@ -341,15 +349,15 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
getUtilisation() {
|
getUtilisation() {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.potion:
|
case ITEM_TYPES.potion:
|
||||||
switch (this.system.categorie) {
|
switch (this.system.categorie) {
|
||||||
case 'Alchimie': case 'AlchimieEnchante': case 'AlchimieAutre': return 'alchimie'
|
case 'Alchimie': case 'AlchimieEnchante': case 'AlchimieAutre': return 'alchimie'
|
||||||
case 'Cuisine': return 'cuisine'
|
case 'Cuisine': return 'cuisine'
|
||||||
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante': return 'soins'
|
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante': return 'soins'
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
case TYPES.nourritureboisson: return 'cuisine';
|
case ITEM_TYPES.nourritureboisson: return 'cuisine';
|
||||||
case TYPES.herbe: case TYPES.faune: case TYPES.ingredient: case TYPES.plante:
|
case ITEM_TYPES.herbe: case ITEM_TYPES.faune: case ITEM_TYPES.ingredient: case ITEM_TYPES.plante:
|
||||||
switch (this.system.categorie) {
|
switch (this.system.categorie) {
|
||||||
case 'Cuisine': return 'cuisine';
|
case 'Cuisine': return 'cuisine';
|
||||||
case 'Toxique': case 'Poison': return 'poison';
|
case 'Toxique': case 'Poison': return 'poison';
|
||||||
@ -364,9 +372,9 @@ export class RdDItem extends Item {
|
|||||||
getUtilisationCuisine() {
|
getUtilisationCuisine() {
|
||||||
if (this.getUtilisation() == 'cuisine') {
|
if (this.getUtilisation() == 'cuisine') {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.nourritureboisson:
|
case ITEM_TYPES.nourritureboisson:
|
||||||
return 'pret';
|
return 'pret';
|
||||||
case TYPES.herbe: case TYPES.faune: case TYPES.ingredient: case TYPES.plante:
|
case ITEM_TYPES.herbe: case ITEM_TYPES.faune: case ITEM_TYPES.ingredient: case ITEM_TYPES.plante:
|
||||||
return 'brut';
|
return 'brut';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,7 +382,7 @@ export class RdDItem extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isCristalAlchimique() {
|
isCristalAlchimique() {
|
||||||
return this.type == TYPES.objet && Grammar.includesLowerCaseNoAccent(this.name, 'cristal alchimique') && this.system.quantite > 0;
|
return this.type == ITEM_TYPES.objet && Grammar.includesLowerCaseNoAccent(this.name, 'cristal alchimique') && this.system.quantite > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
isMagique() {
|
isMagique() {
|
||||||
@ -402,11 +410,11 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
getEnc() {
|
getEnc() {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.service:
|
case ITEM_TYPES.service:
|
||||||
return 0;
|
return 0;
|
||||||
case TYPES.herbe:
|
case ITEM_TYPES.herbe:
|
||||||
return this.getEncHerbe();
|
return this.getEncHerbe();
|
||||||
case TYPES.gemme:
|
case ITEM_TYPES.gemme:
|
||||||
return encPepin * this.system.taille;
|
return encPepin * this.system.taille;
|
||||||
}
|
}
|
||||||
return Math.max(this.system.encombrement ?? 0, 0);
|
return Math.max(this.system.encombrement ?? 0, 0);
|
||||||
@ -484,7 +492,7 @@ export class RdDItem extends Item {
|
|||||||
|
|
||||||
getActionPrincipale(options = { warnIfNot: true }) {
|
getActionPrincipale(options = { warnIfNot: true }) {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.conteneur: return 'Ouvrir';
|
case ITEM_TYPES.conteneur: return 'Ouvrir';
|
||||||
}
|
}
|
||||||
if (this.actor?.isPersonnage()) {
|
if (this.actor?.isPersonnage()) {
|
||||||
const warn = options.warnIfNot;
|
const warn = options.warnIfNot;
|
||||||
@ -492,11 +500,11 @@ export class RdDItem extends Item {
|
|||||||
return 'Cuisiner';
|
return 'Cuisiner';
|
||||||
}
|
}
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
|
case ITEM_TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
|
||||||
case TYPES.potion: return this._actionOrWarnQuantiteZero('Consommer', warn);
|
case ITEM_TYPES.potion: return this._actionOrWarnQuantiteZero('Consommer', warn);
|
||||||
case TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
|
case ITEM_TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
|
||||||
case TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
case ITEM_TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
||||||
case TYPES.queue: case TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
|
case ITEM_TYPES.queue: case ITEM_TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -2,7 +2,7 @@ import { RdDBaseActor } from "./actor/base-actor.js";
|
|||||||
import { LOG_HEAD, SYSTEM_RDD } from "./constants.js";
|
import { LOG_HEAD, SYSTEM_RDD } from "./constants.js";
|
||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { Monnaie } from "./item-monnaie.js";
|
import { Monnaie } from "./item-monnaie.js";
|
||||||
import { RdDItem, TYPES } from "./item.js";
|
import { RdDItem, ITEM_TYPES } from "./item.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDRaretes } from "./item/raretes.js";
|
import { RdDRaretes } from "./item/raretes.js";
|
||||||
import { RdDCalendrier } from "./time/rdd-calendrier.js";
|
import { RdDCalendrier } from "./time/rdd-calendrier.js";
|
||||||
@ -465,7 +465,7 @@ class _10_7_19_CategorieCompetenceCreature extends Migration {
|
|||||||
|
|
||||||
async migrate() {
|
async migrate() {
|
||||||
await this.applyItemsUpdates(items => items
|
await this.applyItemsUpdates(items => items
|
||||||
.filter(it => TYPES.competencecreature == it.type)
|
.filter(it => ITEM_TYPES.competencecreature == it.type)
|
||||||
.map(it => this.migrateCompetenceCreature(it))
|
.map(it => this.migrateCompetenceCreature(it))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -502,7 +502,7 @@ class _10_7_19_PossessionsEntiteVictime extends Migration {
|
|||||||
|
|
||||||
async migrate() {
|
async migrate() {
|
||||||
await this.applyItemsUpdates(items => items
|
await this.applyItemsUpdates(items => items
|
||||||
.filter(it => TYPES.possession == it.type)
|
.filter(it => ITEM_TYPES.possession == it.type)
|
||||||
.map(it => this.migratePossession(it))
|
.map(it => this.migratePossession(it))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
|||||||
import { ChatUtility } from "./chat-utility.js";
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
@ -92,18 +92,18 @@ export class RdDEmpoignade {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isEmpoignadeEnCours(actor) {
|
static isEmpoignadeEnCours(actor) {
|
||||||
return actor.itemTypes[TYPES.empoignade].find(it => it.system.pointsemp > 0)
|
return actor.itemTypes[ITEM_TYPES.empoignade].find(it => it.system.pointsemp > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getEmpoignadeById(actor, id) {
|
static getEmpoignadeById(actor, id) {
|
||||||
let emp = actor.itemTypes[TYPES.empoignade].find(it => it.system.empoignadeid == id)
|
let emp = actor.itemTypes[ITEM_TYPES.empoignade].find(it => it.system.empoignadeid == id)
|
||||||
return emp && foundry.utils.duplicate(emp) || undefined;
|
return emp && foundry.utils.duplicate(emp) || undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getEmpoignade(attacker, defender) {
|
static getEmpoignade(attacker, defender) {
|
||||||
let emp = attacker.itemTypes[TYPES.empoignade].find(it =>
|
let emp = attacker.itemTypes[ITEM_TYPES.empoignade].find(it =>
|
||||||
(it.system.empoigneurid == attacker.id && it.system.empoigneid == defender.id) ||
|
(it.system.empoigneurid == attacker.id && it.system.empoigneid == defender.id) ||
|
||||||
(it.system.empoigneurid == defender.id && it.system.empoigneid == attacker.id)
|
(it.system.empoigneurid == defender.id && it.system.empoigneid == attacker.id)
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { RdDItemArme } from "./item-arme.js";
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
|
|
||||||
export class RdDHotbar {
|
export class RdDHotbar {
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export class RdDHotbar {
|
|||||||
|
|
||||||
static async addToHotbar(item, slot) {
|
static async addToHotbar(item, slot) {
|
||||||
switch (item?.type ?? '') {
|
switch (item?.type ?? '') {
|
||||||
case TYPES.arme:
|
case ITEM_TYPES.arme:
|
||||||
{
|
{
|
||||||
// Les armes peuvent avoir plusieurs usages
|
// Les armes peuvent avoir plusieurs usages
|
||||||
if (item.system.competence != '') {
|
if (item.system.competence != '') {
|
||||||
@ -54,12 +54,12 @@ export class RdDHotbar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
case TYPES.competencecreature:
|
case ITEM_TYPES.competencecreature:
|
||||||
const categorie = RdDItemCompetenceCreature.getCategorieAttaque(item) ?? 'competence';
|
const categorie = RdDItemCompetenceCreature.getCategorieAttaque(item) ?? 'competence';
|
||||||
await this.createItemMacro(item, slot, categorie)
|
await this.createItemMacro(item, slot, categorie)
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
case TYPES.competence:
|
case ITEM_TYPES.competence:
|
||||||
await this.createItemMacro(item, slot++, 'competence')
|
await this.createItemMacro(item, slot++, 'competence')
|
||||||
if (item.isCorpsACorps()) {
|
if (item.isCorpsACorps()) {
|
||||||
await this.createItemMacro(item, slot++, 'pugilat')
|
await this.createItemMacro(item, slot++, 'pugilat')
|
||||||
@ -79,7 +79,7 @@ export class RdDHotbar {
|
|||||||
* Actor - open actor sheet
|
* Actor - open actor sheet
|
||||||
* Journal - open journal sheet
|
* Journal - open journal sheet
|
||||||
*/
|
*/
|
||||||
static initDropbar() {
|
static init() {
|
||||||
|
|
||||||
Hooks.on('hotbarDrop', (bar, documentData, slot) => {
|
Hooks.on('hotbarDrop', (bar, documentData, slot) => {
|
||||||
|
|
||||||
@ -88,9 +88,9 @@ export class RdDHotbar {
|
|||||||
const item = fromUuidSync(documentData.uuid) ?? this.actor.items.get(documentData.uuid)
|
const item = fromUuidSync(documentData.uuid) ?? this.actor.items.get(documentData.uuid)
|
||||||
console.log('DROP', documentData, item)
|
console.log('DROP', documentData, item)
|
||||||
switch (item?.type) {
|
switch (item?.type) {
|
||||||
case TYPES.arme:
|
case ITEM_TYPES.arme:
|
||||||
case TYPES.competence:
|
case ITEM_TYPES.competence:
|
||||||
case TYPES.competencecreature:
|
case ITEM_TYPES.competencecreature:
|
||||||
this.addToHotbar(item, slot)
|
this.addToHotbar(item, slot)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -116,9 +116,9 @@ export class RdDHotbar {
|
|||||||
|
|
||||||
// Trigger the item roll
|
// Trigger the item roll
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case TYPES.arme:
|
case ITEM_TYPES.arme:
|
||||||
return actor.rollArme(item, categorieArme);
|
return actor.rollArme(item, categorieArme);
|
||||||
case TYPES.competence:
|
case ITEM_TYPES.competence:
|
||||||
if (item.isCorpsACorps()) {
|
if (item.isCorpsACorps()) {
|
||||||
switch (categorieArme) {
|
switch (categorieArme) {
|
||||||
case 'pugilat':
|
case 'pugilat':
|
||||||
@ -128,7 +128,7 @@ export class RdDHotbar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return actor.rollCompetence(item);
|
return actor.rollCompetence(item);
|
||||||
case TYPES.competencecreature:
|
case ITEM_TYPES.competencecreature:
|
||||||
return item.system.iscombat && !item.system.isparade
|
return item.system.iscombat && !item.system.isparade
|
||||||
? actor.rollArme(item, categorieArme)
|
? actor.rollArme(item, categorieArme)
|
||||||
: actor.rollCompetence(item);
|
: actor.rollCompetence(item);
|
||||||
|
@ -3,7 +3,7 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
|||||||
import { RdDRoll } from "./rdd-roll.js";
|
import { RdDRoll } from "./rdd-roll.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { Targets } from "./targets.js";
|
import { Targets } from "./targets.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* On part du principe qu'une entité démarre tjs
|
/* On part du principe qu'une entité démarre tjs
|
||||||
@ -20,9 +20,9 @@ export class RdDPossession {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static searchPossessionFromEntite(attacker, defender) {
|
static searchPossessionFromEntite(attacker, defender) {
|
||||||
let poss = attacker.items.find(poss => poss.type == TYPES.possession && poss.system.victime.actorid == defender.id);
|
let poss = attacker.items.find(poss => poss.type == ITEM_TYPES.possession && poss.system.victime.actorid == defender.id);
|
||||||
if (!poss) {
|
if (!poss) {
|
||||||
poss = defender.items.find(poss => poss.type == TYPES.possession && poss.system.victime.actorid == defender.id);
|
poss = defender.items.find(poss => poss.type == ITEM_TYPES.possession && poss.system.victime.actorid == defender.id);
|
||||||
}
|
}
|
||||||
return poss && foundry.utils.duplicate(poss) || undefined;
|
return poss && foundry.utils.duplicate(poss) || undefined;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import { RdDDice } from "./rdd-dice.js";
|
|||||||
import { STATUSES } from "./settings/status-effects.js";
|
import { STATUSES } from "./settings/status-effects.js";
|
||||||
import { RdDRencontre } from "./item/rencontre.js";
|
import { RdDRencontre } from "./item/rencontre.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
|
|
||||||
const TMR_DISPLAY_SIZE = {
|
const TMR_DISPLAY_SIZE = {
|
||||||
@ -208,11 +208,11 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get sortsReserve() {
|
get sortsReserve() {
|
||||||
return this.actor.itemTypes[TYPES.sortreserve];
|
return this.actor.itemTypes[ITEM_TYPES.sortreserve];
|
||||||
}
|
}
|
||||||
|
|
||||||
getSortsReserve(coord) {
|
getSortsReserve(coord) {
|
||||||
return this.actor.itemTypes[TYPES.sortreserve].filter(// Reserve sur une case fleuve ou normale
|
return this.actor.itemTypes[ITEM_TYPES.sortreserve].filter(// Reserve sur une case fleuve ou normale
|
||||||
TMRUtility.getTMR(coord).type == 'fleuve'
|
TMRUtility.getTMR(coord).type == 'fleuve'
|
||||||
? it => TMRUtility.getTMR(it.system.coord).type == 'fleuve'
|
? it => TMRUtility.getTMR(it.system.coord).type == 'fleuve'
|
||||||
: it => it.system.coord == coord
|
: it => it.system.coord == coord
|
||||||
@ -270,7 +270,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getTokensSortsReserve() {
|
_getTokensSortsReserve() {
|
||||||
const sortsReserve = this.actor.itemTypes[TYPES.sortreserve];
|
const sortsReserve = this.actor.itemTypes[ITEM_TYPES.sortreserve];
|
||||||
return Misc.concat(sortsReserve.map(sortReserve =>
|
return Misc.concat(sortsReserve.map(sortReserve =>
|
||||||
EffetsDraconiques.sortReserve.tokens(this.pixiTMR, sortReserve, () => sortReserve.system.coord)))
|
EffetsDraconiques.sortReserve.tokens(this.pixiTMR, sortReserve, () => sortReserve.system.coord)))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { TMRUtility } from "../tmr-utility.js";
|
import { TMRUtility } from "../tmr-utility.js";
|
||||||
import { PixiTMR } from "./pixi-tmr.js";
|
import { PixiTMR } from "./pixi-tmr.js";
|
||||||
|
|
||||||
@ -12,10 +12,10 @@ export class Draconique {
|
|||||||
static init() {
|
static init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static isCaseTMR(item) { return item.type == TYPES.casetmr; }
|
static isCaseTMR(item) { return item.type == ITEM_TYPES.casetmr; }
|
||||||
static isQueueDragon(item) { return item.isQueueDragon(); }
|
static isQueueDragon(item) { return item.isQueueDragon(); }
|
||||||
static isSouffleDragon(item) { return item.type == TYPES.souffle; }
|
static isSouffleDragon(item) { return item.type == ITEM_TYPES.souffle; }
|
||||||
static isTeteDragon(item) { return item.type == TYPES.tete; }
|
static isTeteDragon(item) { return item.type == ITEM_TYPES.tete; }
|
||||||
static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); }
|
static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); }
|
||||||
|
|
||||||
static register(draconique, code = undefined) {
|
static register(draconique, code = undefined) {
|
||||||
|
@ -18,7 +18,7 @@ import { Periple } from "./periple.js";
|
|||||||
import { UrgenceDraconique } from "./urgence-draconique.js";
|
import { UrgenceDraconique } from "./urgence-draconique.js";
|
||||||
import { Grammar } from "../grammar.js";
|
import { Grammar } from "../grammar.js";
|
||||||
import { AugmentationSeuil } from "./augmentation-seuil.js";
|
import { AugmentationSeuil } from "./augmentation-seuil.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
|
|
||||||
export class EffetsDraconiques {
|
export class EffetsDraconiques {
|
||||||
static carteTmr = new CarteTmr();
|
static carteTmr = new CarteTmr();
|
||||||
@ -122,11 +122,11 @@ export class EffetsDraconiques {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static tetesDragon(actor, name) {
|
static tetesDragon(actor, name) {
|
||||||
return actor.itemTypes[TYPES.tete].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
return actor.itemTypes[ITEM_TYPES.tete].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static soufflesDragon(actor, name) {
|
static soufflesDragon(actor, name) {
|
||||||
return actor.itemTypes[TYPES.souffle].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
return actor.itemTypes[ITEM_TYPES.souffle].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static queuesDragon(actor, name) {
|
static queuesDragon(actor, name) {
|
||||||
@ -134,7 +134,7 @@ export class EffetsDraconiques {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static queuesSoufflesDragon(actor, name) {
|
static queuesSoufflesDragon(actor, name) {
|
||||||
return actor.filterItems(it => [TYPES.queue, TYPES.ombre, TYPES.souffle].includes(it.type) && Grammar.includesLowerCaseNoAccent(it.name, name));
|
return actor.filterItems(it => [ITEM_TYPES.queue, ITEM_TYPES.ombre, ITEM_TYPES.souffle].includes(it.type) && Grammar.includesLowerCaseNoAccent(it.name, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static countAugmentationSeuil(actor) {
|
static countAugmentationSeuil(actor) {
|
||||||
|
@ -5,7 +5,7 @@ import { RdDRollTables } from "../rdd-rolltables.js";
|
|||||||
import { TMRUtility } from "../tmr-utility.js";
|
import { TMRUtility } from "../tmr-utility.js";
|
||||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||||
import { Draconique } from "./draconique.js";
|
import { Draconique } from "./draconique.js";
|
||||||
import { TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { TMRAnimations } from "./animation.js";
|
import { TMRAnimations } from "./animation.js";
|
||||||
|
|
||||||
export class UrgenceDraconique extends Draconique {
|
export class UrgenceDraconique extends Draconique {
|
||||||
@ -14,7 +14,7 @@ export class UrgenceDraconique extends Draconique {
|
|||||||
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('urgence draconique'); }
|
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('urgence draconique'); }
|
||||||
manualMessage() { return false }
|
manualMessage() { return false }
|
||||||
async onActorCreateOwned(actor, queue) {
|
async onActorCreateOwned(actor, queue) {
|
||||||
const coordSortsReserve = actor.itemTypes[TYPES.sortreserve].map(it => it.system.coord) ?? [];
|
const coordSortsReserve = actor.itemTypes[ITEM_TYPES.sortreserve].map(it => it.system.coord) ?? [];
|
||||||
if (coordSortsReserve.length == 0) {
|
if (coordSortsReserve.length == 0) {
|
||||||
// La queue se transforme en idée fixe
|
// La queue se transforme en idée fixe
|
||||||
const ideeFixe = await RdDRollTables.getIdeeFixe();
|
const ideeFixe = await RdDRollTables.getIdeeFixe();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { TYPES } from "../item.js"
|
import { ITEM_TYPES } from "../item.js"
|
||||||
import { RdDItemCompetence } from "../item-competence.js"
|
import { RdDItemCompetence } from "../item-competence.js"
|
||||||
import { ChatUtility } from "../chat-utility.js"
|
import { ChatUtility } from "../chat-utility.js"
|
||||||
import { Misc } from "../misc.js"
|
import { Misc } from "../misc.js"
|
||||||
@ -69,7 +69,7 @@ export class DialogFatigueVoyage extends Dialog {
|
|||||||
}
|
}
|
||||||
const competencesVoyage = {}
|
const competencesVoyage = {}
|
||||||
CODES_COMPETENCES_VOYAGE.forEach(codeSurvie => {
|
CODES_COMPETENCES_VOYAGE.forEach(codeSurvie => {
|
||||||
competencesVoyage[codeSurvie] = RdDItemCompetence.findCompetence(actor.itemTypes[TYPES.competence], codeSurvie, { onMessage: () => { } })
|
competencesVoyage[codeSurvie] = RdDItemCompetence.findCompetence(actor.itemTypes[ITEM_TYPES.competence], codeSurvie, { onMessage: () => { } })
|
||||||
})
|
})
|
||||||
TABLEAU_FATIGUE_MARCHE.forEach(terrain => {
|
TABLEAU_FATIGUE_MARCHE.forEach(terrain => {
|
||||||
actorParameters.survies[terrain.code] = Misc.join(
|
actorParameters.survies[terrain.code] = Misc.join(
|
||||||
|
Loading…
Reference in New Issue
Block a user