Calculs des informations dérivées
Calcul automatique des informations dérivées: - vie max - endurance max - bonus dommages Ces informations ne peuvent plus être saisies. L'endurance max des animaux est vie+constitution. Les entités non-incarnées n'ont pas de +dom
This commit is contained in:
parent
e98a793506
commit
f13677106e
@ -55,40 +55,26 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
* Prepare Character type specific data
|
* Prepare Character type specific data
|
||||||
*/
|
*/
|
||||||
prepareActorData() {
|
prepareActorData() {
|
||||||
this.$computeCaracDerivee()
|
|
||||||
this.$computeIsHautRevant()
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
$computeCaracDerivee() {
|
|
||||||
|
|
||||||
this.system.carac.force.value = Math.min(this.system.carac.force.value, parseInt(this.system.carac.taille.value) + 4);
|
this.system.carac.force.value = Math.min(this.system.carac.force.value, parseInt(this.system.carac.taille.value) + 4);
|
||||||
this.system.carac.melee.value = Math.floor((parseInt(this.system.carac.force.value) + parseInt(this.system.carac.agilite.value)) / 2);
|
|
||||||
|
this.system.carac.melee.value = Math.floor((this.getForce() + parseInt(this.system.carac.agilite.value)) / 2);
|
||||||
this.system.carac.tir.value = Math.floor((parseInt(this.system.carac.vue.value) + parseInt(this.system.carac.dexterite.value)) / 2);
|
this.system.carac.tir.value = Math.floor((parseInt(this.system.carac.vue.value) + parseInt(this.system.carac.dexterite.value)) / 2);
|
||||||
this.system.carac.lancer.value = Math.floor((parseInt(this.system.carac.tir.value) + parseInt(this.system.carac.force.value)) / 2);
|
this.system.carac.lancer.value = Math.floor((parseInt(this.system.carac.tir.value) + parseInt(this.system.carac.force.value)) / 2);
|
||||||
this.system.carac.derobee.value = Math.floor(parseInt(((21 - this.system.carac.taille.value)) + parseInt(this.system.carac.agilite.value)) / 2);
|
this.system.carac.derobee.value = Math.floor(parseInt(((21 - this.system.carac.taille.value)) + parseInt(this.system.carac.agilite.value)) / 2);
|
||||||
|
|
||||||
let bonusDomKey = Math.floor((parseInt(this.system.carac.force.value) + parseInt(this.system.carac.taille.value)) / 2);
|
super.prepareActorData()
|
||||||
let tailleData = RdDCarac.getCaracDerivee(bonusDomKey);
|
|
||||||
this.system.attributs.plusdom.value = tailleData.plusdom;
|
|
||||||
this.system.attributs.encombrement.value = (parseInt(this.system.carac.force.value) + parseInt(this.system.carac.taille.value)) / 2;
|
|
||||||
|
|
||||||
this.system.attributs.sconst.value = RdDCarac.calculSConst(this.system.carac.constitution.value);
|
this.system.attributs.sconst.value = RdDCarac.calculSConst(this.getConstitution())
|
||||||
this.system.attributs.sust.value = RdDCarac.getCaracDerivee(this.system.carac.taille.value).sust;
|
this.system.attributs.sust.value = RdDCarac.getCaracDerivee(this.getTaille()).sust
|
||||||
this.system.sante.vie.max = Math.ceil((parseInt(this.system.carac.taille.value) + parseInt(this.system.carac.constitution.value)) / 2);
|
|
||||||
|
|
||||||
this.system.sante.vie.value = Math.min(this.system.sante.vie.value, this.system.sante.vie.max)
|
this.system.sante.fatigue.max = this.getFatigueMax()
|
||||||
this.system.sante.endurance.max = Math.max(parseInt(this.system.carac.taille.value) + parseInt(this.system.carac.constitution.value), parseInt(this.system.sante.vie.max) + parseInt(this.system.carac.volonte.value));
|
|
||||||
this.system.sante.endurance.value = Math.min(this.system.sante.endurance.value, this.system.sante.endurance.max);
|
|
||||||
this.system.sante.fatigue.max = this.getFatigueMax();
|
|
||||||
this.system.sante.fatigue.value = Math.min(this.system.sante.fatigue.value, this.system.sante.fatigue.max);
|
this.system.sante.fatigue.value = Math.min(this.system.sante.fatigue.value, this.system.sante.fatigue.max);
|
||||||
|
|
||||||
//Compteurs
|
//Compteurs
|
||||||
this.system.reve.reve.max = this.system.carac.reve.value;
|
this.system.reve.reve.max = 3 * this.getReve()
|
||||||
this.system.compteurs.chance.max = this.system.carac.chance.value;
|
this.system.compteurs.chance.max = this.getChance()
|
||||||
}
|
|
||||||
|
|
||||||
$computeIsHautRevant() {
|
|
||||||
this.system.attributs.hautrevant.value = this.itemTypes[ITEM_TYPES.tete].find(it => RdDItemTete.isDonDeHautReve(it))
|
this.system.attributs.hautrevant.value = this.itemTypes[ITEM_TYPES.tete].find(it => RdDItemTete.isDonDeHautReve(it))
|
||||||
? "Haut rêvant"
|
? "Haut rêvant"
|
||||||
: "";
|
: "";
|
||||||
@ -114,6 +100,8 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
getChanceActuel() { return this.system.compteurs.chance?.value ?? 10 }
|
getChanceActuel() { return this.system.compteurs.chance?.value ?? 10 }
|
||||||
getMoralTotal() { return this.system.compteurs.moral?.value ?? 0 }
|
getMoralTotal() { return this.system.compteurs.moral?.value ?? 0 }
|
||||||
|
|
||||||
|
getEnduranceMax() { return Math.max(1, Math.max(this.getTaille() + this.getConstitution(), this.getVieMax() + this.getVolonte())) }
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getEtatGeneral(options = { ethylisme: false }) {
|
getEtatGeneral(options = { ethylisme: false }) {
|
||||||
const etatGeneral = this.system.compteurs.etat?.value ?? 0
|
const etatGeneral = this.system.compteurs.etat?.value ?? 0
|
||||||
@ -1095,9 +1083,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSConst() {
|
getSConst() { return RdDCarac.calculSConst(this.getConstitution()) }
|
||||||
return RdDCarac.calculSConst(this.system.carac.constitution.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
async ajoutXpConstitution(xp) {
|
async ajoutXpConstitution(xp) {
|
||||||
await this.update({ "system.carac.constitution.xp": Misc.toInt(this.system.carac.constitution.xp) + xp });
|
await this.update({ "system.carac.constitution.xp": Misc.toInt(this.system.carac.constitution.xp) + xp });
|
||||||
|
@ -19,6 +19,7 @@ import { RdDCombat, RdDCombatManager } from "../rdd-combat.js";
|
|||||||
import { RdDConfirm } from "../rdd-confirm.js";
|
import { RdDConfirm } from "../rdd-confirm.js";
|
||||||
import { ENTITE_INCARNE, SHOW_DICE, SYSTEM_RDD } from "../constants.js";
|
import { ENTITE_INCARNE, SHOW_DICE, SYSTEM_RDD } from "../constants.js";
|
||||||
import { RdDItemArme } from "../item-arme.js";
|
import { RdDItemArme } from "../item-arme.js";
|
||||||
|
import { RdDCarac } from "../rdd-carac.js";
|
||||||
|
|
||||||
const POSSESSION_SANS_DRACONIC = {
|
const POSSESSION_SANS_DRACONIC = {
|
||||||
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
||||||
@ -36,6 +37,13 @@ const POSSESSION_SANS_DRACONIC = {
|
|||||||
*/
|
*/
|
||||||
export class RdDBaseActorReve extends RdDBaseActor {
|
export class RdDBaseActorReve extends RdDBaseActor {
|
||||||
|
|
||||||
|
prepareActorData() {
|
||||||
|
super.prepareActorData()
|
||||||
|
this.system.attributs.plusdom.value = this.getBonusDegat()
|
||||||
|
this.system.sante.endurance.max = this.getEnduranceMax()
|
||||||
|
this.system.sante.endurance.value = Math.min(this.system.sante.endurance.value, this.system.sante.endurance.max)
|
||||||
|
}
|
||||||
|
|
||||||
getCaracChanceActuelle() {
|
getCaracChanceActuelle() {
|
||||||
return {
|
return {
|
||||||
label: 'Chance actuelle',
|
label: 'Chance actuelle',
|
||||||
@ -52,21 +60,26 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getTaille() { return Misc.toInt(this.system.carac.taille?.value) }
|
||||||
|
getConstitution() { return this.getReve() }
|
||||||
|
getForce() { return this.getReve() }
|
||||||
|
getAgilite() { return this.getForce() }
|
||||||
|
getReve() { return Misc.toInt(this.system.carac.reve?.value) }
|
||||||
|
getChance() { return this.getReve() }
|
||||||
|
|
||||||
getReveActuel() { return this.getReve() }
|
getReveActuel() { return this.getReve() }
|
||||||
getChanceActuel() { return this.getChance() }
|
getChanceActuel() { return this.getChance() }
|
||||||
|
|
||||||
getReve() { return Number(this.system.carac.reve?.value ?? 0) }
|
getEnduranceMax() { return Math.max(1, this.getTaille() + this.getConstitution()) }
|
||||||
getForce() { return this.getReve() }
|
getEncombrementMax() { return (this.getForce() + this.getTaille()) / 2 }
|
||||||
getTaille() { return Number(this.system.carac.taille?.value ?? 0) }
|
getBonusDegat() { return RdDCarac.getCaracDerivee(this.getEncombrementMax()).plusdom }
|
||||||
getAgilite() { return this.getForce() }
|
|
||||||
getChance() { return this.getReve() }
|
|
||||||
getMoralTotal() { return 0 }
|
getMoralTotal() { return 0 }
|
||||||
getBonusDegat() { return Number(this.system.attributs?.plusdom?.value ?? 0) }
|
|
||||||
getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) }
|
getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) }
|
||||||
getSConst() { return 0 }
|
getSConst() { return 0 }
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getEncombrementMax() { return 0 }
|
|
||||||
isSurenc() { return false }
|
isSurenc() { return false }
|
||||||
computeMalusSurEncombrement() { return 0 }
|
computeMalusSurEncombrement() { return 0 }
|
||||||
|
|
||||||
@ -84,7 +97,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
isActorCombat() { return true }
|
isActorCombat() { return true }
|
||||||
|
|
||||||
getCaracInit(competence) {
|
getCaracInit(competence) {
|
||||||
if (!competence){
|
if (!competence) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if (competence.type == ITEM_TYPES.competencecreature) {
|
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||||
|
@ -6,6 +6,7 @@ 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";
|
||||||
import { ChatUtility } from "../chat-utility.js";
|
import { ChatUtility } from "../chat-utility.js";
|
||||||
|
import { Misc } from "../misc.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe de base pour les acteurs qui peuvent subir des blessures
|
* Classe de base pour les acteurs qui peuvent subir des blessures
|
||||||
@ -14,25 +15,32 @@ import { ChatUtility } from "../chat-utility.js";
|
|||||||
*/
|
*/
|
||||||
export class RdDBaseActorSang extends RdDBaseActorReve {
|
export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||||
|
|
||||||
|
prepareActorData() {
|
||||||
|
this.system.sante.vie.max = Math.ceil((this.getTaille() + this.getConstitution()) / 2)
|
||||||
|
this.system.sante.vie.value = Math.min(this.system.sante.vie.value, this.system.sante.vie.max)
|
||||||
|
super.prepareActorData()
|
||||||
|
this.system.attributs.encombrement.value = this.getEncombrementMax()
|
||||||
|
}
|
||||||
|
|
||||||
getForce() { return Number(this.system.carac.force?.value ?? 0) }
|
getForce() { return Misc.toInt(this.system.carac.force?.value) }
|
||||||
|
getConstitution() { return Misc.toInt(this.system.carac.constitution?.value) }
|
||||||
|
getVolonte() { return Misc.toInt(this.system.carac.volonte?.value) }
|
||||||
|
|
||||||
getBonusDegat() { return Number(this.system.attributs?.plusdom?.value ?? 0) }
|
getVieMax() { return Misc.toInt(this.system.sante.vie?.max) }
|
||||||
getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) }
|
getEnduranceMax() { return Math.max(1, this.getTaille() + this.getConstitution()) }
|
||||||
getSConst() { return 0 }
|
getFatigueMax() { return this.getEnduranceMax() * 2 }
|
||||||
|
|
||||||
getEnduranceMax() { return Math.max(1, Math.min(this.system.sante.endurance.max, MAX_ENDURANCE_FATIGUE)) }
|
getProtectionNaturelle() { return Misc.toInt(this.system.attributs?.protection?.value) }
|
||||||
|
|
||||||
getFatigueActuelle() {
|
getFatigueActuelle() {
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
return Math.max(0, Math.min(this.getFatigueMax(), this.system.sante.fatigue?.value ?? 0));
|
return Math.max(0, Math.min(this.getFatigueMax(), Misc.toInt(this.system.sante.fatigue?.value)))
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
|
getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
|
||||||
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
||||||
getFatigueMax() { return this.getEnduranceMax() * 2 }
|
|
||||||
|
|
||||||
malusFatigue() {
|
malusFatigue() {
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
@ -42,7 +50,6 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getEncombrementMax() { return Number(this.system.attributs?.encombrement?.value ?? 0) }
|
|
||||||
isSurenc() { return this.computeMalusSurEncombrement() < 0 }
|
isSurenc() { return this.computeMalusSurEncombrement() < 0 }
|
||||||
|
|
||||||
computeMalusSurEncombrement() {
|
computeMalusSurEncombrement() {
|
||||||
|
@ -18,6 +18,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
.map(it => it[0])
|
.map(it => it[0])
|
||||||
.find(it => it)
|
.find(it => it)
|
||||||
}
|
}
|
||||||
|
|
||||||
static $findCaracByName(carac, name) {
|
static $findCaracByName(carac, name) {
|
||||||
const caracList = Object.entries(carac);
|
const caracList = Object.entries(carac);
|
||||||
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' });
|
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' });
|
||||||
@ -26,6 +27,16 @@ export class RdDBaseActor extends Actor {
|
|||||||
}
|
}
|
||||||
return entry && entry.length > 0 ? carac[entry[0]] : undefined;
|
return entry && entry.length > 0 ? carac[entry[0]] : undefined;
|
||||||
}
|
}
|
||||||
|
static getDefaultValue(actorType, path) {
|
||||||
|
if (path.includes('.')) {
|
||||||
|
path = path.split('.')
|
||||||
|
}
|
||||||
|
let obj = game.model.Actor[actorType]
|
||||||
|
for (let p of path) {
|
||||||
|
obj = obj ? obj[p] : undefined
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
|
||||||
static getDefaultImg(itemType) {
|
static getDefaultImg(itemType) {
|
||||||
return game.system.rdd.actorClasses[itemType]?.defaultIcon ?? defaultItemImg[itemType];
|
return game.system.rdd.actorClasses[itemType]?.defaultIcon ?? defaultItemImg[itemType];
|
||||||
@ -178,7 +189,8 @@ export class RdDBaseActor extends Actor {
|
|||||||
this.computeEncTotal()
|
this.computeEncTotal()
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepareActorData() { }
|
prepareActorData() { }
|
||||||
|
|
||||||
async computeEtatGeneral() { }
|
async computeEtatGeneral() { }
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
findPlayer() {
|
findPlayer() {
|
||||||
@ -210,6 +222,9 @@ export class RdDBaseActor extends Actor {
|
|||||||
getMonnaie(id) { return this.findItemLike(id, 'monnaie'); }
|
getMonnaie(id) { return this.findItemLike(id, 'monnaie'); }
|
||||||
getEncombrementMax() { return 0 }
|
getEncombrementMax() { return 0 }
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async updateCarac(caracName, to) {
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async onPreUpdateItem(item, change, options, id) { }
|
async onPreUpdateItem(item, change, options, id) { }
|
||||||
async onCreateItem(item, options, id) { }
|
async onCreateItem(item, options, id) { }
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { ENTITE_INCARNE } from "../constants.js";
|
|
||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { STATUSES } from "../settings/status-effects.js";
|
|
||||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||||
|
|
||||||
export class RdDCreature extends RdDBaseActorSang {
|
export class RdDCreature extends RdDBaseActorSang {
|
||||||
@ -9,6 +7,7 @@ export class RdDCreature extends RdDBaseActorSang {
|
|||||||
return "systems/foundryvtt-reve-de-dragon/icons/creatures/bramart.svg";
|
return "systems/foundryvtt-reve-de-dragon/icons/creatures/bramart.svg";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEnduranceMax() { return Math.max(1, this.getVieMax() + this.getConstitution()) }
|
||||||
isCreature() { return true }
|
isCreature() { return true }
|
||||||
|
|
||||||
canReceive(item) {
|
canReceive(item) {
|
||||||
|
@ -27,6 +27,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
|||||||
getForce() { return this.getReve() }
|
getForce() { return this.getReve() }
|
||||||
getAgilite() { return this.getReve() }
|
getAgilite() { return this.getReve() }
|
||||||
getChance() { return this.getReve() }
|
getChance() { return this.getReve() }
|
||||||
|
getEnduranceMax() { return Math.max(1, this.getTaille() + this.getReve()) }
|
||||||
|
|
||||||
getDraconicOuPossession() {
|
getDraconicOuPossession() {
|
||||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||||
|
@ -76,7 +76,7 @@ const MAPPING_BASE = [
|
|||||||
{ column: "derobee", rollClass: 'roll-carac', colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value },
|
{ column: "derobee", rollClass: 'roll-carac', colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value },
|
||||||
{ column: "vie", getter: (actor, context) => actor.system.sante.vie.max },
|
{ column: "vie", getter: (actor, context) => actor.system.sante.vie.max },
|
||||||
{ column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max },
|
{ column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max },
|
||||||
{ column: "plusdom", colName: '+dom', getter: (actor, context) => actor.system.attributs.plusdom.value },
|
{ column: "plusdom", colName: '+dom', getter: (actor, context) => actor.getBonusDegat() },
|
||||||
{ column: "protectionnaturelle", colName: 'Protection naturelle', getter: (actor, context) => actor.system.attributs.protection.value > 0 ? actor.system.attributs.protection.value : '' },
|
{ column: "protectionnaturelle", colName: 'Protection naturelle', getter: (actor, context) => actor.system.attributs.protection.value > 0 ? actor.system.attributs.protection.value : '' },
|
||||||
{ column: "description", getter: (actor, context) => Mapping.getDescription(actor) },
|
{ column: "description", getter: (actor, context) => Mapping.getDescription(actor) },
|
||||||
{ column: "armure", getter: (actor, context) => Mapping.getArmure(actor, context) },
|
{ column: "armure", getter: (actor, context) => Mapping.getArmure(actor, context) },
|
||||||
|
@ -58,9 +58,6 @@ export class Misc {
|
|||||||
* @param {*} value value to convert to an integer using parseInt
|
* @param {*} value value to convert to an integer using parseInt
|
||||||
*/
|
*/
|
||||||
static toInt(value) {
|
static toInt(value) {
|
||||||
if (value == undefined) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
const parsed = parseInt(value);
|
const parsed = parseInt(value);
|
||||||
return isNaN(parsed) ? 0 : parsed;
|
return isNaN(parsed) ? 0 : parsed;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ export class RdDCarac {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getCaracDerivee(value) {
|
static getCaracDerivee(value) {
|
||||||
return TABLE_CARACTERISTIQUES_DERIVEES[Math.min(Math.max(Number(value), 1), 32)];
|
return TABLE_CARACTERISTIQUES_DERIVEES[Math.min(Math.max(Math.floor(Number(value)), 1), 32)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static computeTotal(carac, beaute = undefined) {
|
static computeTotal(carac, beaute = undefined) {
|
||||||
|
@ -20,6 +20,7 @@ import { ExperienceLog } from "./actor/experience-log.js";
|
|||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { APP_ASTROLOGIE_REFRESH } from "./sommeil/app-astrologie.js";
|
import { APP_ASTROLOGIE_REFRESH } from "./sommeil/app-astrologie.js";
|
||||||
import { RDD_CONFIG } from "./constants.js";
|
import { RDD_CONFIG } from "./constants.js";
|
||||||
|
import { RdDBaseActor } from "./actor/base-actor.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// This table starts at 0 -> niveau -10
|
// This table starts at 0 -> niveau -10
|
||||||
@ -288,6 +289,8 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
|
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
|
||||||
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
|
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
|
||||||
|
|
||||||
|
Handlebars.registerHelper('actor-default', (actorType, ...path) => RdDBaseActor.getDefaultValue(actorType, path.slice(0, -1)));
|
||||||
|
|
||||||
Handlebars.registerHelper('array-includes', (array, value) => array.includes(value));
|
Handlebars.registerHelper('array-includes', (array, value) => array.includes(value));
|
||||||
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
|
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
|
||||||
Handlebars.registerHelper('isLastIndex', (index, list) => index + 1 >= list.length);
|
Handlebars.registerHelper('isLastIndex', (index, list) => index + 1 >= list.length);
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"label": "Vitesse",
|
"label": "Vitesse",
|
||||||
"derivee": true
|
"derivee": false
|
||||||
},
|
},
|
||||||
"protection": {
|
"protection": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
@ -195,13 +195,13 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"label": "Vitesse",
|
"label": "Vitesse",
|
||||||
"derivee": true
|
"derivee": false
|
||||||
},
|
},
|
||||||
"encombrement": {
|
"encombrement": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"label": "Encombrement",
|
"label": "Encombrement",
|
||||||
"derivee": false
|
"derivee": true
|
||||||
},
|
},
|
||||||
"protection": {
|
"protection": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
|
@ -1,8 +1,21 @@
|
|||||||
<ol class="carac-list alterne-list">
|
<ol class="carac-list alterne-list">
|
||||||
{{#each system.attributs as |attr key|}}
|
{{#each system.attributs as |attr key|}}
|
||||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
{{#if (and (eq key 'plusdom') (eq @root.system.definition.typeentite 'nonincarne'))}}
|
||||||
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}</span>
|
{{else}}
|
||||||
<input class="caracteristique streched" type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
|
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||||
</li>
|
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}</span>
|
||||||
|
{{#if (actor-default @root.type 'attributs' key 'derivee')}}
|
||||||
|
<input class="caracteristique streched" type="text" name="system.attributs.{{key}}.value"
|
||||||
|
{{#if (eq key 'plusdom')}}
|
||||||
|
value="{{numberFormat attr.value decimals=0 sign=true}}"
|
||||||
|
{{else}}
|
||||||
|
value="{{attr.value}}"
|
||||||
|
{{/if}}
|
||||||
|
data-dtype="{{attr.type}}" disabled/>
|
||||||
|
{{else}}
|
||||||
|
<input class="caracteristique streched" type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -11,10 +11,6 @@
|
|||||||
{{selectOptions (RDD_CONFIG 'typeEntite') selected=system.definition.typeentite}}
|
{{selectOptions (RDD_CONFIG 'typeEntite') selected=system.definition.typeentite}}
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
{{#each system.attributs as |attr key|}}
|
</ol>
|
||||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
|
||||||
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}} : </span>
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html"}}
|
||||||
<input class="caracteristique streched" type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ol>
|
|
||||||
|
@ -1,36 +1,39 @@
|
|||||||
<ul class="carac-list alterne-list">
|
<ul class="carac-list alterne-list">
|
||||||
{{#each system.carac as |carac key|}}
|
{{#each system.carac as |carac key|}}
|
||||||
|
{{#if (and (eq key 'taille') (eq @root.system.definition.typeentite 'nonincarne'))}}
|
||||||
|
{{else}}
|
||||||
<li class="caracteristique flexrow list-item{{#if carac.isLevelUp}} xp-level-up{{/if}}" data-attribute="{{key}}">
|
<li class="caracteristique flexrow list-item{{#if carac.isLevelUp}} xp-level-up{{/if}}" data-attribute="{{key}}">
|
||||||
{{#if (eq key 'taille')}}
|
{{#if (eq key 'taille')}}
|
||||||
<span class="carac-label" name="system.carac.{{key}}.label">{{carac.label}}</span>
|
<span class="carac-label" name="system.carac.{{key}}.label">{{carac.label}}</span>
|
||||||
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||||
<label class="carac-xp"/>
|
<label class="carac-xp"/>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if carac.derivee}}
|
{{#if (actor-default @root.type 'carac' key 'derivee')}}
|
||||||
<span class="carac-label" name="system.carac.{{key}}.label"><a class="roll-carac" data-carac-name={{key}}>{{carac.label}}</a></span>
|
<span class="carac-label" name="system.carac.{{key}}.label"><a class="roll-carac" data-carac-name={{key}}>{{carac.label}}</a></span>
|
||||||
<label class="competence-value">{{carac.value}}</label>
|
<label class="competence-value">{{carac.value}}</label>
|
||||||
<label class="carac-xp"/>
|
<label class="carac-xp"/>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if carac.isLevelUp}}
|
{{#if carac.isLevelUp}}
|
||||||
<span class="carac-label tooltip" name="system.carac.{{key}}.label">
|
<span class="carac-label tooltip" name="system.carac.{{key}}.label">
|
||||||
<span class="tooltiptext ttt-levelup">
|
<span class="tooltiptext ttt-levelup">
|
||||||
Vous pouvez dépenser {{carac.xpNext}} points d'Experience pour augmenter de 1 votre caractéristique {{carac.label}}
|
Vous pouvez dépenser {{carac.xpNext}} points d'Experience pour augmenter de 1 votre caractéristique {{carac.label}}
|
||||||
</span>
|
|
||||||
<a name={{key}}>{{carac.label}}</a>
|
|
||||||
<a class="carac-xp-augmenter" name="augmenter.{{key}}" data-tooltip="Augmenter la caractéristique avec l'expérience">
|
|
||||||
<i class="fas fa-arrow-alt-circle-up"></i>
|
|
||||||
</a>
|
|
||||||
</span>
|
</span>
|
||||||
{{else}}
|
<a name={{key}}>{{carac.label}}</a>
|
||||||
<span class="carac-label tooltip" name="system.carac.{{key}}.label"><a class="roll-carac" data-carac-name={{key}}>{{carac.label}}</a></span>
|
<a class="carac-xp-augmenter" name="augmenter.{{key}}" data-tooltip="Augmenter la caractéristique avec l'expérience">
|
||||||
{{/if}}
|
<i class="fas fa-arrow-alt-circle-up"></i>
|
||||||
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
</a>
|
||||||
<span class="carac-xp tooltip">
|
|
||||||
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
|
||||||
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
|
|
||||||
</span>
|
</span>
|
||||||
|
{{else}}
|
||||||
|
<span class="carac-label tooltip" name="system.carac.{{key}}.label"><a class="roll-carac" data-carac-name={{key}}>{{carac.label}}</a></span>
|
||||||
|
{{/if}}
|
||||||
|
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||||
|
<span class="carac-xp tooltip">
|
||||||
|
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||||
|
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
|
||||||
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
<a class="jet-vie" name="system.sante.vie.label" data-tooltip="Faire un jet de vie">Vie</a>
|
<a class="jet-vie" name="system.sante.vie.label" data-tooltip="Faire un jet de vie">Vie</a>
|
||||||
<a class="vie-moins"><i class="fa-solid fa-square-minus"></i></a>
|
<a class="vie-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||||
<input class="resource-content" type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number" />
|
<input class="resource-content" type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number" />
|
||||||
/ {{#if @root.options.vueDetaillee}}
|
/ {{system.sante.vie.max}}
|
||||||
<input class="resource-content" type="text" name="system.sante.vie.max" value="{{system.sante.vie.max}}" data-dtype="Number"/>
|
|
||||||
{{else}}{{system.sante.vie.max}}{{/if}}
|
|
||||||
<a class="vie-plus"><i class="fa-solid fa-square-plus"></i></a>
|
<a class="vie-plus"><i class="fa-solid fa-square-plus"></i></a>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
@ -16,9 +14,7 @@
|
|||||||
<a class="jet-endurance" name="system.sante.endurance.label" data-tooltip="Faire un jet d'endurance pour ne pas être sonné">Endurance</a>
|
<a class="jet-endurance" name="system.sante.endurance.label" data-tooltip="Faire un jet d'endurance pour ne pas être sonné">Endurance</a>
|
||||||
<a class="endurance-moins"><i class="fa-solid fa-square-minus"></i></a>
|
<a class="endurance-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||||
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number"/>
|
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number"/>
|
||||||
/ {{#if @root.options.vueDetaillee}}
|
/ {{system.sante.endurance.max}}
|
||||||
<input class="resource-content" type="text" name="system.sante.endurance.max" value="{{system.sante.endurance.max}}" data-dtype="Number"/>
|
|
||||||
{{else}}{{system.sante.endurance.max}}{{/if}}
|
|
||||||
<a class="endurance-plus"><i class="fa-solid fa-square-plus"></i></a>
|
<a class="endurance-plus"><i class="fa-solid fa-square-plus"></i></a>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
Endurance
|
Endurance
|
||||||
<a class="endurance-moins"><i class="fa-solid fa-square-minus"></i></a>
|
<a class="endurance-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||||
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number" />
|
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number" />
|
||||||
/ {{#if @root.options.vueDetaillee}}
|
/ {{system.sante.endurance.max}}
|
||||||
<input class="resource-content" type="text" name="system.sante.endurance.max" value="{{system.sante.endurance.max}}" data-dtype="Number"/>
|
|
||||||
{{else}}{{system.sante.endurance.max}}{{/if}}
|
|
||||||
<a class="endurance-plus"><i class="fa-solid fa-square-plus"></i></a>
|
<a class="endurance-plus"><i class="fa-solid fa-square-plus"></i></a>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user